View Full Version : php script for Thank you page?

04-26-2007, 08:57 PM
I watched form tutorial part 1 and have a question. The tutorial shows we should add following script between head tag:

$email = $HTTP_POST_VARS[email];
$mailto = "you@yourtsite.com"; modifiy this to my address
$mailsubj = "Contact Form Submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))

This seems incomplete php code. But that is all shown on tutorial window. Where we can copy complete php script for inserting between head tag?



04-27-2007, 06:46 AM
No, you have Copied (by hand ?) the code form the example image, not from the code window. The code in the window is:

$mailto ="exampleemail@example.com";
$email = $HTTP_POST_VARS[email];
if ($email == "") {
$email = $mailto;
$mailsubj = "Type your mail subject here";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
if ($key!="submit")
$mailbody .= "$key : $val\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);

04-27-2007, 03:26 PM
Thank you Navaldesign. Yes, I copied the code from tutorial window image. What do you mean by "code window"? If you mean the bottom window after I click page HTML and then select between head tag, it is completely blank. If you mean somewhere else, that is exactly what I am looking for. Where is that?


04-27-2007, 03:57 PM
If you look at the Forms Tutorial pART 1, just ABOVE the image from where you have copied the code from, you will see that there is a code "window" . (Its not a real window, its the code "quoted"). That's the same code i gave you here. Copy it, and paste it in the Between Head (but you can also paste it in the Start of Page, or Inside Body, or wherever else you like, it is not important)

Tom vR
04-28-2007, 10:11 PM
Hi Nave,design,

I have exactly the same problem as Jay. I understand fully where to copy the PHP code from, but when I open my Page HTML, that code is nowhere to be found. Here is my code and the PHP is not there:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Thank You</title>
<meta name="AUTHOR" content="Tom">
<meta name="KEYWORDS" content="frequent,properties,houses,forsale,centurion,south africa,south,africa,zwartkop,pretoria">
<meta name="DESCRIPTION" content="We are real estate agents in Centurion (nearby Pretoria), South Africa. We manage buying and selling of properties.">
<meta name="GENERATOR" content="Created by BlueVoda">
<style type="text/css">
width: 800px;
position: relative;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
text-align: left;
text-align: center;
margin: 0;
<body bgcolor="#E6E6FA" text="#000000" link="#800080" style="scrollbar-face-color:#E2261D;scrollbar-arrow-color:#0000FF;scrollbar-3dlight-color:#ECE9D8;scrollbar-darkshadow-color:#716F64;scrollbar-highlight-color:#FFFFFF;scrollbar-shadow-color:#ACA899;scrollbar-track-color:#D4D0C8;">
<div id="container">
<div id="bv_" style="position:absolute;left:0px;top:192px;width:800px;h eight:608px;z-index:0" align="left">
<img src="bv01070.gif" id="Shape2" align="top" alt="" border="0" width="800" height="608"></div>
<div id="bv_" style="position:absolute;left:304px;top:760px;width:360px ;height:29px;z-index:1" align="left">
<font style="font-size:12px" color="#000000" face="verdana">Copyright &#169; Frequent Properties - All Rights Reserved</font><font style="font-size:16px" color="#000000" face="Times New Roman"> <br>
<img src="FP_Header_Colour_Web.jpg" id="Image2" alt="" align="top" border="0" width="800" height="197" style="position:absolute;left:0px;top:0px;width:800px;hei ght:197px;z-index:2">
<div id="bv_" style="position:absolute;left:8px;top:204px;width:160px;h eight:588px;z-index:3" align="left">
<img src="bv01071.gif" id="Shape1" align="top" alt="" border="0" width="160" height="588"></div>
<div id="bv_" style="position:absolute;left:268px;top:284px;width:268px ;height:90px;z-index:4" align="left">
<font style="font-size:16px" color="#000000" face="Arial">Thank you for your enquiry.<br>
We will contact you ASAP.<br>
Frequent Properties at your service.</font></div>

Maybe Jay had the same problem. I will rather try to use the code you've given, but what could be wrong on my page that the code is missing?

04-28-2007, 10:37 PM
I'm not sure what you mean. The code is NOT in your thank you page, it is you who is supposed to put it in the page.

Copy the code from the tutorial. (highlight it, then rig***lick, Copy)

Then, go in your page, in BV, click on View, Page Html, click on the Start of Page (or Inside body, or between Head, it is NOT important) and paste the code you had copied earlier, in the lower window. The image in the tutorial is pretty clear.

That's all.

Tom vR
04-28-2007, 11:06 PM
Got it. I've not read further down in the example page. Dull moment here...

Danny Canada
04-29-2007, 04:23 AM
Hi Guys

I have created my "Contacts" page and followed the tutorial (#1). Good to this point!

Here is what I did next;

Upon finishing my contacts page with the form details, I then saved the page as "thankyou" and proceeded to finish the details in the "page properties" and the "page HTML". Inserted the script "between head tag" and saved and published.

However, I cannot get it to work and only get an "web page cannot be found" error message.

Does it matter if I didn't create a "new" page and simply used the "save page as" instead.

For some reason I cannot get the submit form to work



Danny Canada
04-29-2007, 05:09 AM
No need to respond guys as I have figured it out and it works like a charm. However, I did have one request and that is how to edit the default "submit" and "reset" buttons that are part of the forms section. Is there no way to edit the text or the size of the button?

Shame to build a nice site and then only have an option to use them.

Am I missing something?



Tom vR
04-29-2007, 10:05 AM
I have the same request. I even tried to use an image button, but then you do not have the default built-in options required, i.e. no submit, reset, etc options.

04-29-2007, 10:34 AM
Use the Advanced Button. If you want you can make it submit, as well as reset. You can edit the text as you would normally for any text. You can also rig***lick it, properties, and change the style: background color, border color etc. You can also place an image as button, using the image as background.

05-04-2007, 10:14 PM
Hi there. I'm new to the website building thing and just had a quick question on forms. If the php code where it says $mailbody = "Values submitted from web site form :\n"; what exactly am I supposed to fill in there?

05-05-2007, 05:54 AM
Yo can replace "Values submitted from web site form :" in whatever you wish your mail to start with, i.e. "A visitor has sent the following info:" . Don't touch the "\n" part