PHP following a hyperlink

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
Hi there,

I'm rather new to php, I know in ASP there is a way to use code to follow a certain link, but is there a way in PHP. What I mean is I want the PHP code to redirect to a certain page accordingly.

I'm sure there is a way to do this, I'm just not finding it. If anyone could help, I'd appreciate it.

Thank you.
 
You're question makes me think that ASP also does stuff client side. I thought that ASP was only server-side (like PHP)?
I don't know ASP, so I might be misunderstanding you..

Anyway, with PHP you create HTML-files wich are sent to the user.
So you van use normal html-links wich the user can click to request another page.

If you're processing a file and you want to run code wich is in another file you can use the function include.

Greetz Daan
 
I think I explained that poorly...

Here's an example.

If the user's machine uses English then direct automatically to the english version of the site.

If the user's machine uses French then direct to that part of the site.

That's not exactly what I'm doing, but this example is easier to explain.
 
How EXACTLY do you do that in ASP? You can only know if the client is british or french from either their Browser details (available to PHP) or from their IP (also available to PHP).

If you want to see what variables you have to play with, use print_r($_SERVER) and it'll output all the variables the server knows of. You can then use this to perhaps achieve the same thing, which I think is what you're asking!
 
Back
Top