cturner Posted November 4, 2006 Share Posted November 4, 2006 My query string is suppose to look like this: http://domain.biz/folder/viewcart.php?username=simplystuck&pd_id=1 but it looks like this: http://domain.biz/folder/viewcart.php?username=simplystuck&pd_id=. Can someone please tell me why and how I can fix it? Thanks in advance.Here is my code that I am working with:[code=php:0]// there is more code here$pd_id = $_GET['pd_id'];// there is more code hereheader ('Location: viewcart.php?username='.$username.'&pd_id='.$pd_id);// there is more code here[/code] Link to comment https://forums.phpfreaks.com/topic/26169-query-string-not-working/ Share on other sites More sharing options...
ToonMariner Posted November 4, 2006 Share Posted November 4, 2006 it would appear that $_GET['pd_id'] is not being set!!! Link to comment https://forums.phpfreaks.com/topic/26169-query-string-not-working/#findComment-119667 Share on other sites More sharing options...
cturner Posted November 4, 2006 Author Share Posted November 4, 2006 How do I set $_GET['pd_id']? Link to comment https://forums.phpfreaks.com/topic/26169-query-string-not-working/#findComment-119670 Share on other sites More sharing options...
almightyegg Posted November 4, 2006 Share Posted November 4, 2006 well is pd_id defined? can it recognise what it is? Link to comment https://forums.phpfreaks.com/topic/26169-query-string-not-working/#findComment-119677 Share on other sites More sharing options...
ToonMariner Posted November 4, 2006 Share Posted November 4, 2006 I it is passed in the url to the script. The fact that your header is not getting $pd_id suggest that $_GET['pd_id'] is empty - therefore it is not in the url.ARe you POSTING this value to that script? if so use $pd_id = $_POST['pd_id'] Link to comment https://forums.phpfreaks.com/topic/26169-query-string-not-working/#findComment-119678 Share on other sites More sharing options...
cturner Posted November 4, 2006 Author Share Posted November 4, 2006 pd_id is in a url. I now understand that it is empty. Is there a way to keep it from being empty. Link to comment https://forums.phpfreaks.com/topic/26169-query-string-not-working/#findComment-119726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.