Strange issues while running winPHP on IIS6.0

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
belcherman
Forum Newbie
Posts: 6
Joined: Wed Aug 13, 2008 11:59 pm

Strange issues while running winPHP on IIS6.0

Post by belcherman »

I am getting blank pages when I add code like:

Code: Select all

 
if ($username = = "letmein") {
print ("Welcome back, friend!");
}
else {
print ("You're not a member of this site");
}
 

EXAMPLE: - Page that works:

Code: Select all

 
<html>
<head>
<title>A BASIC HTML FORM</title>
 
<?PHP
 
$username = $_POST['username'];
print ($username);
 
?>
</head>
<body>
 
<FORM NAME ="form1" METHOD ="POST" ACTION = "">
 
<INPUT TYPE = "TEXT" VALUE ="username" NAME = "username">
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
 
</FORM>
</body>
</html>
 
 










PAGE: Now I add a if then block and blank page is what shows up:

Code: Select all

 
<html>
<head>
<title>A BASIC HTML FORM</title>
 
<?PHP
if (isset($_POST['Submit'])) {
$username = $_POST['username'];
 
if ($username = = "letmein") {
print ("Welcome back, friend!");
}
else {
print ("You're not a member of this site");
}
}
 
?>
 
</head>
<body>
 
<FORM NAME ="form1" METHOD ="POST" ACTION = "basicForm.php">
 
<INPUT TYPE = "TEXT" VALUE ="username" NAME = "username">
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
 
</FORM>
</body>
</html>
 
Results - this is what the source of the page that is outputed:

Code: Select all

 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY>
<META content=QRJATYDIMO name=SKYPE_FRAMEID>
<META content=QRJATYDIMO name=SKYPE_FRAMEID></HTML>
 
filippo.toso
Forum Commoner
Posts: 30
Joined: Thu Aug 07, 2008 7:18 am
Location: Italy
Contact:

Re: Strange issues while running winPHP on IIS6.0

Post by filippo.toso »

The row 2 contains a parse error. It should be:

Code: Select all

if ($username == "letmein") {
I suggest you to configure PHP to display all the errors during the development phase.
belcherman
Forum Newbie
Posts: 6
Joined: Wed Aug 13, 2008 11:59 pm

Re: Strange issues while running winPHP on IIS6.0

Post by belcherman »

What is funny is that I am copying this right out of a php lession book. How can I configure PHP to show all errors? I will look for that in the meantime. I guess the error is = = as it shoudl be ==?
nowaydown1
Forum Contributor
Posts: 169
Joined: Sun Apr 27, 2008 1:22 am

Re: Strange issues while running winPHP on IIS6.0

Post by nowaydown1 »

There is a directive called display_errors that can be set in your php.ini file. Check out the PHP manual page (http://us2.php.net/manual/en/errorfunc. ... lay-errors) for specifics on how to get it running. As filippo.toso said, you were probably getting a blank page because a parse error was happening, but you didn't have display errors on.
Post Reply