Connecting Tech Pros Worldwide Forums | Help | Site Map

Go to list of URL's

Newbie
 
Join Date: Dec 2008
Location: 2176 & 2165 Bruvha ;)
Posts: 22
#1: Feb 1 '09
Hi i want to make a php script to open certain URL's then close it and open another URL.
i think it can be done with an iframe (to my understanding) but i might be wrong.

Basicly i want it to do this:
Expand|Select|Wrap|Line Numbers
  1. while ($u < 100){
  2. go to a url
  3.  
  4. w8 till url has loaded close the url
  5. $u++;
  6. } // do the next url
if any1 could shed some light itl be nice

Tnx and Take Care
GhOsT

dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#2: Feb 1 '09

re: Go to list of URL's


Quote:

Originally Posted by GhOsTTeCh View Post

Hi i want to make a php script to open certain URL's then close it and open another URL.
i think it can be done with an iframe (to my understanding) but i might be wrong.

Basicly i want it to do this:

Expand|Select|Wrap|Line Numbers
  1. while ($u < 100){
  2. go to a url
  3.  
  4. w8 till url has loaded close the url
  5. $u++;
  6. } // do the next url
if any1 could shed some light itl be nice

Tnx and Take Care
GhOsT

I don't see what you're trying to do. Do you know PHP is a /server side/ processing language and don't work "in" the browser. HTML (which is what the <ifram> tag is) is given to the browser.

So if you want to display these pages, you can just use Iframe and direct the URL there. multiple iframes for multiple URLS.

If you want PHP to grab the content while still server side and put it into a variable, see cURL() functions, that's the only way PHP can grab multiple URLs.

Cheers,





Dan
Newbie
 
Join Date: Dec 2008
Location: 2176 & 2165 Bruvha ;)
Posts: 22
#3: Feb 1 '09

re: Go to list of URL's


Quote:

Originally Posted by dlite922 View Post

I don't see what you're trying to do. Do you know PHP is a /server side/ processing language and don't work "in" the browser. HTML (which is what the <ifram> tag is) is given to the browser.

So if you want to display these pages, you can just use Iframe and direct the URL there. multiple iframes for multiple URLS.

If you want PHP to grab the content while still server side and put it into a variable, see cURL() functions, that's the only way PHP can grab multiple URLs.

Cheers,
Dan

so i shuld post dis in da javascript forums?
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#4: Feb 1 '09

re: Go to list of URL's


Quote:

Originally Posted by GhOsTTeCh View Post

so i shuld post dis in da javascript forums?

First of all I'd appreciate it if you used correct English grammer.

I was asking about your intentions so I can better assist you or point you in a better direction.

What does your web page attempt to accomplish?





Dan
Newbie
 
Join Date: Dec 2008
Location: 2176 & 2165 Bruvha ;)
Posts: 22
#5: Feb 1 '09

re: Go to list of URL's


lol sorry about my English.

basicly i have a Cpanel Hosting with hostmonster , and i need a whole bunch of emails created (they dnt hav option 2) so the email can be created by going to a page and adding the varibles in the url
eg. domain.com/manager/doaddpop.html?user=test&domain=domain.com&password =trial....
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#6: Feb 1 '09

re: Go to list of URL's


Quote:

Originally Posted by dlite922 View Post

If you want PHP to grab the content while still server side and put it into a variable, see cURL() functions, that's the only way PHP can grab multiple URLs.

Not necessarily the only way.
Assuming the "allow_url_fopen" directive is enabled (which it is by default), you can use the Filesystem functions functions to open URLs as well.

So, doing:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. for($i = 0; $i < 10; $i++) {
  3.   file_get_contents("http://www.example.com/?id=$i");
  4. }
  5. ?>
Would call example.com 10 times, each time passing a different "id" GET value.
Reply


Similar PHP bytes