kathleenm kathleenm - 1 year ago 93
HTML Question

PHP pass variable through location name

I have inherited this website at my work and it is written in php5, html4, and javascript. The way they pass variables from one page to another is like this:


So when submitting a form I've seen

<form method="post" name="auth" action="login.php?logon=logon">

and then in
is used right away without any use of

I'm currently upgrading everything and right now I've got it running php7.0. This method of passing variables no longer works. Because it is so hard to phrase what this is doing I haven't been able to find an example of this online. So I don't know why it worked before and I can't figure out why is doesn't work now. Everyone seems to be using SESSION variables or GLOBAL variables but because of the many ways this format is used in the code it is impossible to replace it in every case.

Any information about this would be appreciated.

This is literally the first lines of login.php. $logon is not in "global_vars.php"

define( 'direct_access', 1 );

if ($logon == "logon"){

Answer Source

Use PHP's extract() function to import variables into the current symbol table from an array.


Documentation: http://nl3.php.net/manual/en/function.extract.php

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download