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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.