Page 1 of 1

Execute a script via a URL but not from Browser

Posted: Sat Feb 28, 2004 6:07 am
by digital5
Have a small script that I have created which is called via a 3rd party script, it then receives some variables via HTTP POST. I then want to pass some variables via a URL back to a third party script.

I tried using the headers("Location: http://........."); which works perfectly if i call it via the browser, but my problem is that i won't be calling it via the brower.

What command do i use to send the url?

Posted: Sat Feb 28, 2004 8:01 am
by jollyjumper
Hi,

You could use the file command. eg: file('http://yoururl.com?var=value');

Hope this is what you are looking for.

Greetz Laurens.

Posted: Sat Feb 28, 2004 9:19 am
by digital5
ok i tried this:-

Code: Select all

$value = "This is a test";
file('http://yoururl.com?var=$value');
And it did not work! So i tried this:-

Code: Select all

$value = "This is a test";
file("http://yoururl.com?var=$value");
And all i got back was:-

Code: Select all

This
If i try this:-

Code: Select all

$value = "This%20is a test";
file("http://yoururl.com?var=$value");
I get:-

Code: Select all

This is
How do i rectify this?

Posted: Sat Feb 28, 2004 9:46 am
by Weirdan

Code: Select all

$value = "This is a test"; 
file("http://yoururl.com?var=".urlencode($value));

Posted: Sat Feb 28, 2004 10:13 am
by digital5
PERFECT, many thanks to you both!

Posted: Sat Feb 28, 2004 11:06 am
by jollyjumper
you're welcome..