PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 31st, 2000, 01:55 PM
ghost_swg ghost_swg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 9 ghost_swg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi, i recently found out my site doesn't work for Linux netscape and a few other non-popular browsers.

so I decided to try and make a script that would redirect the people depending on their browser...

I stick this inside the href tag like this:

<a href="<?php
if ($BROWSER == "MSIE") { echo "site/"; }
if ($BROWSER == "Netscape") { echo "site/"; }
else { echo "site/text-only/"; }
?>">enter</a>

what am I doing wrong? btw...I don't have any real programming experience - just trying to do it off the top of my head and from articles.

Thanks

- ghost

------------------

Reply With Quote
  #2  
Old March 31st, 2000, 10:29 PM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
your script just prints out links , you need to tell the browser to execute them - ie:
if (etc etc ......
<?php echo "<script>window.location.href= "thisdir.html"</script>";?>

etc

Regards



------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
  #3  
Old April 3rd, 2000, 11:30 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
fp is right that you can't just print out the links, but using JS to solve the problem isn't a solution as a lot of the browsers you're having problems with won't support that. Use the PHP header() function to do a redirect:

if ($condition==$good_browser)
{
header("Location: site/");
exit;
}
header("location: site/text-only/");
exit

Reply With Quote
  #4  
Old April 4th, 2000, 09:49 AM
ghost_swg ghost_swg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 9 ghost_swg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well, what I am looking for is not a direct "redirection"...
instead, I have a button that they must click to select the specific site they want to go to... and I only need the browser specific stuff for that one button link. There are multiple sites to go to (this page is sort of like a Table of Contents)... and only one site needs the browser specific stuff.

I also need to know the variable names for the Different browsers. I need both IE and Netscape names.

Seeing how this is a preprocessor language, I think that the page should be able to detect the browser...and upon the detection, change the URL that the specific button will go to.

(sorry if this sounds confusing)

Thanks

- ghost

------------------

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > href php redirection help!!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap