Jump to content

Query string not working???


cturner

Recommended Posts

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 here
header ('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

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']

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.