Page 1 of 1

Streams and Errors

Posted: Sat Sep 04, 2004 2:15 pm
by SidewinderX
Hello, i have 2 questions basically evolving around the same thing. I have 2 servers one with apache 1.3 and the other with apache 2.0 they both have the same version of php. My first question is that when I run this script on one server (apache 1.3) i dont get an error but when i run it on my other server i get this error.
Not Found

The requested URL /method="post" was not found on this server.
My other question has to do with Registered PHP Streams. On one of my servers, the one running v1.3 dosnt have https as a registered php stream but the server with v2.0 has the https stream registered... i dont think the version of apache would have to do with this but i could be wrong? any info is appreciated. thanks

Posted: Sat Sep 04, 2004 2:38 pm
by John Cartwright
I believe you set that in your httpd.confg

I am most likely wrong tho :P

Posted: Sat Sep 04, 2004 4:03 pm
by d3ad1ysp0rk
post your HTML code.
i think you put method as action instead of method.. if u understand what i mean.

Posted: Sat Sep 04, 2004 4:07 pm
by SidewinderX

Code: Select all

<?php
$content = file_get_contents($url); 
print "<form><textarea name="source" rows="15" cols="100">$content</textarea></form>"; 
print "Enter a FULL URL to view the source of:<br><form name="url_submit" action=$PHP_SELF method="post"><input type="textbox" name="url" value="http://"><input type="submit" name="submit" value="Get Source">"; 
?>

Posted: Sat Sep 04, 2004 4:32 pm
by timvw
my bet is on [php_man]register_globals[/php_man]

Posted: Sat Sep 04, 2004 4:44 pm
by SidewinderX
hey i did a check and registered globals were off.. so i changed it to this..

Code: Select all

<?php
$content = file_get_contents($_POST[url]); 
print "<form><textarea name="source" rows="15" cols="100">$content</textarea></form>"; 
print "Enter a FULL URL to view the source of:<br><form name="url_submit" action=$PHP_SELF method="POST"><input type="textbox" name="url" value="http://"><input type="submit" name="submit" value="Get Source">";
?>
....still get the same error

Slap me if I'm wrong

Posted: Sat Sep 04, 2004 8:41 pm
by wasabi

Code: Select all

<?php
$content = file_get_contents($_POST[url]); 
?>
Isn't file_get_contents($_POST[url]); Drawing the data?

if yes shouldn't it be?

Code: Select all

<?php
$content = file_get_contents($_GET[url]);
?>

Posted: Sat Sep 04, 2004 9:05 pm
by d3ad1ysp0rk
No, but it should be $_POST['url']

Also, post more code. A file_get_contents and an echo isn't helping too much ;)

Posted: Sat Sep 04, 2004 9:39 pm
by SidewinderX
me? thats all the code there is

Posted: Sat Sep 04, 2004 10:19 pm
by d3ad1ysp0rk

Code: Select all

<?php
$content = file_get_contents($_POST['url']);
print "<form><textarea name="source" rows="15" cols="100">" . $content . "</textarea></form>";
print "Enter a FULL URL to view the source of:<br><form name="url_submit" action="" . $_SERVER['PHP_SELF'] . "" method="POST"><input type="text" name="url" value="http://"><input type="submit" name="submit" value="Get Source"></form>";
?>
Try that.

[edit]Just tested it on my server:
http://70.16.216.104:12/tessst.php (url will be invalid if I reboot, if so, try lps.no-ip.org instead of the ip:port).
works fine[/edit]

Posted: Sat Sep 04, 2004 10:37 pm
by SidewinderX
yeah, i got it thanks

1. Registered Variables were off
2. i forgot the ' ' in the $_POST['url']

now for the corrilation between this and https, i need to 'get' the contents of this site
https://www.novaworld.com/NWCommunities ... ayerCard=1

like yours, mine gives me an error when i 'get' the contents because https is not set as Registererd PHP Stream

i posted in a more appoririate forum
viewtopic.php?p=131705#131705 ..to continue the thread.