Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Function Explode - MySql

Posted on 2007-10-10
10
Medium Priority
?
8,483 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!
0
Comment
Question by:geist62
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 24

Expert Comment

by:mankowitz
ID: 20053780
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" ); ?>
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20054412
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" ); ?>

0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 20054890
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;
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:geist62
ID: 20062490
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!
0
 
LVL 24

Expert Comment

by:mankowitz
ID: 20064532
geist-

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

0
 

Author Comment

by:geist62
ID: 20064837
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).
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 20066542
What versions are the "old" and "new" servers? What does

<?php
phpinfo();
?>

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

Author Comment

by:geist62
ID: 20069166
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!
0
 

Author Comment

by:geist62
ID: 20069798
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.
0
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 2000 total points
ID: 20072099
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.



See http://www.php.net/ini_set

and read up on how to convert from register_globals to the MUCH SAFER coding style that is preferred

http://uk.php.net/variables.external
http://www.modsecurity.org/documentation/php-register-globals.html
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question