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".
how can i include from other server.
Moderator: General Moderators
Re: how can i include from other server.
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:
if you want to use a variable for email you can do that too... just get the value into something like $email and then:
If you want to run in the BACKGROUND, then you need to use AJAX.
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");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.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: how can i include from other server.
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:
If not, then try using http_get().
Code: Select all
file_get_contents('http://www.examole.com/a.aspx?email=sadfasd');mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.