Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
a7269587 is on a distinguished road
 
Posts: 2
Join Date: Mar 2009
Unhappy Help - Contact Form - 03-25-2009, 11:38 PM

I did a contact form but when i submit, the content of the form is not sent to my email address. I do not know where my errors are.
1- How <form ....> should look like?
2- Is the document who conain the form supposed to be .html or .php ?
3- Have you some exemples of scripts that work?
Thanks for any help!
Reply With Quote
(#2 (permalink))
Old
Junior Member
vin1985 is on a distinguished road
 
Posts: 8
Join Date: Mar 2009
Default 03-26-2009, 09:14 AM

show the code you've tried to use if possible...also are you trying to send to a hotmail account?

the document which contains the form can be .php or .html but the "action" of the form needs to refer to the .php file which contains the script that allows the email to be sent...if the script and form are both in the same document then it needs to be .php

this is a simple php mail script with simple validation, which i've used in a few websites, it's been a while since i last used it so might need a few tweaks depending on php version but give it a try anyway

Code:
 <?
error_reporting(0);

$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$to = 'yourname@yourdomain.com';
$subject = "$subject";
$message = 

"Name: $name, 
Email: $email, 
Message: $message";

$headers = "From: $email";


mail($to, $subject, $message, $headers);
function VerifyForm(&$values, &$errors)

{


if (strlen($values['name']) < 1)

$errors['name'] = 'Please enter your name';

if (!ereg('.*@.*\..{2,4}', $values['email']))

$errors['email'] = 'Please enter a valid email';

if (strlen($values['message']) < 1)

$errors['message'] = 'Please enter a message';

return (count($errors) == 0);

}

function DisplayForm($values, $errors)

{

?>
  



<form method="post" action="contact.php">

Name:
<input name="name" type="text" />  <?= $errors['name'] ?>  </div>

Email:
 <?= $errors['email'] ?>

Subject:
<input name="subject" type="text" /></div>
>Message:
<textarea name="message" rows="6" cols="40"><?= $errors['message'] ?>
</textarea>

<input name="submit" type="submit" value="Submit" /><input type="reset" 


</form>


this bit is to be entered after the closing html tag </html>

Code:
<?php

}

function ProcessForm($values)

{

echo ( "Thank you, your email has been sent!" );

echo "<a href=\"javascript:history.back()\">Click here to go back</a>";


#
}
#
 
#
if ($_SERVER['REQUEST_METHOD'] == 'POST')
#
{
#
$formValues = $_POST;
#
$formErrors = array();
#
 
#
if (!VerifyForm($formValues, $formErrors))
#
DisplayForm($formValues, $formErrors);
#
else
#
ProcessForm($formValues);
#
}
#
else
#
DisplayForm(null, null);
#
?>
Reply With Quote
(#3 (permalink))
Old
Junior Member
siarah2k@yahoo.com is on a distinguished road
 
Posts: 10
Join Date: Nov 2008
Default Same problem - 04-10-2009, 02:12 PM

I also have this problem, but I don't know much of HTML, so I haven't got a clue what you said to do.... Anything simpler?
Reply With Quote
(#4 (permalink))
Old
Junior Member
a1082612 is on a distinguished road
 
Posts: 15
Join Date: Apr 2009
Default 04-19-2009, 08:40 PM

Quote:
Originally Posted by siarah2k@yahoo.com View Post
I also have this problem, but I don't know much of HTML, so I haven't got a clue what you said to do.... Anything simpler?
I'm in the same boat. I'm not anxious to learn PHP just for a "contact us" form. I found this site (www [dot] emailmeform [dot] com) who does "contact us" forms as a free service. You use a wizard to create the form. You store the form on your web host, style it anyway you desire. It invokes their processing on their host. It even has "captha" images (and something else) to reduce spam.

I don't know anything about them. If anyone's heard anything bad, please reply. I'm just starting to try their service.

(I'm not affiliated with them. I hope this isn't viewed as spam.).

Mark
Reply With Quote
(#5 (permalink))
Old
Junior Member
siarah2k@yahoo.com is on a distinguished road
 
Posts: 10
Join Date: Nov 2008
Default I got it! :) - 04-19-2009, 08:52 PM

I figured out how to do it.

I just entered my site using the admin login, then I clicked on config. which is located on the top of the page. From there I changed the admin email address to my email address. After that the emails were forwarded to my email address.
Reply With Quote
(#6 (permalink))
Old
Banned
probannerdesigns is on a distinguished road
 
Posts: 44
Join Date: May 2009
Default 05-27-2009, 02:02 AM

i have a very easy contact form builder let me know if i can asist u


~ Brian
Reply With Quote
(#7 (permalink))
Old
Junior Member
a1082612 is on a distinguished road
 
Posts: 15
Join Date: Apr 2009
Default 05-27-2009, 10:29 PM

Quote:
Originally Posted by probannerdesigns View Post
i have a very easy contact form builder let me know if i can asist u
In the same spirit: Regarding my earlier comment that I was looking at an external service (emailmeform.com), I ended up developing my own contact form: http://www.sbcleaning.netne.net/contactenos/

It's not as easy as using a "form builder." But, it employs what I consider to be best practices that probably aren't available with one-size-fits-all solutions.

For example:

1. Uses "secureimage" (free from phpcaptcha.org, and relatively easy to install on a 000webhost ftp-only account) to eliminate spam.
2. Sends emails with a unique sequence number in the subject. Makes it easy to detect if an email is lost (when you see gaps in the sequence).
3. Logs all email contacts. (If you detect a lost email, you can view it in the log.).
4. Serializes the creation of the sequence number, log write and email. This is probably excessive, but if two people used the contact form at *exactly* the same time, this serialization keeps things from being screwed up.

If there is interest I can put together the details (in English) and post the php script for a working example.

People can play with the URL above. It's not really live yet.

Mark
Reply With Quote
(#8 (permalink))
Old
Junior Member
wren99 is on a distinguished road
 
Posts: 3
Join Date: Jul 2009
Default 07-10-2009, 06:21 PM

I have a similar problem. I built an HTML contact form using Dreamweaver with Spry validation, but I don't know anything about php. Is there a way to use a simple javascript to email the form info? Can someone help me write something quick and simple to do the job? Also, is there a way to "hide" the email from bots, etc? Please help! Thank you!!!

Here is the code for my form:


<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />

<form id="Request_Quote_Form" name="Request_Quote_Form" method="post" action="">
<p class="style4"><span id="sprytextfield4">
<label>Contact name:
<input type="text" name="Name" id="Name" />
</label>
<span class="textfieldRequiredMsg">A contact name is required.</span></span><span class="textfieldRequiredMsg">A contact name is required.</span></p>
<p class="style4">
<label>Organization:
<input type="text" name="organization" id="organization" />
<br />
<br />
</label>
<span id="spry-text"><span id="sprytextfield3">
<label>E-mail address:
<input name="email" type="text" id="email" />
</label>
<span class="textfieldRequiredMsg">A contact e-mail is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></span></p>
<p class="style4">
<label>Phone:
<input type="text" name="phone" id="phone" />
</label>
</p>
<p class="style4">
<label>Name of project:
<input type="text" name="project_name" id="project_name" />
</label>
</p>
<p class="style4">
<label><span id="spryselect1">Type of project:
<select name="project_type" id="project_type">
<option value="-1" selected="selected">--Select a Project Type--</option>
<option>Book</option>
<option>Identity (logo, business cards, stationery)</option>
<option>Newsletter</option>
<option>Magazine or Journal</option>
<option>Promotional Material (brochure, poster, etc.)</option>
<option>Website (editorial only)</option>
<option>Invitation, Placecard, or Announcement</option>
<option>Menu</option>
<option>Other</option>
</select>
<span class="selectInvalidMsg">Please select a project type.</span>
</span></label>

</p><div id="table" style="margin-bottom:30px;">
<table width="95%" border="0" align="left" cellpadding="0" cellspacing="0" id="table1" ">
<tr>
<td colspan="3" class="style4"><p>Services desired:
</p> </td>
</tr>
<tr>
<td width="27%" class="style4"><u>Editorial</u></td>
<td width="39%" class="style4"><u>Design</u></td>
<td width="34%" class="style4"><u>Production</u></td>
</tr>
<tr>
<td class="style4">
<label>
<input type="checkbox" name="Copywriting" id="Copywriting" />
Copywriting</label>
</td>
<td class="style4"><label>
<input type="checkbox" name="gen_design" id="gen_design" />
General Design</label></td>
<td class="style4"><label>
<input type="checkbox" name="typesetting" id="typesetting" />
Typesetting</label></td>
</tr>
<tr>
<td class="style4">
<label>
<input type="checkbox" name="copyediting" id="copyediting" />
Copyediting</label>
</td>
<td class="style4"><label>
<input type="checkbox" name="cover_design" id="cover_design" />
Cover Design (books)</label></td>
<td class="style4"><label>
<input type="checkbox" name="image_editing" id="image_editing" />
Image Editing/Retouching</label></td>
</tr>
<tr>
<td><label class="style4">
<input type="checkbox" name="proofreading" id="proofreading" />
Proofreading</label></td>
<td class="style4"><label>
<input type="checkbox" name="interior_design" id="interior_design" />
Interior Design (books)</label></td>
<td class="style4"><label>
<input type="checkbox" name="prepress" id="prepress" />
Prepress/Preflight</label></td>
</tr>
</table>
</div>

<p class="style4">&nbsp;</p>
<p class="style4">&nbsp;</p>
<p class="style4">&nbsp;</p>

<div id="project_descript" style="margin: 30 px">
<p class="style4">&nbsp;</p>

<p class="style4"><span id="sprytextarea2">
<label>Project Description<br />
<textarea name="project_descrip" id="project_descrip" cols="45" rows="20">Please describe your project in detail. Include (where applicable): trim size, word count, page count, number of inks (1-color, 2-color, 4-color)</textarea>
</label>
<span class="textareaRequiredMsg">Please enter a project description.</span></span></p>
</div><!--end #project_descript -->

<label><span class="style4">Additional Information</span> <br />
<textarea name="additional_info" id="additional_info" cols="45" rows="10"></textarea>
</label>
<p></p>
<p></p>
<table width="549" cols="2" class="style4" id="contact_table" rows="1">
<tr>
<td width="210">
Preferred Contact Method: </td>
<td width="155">
<label>
<input type="radio" name="radio" id="contact_by_email" value="contact_by_email" />
Please e-mail.</label>
</td>
<td width="168">
<label>
<input type="radio" name="radio" id="contact_by_phone" value="contact_by_phone" />
Please phone.</label>
</td>
</tr>
</table>


<p>&nbsp;</p>
<div id="buttons" align="left">
<input type="reset" name="reset_form" id="reset_form" value="Reset" />
<input type="submit" name="submit" id="submit" value="Submit" />


<p class="style4">&nbsp;</p>
<p class="style4">&nbsp;</p>
</div><!-- end #buttons -->
</form>


<script type="text/javascript">
<!--
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue:"-1", isRequired:false, validateOn:["change"]});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
var sprytextarea2 = new Spry.Widget.ValidationTextarea("sprytextarea2");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
//-->
Reply With Quote
(#9 (permalink))
Old
Junior Member
ntgonzalez is on a distinguished road
 
Posts: 1
Join Date: Sep 2009
Unhappy Hi, can anyone help me on this? - 09-17-2009, 05:30 PM

Hi, I´ve recently designed my first web site, using Incomedia Website X5, so you may guess I stiil have lots of things to learn.
I have this problem, with a contact form I´ve included in my site www.jygenvasado.com.ar

When I fill in all intended fields and hit the "send" button ("enviar" in spanish as you should see in the site), I get no message of any kind (neither an email with data nor an error message).

Here is the php code of the form that I´ve copied from the file manager tools included in 000webhost.com:

I would really appreciate if anyone can help me on this, I still haven´t figured out how to solve this problem and I think it probably takes a long time to learn php to get it done !

Thanks in advance, bye!

Néstor.


<?php
include "../res/imemail.inc.php";

//Form Data
$txtData = "";
$htmData = "";
$txtData .= "Ingrese su nombre y apellido: " . $_POST["Itm_8_00_1"] . "\r\n";
$htmData .= "<tr><td width=\"25%\"><b>Ingrese su nombre y apellido:</b></td><td>" . $_POST["Itm_8_00_1"] . "</td></tr>";
$csvData .= $_POST["Itm_8_00_1"] . ";";
$txtData .= "Ingrese su email: " . $_POST["Itm_8_00_2"] . "\r\n";
$htmData .= "<tr><td width=\"25%\" bgcolor=\"#EEEEEE\"><b>Ingrese su email:</b></td><td bgcolor=\"#EEEEEE\">" . $_POST["Itm_8_00_2"] . "</td></tr>";
$csvData .= $_POST["Itm_8_00_2"] . ";";
$txtData .= "Asunto: " . $_POST["Itm_8_00_3"] . "\r\n";
$htmData .= "<tr><td width=\"25%\"><b>Asunto:</b></td><td>" . $_POST["Itm_8_00_3"] . "</td></tr>";
$csvData .= $_POST["Itm_8_00_3"] . ";";
$txtData .= "Ingrese su mensaje: " . $_POST["Itm_8_00_4"] . "\r\n";
$htmData .= "<tr><td width=\"25%\" bgcolor=\"#EEEEEE\"><b>Ingrese su mensaje:</b></td><td bgcolor=\"#EEEEEE\">" . $_POST["Itm_8_00_4"] . "</td></tr>";
$csvData .= $_POST["Itm_8_00_4"] . ";";
$txtData .= "Si desea, puede enviar un archivo adjunto: " . $_FILES["Itm_8_00_5"]["name"] . "\r\n";
$htmData .= "<tr><td width=\"25%\"><b>Si desea, puede enviar un archivo adjunto:</b></td><td>" . $_FILES["Itm_8_00_5"]["name"] . "</td></tr>";
$csvData .= $_FILES["Itm_8_00_5"]["name"] . ";";

// Template
$htmHead = "<table width=\"90%\" border=\"0\" bgcolor=\"#FFFFC0\" cellpadding=\"4\" style=\"font: bold 12px Tahoma; color: #004040; border: 1px solid #BBBBBB;\">";
$htmFoot = "</table>";

//Send email to owner
$txtMsg = "";
$htmMsg = $htmHead . "<tr><td></td></tr>" . $htmFoot;
$oEmail = new imEMail(($imForceSender ? $_POST["Itm_8_00_2"] : "gustavo.perotti@jygenvasado.com.ar"),"gustavo.per otti@jygenvasado.com.ar","Nuevo Contacto","iso-8859-1");
$oEmail->setText($txtMsg . "\r\n\r\n" . $txtData);
$oEmail->setHTML("<html><body bgcolor=\"#063A69\"><center>" . $htmMsg . "<br>" . $htmHead . $htmData . $htmFoot . "<br>" . $htmHead . "<tr><td style=\"font-size: 85%\">" . $csvData . "</td></tr>" . $htmFoot . "</center></body></html>");
if ($_FILES["Itm_8_00_5"]["name"] != "") $oEmail->attachFile($_FILES["Itm_8_00_5"]["name"],file_get_contents($_FILES["Itm_8_00_5"]["tmp_name"]),$_FILES["Itm_8_00_5"]["type"]);
$oEmail->send();

//Send email to user
$txtMsg = "Gracias por escribirnos.\r\n\r\nHemos recibido su mensaje, el mismo ser� le�do y respondido a la mayor brevedad posible.\r\n\r\nSus consultas y dudas ayudan a mejorar nuestro servicio y a brindarle una mayor satisfacci�n a nuestros clientes.\r\n\r\nCordialmente,\r\n\r\nJyG Envasado\r\n";
$htmMsg = $htmHead . "<tr><td>Gracias por escribirnos.<br><br>Hemos recibido su mensaje, el mismo ser� le�do y respondido a la mayor brevedad posible.<br><br>Sus consultas y dudas ayudan a mejorar nuestro servicio y a brindarle una mayor satisfacci�n a nuestros clientes.<br><br>Cordialmente,<br><br>JyG Envasado<br></td></tr>" . $htmFoot;
$oEmail = new imEMail("gustavo.perotti@jygenvasado.com.ar",$_POS T["Itm_8_00_2"],"Aviso de recepci�n de su email.","iso-8859-1");
$oEmail->setText($txtMsg . "\r\n\r\n" . $txtData);
$oEmail->setHTML("<html><body bgcolor=\"#063A69\"><center>" . $htmMsg . "<br>" . $htmHead . $htmData . $htmFoot . "</center></body></html>");
$oEmail->send();
@header("Location: ../respuesta_a_email.html");
?>
Reply With Quote
(#10 (permalink))
Old
Junior Member
paul_nicholls is on a distinguished road
 
Posts: 10
Join Date: Sep 2009
Default 09-30-2009, 03:02 AM

Quote:
Originally Posted by a1082612 View Post
In the same spirit: Regarding my earlier comment that I was looking at an external service (emailmeform.com), I ended up developing my own contact form: http://www.sbcleaning.netne.net/contactenos/

It's not as easy as using a "form builder." But, it employs what I consider to be best practices that probably aren't available with one-size-fits-all solutions.

For example:

1. Uses "secureimage" (free from phpcaptcha.org, and relatively easy to install on a 000webhost ftp-only account) to eliminate spam.
2. Sends emails with a unique sequence number in the subject. Makes it easy to detect if an email is lost (when you see gaps in the sequence).
3. Logs all email contacts. (If you detect a lost email, you can view it in the log.).
4. Serializes the creation of the sequence number, log write and email. This is probably excessive, but if two people used the contact form at *exactly* the same time, this serialization keeps things from being screwed up.

If there is interest I can put together the details (in English) and post the php script for a working example.

People can play with the URL above. It's not really live yet.

Mark
Neato! I would be interested in the details for this if you could Mark
cheers,
Paul
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com