Can't pass include file parameters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Can't pass include file parameters

Post by amir »

in my page i want to include this file on a remote server outside our company.

i also want to pass the page some parameters and ive stored all my parameter values in a variable called: $param.

include('http://www.remotesite.co.uk/intranet/pe ... ?'.$params);

but i get an error telling me that the stream failed to open.

ive looked around for an answer to this issue, but havent found anything yet that is a solution
User avatar
thomas777neo
Forum Contributor
Posts: 214
Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa

Post by thomas777neo »

Rather use the header function to do that.

http://www.php.net/manual/en/function.header.php

Edit: Your php page should already exist on the remote server, you cannot pass parameters through the include function like that, essentially, if you include the file, the variables on the page where you included the file are available to that file.
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

Thanks and Cheers.
Post Reply