PHP question

Mark Richards mark.richards at massmicro.com
Fri Mar 30 10:54:23 EDT 2007


Jerry Feldman wrote:
> I have a PHP script that was written under PHP 3, and worked when the
> BLU upgraded from the old ProLiant server (was it Red Hat 7?). The
> replacement server, I believe was running CentOS 4 with PHP 5, and the
> script was working on that server (I fixed 1 problem that was not in
> the script). 
> On the new web server, the script allows the post values to be
> inserted, but the submit button tends to cause the script to reset all
> the fields. JABR took a quick look and found a couple of potential
> problems, but what I am looking for is a better way to debug a php
> script. The submit button essentially causes the script to execute a
> validate function to make sure the required fields are filled in, and
> then calls a function to format and send an email with the information. 

You could stick a call to PrintGetPostRequestVars() (below) at the top 
of your script to see what has been sent.

Offhand I recall there's significant changes going to php 5 and among 
them principally are a change to the behaviour of "register_globals". 
That may play into your issues.

/m



function PrintGetPostRequestVars()
{
	// ------------------------------------
	print '$_POST array';
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	foreach ( $_POST as $key => $value ) {
	 print $key . " " . "=" . " " . $value;
	 print "<BR/>";
	}
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	print '$_GET array';
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	foreach ( $_GET as $key => $value ) {
	 print $key . " " . "=" . " " . $value;
	 print "<BR/>";
	}
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	print '$_REQUEST array';
	// ------------------------------------
	print "<BR/>";
	// ------------------------------------
	foreach ( $_REQUEST as $key => $value ) {
	 print $key . " " . "=" . " " . $value;
	 print "<BR/>";
	}	
}


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Discuss mailing list