Astahost.com   Sep 3, 2010
  Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting

Login Form Not Working

Eggie


I am "rewriting" my old game scripts and i am having problems with it ...
right now i am having problems recovering my login form script

this is in my head.php
CODE
<tr><form method=post action=login.php>
                          <td align="center"><b>Name</b></td>
                        </tr>
                        <tr>
                          <td align="center"><input type=text name=user size="12"></td>
                        </tr>
                        <tr>
                          <td align="center"><b>Password</b></td>
                        </tr>
                        <tr>
                          <td align="center"><input type=password name=pass size="12"></td>
                        </tr>
                        <tr>
                          <td align="center">
                            <p align="center"><input type=submit value=Login></form></p>


this is in my login.php
CODE
<?php $title = "Login";
if (!$user || !$pass) {
    include("head.php");
    print "Please fill out all fields.";
    include("foot.php");
    exit;
}



it says "Notice: Undefined variable: user in C:\wamp\www\login.php on line 2" when i try to login ...
what is the problem??it worked before.

 

 

 


Comment/Reply (w/o sign-up)

mastercomputers
Hi Eggie,

Newer versions of PHP now have autoglobals off, which means POST'ed data no long take on generating their equivalent named variable.

What you now have to do is:

$user = $_POST['user'];
$pass = $_POST['pass'];

Your scripts could do with some better checks though to make sure the data exists, otherwise you're going to throw up warnings if you had error reporting on.


Cheers,


MC

Comment/Reply (w/o sign-up)

Eggie
Hi mastercomputers,
i can see some things have been changed on php...this doesn't sound good sad.gif
so,i can't just make "autoglobals" on??
i have many errors since last time i used my site(which is no longer hosted,i am using wamp to finish it)
i will need to make many changes on my site because of this,and i won't if i can do something else biggrin.gif

Thanks...Eggie

Comment/Reply (w/o sign-up)

FirefoxRocks
I would recommend leaving register_globals OFF. Having register_globals ON is very dangerous as stated by the PHP team: http://php.net/manual/en/security.globals.php

Learn to validate input and develop with register_globals off, cause it is easy to hack into your site if you leave register globals on.

Comment/Reply (w/o sign-up)

magiccode9
You should leave the register global off and take a look
of this function. It can temp. import global variables ($_POST*, $_GET*, $_COOKIE*)
into typical scalar variables similar to register global on.

After the script work correctly. You can update all of your scripts to work with register global off.

Comment/Reply (w/o sign-up)

8ennett
You should probably check your code for deprecated functions as well. A lot of functions were superseded by either improved versions or replaced completely in PHP 5 and will be removed in PHP 6. It's funny though because a lot of web hosts are still using PHP 4 and are refusing to upgrade to 5.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Login Working

  1. Login Help - a lil help with the login page (3)



Looking for Login, Form, Not, Working

free web hosting



*SIMILAR VIDEOS*
Searching Video's for Login, Form, Not, Working
advertisement




Login Form Not Working

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com



Creative Commons License