• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

get url blank

I am trying to set up a redirect url:

URL being passed to my page:

Page Code:
$dte = $_GET[sourcedte];

      foreach ($_GET[ID] as $key => $value) {
            //if ($value) {
            $red .= "&ID[$value]"; //build redirect link

$url = "orders_find_visit_print_custom_status_noforms_nocosts_idfilter2_Redirect.php?p=1$red&amp;$dte";
//header('Location: '.$url); die;
Result of var_dump:
ng(120) "orders_find_visit_print_custom_status_noforms_nocosts_idfilter2_ReadOnly.php?p=1&ID[]&ID[]&September 27, 2012 7:46pm"

Why are the following fields blank when they are filled in the original url:
2 Solutions
There is no value, if you want the key (the bit inside [ ]) then

$red .= "&ID[$key]"; //build redirect link
Marco GasiFreelancerCommented:
$_GET is an array where ID is the key and78 is the value. You're trying to create an array with a duplicate key and this could the reason of your error. Why you pass two ID? They should have two significant different names...
Marco GasiFreelancerCommented:
Sorry, I misunderstood :(
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Ray PaseurCommented:
This is what you will expect to find in the $_GET array.  Note that the ID array has numbered keys, and empty values.
array(4) {
  string(1) "1"
  array(2) {
    string(0) ""
    string(0) ""
  string(3) "126"
  string(25) "September 27, 2012 7:46pm"

Open in new window

doctorbillAuthor Commented:
Solved - thanks a million
Marco GasiFreelancerCommented:
Hi, doctorbill. I pray you to request attention to a moderator (you find the link below the question box, to the right) and award points to cathal only: his solution works fine (i just tested) and me, I said a greatly stupid think. In addition, other future users who can view this thread would'nt understand what solution is 'Sorry, I misunderstood...' :)

So, please, reassign points: it's not a hard work and it'll make EE a more rational place despite my stupid comment.

Thanks in advance
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now