Function Explode - MySql


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:


      $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

Thanks for your help!
Who is Participating?
Beverley PortlockCommented:
The register_globals is the issue. You either need to

1) Alter the code that depends on register_globals, or

2) Alter PHP to turn register_globals back on.

Of the two, number (1) is the best fix, but number (2) will be the quickest so at the start of your script add

ini_set('register_globals', 'on');

Putting this at the start of a script should not require a restart of Apache, altering php.ini will require an apache restart.


and read up on how to convert from register_globals to the MUCH SAFER coding style that is preferred
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 EngineerCommented:
first warning can come from here:
because, if username is not in the post data, you put "". you might want to change to something else:

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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Beverley PortlockCommented:
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;
geist62Author 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?


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

geist62Author 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).
Beverley PortlockCommented:
What versions are the "old" and "new" servers? What does


produce? In particular, how is register_globals set on both systems?
geist62Author 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.

geist62Author 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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.