Web Form + Submit button

Soldato
Joined
18 Oct 2002
Posts
4,023
Location
Wellington, NZ
Hi,

To make a web form work, after pressing the submit button what should I need to know to put in the code to make it work?

I have a form with all the required fields and i'm wanting the send button to send an email to my webhost email address without going through outlook.

Is this is as difficult thing to do? I've had a look in google but it's not too clear.
 
Thanks for the link :) Is there no way to do it internally through the browser and the webhost mail server though without going through Outlook?

thanks
 
I'll read into that, i'm sure we have php services.. I think the reason it's a bit tougher is because i'm trying implement this to a form created already:


<br style="line-height:9px">
<form action="" enctype="multipart/form-data" id="form">
<table cellspacing="0" cellpadding="0" class="form">
<tr>
<td style="width:198px; height:128px">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="width:198px; height:27px"><input name="" type="text" value="your name:"></td>
</tr>
<tr>
<td style="width:198px; height:27px"><input name="" type="text" value="your company:"></td>
</tr>
<tr>
<td style="width:198px; height:27px"><input name="" type="text" value="telephone:"></td>
</tr>
<tr>
<td style="width:198px; height:27px"><input name="" type="text" value="e-mail"></td>
</tr>
</table>
</td>
<td style="width:202px; height:128px">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="width:202px; height:109px"><textarea name="" cols="0" rows="0">message:</textarea></td>
</tr>
<tr>
<td style="width:202px; height:19px">
<br style="line-height:1px">
<img src="images/spacer.gif" alt="" width="116" height="1"><strong><a href="#" onClick="document.getElementById('form').reset()">reset</a></strong><img src="images/spacer.gif" alt="" width="15" height="1"><strong><a href="#" onClick="document.getElementById('form').submit()">send</a></strong> </td>
</tr>
</table>
</td>
</tr>
</table>

that is the code without CSS - 'document.getElementById' is this what I need to be looking at?

thanks
 
the reason it's that hard is because I want to retain the styling. I've just tested and got that form working on the last link you posted but on my form the submit button is a link rather than a button - this seems to be the problem at the moment.

Cheers :)
 
you're not i'm just not very good at explaining my requirements :D

I'm not sure why it's using a javascript action. How would I use the CSS to do that as i'm pretty sure that's the last piece of the jigsaw.
 
Cheers for the replies:

Managed to get the form to send but it's now blank apart from the email!!:o
___________________________________________________________________________________________________________
<form method="post" action="sendmail.php">

<table cellspacing="0" cellpadding="0" class="form">
<tr>
<td style="width:198px; height:128px">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="width:198px; height:27px"><input name="name" type="text" value="your name:"></td>
</tr>
<tr>
<td style="width:198px; height:27px"><input name="company" type="text" value="your company:"></td>
</tr>
<tr>
<td style="width:198px; height:27px"><input name="telephone" type="text" value="telephone:"></td>
</tr>
<tr>
<td style="width:198px; height:27px"><input name="email" type="text" value="e-mail:"></td>
</tr>
</table> </td>
<td style="width:202px; height:128px">
<table cellspacing="0" cellpadding="0">
<tr>

<td style="width:202px; height:109px">message:<textarea name="textarea" cols="0" rows="0"></textarea></td>
</tr>
<tr>
<td style="width:202px; height:19px">
<br style="line-height:1px">
<img src="images/spacer.gif" alt="" width="116" height="1"><input type="submit" />
____________________________________________________________________________
That's the form element.
____________________________________________________________________________
This is the PHP element:
<?php
$name = $_REQUEST['name'] ;
$company = $_REQUEST['company'] ;
$telephone = $_REQUEST['telephone'] ;
$email = $_REQUEST['email'] ;
$textarea = $_REQUEST['textarea'] ;


mail( "****@hotmail.com", "Feedback",
$message, "From: $email" );
header( "Location: thankyou.html" );
?>

What's going wrong now?
 
Back
Top Bottom