![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jul 2003
Location: au
Posts: 3,267
|
Retrieving external dynamic pages with variables through PHP
I have encountered a bump on a project I am currently working on. The project requires a script to retrieve the content of an external page with variables for further processing, and I can't seem to get it to work even when using FSockOpen. This may, or should, be a failure on my part, but I looked the issue up in Google and found that others have had the same problem. Among other things, I found some interesting discussion forum threads, but the answers (if you can call it that) was rather vague and speculative and lead me no closer to a solution.
I know for a fact that what I am seeking to do is possible, some way or the other, but this is the first time I have had to retrieve content from external pages with variables. Any input would be highly appreciated. Danke schön. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Join Date: Jul 2003
Posts: 77
|
![]() Not sure what you mean by "with variables" .. but for just saving the contents of a webpage to a variable, have you tried "file_get_contents"? Probably the easiest solution.
![]() Could also use fopen and all that crap too
__________________
icq: 201430673 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
odin:
simple, do the following: the external page should look something like this: PHP Code:
you would simply do: include("http://www.fuckyoutoo.com/some.php"); in your main file that needs the vars. You can of course also not use those strange echos and print the <? ?> directly in the file, but you have to make sure that the server that file is on will not parse it for php since it'll of course be empty for the include() then.
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
A/S/L .. I don't names.
Industry Role:
Join Date: Aug 2003
Posts: 1,177
|
bah
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Jul 2003
Location: au
Posts: 3,267
|
Quote:
I appreciate your time and effort though. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
Hey.. emm.
whats the problem about doing that? <G> $lines = file("http://www.somepage.com?with=vars&foo=bar"); that doesn't work for you?
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Jul 2003
Location: au
Posts: 3,267
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Jun 2003
Location: "Sunny" San Francisco
Posts: 262
|
Quote:
there to let you use the google api as rss/rdf feeds. I've got one that workds with news.google.com if you need one as an example.
__________________
---------------------------------------------- Systems Architect http://www.bitpusher.com/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Dec 2001
Posts: 654
|
just use wget
__________________
- Brian [ a directive occured while processing this error ] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
|
Get a Google Api account and then check out http://www.jappc.com/google
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A> <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Jan 1995
Posts: 2,417
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Jan 1995
Posts: 2,417
|
If Google isn't the "dynamic pages" you want to pull variables from, then you'll probably need to do some sort of REG/EX to pull the correct values.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
A/S/L .. I don't names.
Industry Role:
Join Date: Aug 2003
Posts: 1,177
|
sexy
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Industry Role:
Join Date: Jan 1995
Posts: 2,417
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Join Date: Aug 2001
Location: An Oasis atop a High Desert Mesa
Posts: 386
|
The only way you can "trap" these variables is if you parse the URI in your php script. If they are hidden or session variables you are basically screwed unless you already know the variable names associated with the page you are attempting to 'scan'.
People that have accomplished what I think you are trying to do have been given explicit permission from the sites they are parsing and have been granted access to some sort of an API that said site(s) have available. I may not be Completely accurate here but I think that using any kind of TCP socket connection to said web page will not garner you the info you wish to gather.
__________________
I'm not a porn monger. I'm a porn ... STYLIST! Buildit Cheap, build it Fast, Build it Right. - Pick Two. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Jun 2003
Location: "Sunny" San Francisco
Posts: 262
|
Also, look into CURL .. you can do a lot of
page scraping type work with CURL .. or just go to CPAN.org and search for page scrape and do your page scraping in perl
__________________
---------------------------------------------- Systems Architect http://www.bitpusher.com/ |
![]() |
![]() ![]() ![]() ![]() ![]() |