Simple Question - How to use php tp open a url

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
hcanning
Forum Newbie
Posts: 3
Joined: Mon Jul 27, 2009 9:35 am

Simple Question - How to use php tp open a url

Post 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>";
sailing_mad_bob
Forum Newbie
Posts: 2
Joined: Sun Jul 26, 2009 7:53 am

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

Post 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()
hcanning
Forum Newbie
Posts: 3
Joined: Mon Jul 27, 2009 9:35 am

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

Post by hcanning »

Thanks. This did it for me

else {
$link = "http://www.xyz.com.html";
Header("Location: $link");
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

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

Post by jackpf »

That's not opening a url, that's redirecting.
Post Reply