[Xitami] php and xitami
MRJ
mrj at 10e12.com
Fri Jul 18 18:58:38 CEST 2008
Skip all they say about PHP-CGI
Use this to make it work..
In defaults.cfg add the following...
[Filter]
#
-------------------------------------------------------------------------
.php="c:/php/php.exe"
[Mime]
php=application/x-httpd-php
Change your default index settings as follows...
default1=index.php
default2=default.php
default3=index.htm
default4=default.htm
default5=index.html
default6=default.html
default7=404.htm
In default setup of PHP 5 on Windows you should be aware of the following.
a) $_POST[$VarName] WILL NOT WORK
$_SESSION[$xVar] WILL NOT WORK
they are turned off by default and should be so as well since they pose
security risks.
b) The workaround for this is included below
(©2008 to myself)
<?php
/*
==========================================================================
A replacement function for $_REQUEST as this does not work at all out of
the box on XITAMI web server. I was seriously thinking of making it a
somwhat permanent fixture in my PHP arsenal by adding a $_ infront of
the name but that would not fly to well in some languages I bet.
==========================================================================
Safer Networks Ltd. (c) 2008 - Major Thanks to
lphuberdeau at phpquebec dot org (21-Aug-2004 05:55)
for the entry that resolved all my problems in PHP man. 5 chm version
suggestion in Chapter 4. Dealing with XForms
==========================================================================
*/
function EX_REQUEST($var){
If ($_SERVER['REQUEST_METHOD']=="GET"){
$qstr = $_SERVER['QUERY_STRING'];
If ($qstr!=""){
parse_str($qstr, $element);
$val = $element[$var];
}else{
$val = NULL;
}
unset($qstr); //free mem or data you dont want GC to keep
}else if($_SERVER['REQUEST_METHOD']=="POST"){
$fp = fopen( "php://stdin", "r" );
$data = "";
while(!feof( $fp ) ){
$data .= fgets( $fp );
}
fclose( $fp );
if($data!=""){
parse_str($data, $element); //printf($data);
$val = $element[$var];
unset($data); //free mem or data you dont want GC to keep
}else{
$val = NULL;
}
}else{
// DOES NOT SUPPORT PUT OR HEAD AT THIS TIME.
// and we cannot return Empty or 0 when nothing was recieved.
$val = NULL;
}
return $val;
}
?>
SEE SOURCE FOR INFORMATION<HR>
<?php
// HOW TO USE THE FUNCTION --------------------
/* REMOVE LINE 46 AND 66 TO SEE WORKING EXAMPLE
<html><body>
<form method=post action="x.php"
enctype='application/x-www-form-urlencoded'>
<input type=hidden value=4 name='p'><input type=submit value='post
it'></form><br>
<form method=get action="x.php" enctype='application/x-www-form-urlencoded'>
<input type=hidden value=4 name='p'><input type=submit value='get
it'></form><br>
<?php
echo "The variable p is detected as having Value: " . ParseReq('p') .
"<br>";
?>
</body></html>
*/
?>
DISCLAIMER===========================================================
The information contained in this communication is confidential
and may be legally privileged. It is intended solely for the
use of the individual or entity to whom it is addressed and
any others authorized to receive it. If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents
of this information is strictly prohibited. If you received this
communication in error, please immediately notify the sender
by return message and delete this communication and any copies
thereof, including any electronically saved copies in your systems.
NOTHING DISCLOSED BY E-MAIL, CHAT, SKYPE MESSAGE OR OTHER
COMMUNICATION SHOULD AT ANY TIME BE CONSTRUED OR INTERPRETED AS
LEGAL, INVESTMENT OR OTHER FINANCIAL ADVICE. IT IS IMPERATIVE
THAT YOU, THE RECIPIENT CONTACT, SEEK ADVICE, FROM A FULLY LICENSED
AND QUALIFIED FINANCIAL MARKET SPECIALIST BEFORE MAKING ANY DECISION
IN REGARDS TO INVESTMENT, FUNDING, LOANS, MORTGAGE OR OTHER SERVICES
AS REQUIRED FROM TIME TO TIME AND AT EACH SUCH TIME.
10e12 (Trillion) Ltd. is registered in
the United Kingdom, company #06331971.
FSA Reg. No 300699 CCLic. Reg. 530996
Also ask us about Mortgage solutions
in cooperation with S.G.Mortgages
=====================================================================
More information about the Xitami
mailing list