8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

i want, form contact inlightbox and if u have send form email, page of thanks for email load on lightbox. how?!

8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

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

244 posts
  • Has sold $10,000+ on Envato Market
  • Has referred 10+ members
  • Had an item featured on Envato Market
  • Located in Canada
+3 more
KBRmedia says

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).

8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

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");
5492 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says

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

8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

What? path?!

8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

ok, i patch this error, but not not load page checks.html in lightbox

8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

Please Help me :(

8 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
mehrany says

ajax loading?!

244 posts
  • Has sold $10,000+ on Envato Market
  • Has referred 10+ members
  • Had an item featured on Envato Market
  • Located in Canada
+3 more
KBRmedia says

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
You 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 file_get_contents("PATH/TO/checks.html")

If you want to use jQuery, simply use $(“HOLDER”).load(“http://YOURSITE/checks.html”)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by