Hi i asked a question before here : how-can-i-integrate-php-with-my-http-server i programmed a personal web server and i tried to integrate it with PHP using the PHP-CGI , i run a system command ("PHP-CGI.exe path/to/php/script.php getvar=getValue") and i send the outputs to the browser , everything works cool except that the output shows in the browser as plain/text page like :
X-Powered-By: PHP/5.4.14 Set-Cookie: PHPSESSID=9rurvleetdkucms44i4cac9a14; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html
ID value = AAAA< /h1>
here's the PHP script :
<?php
session_start();
echo "< h1>ID value = < /h1>". $_GET['id'];
?>
and the command i used : php-cgi html_doc/index.php id=AAAA
my question is : why does it send data in plain/text instead of text/html i want?! and why does it show the header information in the browser like above ?! Thank you all in advance! (Notice : i seperated < h1>so it can be appeared!)