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 Bazoom
Få styr på gamer computerens hardware
I gaming-verdenen kan det rigtige hardware være forskellen mellem en uforglemmelig spiloplevelse og konstant frustration. Her er hvad du bør overveje.
22. juli 2024
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; } ?>