kporter.porter Posted September 27, 2007 Share Posted September 27, 2007 I upgrade from PHP4 to PHP5.4.2 and now this code doesn't work. I moved the header command up to the top (you can see where I commented it out lower in the code) and now all that show is the header. If I have the header in the original position the page is blank. This code worked fine before the upgrade. Thanks, <?php include ("header.php"); ?> <?php require("global.php"); SessionStart(); if (GetSessionVar("username")) { RefreshToUrl("member.php"); exit; } //include("header.php"); ?> <script language="javascript"> <!-- function login() { if (document.form1.agentcode.value=="") { alert("Agency code is empty"); return; } if (document.form1.password.value=="") { alert("Password is empty"); return; } document.form1.submit(); } //--> </script> <p> <form method=POST name=form1 action="login.php"> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td colspan=2 ><div align="center"><em> <h2>AGENT LOGIN</h2></font></em></div></td> </tr> <tr> <td><div align="right">Agent code</div></td> <td><input type="text" name="agentcode"></td> </tr> <tr> <td><div align="right">Password</div></td> <td><input type="password" name="password"></td> </tr> <tr> <td><div align="right">State</div></td> <td><select name="state"> <option value="Arkansas">Arkansas</option> <option value="Louisiana">Louisiana</option> <option value="Georgia">Gerogia</option> <option value="Mississippi">Mississippi</option> <option value="Texas">Texas</option> </select></td> </tr> <tr> <td colspan=2><div align="center"> <input type="button" name="Button" value="LOGIN" onClick="login()"> </div></td> </tr> </table> <input type="hidden" name="event" value="login"> </form> <?PHP include("footer.php");?> Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/ Share on other sites More sharing options...
BlueSkyIS Posted September 27, 2007 Share Posted September 27, 2007 if you're seeing a blank page, there is probably an error which you are not seeing because errors are turned off in php.ini. make sure errors are turned on and try again. Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-356702 Share on other sites More sharing options...
freakstyle Posted September 27, 2007 Share Posted September 27, 2007 hey there, also you should always step through your code in issues like this. start at the top and echo out some text, go under the next bit of functionality and repeat, until you don't see the echo'd copy, then you narrowed down where in your code the issue is happening. knowing that is half the battle. good luck Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-356747 Share on other sites More sharing options...
MadTechie Posted September 27, 2007 Share Posted September 27, 2007 as a guess i'll say the problem is here SessionStart(); if (GetSessionVar("username")) { RefreshToUrl("member.php"); exit; } Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-356777 Share on other sites More sharing options...
kporter.porter Posted October 2, 2007 Author Share Posted October 2, 2007 Thanks for all the information. I got the error reporting turned on. I figured out the echo statements too. Why would you automatically go to SessionStart(); if (GetSessionVar("username")) { RefreshToUrl("member.php"); exit; As the problem. I am using a new IDE with a debug and it is giving me Fatal errors on that line. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360386 Share on other sites More sharing options...
MadTechie Posted October 2, 2007 Share Posted October 2, 2007 the reason i say that line is because of the exit.. theirs no other reason i can see that would stop the form loading up.. also if you don't have a function called SessionStart(); then you probably mean session_start(); and GetSessionVar("username") would probably be $_SESSION['username'] Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360387 Share on other sites More sharing options...
kporter.porter Posted October 2, 2007 Author Share Posted October 2, 2007 Those names seem to be correct when compared to my global.php. I am getting alot of can't find files and can't open streams as warnings to. I am back to wondering what changed when I upgraded the PHP to 5.2.4. Everything worked until then. After the upgrade, nothing worked. Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360391 Share on other sites More sharing options...
MadTechie Posted October 2, 2007 Share Posted October 2, 2007 can't find file/ file steaming etc, check the files are uploaded, also check the path to the files. ie to link to a file back one dir, try this require_once dirname(__FILE__)."/../config.php"; Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360392 Share on other sites More sharing options...
kporter.porter Posted October 2, 2007 Author Share Posted October 2, 2007 That seemed to help alot. Whoever did this site used a ini_set to set the include folder. By just typing the path it seemed to have found all the files. And cleared up those errors. Now I am getting Parse error: syntax error, unexpected $end in C:\Inetpub\wwwroot\specialty_old\include\display.php on line 72 Which is strange because the program only goes to line 71. I'll research that one. Thank you so much for your help. Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360404 Share on other sites More sharing options...
MmmVomit Posted October 2, 2007 Share Posted October 2, 2007 That means the file ended before the interpreter expected it to. You're missing a closing php tag or semi colon. Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360407 Share on other sites More sharing options...
MadTechie Posted October 2, 2007 Share Posted October 2, 2007 your missing the end of the file, either a } or hasn't finished uploading Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360409 Share on other sites More sharing options...
MmmVomit Posted October 2, 2007 Share Posted October 2, 2007 Ack, what he said. It is a } that you're missing. Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-360411 Share on other sites More sharing options...
kporter.porter Posted October 3, 2007 Author Share Posted October 3, 2007 Thanks again. I found where he had the } outside the closing php tag. This is good learning from scratch. So now that page works and errors out on the next. I don't know why it worked before. Were earlier versions more freindly to mistakes than the latest? Quote Link to comment https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/#findComment-361226 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.