[thelist] [PHP] Hitting a URL from within a function, but NOT directing the browser there...

Dave Stevens evolt at davestevens.co.uk
Mon Mar 12 06:58:46 CDT 2007


Tris wrote:
> So, how can I hit a URL, without going there in teh browser?

Hi Tris,

The way it's done where I've been working, in PHP, is:

$hitURL = "http://www.whatever.com/file.php?a=1&b=2";
$f = file($hitURL);

I'm not sure of security implications and the like in this case, and 
this may depend on your server configuration / PHP configuration but I 
thought I'd put that out there to give you an idea of something that has 
been working for us.

Should anyone respond with reasons why this method is a bad approach, 
I'll happily hear their comments!

Regards
Dave



More information about the thelist mailing list