473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to get an parameter from a remote php script?

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
4 1697
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
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
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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: miles111 | last post by:
Basically, can I execute a php script from within a php script? Heres some details: I'm using a remote script to get my local ip address using $HTTP_SERVER_VARS; This works. Now I want to run...
5
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was...
1
by: Uli | last post by:
Dear group, I have to replicate remote data to a SQL Server in the headquarter. The data are on a site which does not have permanent online-connection to the headquarter. I have written a...
5
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
1
by: clteh9 | last post by:
There is no error or exception for the code below. It works fine with the calc.exe. But it fails when i call the script. For your information, strScript is the remote script and strFileName is the...
3
by: johnny | last post by:
I have a remote script on a local network and I need to make Web App in PHP, call this remote script on a different machine. How do I do this? Many Thanks.
1
by: =?Utf-8?B?a2lwYWFkdW1hQGdtYWlsLmNvbQ==?= | last post by:
Hello all . I have a WS in the local machine that call another WS in a remote computer. in this call i send some integers and 3 by-reference strings The remote WS looks like that : void...
3
by: joja15 | last post by:
I am working on a Python script to perform as a remote computer manager. So far I have a WOL function working and I would like to add the ability to show if a machine is on or off (I figured I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.