Jump to content

Recommended Posts

This is the function i'm currently using:

[code]
<?php
function Login($Variables,$FormValues) {
if($FormValues[Name] || $FormValues[Password]) {
echo "Logged in";
$_SESSION['Name'] = $FormValues[Name];
$_SESSION['LoggedIn'] = "1";
$_SESSION['UserGroup'] = "2";
echo $_SESSION['LoggedIn'];
} else {
echo "
<form id=\"form1\" name=\"form1\" method=\"post\" action=\"$PHP_SELF?Area=Login\">
<p>Your Name </p>
<p><label><input name=\"FormValues[Name]\" type=\"text\" id=\"Name\" /></label></p>
<p>Password</p>
<p><label><input name=\"FormValues[Password]\" type=\"password\" id=\"Password\" /></label></p>
<p><label><input type=\"submit\" name=\"Submit\" value=\"Submit\" /></label></p>
</form>
";
} // End of if($FormValues)
} // End of Function Login($Variables,$FormValues);
?>[/code]

Now...this is just a test before I add in calling to the database to actually verify the user...but their is one problem when you log in or enter your info into the form and post it, it reloads the page correctly and says Logged In[b]1[/b] now the 1 proves that the session LoggedIn registered but when I hit home I have one thing that tells me if i'm logged in or not and i'm not and all the sessions are cleared...any idea why?
Link to comment
https://forums.phpfreaks.com/topic/35266-sessions-dieing-after-function/
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.