Header php Get method from list -


in test.php have following code:

<php? header ('location: $link '); $link = $_get["id"]  ss1 = 'http://drrd.com';  ss2 = 'http://drrd2.com';  ss3 = 'http://drrd3.com';  ss4 = 'http://drrd4.com';  ss5 = 'http://drrd5.com';  ss6 = 'http://drrd6.com';  ss7 = 'http://drrd7.com'; ?> 

when go test.php?id=ss3 page should redirect me http://drrd3.com/

how that?

try one:

<?php ob_start(); $links = array(     'ss1' => 'http://drrd.com',     'ss2' => 'http://drrd2.com',     'ss3' => 'http://drrd3.com',     'ss4' => 'http://drrd4.com',     'ss5' => 'http://drrd5.com',     'ss6' => 'http://drrd6.com',     'ss7' => 'http://drrd7.com' );  $id = $_get['id'] ? ($links[$_get['id']] ? $_get['id']: 'ss1') : 'ss1'; header ('location:'.$links[$id]); ob_flush(); ?> 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -