Morning,afternoon,evening and av a great night to all,

solution needed plaese.

secnario.

players eneter log on screen and enter name ,password, (id is index on base)
then go to check_logon.php if happy end up at logon_success.php

this run ok :)

am now trying to display players id number on logon_success.php.

check_logon.php

$sql="SELECT * FROM $tbl_name WHERE name='$myusername' and password='$mypassword'";
$result=mysql_query($sql);



// Mysql_num_row is counting table row                                                   t.l
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}


ob_end_flush();
?></HEAD><BODY>

login_success.php

$sql="SELECT * FROM members ";
$result2=mysql_query($sql);
                                            

// store the record of the "example" table into $row
$row = mysql_fetch_assoc( $result2 );
// Print out the contents of the entry 

echo "Name: ".$row['name'];
echo " id: ".$row['id'];

mysql_close();

have been trying to get the header to read{ header("location:login_success.php. '$id'");}
also have been thinking along the lines

$sql="SELECT * FROM members $A";
where $A = 'id' or 'myusername'

any points would be greatley apreachetted :)
thanks.

Recommended Answers

All 3 Replies

forget about PHP.

Post the SQL part of the code where you have any issue.

forget about PHP.

Post the SQL part of the code where you have any issue.

thanks for your time debasisdas , all sortted now .

Nice to know your issue is sorted out.

Happy coding :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.