update mysql and php then this code not work

can not pass variable userid

if(!isset($userid)) {
  echo "test51"  ;    

the full code is below how can i fix it

      <H3>Please log in to access the page you requested.</H3>
         <TD WIDTH="82%" NOWRAP>
            <INPUT TYPE="TEXT" NAME="userid" SIZE="8">
         <TH WIDTH="18%" ALIGN="RIGHT" NOWRAP>Password</TH>
         <TD WIDTH="82%" NOWRAP>
            <INPUT TYPE="PASSWORD" NAME="userpassword" SIZE="8">
            <INPUT TYPE="SUBMIT" VALUE="LOGIN" NAME="Submit">

if(!isset($userid)) {
  echo "test51"  ;
//   exit;
// main else when have log in then process
else {

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

teeraAuthor Commented:
this is the full code  when I up grade php id does not work
Loganathan NatarajanLAMP DeveloperCommented:
I think the above code is not full.. it is broken?
Julian HansenCommented:
What are you asking?

The php code is obviously not complete.

$userid is being used but not set - assuming you are getting the value from the POST ($_POST['userid'])

Where does MySQL come into it

Please take the time to phrase your question properly so we are able to assist you.
Chris StanyonWebDevCommented:
It's probably because SuperGlobals were enabled in your old version of PHP, and disabled in the new version. Instead of accessing POST variables simply by their name, you have to access them through the array. So instead of:

if(!isset($userid)) {

You need to use:

if(!isset($_POST['userid'])) {

As others have said though - if that really is your complete code then it's broken in several places!
Ray PaseurCommented:
We know that cannot possibly be the "full code" because it contains a parse error, and would never have run on any PHP configuration.  But that aside, I think @ChrisStanyon has got a pretty good lead on the problem.  This article explains it.  You're not the only one who thought that "PHP just works this way."


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.