Page 1 of 1
how can i include from other server.
Posted: Mon May 03, 2010 5:09 am
by sandesh
there is one file from another server and its aspx file .. and i want to include that file in my website. So how can i do it.
include("
http://www.examole.com/a.aspx?email=sadfasd");
actually i really dont want the code to get included but just want to trigger that file using php with email="SOME VALUE".
Re: how can i include from other server.
Posted: Mon May 03, 2010 8:57 am
by rnoack
you can't include it, because php is running server-side meaning that if the file you want to include is on another server your program won't be able to read the source code.
If you just want to direct your page to that page, the code you want is:
Code: Select all
header ("Location: http://examole.com/a.aspx?email=sadfasd");
if you want to use a variable for email you can do that too... just get the value into something like $email and then:
Code: Select all
header ("Location: http://examole.com/a.aspx?email=$email");
If you want to run in the BACKGROUND, then you need to use AJAX.
Re: how can i include from other server.
Posted: Mon May 03, 2010 12:05 pm
by AbraCadaver
If you just want to execute the file and don't care about its output, then this will work if you have the fopen wrappers enabled:
Code: Select all
file_get_contents('http://www.examole.com/a.aspx?email=sadfasd');
If not, then try using http_get().