Netwrkengeer
IS-IT--Management
Ok I'm very new at this stuff, but I keep running through different commands and nothing is working. here is some code I wrote, the first piece is the html which is working fine. The second 2 pieces are 2 separate attempts to achieve my desired result.
My desired result is to send info to a website, and grab the raw html of the site.
/*HTML,eagle5.htm works fine*/
<html><head><title>SM2</title></head><body>
<!--the form attempts to send info via "POST" locally to sm2proc2.phtml-->
<FONT FACE="DAXLIGHT" >
<TABLE COLSPEC="L20 L20" >
<TR>
<TD>
<H1>
</H1>
</TD>
<TD>
Input your address.
<FORM ACTION="sm2proc2.phtml" METHOD=post>
<PRE>
<!--the form variables street,city,state,zip, are unalterable-->
Street Address: <INPUT SIZE=30 NAME="street">
City: <INPUT SIZE=30 NAME="city">
State: <INPUT SIZE=3 NAME="state"> Zip: <INPUT SIZE=6 NAME="zip" <br>
<input type=submit name="geocode" VALUE="request">
</PRE>
</FORM>
</TD>
</TR>
</TABLE>
</body></html>
/*PHP1, problem, won't echo/print contents of html from url, I test the url variables with echo and it printed the url with the inputed variables correctly, I then copied the correctly echo url into the address bar of my browser, and it gave me the page I wanted to see, so it works the way I want it to. now for the problem, with this code I get a log in page, not what I want.*/
<?php
/*
overview of code.
To submit info to a website via its URL, utilize variables from the POST form eagle5 which are concated into the url.
*/
readfile("
exit();
?>
/*PHP2, problem, won't echo/print contents of html from url, I test the url variables with echo and it printed the url with the inputed variables correctly, I then copied the correctly echo url into the address bar of my browser, and it gave me the page I wanted to see, so it works the way I want it to. now for the problem, with this code I get an echo of (0), not what I want.*/
<?php
/*
overview of code.
To submit info to a website via its URL, utilize variables from the POST form eagle5.htm which are concated into the url.
*/
/*opening connection to site, utilizing variables to access activated part of site i.e. $street*/
$fp = fsockopen (" 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n"
while (!feof($fp)) {
echo fgets ($fp,128);
}
fpassthru ($fp);
}
?>
/*PHPtest, this is the code I used to test the form and url.*/
<?php
echo $street."<br>";
echo $city."<br>";
echo $state."<br>";
echo $zip."<br>";
echo " 80, $errno, $errstr, 30;
?>
I'm stumped,
thanks for any help you can give.
robert
My desired result is to send info to a website, and grab the raw html of the site.
/*HTML,eagle5.htm works fine*/
<html><head><title>SM2</title></head><body>
<!--the form attempts to send info via "POST" locally to sm2proc2.phtml-->
<FONT FACE="DAXLIGHT" >
<TABLE COLSPEC="L20 L20" >
<TR>
<TD>
<H1>
</H1>
</TD>
<TD>
Input your address.
<FORM ACTION="sm2proc2.phtml" METHOD=post>
<PRE>
<!--the form variables street,city,state,zip, are unalterable-->
Street Address: <INPUT SIZE=30 NAME="street">
City: <INPUT SIZE=30 NAME="city">
State: <INPUT SIZE=3 NAME="state"> Zip: <INPUT SIZE=6 NAME="zip" <br>
<input type=submit name="geocode" VALUE="request">
</PRE>
</FORM>
</TD>
</TR>
</TABLE>
</body></html>
/*PHP1, problem, won't echo/print contents of html from url, I test the url variables with echo and it printed the url with the inputed variables correctly, I then copied the correctly echo url into the address bar of my browser, and it gave me the page I wanted to see, so it works the way I want it to. now for the problem, with this code I get a log in page, not what I want.*/
<?php
/*
overview of code.
To submit info to a website via its URL, utilize variables from the POST form eagle5 which are concated into the url.
*/
readfile("
exit();
?>
/*PHP2, problem, won't echo/print contents of html from url, I test the url variables with echo and it printed the url with the inputed variables correctly, I then copied the correctly echo url into the address bar of my browser, and it gave me the page I wanted to see, so it works the way I want it to. now for the problem, with this code I get an echo of (0), not what I want.*/
<?php
/*
overview of code.
To submit info to a website via its URL, utilize variables from the POST form eagle5.htm which are concated into the url.
*/
/*opening connection to site, utilizing variables to access activated part of site i.e. $street*/
$fp = fsockopen (" 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n"
while (!feof($fp)) {
echo fgets ($fp,128);
}
fpassthru ($fp);
}
?>
/*PHPtest, this is the code I used to test the form and url.*/
<?php
echo $street."<br>";
echo $city."<br>";
echo $state."<br>";
echo $zip."<br>";
echo " 80, $errno, $errstr, 30;
?>
I'm stumped,
thanks for any help you can give.
robert