By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,965 Members | 1,702 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,965 IT Pros & Developers. It's quick & easy.

How to get an parameter from a remote php script?

P: n/a
Okay im to stupid to figure this out.

example:
?php on http://bi.com
{
$t = "http://foo.com/boo.php?action=1&test=2";
echo $t;
}

Now on foo.com the php script boo.php
does something with this request.. So far i get it :)

Now comes the problem.

How I get the result from foo.com/boo.php into the $t ?

Any expert out where may could help me find the way around this ?

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Markus wrote:
Okay im to stupid to figure this out.

example:
?php on http://bi.com
{
$t = "http://foo.com/boo.php?action=1&test=2";
echo $t;
}

Now on foo.com the php script boo.php
does something with this request.. So far i get it :)

Now comes the problem.

How I get the result from foo.com/boo.php into the $t ?

Any expert out where may could help me find the way around this ?


A really good bookmark/favorite is:

http://www.php.net/manual/en/index.php

and from there you can use the earch bar (near the top left) for "get
url" and find:

http://www.php.net/function.parse-url
Michael Austin.
I believe this is what you are looking for...
Jul 17 '05 #2

P: n/a
Markus wrote:
Okay im to stupid to figure this out.

example:
?php on http://bi.com
{
$t = "http://foo.com/boo.php?action=1&test=2";
echo $t;
}

Now on foo.com the php script boo.php
does something with this request.. So far i get it

Now comes the problem.

How I get the result from foo.com/boo.php into the $t ?

Any expert out where may could help me find the way around this ?

function URLopen($url)
{
// Fake the browser type
ini_set(’user_agent’,’MSIE 4\.0b2;’);

$dh = fopen("$url",’r’);
while (!feof($dh)) {
$result .= fread($dh,8192);
}

return $result;
}

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-paramete...ict124155.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=413680
Jul 17 '05 #3

P: n/a
Markus <da****@foo.com> wrote in message
ews:<40***********************@news.sunrise.ch>...

?php on http://bi.com
{
$t = "http://foo.com/boo.php?action=1&test=2";
echo $t;
}

Now on foo.com the php script boo.php
does something with this request.. So far i get it :)

Now comes the problem.

How I get the result from foo.com/boo.php into the $t ?


$t = file_get_contents('http://foo.com/boo.php?action=1&test=2');
echo $t;

Or, in case you don't need to store the remote file in a variable,
simply:

readfile('http://foo.com/boo.php?action=1&test=2');

Cheers,
NC
Jul 17 '05 #4

P: n/a
> Markus <da****@foo.com> wrote in message
ews:<40e0baed[quote:8a1089b46d="Nikolai Chuvakhin"]Markus <da****@foo.com> wrote in message ews:<40***********************@news.sunrise.ch>...
?php on http://bi.com
{
$t = "http://foo.com/boo.php?action=1&test=2";
echo $t;
}

Now on foo.com the php script boo.php
does something with this request.. So far i get it

Now comes the problem.

How I get the result from foo.com/boo.php into the $t ?


$t = file_get_contents(’http://foo.com/boo.php?action=1&test=2’);
echo $t;

Or, in case you don’t need to store the remote file in a variable,
simply:

readfile(’http://foo.com/boo.php?action=1&test=2’);

Cheers,
NC[/quote:8a1089b46d]
64*******@news.sunrise.ch>...

?php on http://bi.com
{
$t = "http://foo.com/boo.php?action=1&test=2";
echo $t;
}

Now on foo.com the php script boo.php
does something with this request.. So far i get it

Now comes the problem.

How I get the result from foo.com/boo.php into the $t ?


$t = file_get_contents(’http://foo.com/boo.php?action=1&test=2’);
echo $t;

Or, in case you don’t need to store the remote file in a variable,
simply:

readfile(’http://foo.com/boo.php?action=1&test=2’);

Cheers,
NC

Nikolai, learned something new today. My approach works, but I like
yours a lot better!

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-paramete...ict124155.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=414575
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.