Jump to content

Recommended Posts

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");?>

Link to comment
https://forums.phpfreaks.com/topic/70950-solved-why-this-code-makes-a-blank-page/
Share on other sites

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

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.

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']

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.

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.

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.