i want, form contact inlightbox and if u have send form email, page of thanks for email load on lightbox. how?!
form contact: php ::
<?php
$EmailFrom = "no-reply@______";
$EmailTo = "__________";
$Subject = "Contact";
$name = Trim(stripslashes($_POST['name']));
$mail = Trim(stripslashes($_POST['mail']));
$comment = Trim(stripslashes($_POST['comment']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "mail: ";
$Body .= $mail;
$Body .= "\n";
$Body .= "comment: ";
$Body .= $comment;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=checks.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contact.html\">";
}
?>
i want if u have click send, show checks.html in to the lightbox
If you want to show just the content of checks.html, you can use the file_get_contents() function.
Example You can replace this:
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=checks.html\">";
}
By this:
// redirect to success page
if ($success){
echo file_get_contents("checks.html");
}
This is one of many ways to show an external file if you are not redirecting user to another page, using PHP. You can also use jQuery to do the exact same thing (Hint: Search $.load() on google).
not work it error is : Warning: file_get_contents(checks.html) [function.file-get-contents]: failed to open stream: No such file or directory in wwwroot\emails.php on line 35
lin 35 is :
echo file_get_contents("checks.html");
mehrany said
not work it error is : Warning: file_get_contents(checks.html) [function.file-get-contents]: failed to open stream: No such file or directory in wwwroot\emails.php on line 35 lin 35 is :echo file_get_contents("checks.html");
..path
What? path?!
ok, i patch this error, but not not load page checks.html in lightbox
Please Help me 
ajax loading?!
mehrany saidYou are getting that error because you need the path to checks.html. So if your contact.php and checks.html are not in the same directory you need to add the directory to
not work it error is : Warning: file_get_contents(checks.html) [function.file-get-contents]: failed to open stream: No such file or directory in wwwroot\emails.php on line 35
file_get_contents("PATH/TO/checks.html")
If you want to use jQuery, simply use $(“HOLDER”).load(“http://YOURSITE/checks.html”)
