Streams and Errors

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Streams and Errors

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I believe you set that in your httpd.confg

I am most likely wrong tho :P
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

post your HTML code.
i think you put method as action instead of method.. if u understand what i mean.
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post 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">"; 
?>
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

my bet is on [php_man]register_globals[/php_man]
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post 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
wasabi
Forum Newbie
Posts: 17
Joined: Sat Sep 04, 2004 9:38 am
Location: Adelaide

Slap me if I'm wrong

Post 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]);
?>
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post 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 ;)
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

me? thats all the code there is
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post 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]
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post 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.
Post Reply