alphadeltaviii Posted February 26, 2008 Share Posted February 26, 2008 On my navigation, I have a form using radio buttons to indicate values ($action and $table). Trouble is, i am having trouble getting my redirect to work. I want it to redirect to $action.php?id=$table <?php $action = $_GET['action']; $table = $_GET['table']; $url = $action.php?id=$table header( "Location: http://hostname.com/$url") ; exit; ?> Link to comment https://forums.phpfreaks.com/topic/92989-redirect-help/ Share on other sites More sharing options...
DarkerAngel Posted February 26, 2008 Share Posted February 26, 2008 Tell me how that works for you <?php $action = $_GET['action']; $table = $_GET['table']; $url = $action.'.php?id='.$table; header( "Location: http://hostname.com/$url") ; exit; ?> (I don't know if header("Location: URL"); redirects I'm just patching whats obviously wrong to me) Link to comment https://forums.phpfreaks.com/topic/92989-redirect-help/#findComment-476425 Share on other sites More sharing options...
alphadeltaviii Posted February 26, 2008 Author Share Posted February 26, 2008 Thanks, I got it working. One problem was I was using $_GET and not $_POST Link to comment https://forums.phpfreaks.com/topic/92989-redirect-help/#findComment-476446 Share on other sites More sharing options...
unsider Posted February 26, 2008 Share Posted February 26, 2008 <?php $action = $_POST['action']; $table = $_POST['table']; $url = $action.php?id=$table header( "Location: http://hostname.com/$url") ; exit; ?> EDIT: Nevermind, you figured it out, and wow two mistakes in one thread, record Link to comment https://forums.phpfreaks.com/topic/92989-redirect-help/#findComment-476452 Share on other sites More sharing options...
unsider Posted February 26, 2008 Share Posted February 26, 2008 Oops double. Link to comment https://forums.phpfreaks.com/topic/92989-redirect-help/#findComment-476454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.