Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    substr_count() [function.substr-count]: Empty substring.

    Hello;

    I am recieving the following errors ....

    Warning: substr_count() [function.substr-count]: Empty substring. in /home/ventajas/public_html/contacto/send.php on line 3

    Warning: main(error.) [function.main]: failed to open stream: No such file or directory in /home/ventajas/public_html/contacto/send.php on line 27

    Warning: main() [function.include]: Failed opening 'error.' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ventajas/public_html/contacto/send.php on line 27


    can you please help.

    Its a php mail script.


    When I visit the URL http://<domainname>/contacto.php and fill the email form, it is redirected to send.php with the avobe errors.

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    Please post the code, it looks like the string is empty and the is no such file... Read the errors.

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much ..... here is the code.----------->


    <?php

    if ( !substr_count($HTTP_REFERER, $HTTP_HOST) > 0 ) $error.="El formulario no puede ser enviado. Ud. esta tratando de enviar un formulario fuera del dominio donde esta instalado el sistema y esto no está permitodo.<BR>";
    $campo=explode(",",$requiere);
    while(list($check)=each($campo)) {
    if(!$$campo[$check]) $error.="Problemas en el Campo: <b>$campo[$check]</b><BR>";
    }

    $check_mail = 0;
    if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@")){
    if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," "))) {
    if (substr_count($email,".")>= 1){
    $term_dom = substr(strrchr ($email, '.'),1);
    if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) ){
    $antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);
    $caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);
    if ($caracter_ult != "@" && $caracter_ult != "."){
    $check_mail = 1;
    }
    }
    }
    }
    }
    if ($check_mail == "0") $error.="Formato de email incorrecto. Debe ingresarlo nuevamente<BR>";

    if ($error) {
    include("error.$extension");
    exit();
    }

    $ip_client=$REMOTE_ADDR;
    $agent_client=$HTTP_USER_AGENT;
    $fecha=date("d-m-Y H:i:s");

    mail("$destino", "$asunto", "
    Nombre: $nombre
    Email: $email
    IP: $ip_client
    Browser: $agent_client
    Fecha y Hora: $fecha

    Mensaje:

    $mensaje

    --------------------------------------------------
    Mensaje enviado por VentajasWeb Networks
    --------------------------------------------------", "From: $nombre <$email>");

    include("gracias.$extension");
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •