Search the Community
Showing results for tags 'php output'.
-
Hallo, i need some help with the scripts for a http header request. In the first script you can type the URL and the second shows the information of the header. The output produce an array. I will change this output style with css. How I can manipulate the data output? Here is the code: url.php <table width="65%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr bgcolor="#DFDFFF"> <td> <form name="Form" method="post" action="empfangeURL.php"> <p>URL: <input name="url" type="text" value="http://"> </p> <p> <input type="submit" name="Submit" value="Senden"> <input type="reset" name="Submit2" value="Reset"> </p> </form> </td> </tr> </table> ------------------------------------------------------------------------- empfangeURL.php <title>Receiving</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? # get headers of response $url = $_REQUEST; $scheme = 'http://'; $_response = get_headers($scheme.$url, 1); echo "<pre>\r\n"; echo htmlspecialchars(print_r($_response,1)); echo "</pre>\r\n"; ?> -------------------------------------------------------------------------- echo htmlspecialchars(print_r($_response,1)); produce this output: Array( [0] => HTTP/1.0 301 Moved Permanently [Server] => Array ( [0] => Apache [1] => Apache-Coyote/1.1 [2] => Apache-Coyote/1.1 ) [Location] => Array ( [0] => http://www.ard.de/home/ard/ARD_Home/21920/index.html [1] => /home/ard/ARD_Startseite/21920/index.html ) [Content-Length] => Array ( [0] => 322 [1] => 0 ) [Content-Type] => Array ( [0] => text/html; charset=iso-8859-1 [1] => text/html [2] => text/html;charset=UTF-8 ) [Date] => Array ( [0] => Sun, 05 Jan 2014 20:52:16 GMT [1] => Sun, 05 Jan 2014 20:52:17 GMT [2] => Sun, 05 Jan 2014 20:52:18 GMT ) [Connection] => Array ( [0] => close [1] => close [2] => close ) [1] => HTTP/1.0 301 Moved Permanently [Content-Language] => Array ( [0] => de-DE [1] => de-DE ) [Cache-Control] => Array ( [0] => max-age=45 [1] => max-age=45 ) [2] => HTTP/1.0 200 OK) Any ideas how to manipulate the output? Best, Richard