GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php quesiton - loading multiple url based queries using script (https://gfy.com/showthread.php?t=805712)

mkx 02-07-2008 02:56 AM

php quesiton - loading multiple url based queries using script
 
Basically, I need to load a few url based commands using a php script. Example=

http://www.test.com/command.php?test=1&test1=1
http://www.test.com/command.php?test=2&test2=2
http://www.test.com/command.php?test=3&test3=3
etc. etc.

This url is on an external site

Hope I explained this right

georgeyw 02-07-2008 04:09 AM

php.net is your friend

k0nr4d 02-07-2008 04:51 AM

i'm not sure what you mean, but file_get_contents is probably what you are looking for...

mkx 02-07-2008 08:09 AM

My php is very week.

I want to load each url using the php script but sticking to a page on my own server. Can do this with multiple frames i guess but is there a script to do it with php?

k0nr4d 02-07-2008 08:11 AM

<?php $string = file_get_contents('http://www.url.goes/here'); echo $string; ?>

drocd 02-07-2008 08:15 AM

If you have fopen wrapper enabled, this should load all the urls, and populate $result with the page outputs.

PHP Code:

$urls = Array(
'url1',
'url2',
'url3');

$result = Array();
foreach(
$urls AS $url) {
$result[] = file_get_contents($url);



mkx 02-07-2008 08:23 AM

thanks that worked, one more question, anyone know how to set a referesh command at the bottom of the page so when the urls finish loading it automatically refreshes?

drocd 02-07-2008 08:26 AM

Quote:

Originally Posted by mkx (Post 13750651)
thanks that worked, one more question, anyone know how to set a referesh command at the bottom of the page so when the urls finish loading it automatically refreshes?

You'll probably want to put
Code:

<meta http-equiv="refresh" content="0" />
at end end of the page. That way it doesn't matter if headers are already sent. By the way, you should be careful about the page timing out if you are loading a lot of URLs.

mkx 02-07-2008 08:28 AM

I guess using the php include command works just as good as get file contents no?

mkx 02-07-2008 08:29 AM

Quote:

Originally Posted by drocd (Post 13750673)
You'll probably want to put
Code:

<meta http-equiv="refresh" content="0" />
at end end of the page. That way it doesn't matter if headers are already sent. By the way, you should be careful about the page timing out if you are loading a lot of URLs.

I want it to refresh after all the urls are loaded, would this do that or could it do it faster/slower.

drocd 02-07-2008 08:31 AM

Quote:

Originally Posted by mkx (Post 13750684)
I guess using the php include command works just as good as get file contents no?

You could, but I'd only do it if it was your site. If one of the URLs returned php code, you script would execute it and who knows what could happen from there.

drocd 02-07-2008 08:33 AM

Quote:

Originally Posted by mkx (Post 13750692)
I want it to refresh after all the urls are loaded, would this do that or could it do it faster/slower.

It will do it fast. The other option would be to do:
PHP Code:

header('Location: '.$_SERVER['PHP_SELF']); 

But only if you haven't already sent output to the browser.

mkx 02-07-2008 08:40 AM

thanks so much!

drocd 02-07-2008 09:14 AM

Quote:

Originally Posted by mkx (Post 13750765)
thanks so much!

Where do I send the invoice?

CheneyRumsfeld 02-07-2008 09:22 AM

great way to 0wn some surfers machine.
but who am I to bitch?





















botnets are were its at.
just leave your machine on all night.
we will take care of it.

SmokeyTheBear 02-07-2008 10:10 AM

i think you are looking for this
<html>
<body>
<? @readfile("http://www.test.com/command.php?test=3&test3=3") ?>
</body>
</html>


All times are GMT -7. The time now is 11:34 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123