Jump to content

[SOLVED] Passing value in header URL


mark110384

Recommended Posts

How do u do it? I've got the following header to redirect to the view items page

 

header ('location:viewitems.php?category_selected=$categoryid');

 

but it displays non of the

 

and the URL has the following

 

 

It doesn't seem to find the value?

Link to comment
https://forums.phpfreaks.com/topic/111662-solved-passing-value-in-header-url/
Share on other sites

Variables contained in strings delimited by single quotes are not expanded, those in strings delimited by double quotes are.

 

Use either:

<?php
header ("location:viewitems.php?category_selected=$categoryid");
?>

 

or

<?php
header ('location:viewitems.php?category_selected=' . $categoryid);
?>

 

Ken

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.