SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: execute a url?

  1. #1
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    execute a url?

    hi...
    is there a function that would let me open a particular url?

    for example, if i have a "me.php" script, how would i get the browser to open "http://www.blah.com/blah.php" from that script?
    is there a function? i checked the manual but i can't find anything.

    secondly, if "me.php" was called using the crontab, would "http://www.blah.com/blah.php" also be run?

    all help appreciated.
    thanks.

  2. #2
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Header("Location: blah.php");

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    include("http://www.blah.com/blah.php"); 
    This will include the output of the script, not the source.

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  4. #4
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you really put in a full URL address in an include()??

  5. #5
    SitePoint Zealot NZ Joe's Avatar
    Join Date
    Apr 2001
    Location
    Kapiti, New Zealand
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depend on how the host is set up. Some do allow remote includes, the security aware hosts don't.
    Gravity always wins

  6. #6
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by manipura
    can you really put in a full URL address in an include()??
    As NZ Joe said, you can but it depends on the host

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  7. #7
    Bored One boredboi's Avatar
    Join Date
    Jul 2000
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by delemtri
    Header("Location: blah.php");
    I can use this with remote files right?
    Also, will this url be executed if i run the script using CRON?

    Thanks again.

  8. #8
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like said above, it depends on your host; as for the crons, I don't quite know.

  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also in windows versions of PHP you cannot include external links only on unix setups.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  10. #10
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you do a full path?
    cause sometimes when i do
    PHP Code:
    include ('/firstfolder/secondfolder/file.php'); 
    it won't include the file i want.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •