not taken to second page

Posted on 2011-05-11
Last Modified: 2013-12-13
i enter any information into this form and I am not taken to the next page

is there something wrong with my php 5.2.17 windows server 2008 iis7 (fastcgi or cgi)  installation

if(isset($_POST['username'])) {
	$username = $_POST['username'];

		$username = $_POST['username'];
		$password = $_POST['password'];

		//if(validateLogin($username, $password)) {

			$_SESSION['name'] = 'name';
			$_SESSION['last'] = 'last';
			$_SESSION['login'] = 'login';
			$_SESSION['userid'] = 'userid';
			$_SESSION['olduserid'] = 'olduserid';
			$_SESSION['permissions'] = explode(",",'permissions');
			$_SESSION['loggedin'] = 1;
			$_SESSION['emailaccount'] = 'email';
			$_SESSION['extension'] = 'extension';
			$ipaddress = $_SERVER['REMOTE_ADDR'];		
			//$password = encrypt($password);
			$url = '';
<script type="text/javascript">
window.location = "'.$url.'"
			header('Location: '.$url);

		//}//end validatelogin 

else {
	echo '
	<body class="login">

	<form name="loginform" id="loginform" action="login.php" method="post">
			<label>Username:<br />
			<input type="text" name="username" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
			<label>Password:<br />
			<input type="password" name="password" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>

		<p class="submit">
			<input type="submit" name="wp-submit" id="wp-submit" value="Login &raquo;" tabindex="100" />
		echo '

function validateLogin($user,$pass) {
    return true;


Open in new window

Question by:rgb192
    LVL 9

    Expert Comment

    I haven't tested, but:

    1. Line 36, add a ; to terminate the line.
    2. Move header above any output (ie- the echo at line 33. See:
    LVL 13

    Expert Comment

    instead of
    window.location = "'.$url.'"

    window.location.href = "'.$url.'";

    Author Comment

    I added the javascript redirect, because I was getting 500 error.
    I dont know what the error is
    LVL 107

    Accepted Solution

    You might want to try something like the design pattern illustrated in this article.  I am fairly sure it works.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
    This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now