A
Anonymous
Guest
--------------------------------------------------------------------------------
i need help with the ereg function. i am getting this error message:
Fatal error: Cannot redeclare phonecheck() (previously declared in
/home/username/public_html/folder/thanks2.php:257) in /home/username/public_html/folder/thanks2.php
on line 257
i have tried a few different functions to get this to work, but still having the same error message, can someone please help me to get this to work without having this error message?
here is what i am trying to use but coming up with errors. i am not redeclaring this function anywhere else in my code. i also try changing the name of the function, for example i try to change datecheck() to dateck() and still i keep getting the same error message. what else can i try for this to work and the error message to go away?
thanks
i also have these functions inside of a while loop and when i take these functions outside of a while loop, the form keeps looping and makes at least 45 copies of itself on the page. can someone help me in trying to get the page to stop copying itself and get this page to work without any errors and without anything copying itself?
thanks
let me know if you want me to post the whole page that i am working on.
here are the functions i have used:
i need help with the ereg function. i am getting this error message:
Fatal error: Cannot redeclare phonecheck() (previously declared in
/home/username/public_html/folder/thanks2.php:257) in /home/username/public_html/folder/thanks2.php
on line 257
i have tried a few different functions to get this to work, but still having the same error message, can someone please help me to get this to work without having this error message?
here is what i am trying to use but coming up with errors. i am not redeclaring this function anywhere else in my code. i also try changing the name of the function, for example i try to change datecheck() to dateck() and still i keep getting the same error message. what else can i try for this to work and the error message to go away?
thanks
i also have these functions inside of a while loop and when i take these functions outside of a while loop, the form keeps looping and makes at least 45 copies of itself on the page. can someone help me in trying to get the page to stop copying itself and get this page to work without any errors and without anything copying itself?
thanks
let me know if you want me to post the whole page that i am working on.
here are the functions i have used:
Code:
function datecheck($intext) {
$theresults = ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $intext, $trashed);
if ($theresults) { $isamatch = ""; } else { $isamatch = "No - NOT A MATCH"; }
echo("\"$intext\" $isamatch<br>\n");
}
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $expire, $regs)) {
echo "$regs[3].$regs[2].$regs[1]";
} else {
echo "Invalid date format: $expire";
}
function dateck($expire)
{
// check an email address is possibly valid
if (ereg("([0-9]{1,2})-([0-9]{1,2})-([0-9]{4})", $expire))
return true;
else
return false;
}