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
https://forums.phpfreaks.com/topic/127232-solved-easy-post-question/
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.

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.