Jump to content

run a link


asmith

Recommended Posts

for one thing the code i gave will only generate one link, if you notice im just if'ing the href portion of a single link, but now i understand what your wanting

 

you can do it thru javascipt on the body tag onload event.

 

<body onload="window.location = '<? if ($a = "hello") { echo "http://yahoo.com";} else {echo "http://gmail.com";} ?>'>

Link to comment
Share on other sites

header won't work in the middle of the html , it should be at the top . before html begins

any special code that simply opens a link automaticlly anywhere on the page ? (PHP)

 

for one thing the code i gave will only generate one link, if you notice im just if'ing the href portion of a single link, but now i understand what your wanting

 

you can do it thru javascipt on the body tag onload event.

 

<body onload="window.location = '<? if ($a = "hello") { echo "http://yahoo.com";} else {echo "http://gmail.com";} ?>'>

 

it is a good code , but if the browser do not support java, it won't work .

 

Link to comment
Share on other sites

header won't work in the middle of the html , it should be at the top . before html begins

any special code that simply opens a link automaticlly anywhere on the page ? (PHP)

 

It is ilogical to attempt to display data and then redirect. What is the point of displaying something if your simply going to redirect to another page?

 

I suggest you adjust your logic accordingly, or use the previously posted buffering hack.

Link to comment
Share on other sites

header won't work in the middle of the html , it should be at the top . before html begins

any special code that simply opens a link automaticlly anywhere on the page ? (PHP)

 

It is ilogical to attempt to display data and then redirect. What is the point of displaying something if your simply going to redirect to another

 

that's true, i just didn't want to rearrange codes !!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.