Jump to content

$_SESSION login help.


dominic600

Recommended Posts

so ive been trying to figure this out on my own with as little help possible.

 

but now im stuck. so i got my commenting system all down and good but now i want to make it so inorder for anyone to comment they must login.

 

theres my sessions, now would i make like a if statement like

if($username && $userid){
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$pass'") or die(mysql_error());
	$numrows = mysql_num_rows($query);

}

 

$username = $_SESSION['username'];
$userid = $_SESSION['userid'];

 

Like would that work or am i missing something else, or would that be like completly wrong?

 

 

Link to comment
https://forums.phpfreaks.com/topic/244542-_session-login-help/
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.