-
Posts
499 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Everything posted by Grow3r
-
Nu labi! Tagad man viss skaidrs! Var sito
-
Pareizi! Jo nebutu forsi ja visiem tads butu!
-
Nu vecit lai sitadu lietu kadam prasitu! Tev jarecinas vismaz ar 10-20Ls menesi! Nu pa brivu tikai Dzeks kurs ar galvu nevar padomat tures! Vai ari paralizets kuram tu prosta uz PC vinu ieslegsi! Iedo bott3m 10Ls un vins patures
-
Nu jabut! Ja vins saka ka 42 rindina r problema! Tad ari ir jabut tadai rindinai! Tu PC neapmulcosi!
-
Vai ir iespeja kautko izdarit lai atrak nokacajat kada lieta no RevConnect! Es piemeram kacaju lietu kas ir 700Mb liela un man vina ka4ajas 6h! Bet vai ir iespeja izdaritt lai piemeram pa 2h?
-
d:\appserv\www\amxbans\include\functions.lang.php on line 42 Sis nozmime ka ir kluda taja faila 42rindaa!
-
Nu piemeram atraks un lenaks! Man piemeram ir lidz 5Mbs
-
Zinaji ka mDSL ir vairaki limeni!
-
amd Athlon ar 2.2Ghz 1Gm Ram psc Norm! Serverim vajadzetu iet labi! Man serveris ar 15 Slotiem Amd Athlon 1.79Ghz 512Mb Ram Net 4.60 Tev vajadzetu vismaz 18-20Slotus turet!
-
Ne vienkarsi kad man pasa sakuma nesanaca kompilet! Tad es partaisiju to Profilu un tad sanaca!
-
Procesors ?
-
Nu man ari ir mDSL un man netspeed ir 4.60Mbs! Nez tev vajag pieslegt atraku Netu! Pasaki visus sava PC parametrus! Matesplati,RAM,GHz,utt
-
a ko tev nav?? Man ir!! Un visiem citiem ari ir!
-
a tu serveri sodien biji iesledzis??? Un vai tu izmanto Ctr+Alt+delete Priority Real Time
-
Domino! Lidz 100Ls tu vari panemt mazcenas Mobilo! Jebkadu kadu tu gribi
-
Man visos apmeram vienadi rada! Nezinu kape tev ne! A tev serveris ieslegts?
-
Banneri
Grow3r replied to Miedzinjsh[War3-Pro-Player]'s topic in Servera konfigurācija, plugini, etc...
Paradi! Nevar saprast! -
Nu labi! Kr4 tad ir kautkads suds IN PC ka tev Serveris LAGO! Moska Kautkadu jaunu hujnu esi iebazis un tapec lago! Vai nu tava mates plate nevelk 1Gb RAm Nez kautkas jau ir!
-
Errori rodas tikai tad ja kautko kad taisiji Profilu nepareizs! Vai nu kautko speles mape esi nepareizi uztaisijis!
-
Ko tiesi tu nesaproti???
-
Nemts no saita: http://www.techtuts.com/forums/index.php?showtopic=48 Database Setup We will use a database to store all the user information in. Once you have created a database, go to phpmyadmin and run this query: CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(30) NOT NULL default '', `password` varchar(255) NOT NULL default '', `email` varchar(40) NOT NULL default '', `msn` varchar(250) NOT NULL default 'Not Specified', `aim` varchar(250) NOT NULL default 'Not Specified', `location` varchar(36) NOT NULL default 'Not Specified', PRIMARY KEY (`id`) ) TYPE=MyISAM; Connecting to the database Now we need a file to connect to the database with. <? ob_start(); // allows you to use cookies $conn = mysql_connect("localhost","DATABASE USERNAME","DATABASE PASSWORD"); mysql_select_db(DATABASE NAME) or die(mysql_error()); //fill in the above lines where there are capital letters. $logged = MYSQL_QUERY("SELECT * from users WHERE id='$_COOKIE[id]'"); $logged = mysql_fetch_array($logged); //the above lines get the user's information from the database. ?> Save that file as config.php. Setup You will need to add some code to the TOP of every page you want to use the login system on. (not including the pages below). This is the code: <? ob_start(); include("config.php"); ?> We are now ready to start coding the pages. Register.php Register.php will allow users to register. Be sure to read the comments. <?php ob_start(); // allows you to use cookies include("config.php"); //gets the config page if ($_POST[register]) { // the above line checks to see if the html form has been submitted $username = $_POST[username]; $password = $_POST[pass]; $cpassword = $_POST[cpass]; $email = $_POST[emai1]; //the above lines set variables with the user submitted information if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) { //checks to make sure no fields were left blank echo "A field was left blank."; }else{ //none were left blank! We continue... if($password != $cpassword) { // the passwords are not the same! echo "Passwords do not match"; }else{ // the passwords are the same! we continue... $password = md5($password); // encrypts the password $checkname = mysql_query("SELECT username FROM users WHERE username='$username'"); $checkname= mysql_num_rows($checkname); $checkemail = mysql_query("SELECT email FROM users WHERE email='$email'"); $checkemail = mysql_num_rows($checkemail); if ($checkemail>0|$checkname>0) { // oops...someone has already registered with that username or email! echo "The username or email is already in use"; }else{ // noone is using that email or username! We continue... $username = htmlspecialchars($username); $password = htmlspecialchars($password); $email = htmlspecialchars($email); // the above lines make it so that there is no html in the user submitted information. //Everything seems good, lets insert. $query = mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')"); // inserts the information into the database. echo "You have successfully registered!"; } } } } else { // the form has not been submitted...so now we display it. echo (" <center> <form method=\"POST\"> Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"><br /> Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"pass\"><br /> Confirm Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"cpass\"><br /> Email: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"emai1\"><br /> <input name=\"register\" type=\"submit\" value=\"Register\"> </form> </center> "); } ?> Login.php Now that people can register, we need to let them login!. You can put this code in a block on your site, or put it in a blank page. <? oB_start(); // allows you to use cookies. include("config.php"); if (!$logged[username]) { if (!$_POST[login]) { echo(" <center><form method=\"POST\"> <table> <tr> <td align=\"right\"> Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"> </td> </tr> <tr> <td align=\"right\"> Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"password\"> </td></tr><tr> <td align=\"center\"> <input type=\"submit\" name=\"login\" value=\"Login\"> </td></tr><tr> <td align=\"center\"> <a href=\"register.php\">Register Here</a> </td></tr></table></form></center>"); } if ($_POST[login]) { // the form has been submitted. We continue... $username=$_POST['username']; $password = md5($_POST[password]); // the above lines set variables with the submitted information. $info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); $data = mysql_fetch_array($info); if($data[password] != $password) { // the password was not the user's password! echo "Incorrect username or password!"; }else{ // the password was right! $query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); $user = mysql_fetch_array($query); // gets the user's information setcookie("id", $user[id],time()+(60*60*24*5), "/", ""); setcookie("pass", $user[password],time()+(60*60*24*5), "/", ""); // the above lines set 2 cookies. 1 with the user's id and another with his/her password. echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=http://yoursite.com\"/>Thank You! You will be redirected"); // modify the above line...add in your site url instead of yoursite.com } } } else { // we now display the user controls. echo ("<center>Welcome <b>$logged[username]</b><br /></center> - <a href=\"editprofile.php\">Edit Profile</a><br /> - <a href=\"members.php\">Member List</a><br /> - <a href=\"logout.php\">Logout</a>"); } ?> Edit Profile This page will allow users to update their information. Save it as editprofile.php. <? ob_start(); include("config.php"); if ($logged[username]) { // the user is logged in! We continue... if (!$_POST[update]) { // the form hasn't been submitted. We continue... $profile = mysql_query("SELECT * from users where username = '$logged[username]'"); $profile = mysql_fetch_array($profile); // the above lines get the information so that it can be displayed in the html form. echo(" <center><form method=\"POST\"> <table width=\"100%\"> <tr> <td align=\"right\" width=\"25%\"> Location </td> <td align=\"left\"> <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\" value=\"$profile[location]\"></td> </tr> <tr> <td align=\"right\" width=\"25%\"> MSN Messenger </td> <td align=\"left\"> <input size=\"25\" name=\"msn\" value=\"$profile[msn]\"></td> </tr> <tr> <td align=\"right\" width=\"25%\"> AOL Messenger</td> <td align=\"left\"> <input size=\"25\" name=\"aim\" value=\"$profile[aim]\"></td> </tr> <tr> <td align=\"right\" width=\"25%\"> Email Address</td> <td align=\"left\"> <input size=\"25\" name=\"email\" value=\"$profile[email]\"></td> </tr> <tr> <td align=\"center\"> </td> <td align=\"left\"> <input type=\"submit\" name=\"update\" value=\"Update\"></td> </tr> </table> </form> </center>"); } else { $email = htmlspecialchars($_POST[email]); $aim = htmlspecialchars($_POST[aim]); $msn = htmlspecialchars($_POST[msn]); $locate = htmlspecialchars($_POST[locate]); // the above lines get rid of all html. echo ("Your profile has been updated!"); $update = mysql_query("Update users set email = '$email', msn = '$msn', aim = '$aim', location = '$locate' where username = '$logged[username]'"); // updates the information in the database. } } else { // They aren't logged in! echo ("<a href=\"login.php\">You must login</a>"); } ?> Display Users Information Now we need to have a page where members can view other member's profiles. Use this code, and save this as members.php. <? ob_start(); include("config.php"); if (!$_GET[user]) { $getuser = mysql_query("SELECT * from users order by id asc"); while ($user = mysql_fetch_array($getuser)) { // gets all the users information. echo ("<a href=\"members.php?user=$user[username]\">$user[username]</a><br />\n"); // links to a page to view the user's profile. } } ELSE { $getuser = mysql_query("SELECT * from users where username = '$_GET[user]'"); $usernum = mysql_num_rows($getuser); if ($usernum == 0) { echo ("User Not Found"); } else { $profile = mysql_fetch_array($getuser); echo ("<center><b>$profile[username]'s Profile:</b><br /></center> MSN Messenger: $profile[msn]<br /> AIM Messebger: $profile[aim]<br /> Location: $profile[location]<br /> Email: $profile[email]"); // in the above code, we display the user's information. } } ?> Logout.php This page logs the user out. It just updates the cookie with false information. <? ob_start(); setcookie("id", 2132421,time()+(60*60*24*5), "/", ""); setcookie("pass", loggedout,time()+(60*60*24*5), "/", ""); echo ("You are now logged out!"); ?> That concludes this huge tutorial. If you need any help please leave a comment below. Showing the login box in a content box Add this code where you want the login system: <? include("login.php"); ?> Members Only Pages Use this code for a members only page. <? ob_start(); include("config.php"); if ($logged[username]) { echo("You are logged in"); } else { echo("You are not logged in"); } ?> Domaju ka palidzes! Sita laba pamaciba! Pats kautkad saksu veidot savu WEB nevis php-Fusion un izmantosu kautko no sita!
-
Paga vinchister! Vins jau var sakt iet uz datorkursiem! Lasit Skritosanas gramatas! Ja vins loti gribes vins vares visu! Bet tas jau ir vina rokas!
-
Pasaki isti cik tev Ghz Un cik netaatrums: http://no.lv/nettest/
-
Vo man smuks rekords : 323140