Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PHP question



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.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org