Hello All,
This is my first post here and I've been troubleshooting this for days so here it goes.
I have a test server:
Windows 2000 all current patches.
Apache 2.0.59
PHP 5.0.1 (try to upgrade to a version that will stop the security people from complaining)
Now the problem is this, I have a web application that has been running for 2 years now using PHP 5.0.1 when I upgrade to any version of PHP higher than that pages that have form post just don't work anymore. I can't figure this out because EVERYTHING is exactly the same except the version of PHP.
Here is a small example:
This is the relevant code from a simple password recovery page, called getpassword.php
<form action="getpasswordaction.php" method="post">
<h2 id="logintag" class="Rcontent">
Login Name:
</h2>
<input id="loginbox" type="text" name="name" />
<h2 id="question" class="Rcontent">
Challenge Question:
</h2>
<select id="questionbox" name="question" />
<option value=""> -- Select Your Challenge Question -- </option>
<option value="MOMNAME"> Mother's Maiden Name</option>
<option value="PETNAME"> Pet's Name </option>
<option value="PARENTJOB"> Parent's Last Employer </option>
</select>
<h2 id="answer" class="Rcontent">
Answer:
</h2>
<input id="answerbox" type="text" name="answer" />
<h2 id="emailtag" class="Rcontent">
Email Address:
</h2>
<input id="emailbox" type="text" name="email" />
<input id="EnterButton" title="Login" type="submit" name="login" value="Submit" />
<input id="CancelButton" title="Cancel" type="button" value="Cancel" onclick="window.location='/Login.php'" />
</form>
This is part of getpasswordaction.php:
<?
session_start();
require_once('/opr/include/opr-db-functions.inc.php');
require_once('/opr/include/opr-constants.inc.php');
require_once('/opr/include/ccbh-email.class.php');
require_once('/opr/include/opr-functions.inc.php');
require_once('/opr/include/ccbh-web-user.class.php');
$connection = new DB_Connect(WEBMAN_NAME,WEBMAN_PASSWORD,TEST_SERVER,WEBUSER_DATABASE);
$webuser = new CCBHWebUser();
$webuser->setUserName($_POST['name']);
$_SESSION['page_name'] = 'getpasswordaction.php';
LogAction('looking up user: '.$_POST['name'],'passwd_recover');
$userlookup = $connection->Execute("select * from table where var = '".$webuser->getUsername()."'");
The problem is that $_POST['name'] (or anything else that should be) is not populated and this is causing everything else to fail.
Now again everything works perfect with PHP 5.0.1 but any other version causes the above code not to work. I have tried version 5.0.5, 5.1.4, 5.1.5 and 5.1.5-dev but they all produce the same effect.
Any insight would be great!!
Rod