Page 1 of 1

Simple Question - How to use php tp open a url

Posted: Mon Jul 27, 2009 9:39 am
by hcanning
Hi Guys,
Whats the syntax for opening a url as below.

else{
????? i just want to open a url

THANKS


include("confirm.html");
}
else {
$message = "<a href="http://www.myurl.com>Link</a>";

Re: Simple Question - How to use php tp open a url

Posted: Mon Jul 27, 2009 9:56 am
by sailing_mad_bob
To be clear, you want to open another url from within PHP?

If so you will have to use a linux comand like 'curl'.

To use comand line stuff you need to wrap it with the php comand system()

Re: Simple Question - How to use php tp open a url

Posted: Mon Jul 27, 2009 10:01 am
by hcanning
Thanks. This did it for me

else {
$link = "http://www.xyz.com.html";
Header("Location: $link");

Re: Simple Question - How to use php tp open a url

Posted: Mon Jul 27, 2009 10:08 am
by jackpf
That's not opening a url, that's redirecting.