12-06-2007, 01:47 AM
|
#21 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Posts: 154
Thanks: 31
|
I agree with Wildhoney, sounds like your MySQLi module is not enabled or compiled in.
As to your script, I'm looking at this section:
PHP Code:
// Variables $user = $_POST['user']; $pass = $_POST['pass']; $dir = $_POST['dir']; $address = $_POST['address']; $phone = $_POST['phone']; $email = $_POST['email'];
// -----
if (!get_magic_quotes_gpc())
{ $user = stripslashes($user); $pass = stripslashes($pass); $dir = stripslashes($dir); $address = stripslashes($address); $phone = stripslashes($phone); $email = stripslashes($email); }
The first portion is unnecessary; reassigning values is a waste of time and resources. The difference is likely unnoticeable but in the long run good practices should be observed. What if you have 100 separate variables to sort out? You don't want 100 lines of code simply reassigning values to new vars. Anything you need to do with that data can be done by accessing the $_POST index, which makes it extremely handy because any array function can also be applied to $_POST, giving you the ability to create shortcuts.
The second portion of code where you're checking for magic_quotes is still incorrect. You're checking to see if magic_quotes doesn't exist, and then you use stripslashes on the data. If magic_quotes is 'off', stripslashes isn't necessary. In other words, it's the other way around.
|
|
|
|