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
Post a Comment