Jump to content


Photo

Clicking a new link...


  • Please log in to reply
5 replies to this topic

#1 matfish

matfish
  • Members
  • PipPipPip
  • Advanced Member
  • 242 posts
  • LocationUK

Posted 24 October 2006 - 10:00 AM

Hi,

Iv got a list of URLs in an array which I randomly choose, but how do you navigate to it? Like when Iv randomly chosen one, how do I kinda "Click it"?

Many thanks

#2 xsist10

xsist10
  • Members
  • PipPipPip
  • Advanced Member
  • 114 posts

Posted 24 October 2006 - 10:01 AM

What do you mean click it?

Do you want the browser to go to the URL?
Do you want to check if the URL is valid?
Do you want to get the page the URL is pointing to?
SA PHP Archives - www.phparchives.za.org

#3 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 24 October 2006 - 10:07 AM

Just echo it in a link...

echo "<a href=\"{$array[0]}\">My Link</a>";

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#4 matfish

matfish
  • Members
  • PipPipPip
  • Advanced Member
  • 242 posts
  • LocationUK

Posted 24 October 2006 - 10:37 AM

Hi, thanks for the replies.

I have a list of URLs which are all valid etc.. I just want to randomly select one and automatically navigate to it (so dont want to manually click it)

Many thanks

#5 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 24 October 2006 - 10:42 AM

In that case use the header() function.

header("Location: $array[0]");

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#6 matfish

matfish
  • Members
  • PipPipPip
  • Advanced Member
  • 242 posts
  • LocationUK

Posted 24 October 2006 - 11:13 AM

Thanks for the reply,

There no other way? How about selecting a URL and kind of making a iframe navigate to it?

Thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users