Is Wampserver 2.0h faulty?

Discussion in 'Programming' started by wwwbryan, Jun 6, 2009.

  1. #1
    I have this php code:

    <?php
    define('TITLE', 'login');
    define('THIS_SCRIPT', 'login');
    
    $content = 'ee';
    
    function getLayout() {
    	require_once('./global.php');
    	loadHead();
    	echo '<body>';
    	loadHeader();
    	echo '<div id="container">';
    	loadUserinfo();
    	loadNavigationtree('Homepage');
    	echo $GLOBALS['content'];
    	echo '</div>';
    	loadFooter();
    }
    
    
    
    if (!empty($_POST[username]))
    {
    	require_once("connect.php");
    
    	// Check if he has the right info.
    	$query = mysql_query("SELECT * FROM members
    							WHERE username = '$_POST[username]'
    							AND password = '$_POST[password]'")
    	or die ("Error - Couldn't login user.");
    	
    	$row = mysql_fetch_array($query)
    	or die ("Error - Couldn't login user.");
    	
    	if (!empty($row[username])) // he got it.
    	{
    		$_SESSION[username] = $row[username];
    		echo "Welcome $_POST[username]! You've been successfully logged in.";
    		exit();
    	}
    	else // bad info.
    	{
    		echo "Error - Couldn't login user.<br /><br />
    			Please try again.";
    		exit();
    	}
    }
    
    $content = '
    		<form action="login.php" method="post">
    			<table width="75%" border="1" align="center" cellpadding="3" cellspacing="1">
    				<tr>
    					<td width="100%"><h5>Login</h5></td>
    				</tr>
    				<tr>
    					<td width="100%"><label>Username: <input type="text" name="username" size="25" value="<? echo $_POST[username]; ?>"></label></td>
    				</tr>
    				<tr>
    					<td width="100%"><label>Password: <input type="password" name="password" size="25" value=""></label></td>
    				</tr>
    				<tr>
    					<td width="100%"><input type="submit" value="Login!"></td>
    				</tr>
    			</table>
    		</form>
    ';
    
    
    getLayout();
    
    ?>
    Code (markup):
    It works completely fine in the older wampservers (such as wampserver 2.0a), but in 2.0h it just shows a firefox error page, or internet explorer error page when loaded.

    Does anyone know why this is?
     
    wwwbryan, Jun 6, 2009 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    What is the error? Also, have you checked the error logs or tried to debug the script?
     
    Social.Network, Jun 7, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Maybe try xampp and then see if things are wrking fine or no
     
    Bohra, Jun 7, 2009 IP
  4. wwwbryan

    wwwbryan Well-Known Member

    Messages:
    181
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #4
    It's only with Wampserver 2.0h, earlier versions work fine, other servers work fine.
     
    wwwbryan, Jun 7, 2009 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Maybe its an installation problem try re installing as there is no one to double the issue
     
    Bohra, Jun 8, 2009 IP