07. december 2001 - 02:30
Der er
5 kommentarer og 1 løsning
hvad er der galt?
jeg har dette script som skal redirecte baseret på browser/os system..men det virker ikke?? den skriver: Parse error: parse error in /server/jobb23/docs/os.php on line 2 <?php if (preg_match(\'/windows nt 5.0/i\',$HTTP_USER_AGENT))) { header(\'location: win2k.html\'); exit; } if (preg_match(\'/macintosh/i\',$HTTP_USER_AGENT))) { header(\'location: mac.html\'); exit; } if (preg_match(\'/linux/i\',$HTTP_USER_AGENT))) { header(\'location: linux.html\'); exit; } if (preg_match(\'/windows nt 5.1/i\',$HTTP_USER_AGENT))) { header(\'location: winxp.html\'); exit; } if (preg_match(\'/opera/i\',$HTTP_USER_AGENT))) { header(\'location: opera.html\'); exit; } ?>
Annonceindlæg fra Computerworld it-jobbank
Mød 3.500+ it-talenter på IT-DAY 2026
Hos Computerworld it-jobbank er vi stolte af at fortsætte det gode partnerskab med folkene bag IT-DAY – efter vores mening Danmarks bedste karrieremesse for unge og erfarne it-kandidater.
07. december 2001 - 02:34
#1
Du har en parantes for meget på hver if () <?php if (preg_match(\'/windows nt 5.0/i\',$HTTP_USER_AGENT)) { header(\'location: win2k.html\'); exit; } else if (preg_match(\'/macintosh/i\',$HTTP_USER_AGENT)) { header(\'location: mac.html\'); exit; } else if (preg_match(\'/linux/i\',$HTTP_USER_AGENT)) { header(\'location: linux.html\'); exit; } else if (preg_match(\'/windows nt 5.1/i\',$HTTP_USER_AGENT)) { header(\'location: winxp.html\'); exit; } else if (preg_match(\'/opera/i\',$HTTP_USER_AGENT)) { header(\'location: opera.html\'); exit; } ?>