Reply to Re: "Show Source" button

Your name:

Reply:


Posted by Joe on 10/02/05 02:19

>>><?php
>>>if(isset($_GET['site'])){
>>> $fp = fsockopen($server, 80, $errno, $errstr, 30);
>>> if(!$fp){
>>>//echo an error
>>> } else {
>>> $out = "GET ".$_GET['site']." HTTP/1.1\r\n";
>>> $out .= "Host: ".$server."\r\n";
>>> $out .= "Connection: Close\r\n\r\n";
>>> fwrite($fp, $out);
>>> if($fp!=false){
>>> //Echo some header
>>> while (!feof($fp)) {
>>> $output. = htmlentities(fgets($fp, 128));
>>> }
>>> //Do some Highlighting (don't know if the function above
>>> //is capable of html highlighting
>>> //Echo some footer
>>> } else {
>>> //Output error message
>>> }
>>> fclose($fp);
>>> }
>>>} else {
>>> //Error Message
>>>}
>>>?>
>>
>>
>> Rauch,
>>
>> I'm not sure how to use your code you posted. I pasted it into a new page
>> and changed 'site' to the page that I want the source displayed??
>> But I'm getting:
>> parse error, unexpected '=' line 21
>>
>> I left the error message parts blank too because I'm not sure if I needed
>> them since this seemed like a cut and dry operation to get done.
>>
>> Can you give me more details on how to use this? Sorry but I'm pretty new
>> to php.
>>
>> I didn't realize showing html using php would be such a pia! :/
>>
>> Thanks
>
> I don't know, which of these lines is 21 in your script, but on typing i
> made another error.
> Change the following line to have an empty space between the variable but
> now between the =
> $output .= htmlentities(fgets($fp, 128));
>
> You did also adjust the $server to your setting, did you?

Rauch,

That was the line, you're right.. $output .= htmlentities(fgets($fp, 128));
But now I just get a blank page. Yes I changed Host to localhost, is that
correct? I'm sorry I've tried a lot of different things to get it to work
but I just don't get it.

thanks

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация