Need help redirecting URL...

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
macek
php-forum Active User
php-forum Active User
Posts: 277
Joined: Wed Aug 25, 2010 10:42 am
Contact:

Re: Need help redirecting URL...

Post by macek » Mon Feb 17, 2014 11:47 pm

What is the output of the script? "this don't work" or nothing ( blank page ) ?

pietercdevries

Re: Need help redirecting URL...

Post by pietercdevries » Tue Feb 18, 2014 3:14 pm

Hi why don't you use "Case" instead of an "If" statement

BTW: I didn't test this code.

Code: Select all

<?php
$user1=999;
$user2=100;
$user3=200;

$account=$_POST['account'];

switch ($account) {
   case $user1:
       header("location: /support.html");
         break;
   case $user2:
       header("Location: /services.html");
         break;
   case $user3:
        header("Location: /about.html");
         break;
}
?>

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests