Jump to content

PHP Help


Vivid Lust

Recommended Posts

Hi, here is some of a script:

 

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$myusername = $_POST['myusername'];
$mypassword = $_POST['mypassword'];
$sql = "SELECT *, member FROM $tbl_name WHERE email='$myusername' and password='$encrypt'";
$result = mysql_query($sql);
$count = mysql_num_rows($result);
if($count==1){
session_register("myusername");
session_register("mypassword");
header("location:profile.php?member=".HERE);

 

Where i wrote HERE, how can i display the value of "member" from the query?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/91863-php-help/
Share on other sites

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$myusername = $_POST['myusername'];
$mypassword = $_POST['mypassword'];
$sql = "SELECT *, member FROM $tbl_name WHERE email='$myusername' and password='$encrypt'";
$result = mysql_query($sql);
$count = mysql_num_rows($result);
if($count==1){
  $row = mysql_fetch_assoc($result);
  $_SESSION['myusername'] = $myusername;
  header("location:profile.php?member=".$row['member']);
}

 

Note that session_register has long been depricated, and that there should also simply be no reason to store the users password in the session.

Link to comment
https://forums.phpfreaks.com/topic/91863-php-help/#findComment-470454
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.