ajutor profil.php
Last Updated: Jul 02 2016 07:58, Started by
bunicu9
, Jul 01 2016 11:34
·
0
#1
Posted 01 July 2016 - 11:34
Vreau sa fac o pagina profil.php
Baza mea de date arata asa: Quote -- -- Structura de tabel pentru tabelul `players` -- CREATE TABLE IF NOT EXISTS `players` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `password` varchar(128) NOT NULL, `Email` varchar(150) DEFAULT NULL, `Level` int(11) NOT NULL DEFAULT '1', `AdminLevel` int(11) NOT NULL DEFAULT '0', `HelperLevel` int(11) NOT NULL DEFAULT '0', `Cash` int(24) NOT NULL DEFAULT '0', `Account` int(24) NOT NULL DEFAULT '0', `Registred` int(11) DEFAULT '0', `Tutorial` int(11) NOT NULL DEFAULT '0', `IP` varchar(46) DEFAULT NULL, `LastLogin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`ID`), FULLTEXT KEY `password` (`password`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ; Vreau sa ca in profil.php sa pot edita adresa de email si parola login.php arata asa <?php session_start(); ?> <html> <head> <title>Login</title> </head> <body> <a href="index.php">Home</a> <br /> <?php include("connection.php"); if(isset($_POST['submit'])) { $user = mysql_real_escape_string($_POST['username']); $pass = mysql_real_escape_string($_POST['password']); if($user == "" || $pass == "") { echo "Either username or password field is empty."; echo "<br/>"; echo "<a href='login.php'>Go back</a>"; } else { $result = mysql_query("SELECT * FROM players WHERE username='$user' AND password=md5('$pass')",$conn) or die("Could not execute the select query."); $row = mysql_fetch_assoc($result); if(is_array($row) && !empty($row)) { $validuser = $row['username']; $_SESSION['valid'] = $validuser; $_SESSION['name'] = $row['name']; $_SESSION['id'] = $row['ID']; $_SESSION['username'] = $row['username']; $_SESSION['Email'] = $row['Email']; $_SESSION['level'] = $row['Level']; $_SESSION['adminlevel'] = $row['AdminLevel']; $_SESSION['helperevel'] = $row['HelperLevel']; $_SESSION['cash'] = $row['Cash']; $_SESSION['skin'] = $row['Skin']; $_SESSION['sex'] = $row['Sex']; $_SESSION['age'] = $row['Age']; $_SESSION['LastLogin'] = $row['LastLogin']; } else { echo "Invalid username or password."; echo "<br/>"; echo "<a href='login.php'>Go back</a>"; } if(isset($_SESSION['valid'])) { header('Location: index.php'); } } } else { ?> <p><font size="+2">Login</font></p> <form name="form1" method="post" action=""> <table width="75%" border="0"> <tr> <td width="10%">Username</td> <td><input type="text" name="username"></td> </tr> <tr> <td>Password</td> <td><input type="password" name="password"></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="Submit"></td> </tr> </table> </form> <?php } ?> </body> </html>Ma poate ajuta cineva? |
#3
Posted 01 July 2016 - 12:50
Vrea ca in profil.php sa poata edita adresa de email si parola.
|
#4
Posted 01 July 2016 - 12:52
Am inteles asta ... insa inca astept codul facut de el si problemele
|
#5
Posted 01 July 2016 - 13:13
Inca nu am facut profil.php
Nu reusesc. din acest motiv am postat aici poate ma ajuta cineva |
#6
Posted 01 July 2016 - 22:30
De mult nu am mai vazut o tabela MyISAM. De ce nu InnoDB?
mysql_query in 2016? Treci pe mysqli sau PDO. Intr-adevar, ar trebui sa postezi ce ai incercat macar. |
#7
Posted 02 July 2016 - 07:58
bunicu9, on 01 iulie 2016 - 11:34, said:
Vreau sa fac o pagina profil.php bunicu9, on 01 iulie 2016 - 13:13, said:
Inca nu am facut profil.php Nu reusesc. din acest motiv am postat aici poate ma ajuta cineva Tu vino cu codul concret si problemele de care te lovesti, si noi iti spunem ce pas urmator trebuie sa FACI. Stii ce inseamna a face, nu? Spor la facut! |
Anunturi
Bun venit pe Forumul Softpedia!
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users