i`m having this problem after whenever include or require is Used.
help please i dont know how to solve this.
Fatal error: Cannot redeclare validateemail() (previously declared in C:\wamp\www\kislat\functions\functions.php:3) in C:\wamp\www\kislat\functions\functions.php on line 26
<?php session_start();
require "config.php";
$user=$_SESSION['user'];
$id=$_SESSION['id'];
if(!session_is_registered('user')){
header("Location: checklogin.php");
exit;
}
define('INCLUDE_CHECK',1);
require"functions/functions.php";
require"includes/functions.php";
//$user=$_POST['user'];
//$password=($_POST['password']);
$user=$_SESSION['user'];
//$user=peacemaker;
$id=$_SESSION['id'];
//retrieve the users informations
if(isset($_GET['wewe'])){
//$userid=$_GET['wewe'];
require_once("filter/class.inputfilter_clean.php");
$_POST["tags"] = '&, ||,or,and,<br>';
$_POST["attr"] = 'good, style';
$_POST["tagmethod"]=0;
$_POST["attrmethod"]=0;
$_POST["xssauto"] ='y';
//strip the input text
$_GET['wewe']=stripslashes($_GET['wewe']);
//tags array
$tags = explode(',', $_POST["tags"]);
for ($i = 0; $i < count($tags); $i++) $tags[$i] =trim($tags[$i]);
// attr array
$attr = explode(',', $_POST["attr"]);
for ($i = 0; $i < count($attr); $i++) $attr[$i] =trim($attr[$i]);
// select fields
$tag_method = $_POST["tagmethod"];
$attr_method = $_POST["attrmethod"];
if ($_POST["xssauto"] == 'n') $xss_auto = 0;
else $xss_auto = 1;
// more info on parameters in documentation.
$myFilter = new InputFilter($tags, $attr, $tag_method, $attr_method, $xss_auto);
// process input
$userid1= $myFilter->process($_GET['wewe']);
$userid=mysql_real_escape_string($userid1);
if($userid==$id){
header("Location: myprofile.php");//direct to the home page if the user is the one who cliked his own profile
exit;
}
$query = "SELECT *FROM profile where id=$userid";
$result=mysql_query($query);
if(!$result)
{
include"index.php";//return to the home page
exit();
}else{
$row=mysql_fetch_array($result);
$profid=$row['id'];
$name=$row['names'];
$username=$row['users'];
$email=$row['emails'];
$country=$row['countrys'];
$location=$row['locations'];
$langu1=$row['langu1s'];
}
}
here is where the error appears
if(!$result)
{
include"index.php";//return to the home page
exit();
}
And the file C:\wamp\www\kislat\functions\functions.php
<?php
function ValidateEmail($email)
{
/*
Name: Letters, Numbers, Dots, Hyphens and Underscores
@ sign
Domain (with possible subdomain(s) ). Contains only letters, numbers, dots and hyphens (up to 255 characters)
. sign
Extension: Letters only (up to 10 (can be increased in the future) characters)
*/
$regex = "([a-z0-9_\.\-]+)". # name
"@". # at
"([a-z0-9\.\-]+){2,255}". # domain & possibly subdomains
"\.". # period
"([a-z]+){2,10}"; # domain extension
$eregi = eregi_replace($regex, '', $email);
return empty($eregi) ? true : false;
}
?>
I HOPE ONE CAN HELP WITH THIS PROBLEM