Sunday 15 January 2012

php - Redirection Depending Upon Url Parameter -


Searching for a PHP code for redirects depends on the parameter

  Redirect Php? Mid = 1   

should redirect to page 1.php

  redirect.php? Mid = 2   

should redirect to page 2.php

and if url is without parameters

  redirect.php < / Code>  

should be redirected to page 3.php

  & Lt ;? Php // quesry string parameters are accessible via $ _GET or $ _REQUEST switch $ _GET ['middle']) // Only look at the middle parameter, decide what to do based on price {case1: $ page = ' Page1.php '; // Save the redirection in a variable break; Case 2: $ page = 'Page2.fp'; break; Default: $ page = 'page3.php'; break; } // redirect the page header to correct it ('location:'. $ Page); ? & Gt;          



No comments:

Post a Comment