Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Form coding troubles

Featured Replies

Hi there,

 

I have not been able to update my website with a form as the coding seems to be wrong.

 

The code 123reg.co.uk sent me to use was:

 

<form action="/formmail/formmail.cgi" method="post">

//Make sure this is the correct path to your FormMail script.

 

<input type='hidden' name="recipient" value="services@123-reg.co.uk"/>

//Make sure this is the e-mail address you are sending the details to.

 

<input type='hidden' name="subject" value="Form Results"/>

//Replace the value with the one you want the subject of the email results to be.

 

<input type='hidden' name="required" value=""/>

//Add any field names the visitor has to fill in for the form to work.

 

<input type='hidden' name="redirect" value="done.html">

//Enter the location of the "thank you" HTML page here.

 

 

Here are the changes that I made then uploaded on my contact page:

 

<form id="form1" name="form1" method="post" action="/formmail/formmail.cgi">

<form action="/formmail/formmail.cgi" method="post">

<input type='hidden' name="recipient" value="jamie@signs-grafix.co.uk"/>

<input type='hidden' name="subject" value="contactresults"/>

<input type='hidden' name="required" value=""/>

<input type='hidden' name="redirect" value="done.html">

</form> </td>

</tr>

</table>

</body>

</html>

 

You may notice I have added this code at the end of the page between the <tr> and </tr>

 

Is the code correct here or is it something to do with the txt document I had to upload?

 

Any help would be greatly appreciated

 

Kindest regards

 

Jamie

 

my site for reference is: signs-grafix .co.uk

Hi there,

 

I have not been able to update my website with a form as the coding seems to be wrong.

 

The code 123reg.co.uk sent me to use was:

 

<form action="/formmail/formmail.cgi" method="post">

//Make sure this is the correct path to your FormMail script.

 

<input type='hidden' name="recipient" value="services@123-reg.co.uk"/>

//Make sure this is the e-mail address you are sending the details to.

 

<input type='hidden' name="subject" value="Form Results"/>

//Replace the value with the one you want the subject of the email results to be.

 

<input type='hidden' name="required" value=""/>

//Add any field names the visitor has to fill in for the form to work.

 

<input type='hidden' name="redirect" value="done.html">

//Enter the location of the "thank you" HTML page here.

 

 

Here are the changes that I made then uploaded on my contact page:

 

<form id="form1" name="form1" method="post" action="/formmail/formmail.cgi">

<form action="/formmail/formmail.cgi" method="post">

<input type='hidden' name="recipient" value="jamie@signs-grafix.co.uk"/>

<input type='hidden' name="subject" value="contactresults"/>

<input type='hidden' name="required" value=""/>

<input type='hidden' name="redirect" value="done.html">

</form> </td>

</tr>

</table>

</body>

</html>

 

You may notice I have added this code at the end of the page between the <tr> and </tr>

 

Is the code correct here or is it something to do with the txt document I had to upload?

 

Any help would be greatly appreciated

 

Kindest regards

 

Jamie

 

my site for reference is: signs-grafix .co.uk

 

 

you've got a form tag within a form tag

<form id="form1" name="form1" method="post" action="/formmail/formmail.cgi">
<form action="/formmail/formmail.cgi" method="post">

 

Also your missing a submit button

  • Author

Do you know how to put this right.

 

Many thanks

 

Jamie

You also haven't got any fields!

 

I'd recommend using a free premade form instead of building your own, as it's so easy to go wrong with emails.

 

Does your hosting support PHP?

  • Author
You also haven't got any fields!

 

I'd recommend using a free premade form instead of building your own, as it's so easy to go wrong with emails.

 

Does your hosting support PHP?

 

 

Hi,

 

My host does support php.

 

I could not find any premade codes for forms, so I went through the steps one by one that 123reg.co.uk sent to me. I followed everything execpt I put this code below into my contact page I added it at the bottom between the <tr> </tr> tags.

 

<form action="/formmail/formmail.cgi" method="post">

