i have a problem with the posting from the form.
I have recommendation form with captcha, wich i think there is no problem with. Once i press submit, php take action in another if else condition with out passing variable, i quite can figure it out why is like this. Take a look the code, please ....
Code: Select all
if(isset($_GET['cat'])) // when looking at selected category
{
} //problematic submit goes here ...
else if(isset($_POST['submit'])||isset($_POST['search'])||isset($_GET['search'])) // when search button is pressed
{
}
else //when looking at the root of the aplication
{
// some code
if($_POST['submitform']) // problematic submit expected to start here....
{
$yourcode=$_POST['yourcode'];
$thevalue1=$_POST['thevalue'];
if($yourcode=$thevalue1)
{
mail($myemail,$subject,$messagetoemail,$name);
mysql_query ("INSERT INTO moviesreco (id, name, email, message)
VALUES ('', '$name', '$email', '$messagehtml')");
echo "$thanks";
}
else
{
echo "You verification code is not right. Please go back and try again.";
}
}
else
{
//this is recomandation form
echo "
<form action='$PHP_SELF' method='post'>
<input name='name' size='30'>
<input name='email' size='30'>
<textarea name='message' rows='10' cols='30'></textarea>
";
$im = ImageCreate(60, 20); //create image
$white = ImageColorAllocate($im, 0,0, 0);
$black = ImageColorAllocate($im, 120, 200, 68);
$md5 = md5(microtime() * mktime());
$string = substr($md5,0,5);
$verification = $string;
$thevalue= $string;
ImageFill($im, 0, 0, $black);
ImageString($im, 4, 10, 3, $verification, $white);
Imagejpeg($im, "inc/verify.jpeg");
ImageDestroy($im);
echo "
<img src='inc/verify.jpeg' border='0'>
<input type='hidden' value='$thevalue' name='thevalue'>
<input type='text' name='yourcode' size='5' maxlength='5'>
<input class='button1' type='submit' value='Send' name='submitform'>
<input class='button1' type='reset' value='Reset' name='reset'>
</form>
";
}
// some more code
}thank you in advance.
Nita