jaykappy Posted June 12, 2013 Share Posted June 12, 2013 Trying to redirect based off of the original parameters sent to the php page. I can return the values of the 'Dept' and 'Yr' just fine...but think I have the syntax incorrect below. Thoughts? echo $_GET["Dept"]; echo $_GET["Yr"]; //Redirect from PHP page: header("Location: MainPageindexAsbuiltsDisplayYr.php?Dept={$_GET['Dept']}") & Yr={$_GET['Yr']}"); This is the call I am originally making to get to the page, after an update of a record I am trying to redirect back to that location http://156.100.2.30:83/MainPageindexAsbuiltsDisplayYr.php?Dept=Engineering&Yr=1974 Link to comment https://forums.phpfreaks.com/topic/279069-redirect/ Share on other sites More sharing options...
Eddy_J1 Posted June 12, 2013 Share Posted June 12, 2013 Look over your header line again... You are closing the quotes and a bracket after get dept, also I may be wrong buy I'm pretty sure global vars should be out of quotes. Link to comment https://forums.phpfreaks.com/topic/279069-redirect/#findComment-1435532 Share on other sites More sharing options...
Dathremar Posted June 12, 2013 Share Posted June 12, 2013 To get a "cleaner" code I would recommend something like: $location = "MainPageindexAsbuiltsDisplayYr.php?Dept=" . $_GET['Dept'] . "&Yr=" . $_GET['Yr']; header("Location: $location"); Link to comment https://forums.phpfreaks.com/topic/279069-redirect/#findComment-1435535 Share on other sites More sharing options...
jaykappy Posted June 12, 2013 Author Share Posted June 12, 2013 Eddy and Dathremar...both solved my problem....dang syntax....works like a charm.... THank you both..... Link to comment https://forums.phpfreaks.com/topic/279069-redirect/#findComment-1435606 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.