cancel
Showing results for 
Search instead for 
Did you mean: 

[PAYH] moving PHP from CGI to PAYH

decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

[PAYH] moving PHP from CGI to PAYH

A few caveats for moving PHP code from CGI to PAYH. They are a result of PHP being upgraded to V5 and PN-specific settings applied to this version. (These notes have appeared in several prior posts of mine but are collected here for ease of access).
a. any HTML page which has ‘forms GET’ (i.e.?parm=blah) data transfers and calling PAYH PHP cannot rely on having $parm  being set: a $_GET['parm'] must be issued (it was always good practice but sometimes ignored in older PHP code). This applies also to IFRAME construction of the form <iframe src="http://mydomainname/phpcode.php?parm=blah"> which are ‘form GETs’ under another name 
b. any text in a GET, POST or cookie which contains single or double quotes, backslashes or nulls has these characters escaped (i.e. prefixed) with a backslash when it picked up by the receiving PHP. This is a result of magic_quotes_gpc being now switched on. It can be switched off in .htaccess, but since the magic_quotes setting is being removed altogether in PHP6, it is much better to strip off the escape backslashes using PHP ‘stripslashes’
c. inter-server FTP transfers fail when trying to write files on the PAYH side. On CGI, a permission of 640 (owner RW-; user/group R--; everyone ---) works fine but this is insufficient on PAYH. PAYH needs a 666 (owner RW-; user/group RW-; everyone RW-) for the transfers to work 
Zen from May 17. PN Business account from 2004 - 2017