We help IT Professionals succeed at work.

Function Explode - MySql

geist62
geist62 asked
on
8,535 Views
Last Modified: 2013-12-13
Hello:

I am working on a login script. (Was working before). User enters login information which then signs them in. However my page "Loged In" returns the following error message four times:

Warning: explode() [function.explode]: Empty delimiter. in

The following error message appears after the above-noted error message:

Fatal error: Call to undefined function: wa_authenticateuser()

My PHP code looks like this:

----------------------->

<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
      $WA_Auth_Parameter = array(
      "connection" => $Xdb,
      "database" => $database_Xdb,
      "tableName" => "Login",
      "columns" => explode($WA_Auth_Separator,"user_login".$WA_Auth_Separator."user_password"),
      "columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"")  ."".$WA_Auth_Separator."".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"")  .""),
      "columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
      "sessionColumns" => explode($WA_Auth_Separator,"ID"),
      "sessionNames" => explode($WA_Auth_Separator,"ID"),
      "successRedirect" => "Login_Profile.php",
      "failRedirect" => "Login_EmailPW.php",
      "gotoPreviousURL" => TRUE,
      "keepQueryString" => TRUE
      );
      
      WA_AuthenticateUser($WA_Auth_Parameter);
}
?>

Thanks for your help!
Comment
Watch Question

CERTIFIED EXPERT

Commented:
This seems more like a PHP error than MySQL. What did you change to make it stop working? Do you have the webassist libraries that it needs?

Try putting these at the top of your script:
<?php require_once( 'Connections/connBoostem.php' ); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
first warning can come from here:
explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"")
because, if username is not in the post data, you put "". you might want to change to something else:
explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"xxxxx")


in regards to the second error, you are missing an include like this:
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>

CERTIFIED EXPERT

Commented:
The message means that $WA_Auth_Separator is blank. Ensure it has a non-blank value before doing your explodes.

For example if a default value for the separator was '-' then you could do

$WA_Auth_Separator = ( $WA_Auth_Separator == "" ) ? "-" : $WA_Auth_Separator;

Author

Commented:
Nothing seems to work. However, when I move my files to my old server everything works fine. On my new server I receive all of these explode error messages. Is it possible that this has something to do with the way php/apache is configured?

Regards!
CERTIFIED EXPERT

Commented:
geist-

where is auth_separator defined? Check to see if your include files are all present as they are supposed to be.

Author

Commented:
The odd thing is that my include files are all where they should be.  Wondering if it is a directory issue? I don't understand how I can move the exact files to my old server and they work as they should. I haven't changed anything in the files.  "auth_separator" is defined in my main file "Login.php". After completing the form and hitting submitt, it presents me with all of those "explode" errors. I appreciate everyone's help!

1) The working version (old server):

All the files and folders are in directory -   /genealogy

2) The non-working version (new sever):

All the files are in directory - /www (and for some reason there is also a directory with duplicates /public_html).
CERTIFIED EXPERT

Commented:
What versions are the "old" and "new" servers? What does

<?php
phpinfo();
?>

produce? In particular, how is register_globals set on both systems?

Author

Commented:
register_globals is switched to "on" on the server where the script works.

It was switched to "off" on the server where the script didn't work. I switched it "on". Still displays "explode" errors. Do I need to re-boot Apache for the new PHP settings to take effect?

Should I provide the info from "phpinfo" in this forumn. The info is quite lengthy.

Regards!

Author

Commented:
Php version on both servers is PHP Version 4.4.7. However on the new server (where I am having error messages) PHP is the most current version - build date Oct 6, 2007.

I tried turning "safe mode" off. That did nothing.
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.