|
Posted by Pasquale on 10/12/26 11:37
The host that my client is using has display_errors On and I receive
notices of undefined variables and indexes. Also, register_globals is
On. I've included snippets of the lines that the notices refer to in my
code below.
What I have done is taken repetative code and bunched it into a seperate
file. Then I include that file(s) into the page(s) that need them. In
this situation I go to signup.php, which has common.php and formvars.php
included in it.
Are these serious programming issues? If I need to improve how I have
written this and anything in the future, I would like to know how to.
I would appreciate any help or suggestions.
Thanks,
Pasquale
### Begin notices
Notice: Undefined variable: fname in
D:\InetPub\wwwroot\thedomain_com\bsp\common.php on line 7
Notice: Undefined variable: lname in
D:\InetPub\wwwroot\thedomain_com\bsp\common.php on line 7
Notice: Undefined variable: email in
D:\InetPub\wwwroot\thedomain_com\bsp\common.php on line 8
Notice: Undefined variable: uname in
D:\InetPub\wwwroot\thedomain_com\bsp\common.php on line 8
Notice: Undefined variable: password in
D:\InetPub\wwwroot\thedomain_com\bsp\common.php on line 9
Notice: Undefined variable: company in
D:\InetPub\wwwroot\thedomain_com\bsp\common.php on line 9
# etc...
Notice: Undefined index: fname in
D:\InetPub\wwwroot\thedomain_com\bsp\formvars.php on line 2
Notice: Undefined index: lname in
D:\InetPub\wwwroot\thedomain_com\bsp\formvars.php on line 4
Notice: Undefined index: email in
D:\InetPub\wwwroot\thedomain_com\bsp\formvars.php on line 6
Notice: Undefined index: company in
D:\InetPub\wwwroot\thedomain_com\bsp\formvars.php on line 7
# etc...
### End notices
### begin signup.php
session_start();
header("Cache-control: private");
include('common.php');
include('formvars.php');
# rest of my code, an if else with function calls
### end signup.php
### begin common.php
$rqrd = array(
'First name' => $fname, 'Last name' => $lname,
'Email' => $email, 'User name' => $uname,
'Password' => $password, 'Company' => $company,
'Nature of the Business' => $naturebusi, 'Address' => $address,
'City' => $city, 'Province' => $provstate,
'Postal/Zip code' => $postalzip, 'Phone number' => $phonenum
);
# rest of my code
### end common.php
### begin formvars.php
$fname = isset($_POST['fname'])?$_POST['fname']:$_SESSION['fname'];
$fname = NameFilter($fname);
$lname = isset($_POST['lname'])?$_POST['lname']:$_SESSION['lname'];
$lname = NameFilter($lname);
$email = isset($_POST['email'])?$_POST['email']:$_SESSION['email'];
$company =
isset($_POST['company'])?$_POST['company']:$_SESSION['company'];
$company = Filter($company);
# more of the same for the other fields/variables
### end formvars.php
Navigation:
[Reply to this message]
|