Jump to content

[SOLVED] easy post question


ngreenwood6

Recommended Posts

I have alot of code so I am not going to post it because it seems like no one helps if you do. I have a pretty simple question though. I have a form that onlick it posts the username and password to a page called check_user.php. If the username and password are correct it instead posts it to process_login.php. When it goes to process_login.php it registers their username in the session and redirects to main.php.  The problem is that I do not know how to get it to process process_login.php and do what it tells it to do. It just stays on the login page when it is supposed to be redirect to the main.php page. My process_login.php page looks like this:

 

<?php
//include the variables
include("includes/variables.php");

//get the username from the form
$username = strtolower($_POST['username']);

if($username != "")
{
$_SESSION['username'] = $username;
header("Location: main.php");
}

?>

 

How do I get it to go to the main.php page with ajax? It seems like all it does is check this page and not actually do what it says.

Link to comment
Share on other sites

OK, you may be using AJAX on your site, but you're not asking AJAX questions, nor are you posting AJAX code.

 

Again, were my assumptions about what you're trying to do correct?

 

If they are, what happens when you echo your $username variable? I'm thinking that your $_POST variable isn't being passed to this page.

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.