...

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



madan.code
08-26-2006, 09:10 PM
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.

Mwnciau
08-26-2006, 09:13 PM
Please post the code, it looks like the string is empty and the is no such file... Read the errors.

madan.code
08-26-2006, 09:23 PM
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");
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum