Tuesday, 15 September 2015

redirect - PHP - Reloading URL with a GET variable -


I would like to make sure that the $ _GET variable is set to the value of another variable in my URL, if not, then I I want to reload the page / url to show the set variable. This code is using im:

  session_start (); $ Openfile = $ _SESSION ['openfile']; // $ $ $ $ $ _ $ ['openfile'] & amp; Amp; Empty ($ _ session ['openfile']) If $ $ Get current for $$ current issuance of variable isset {// If not, then create new URL string $ hloc = basename ($ _ SERVER ['PHP_SELF']) . '? File = '. $ Openfile; // Change the location in the new URL string header ("location: $ hloc"); }   

I do not understand why this does not work. Any help would be great. Thank you.

Edit: The problem is that the URL does not display information on that top. This fixes properly if the page gets reloaded again, though, obviously what I want.

  if (isset ($ _ GET [file '])) {// its set Mean value is not equal to zero or false} Other {/ / it is not set, therefore}   



No comments:

Post a Comment