
Originally Posted by
TechAsh
Well if this is the only page where it happens then you need to compare it with a page that works and find the difference, there must be one.
when i go to the page directly
no_access.php
it displays correctly
however when this page is accessed via a post request it displays correctly
for example
upload.php
Edit:
apologies sought.......
i think i missed posting a important part of my code
it is the contents of the page post_request.php
PHP Code:
//page_request.php
//post function
<?php
function post($url,$var_arr)
{
$host="nitesh.x10hosting.com";
//$host="localhost";
$var_list="";
foreach($var_arr as $name=>$value)
{
if(isset($var_list))
$var_list.="&";
$var_list.="".$name."=".urlencode($value);
}
$content_len=strlen($var_list);
/*
$request_header=
"
POST $url HTTP/1.1
Host : $host
Content-Type : application/x-www-form-urlencoded
Content-Length : $content_len
Connection : close
$var_list \n\n";
*/
$socket=fsockopen($host,80,$errno,$errstr);
if(!$socket)
{
die("\n<br/>post request failed ERROR $errno : ".$errstr );
}
/*
if(!fputs($socket,$request_header))
{
die("\n <br/>error");
}
*/
fputs($socket,"POST $url HTTP/1.1 \r\n" );
fputs($socket,"Host : $host \r\n" );
fputs($socket,"Content-Type : application/x-www-form-urlencoded \r\n" );
fputs($socket,"Content-Length : $content_len \r\n" );
fputs($socket,"Connection : close \r\n\r\n");
fputs($socket,"$var_list \r\n");
while(!feof($socket))
$result.=fgets($socket,128);
$result = explode("\r\n\r\n", $result, 2);
//if(isset($result["errno"]));
// die("\n<br/>post failed ".$result['errno'].": ".$result['errstr']);
//else
fclose($socket);
// for($i=0;$i<count($result);$i++)
// echo"\n<br/><br/>". $result[$i] ;
return array($result[0],$result[1]);
}
?>