<input type='hidden' name="recipient" value="jamie@signs-grafix.co.uk"/>

<input type='hidden' name="subject" value="Form Results"/>

<input type='hidden' name="required" value="customername,emailaddress"/>

<input type='hidden' name="redirect" value="done.html">

</form>

 

The code for the dreamweaver contact page is:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<title>contact</title>

 

<style type="text/css">

<!--

body {

background-color: #333333;

}

body,td,th {

color: #FFFFFF;

font-family: Verdana, Arial, Helvetica, sans-serif;

}

.style3 {font-size: 11px}

-->

</style>

<script type="text/javascript">

<!--

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_swapImgRestore() { //v3.0

var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

}

 

function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_swapImage() { //v3.0

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

</head>

 

<body onload="MM_preloadImages('Buttons/Interior-Pushed.jpg','Buttons/Vehicle-Pushed.jpg','Buttons/Banners-Pushed.jpg','Buttons/Graphic-Pushed.jpg','Buttons/DIY-Pushed.jpg','Buttons/MX-Pushed.jpg','Buttons/Map-Pushed.jpg','Buttons/Contact-Pushed.jpg','Buttons/Printing-Pushed.jpg','Buttons/Boat-Pushed.jpg','Buttons/Exterior-Pushed.jpg')">

<table width="955" border="0" align="center" cellpadding="0" cellspacing="0">

<!--DWLayoutTable-->

<tr>

<td height="91" colspan="3" valign="top"><a href="index.htm"><img src="images/Index_01.jpg" alt="header1" width="448" height="91" border="0" /></a><img src="images/images/Index-headers_02.jpg" width="507" height="91" border="0" /></td>

</tr>

<tr>

<td height="54" colspan="3" valign="top" bgcolor="#000000"><img src="images/Index_03.jpg" alt="title1" width="408" height="54" /><a href="diy.htm"><img src="images/Index_04.jpg" alt="diy" width="127" height="54" border="0" /></a><a href="motocross.htm"><img src="images/images/Index_05.jpg" width="165" height="54" border="0" /></a><a href="fitting.htm"><img src="images/images/Index_06.jpg" width="246" height="54" border="0" /></a></td>

</tr>

<tr>

<td height="24" colspan="3" align="center" valign="top" bgcolor="#748FBE"><a href="exterior.htm"><img src="Buttons/exterior.jpg" alt="ext" name="Image1" width="87" height="23" border="0" id="Image1" onmouseover="MM_swapImage('Image1','','Buttons/Exterior-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="interior.htm"><img src="Buttons/Interior.jpg" alt="int" name="Image2" width="87" height="23" border="0" id="Image2" onmouseover="MM_swapImage('Image2','','Buttons/Interior-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="boat names.htm"><img src="Buttons/Boat.jpg" width="87" height="23" border="0" id="Image3" onmouseover="MM_swapImage('Image3','','Buttons/Boat-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><img src="Buttons/Vehicle.jpg" alt="veh" name="Image4" width="87" height="23" border="0" id="Image4" onmouseover="MM_swapImage('Image4','','Buttons/Vehicle-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /><a href="diy.htm"><img src="Buttons/DIY.jpg" alt="diy" name="Image8" width="87" height="23" border="0" id="Image8" onmouseover="MM_swapImage('Image8','','Buttons/DIY-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="banners.htm"><img src="Buttons/Banners.jpg" alt="ban" name="Image5" width="87" height="23" border="0" id="Image5" onmouseover="MM_swapImage('Image5','','Buttons/Banners-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="motocross.htm"><img src="Buttons/MX.jpg" alt="mx" name="Image9" width="87" height="23" border="0" id="Image9" onmouseover="MM_swapImage('Image9','','Buttons/MX-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="graphic.htm"><img src="Buttons/Graphic.jpg" alt="gra" name="Image6" width="87" height="23" border="0" id="Image6" onmouseover="MM_swapImage('Image6','','Buttons/Graphic-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="map.htm"><img src="Buttons/Map.jpg" alt="map" name="Image10" width="87" height="23" border="0" id="Image10" onmouseover="MM_swapImage('Image10','','Buttons/Map-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="print.htm"><img src="Buttons/Printing.jpg" alt="print" width="87" height="23" border="0" id="Image7" onmouseover="MM_swapImage('Image7','','Buttons/Printing-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a><a href="contact.htm"><img src="Buttons/Contatc.jpg" alt="cont" name="Image11" width="81" height="23" border="0" id="Image11" onmouseover="MM_swapImage('Image11','','Buttons/Contact-Pushed.jpg',1)" onmouseout="MM_swapImgRestore()" /></a></td>

</tr>

<tr>

<td width="199" height="693" valign="top" bgcolor="#000000"><!--DWLayoutEmptyCell--> </td>

<td width="563" align="center" valign="top" bgcolor="#000000"><p align="center"> </p>

<p align="center" class="style3"> </p>

<p align="center" class="style3"> </p>

<form id="form2" name="form2" method="post" action="">

<table width="0" border="0" cellpadding="0">

<!--DWLayoutTable-->

<tr>

<td width="100" height="31" align="right" valign="middle"><span class="style3">

<label for="customername">Name:</label>

  </span></td>

<td width="257"><label for="customername"></label>

<input name="customername" type="text" id="customername" /></td>

</tr>

<tr>

<td height="31" align="right" valign="middle"><span class="style3">

<label for="emailaddress">Email Address:</label>

  </span></td>

<td><label for="emailaddress"></label>

<input name="emailaddress" type="text" id="emailaddress" /></td>

</tr>

<tr>

<td align="right" valign="middle"><span class="style3">

<label for="enquiry">Enquiry:</label>

  </span></td>

<td><label for="enquiry"></label>

<textarea name="enquiry" id="enquiry" cols="32" rows="5"></textarea></td>

</tr>

<tr>

<td height="31" align="right" valign="middle"> </td>

<td><label>

<input name="newsletter" type="checkbox" id="newsletter" value="Yes" />

<span class="style3"> Add me to the Signs & Grafix Newsletter</span></label></td>

</tr>

<tr>

<td align="right" valign="middle"> </td>

<td><p>

<label>

<input type="radio" name="referrals" value="internetsearch" id="referrals_0" />

<span class="style3">Internet Search</span></label>

<br />

<label>

<input type="radio" name="referrals" value="yell.com" id="referrals_1" />

<span class="style3">Yell.com</span></label>

<br />

<label>

<input type="radio" name="referrals" value="wordofmouth" id="referrals_2" />

<span class="style3">Word of Mouth </span></label>

<br />

<label>

<input type="radio" name="referrals" value="other" id="referrals_3" />

<span class="style3">Other</span></label>

<br />

</p>

<p> </p></td>

</tr>

<tr>

<td align="right" valign="middle"> </td>

<td><input type="reset" name="reset" id="reset" value="Clear Form " />

<input type="submit" name="submit" id="submit" value="Submit Form" /></td>

</tr>

<tr>

<td align="right" valign="middle"> </td>

<td> </td>

</tr>

<tr>

<td align="right" valign="middle"> </td>

<td> </td>

</tr>

<tr>

<td height="6" align="right" valign="middle"></td>

<td></td>

</tr>

</table>

</form>

<p align="center" class="style3">email: jamie@signs-grafix.co.uk</p>

<p align="center" class="style3">msn: signs-grafix@live.co.uk</p>

<p align="center" class="style3">t. 01263 576 973</p>

<p align="center" class="style3">t. 0845 1585 146</p> <p align="center" class="style3">m. 0781 2917 248</p></td>

<td width="193" valign="top" bgcolor="#000000"><!--DWLayoutEmptyCell--> </td>

</tr>

 

<tr>

<td height="184" colspan="3" valign="top"><img src="images/Index_22.jpg" width="955" height="147" /> <form id="form1" name="form1" method="post" action="/formmail/formmail.cgi">

<form action="/formmail/formmail.cgi" method="post">

<input type='hidden' name="recipient" value="jamie@signs-grafix.co.uk"/>

<input type='hidden' name="subject" value="Form Results"/>

<input type='hidden' name="required" value="customername,emailaddress"/>

<input type='hidden' name="redirect" value="done.html">

</form> </td>

</tr>

</table>

</body>

</html>

 

 

 

Here's the url: www.signs-grafix.co.uk

contact.htm

  • Author

I don't know why it's so hard to do. Any ideas at all. Even a premade form would be ok but can't even find a code for that.

 

Thanks :(

don't use formmail i read an article about it's security flaws and aparently it's loaded with them,

 

I seem to remember a contact form script was supplied by a wdf member... no can't find it, what is the form reqauirments n i'll make it xhtml/php (so long as you don't have too many requirments! :) ).

  • Author
don't use formmail i read an article about it's security flaws and aparently it's loaded with them,

 

I seem to remember a contact form script was supplied by a wdf member... no can't find it, what is the form reqauirments n i'll make it xhtml/php (so long as you don't have too many requirments! :) ).

 

 

Hi, I will only require Name, email, enquiry (with text asking; where did you find us)

 

I might have to enrol on an advanced web design course to sort these little problems out.

 

Thank you so much for your help.

 

;)

 

p.s. Don't want to offend you but I think you may have a spelling mistake on your main page of your website:

 

"Sakui, the Definition

 

Sakui is a Japanese "slang or informal speech" term for a concept of design that is specifically creative, origional and most importantly different."

 

Should it be: original ???

 

:)

lol I'ts a typo, honest :), thanks for pointing that out.

 

and... apologies for the delay but I built this so you can make as many custom forms as you wish:

 

http://sandbox.sakuiweb.com/contact/

 

ps I need to add some script for security but i'll do that tomoz

  • Author

Thanks very much for making that generator, That will come in very useful.

 

The site is here http://signs-grafix.co.uk/contact.htm

 

I don't know what I am still doing wrong, it still comes up with the error message :

 

Method Not Allowed

The requested method POST is not allowed for the URL /contact.htm.

 

Sorry to be a nuisance. :)

Option 1

The page must be saved with the extension .php

ie contact.htm >> contact.php

 

Option 2

Alternativley cut the php code from the top (of the code from the gererator), paste this code into anything.php and change the form tag;

from:

<form method="post">

to:

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

ps I need to add some script for security but i'll do that tomoz

:huh: Surely security should be a priority on any script? Especially as you've already got one user of your generator now... I would personally recommend you ditch the addslashes (pointless on a form that's only being sent via email) and put in some proper validation of fields.

  • Author
Option 1

The page must be saved with the extension .php

ie contact.htm >> contact.php

 

Option 2

Alternativley cut the php code from the top (of the code from the gererator), paste this code into anything.php and change the form tag;

from:

<form method="post">

to:

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

 

 

Where abouts should I add the code, I cannot find anything.php.

 

Many thanks

There is no php file yet...

 

option 1 was to rename your page contact.htm to contact.php

 

 

option 2 was to find all the content inside <?php and ?> and save this contents to a php file.

:huh: Surely security should be a priority on any script? Especially as you've already got one user of your generator now... I would personally recommend you ditch the addslashes (pointless on a form that's only being sent via email) and put in some proper validation of fields.

Its a freebie, I don't have the time. If its important to you, write the code yourself and i'll add it, the add slashes is to ensure strings are not escaped, not just for protecting databases.

Its a freebie, I don't have the time.

If you don't have the time, don't distribute the code. Putting people's hosting accounts at risk because you can't be bothered to do it properly is bloody irresponsible.

 

If its important to you, write the code yourself

I did: http://www.jemjabella.co.uk/scripts/free-php-mail-form

 

the add slashes is to ensure strings are not escaped

Er.. I think that you've got that one back to front.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.