Jump to content

Slicker Login (JQuery + PHP)


Zeradin

Recommended Posts

Hello. I've been making login forms like posting to the same document and then checking everything if the post is submitted and then redirecting. I wanted to make it slicker. I started with this:

 

http://www.developertutorials.com/tutorials/ajax/getting-started-with-ajax-in-jquery-8-05-11/page2.html

 

Tutorial and I can't figure out how to transform this into a session. I can verify that it's correct, but then what? I feel like it's a piece of php programming that after I know how to do it a lot of things will make a lot more sense. Thanks.

Link to comment
Share on other sites

Buuut what I don't get is:

<?php
$username = $_POST['username'];
$password = $_POST['password'];

if ($username == "test" && $password == "password")
{
print "<strong>Login succeeded!</strong>";
HERE I can't start a session and I can't store a session variable and for some reason redirect doesn't work?
}
else
{
print "<strong>Login failed! Please try again.</strong>";
}
?>

Link to comment
Share on other sites

What about the redirect. it just sits on SUCCESSFUL! forever when i insert:

<meta http-equiv="Refresh" content="2;url=index.php?p=update">

<br />

<a href="update.php">click here to continue if you are not redirected</a><br />

to the cause. I need it to go somewhere after it is successful.

Thanks for the help btw.

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.