Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Dupa 20 ani de facultate, am uita...

Mobile.de ofera imprumut de bani ...

problema test grila

Digi24 a disparut de pe TV Lg
 Drept de proprietate intelectuala...

Jante noi shitbox

Trinitas TV 4K

Dacia 1316 cu 6 usi ...
 Frecventa modificata radio

Un nou pericol pt batrani

Ar trebuii sa vindem imobiliarele...

Dupa renuntarea la aparat dentar
 pelerinaj in Balcik

Noul format Jpegli iși propu...

Dade, dade

Probleme accesare nr test telefon
 

ajutor profil.php

- - - - -
  • Please log in to reply
6 replies to this topic

#1
bunicu9

bunicu9

    Member

  • Grup: Members
  • Posts: 253
  • Înscris: 14.07.2013
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>&nbsp;</td>
		<td><input type="submit" name="submit" value="Submit"></td>
   </tr>
  </table>
</form>
<?php
}
?>
</body>
</html>

Ma poate ajuta cineva?

#2
yonut_a

yonut_a

    Trala la la la

  • Grup: Senior Members
  • Posts: 3,947
  • Înscris: 03.08.2008
si cu ce sa te ajutam ? ca nu am inteles unde e problema

#3
poadol

poadol

    Guru Member

  • Grup: Senior Members
  • Posts: 14,104
  • Înscris: 13.12.2010
Vrea ca in profil.php sa poata edita adresa de email si parola.

#4
yonut_a

yonut_a

    Trala la la la

  • Grup: Senior Members
  • Posts: 3,947
  • Înscris: 03.08.2008
Am inteles asta ... insa inca astept codul facut de el si problemele

#5
bunicu9

bunicu9

    Member

  • Grup: Members
  • Posts: 253
  • Înscris: 14.07.2013
Inca nu am facut profil.php
Nu reusesc. din acest motiv am postat aici
poate ma ajuta cineva

#6
maxtron_69

maxtron_69

    Senior Member

  • Grup: Senior Members
  • Posts: 2,534
  • Înscris: 18.08.2010
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
OriginalCopy

OriginalCopy

    I'm harmful, fear me please! :))

  • Grup: Senior Members
  • Posts: 27,268
  • Înscris: 10.08.2006

View Postbunicu9, on 01 iulie 2016 - 11:34, said:

Vreau sa fac o pagina profil.php

View Postbunicu9, 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
Te ajutam sa FACI, cum sa nu.

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

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate