Skip to main content
paulc89302236
Participating Frequently
February 8, 2022
Question

Warning: strpos(): Empty needle in ...

  • February 8, 2022
  • 2 replies
  • 1055 views

DW created PhP (v7.4) page is throwing this warning linked to my DB connection file.

Seen a few suggestions recommending adding the following to the php.ini file

Under dynamic extenstions; 

 

extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll

 

But it hasnt resolved the warning issue.

Any other suggestions ?

    This topic has been closed for replies.

    2 replies

    B i r n o u
    Legend
    February 9, 2022

    what is your connexion piece of code ?

    paulc89302236
    Participating Frequently
    February 9, 2022

    I use WebAssists extention to create my local and remote connection:

    The warning cites line 15 - ive highlighted it below.

     

    <?php
    # FileName="WADYN_MYSQLI_CONN.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_MyDevDB = "localhost";
    $database_MyDevDB = "mydevices";
    $username_MyDevDB = "devuser";
    $password_MyDevDB = "pE8/AOzpL(";
    @15938396_start();
    $foundConnection = false;
    if ($foundConnection == false) {
    $domains = explode(",","192.168.0.143");
    for ($domindex = 0; $domindex<sizeof($domains) && !$foundConnection; $domindex++) {
    $domainCheck = trim($domains[$domindex]);
    if (strpos(strtolower($_SERVER["SERVER_NAME"]),strtolower($domainCheck)) !== false && ($domainCheck == "" || strpos(strtolower($_SERVER["SERVER_NAME"]),strtolower($domainCheck)) == strlen($_SERVER["SERVER_NAME"])-strlen($domainCheck))) {
    $hostname_MyDevDB = "192.168.0.143";
    $database_MyDevDB = "mydevices";
    $username_MyDevDB = "devuser";
    $password_MyDevDB = "pE8/AOzpL(";
    $foundConnection = true;
    }
    }
    }

    $MyDevDB = mysqli_init();
    if (defined("MYSQLI_OPT_INT_AND_FLOAT_NATIVE")) $MyDevDB->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
    $MyDevDB->real_connect($hostname_MyDevDB, $username_MyDevDB, $password_MyDevDB, $database_MyDevDB) or die("Connect Error: " . mysqli_connect_error());

    ?>

    BenPleysier
    Community Expert
    Community Expert
    February 9, 2022

    $domains = explode(",","192.168.0.143");

    I think should read

    $domains = explode(",","[URL of your site]"); 

     

    If that does not work, ask Ray at WebAssist.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Nancy OShea
    Community Expert
    Community Expert
    February 9, 2022
    Nancy O'Shea— Product User & Community Expert