Help - Search - Members - Calendar
Full Version: Emailing Form
Zymic Webmaster Forums > Web Design & Development > General Web Design Discussion
aussiemcgr
ok, very simple prob. I have a form that is used to contact me via my email. The only prob is when you press the send button, it just opens the users default email browser and fills some stuff in... Any thoughts?

URL: http://steelersfan.vndv.com/contact.php
Banjo
Its your form action.

Your code is

CODE
<form action="mailto: steelers.pittsburgh@live.com" method="post" enctype="text/plain" name="form1" id="form1">


Where it says mailto: steelers.pittsburgh@live.com that needs to be something like mail.php where that sends the email.
wozzym
and also, php mail is disabled. you need to pay jack $10 to use it.
aussiemcgr
lol, screw that!

So i cant do anything sly like get them to send to my forum's private messages or something can i?
Banjo
You could do that or make your own script so it submits the data to a database then you login to view it.
wozzym
ya you can still do stuff like that, but you cant send an actualy email unless you pay the $10
aussiemcgr
QUOTE(wozzym @ Jul 24 2008, 06:45 PM) *
ya you can still do stuff like that, but you cant send an actualy email unless you pay the $10


sending emails is not the prob, just receiving them.

Ok so if it is possible to send it to my forum's pm, would i use
CODE
mailto: ucp.php?i=pm&folder=inbox
or something?
Banjo
You don't use mailto:, that will just open up the users default email client like Outlook Express. You would need a php script that would insert the data into a database.

Your form would look like this (copy and pasted your source, changed action and names/id's).

CODE

<form action="mail.php" method="post" enctype="text/plain" name="form1" id="form1">
<table width="90%" border="0" cellspacing="2" cellpadding="4" align="center">
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor">

<label for="name">Name: </label>
<input id="name" name="name" type="text" size="50" /> </td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor">
<label for="email">Email: </label>
<input id="email" name="email" type="text" size="50" /> </td>

</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor">
<label for="subject">Subject:</label>
<input id="subject" name="subject" type="text" size="50" /> </td>
</tr>
<tr>
<td colspan="2" style="vertical-align: top" class="TitleColor">

<label for="message">Message:</label>
<br />
<br />
<textarea id="message" name="message" rows="5" cols="50"></textarea> </td>
</tr>
<tr>
<td colspan="2">

<input type="submit" name="Submit" value="Send" /> </td>
</tr>
</table>


and then you would have on mail.php a script that inserted the textfields into a database. E.g (don't use this basic and no protection).

CODE

<?php
$name = $_POST['name'];
$email = $_POST['number'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$sql = "INSERT INTO mail".
" (name,email,subject,message) ".
" VALUES('$name','$email','$subject','$message')";
?>


and on another page just echo out the data in the database. You could as you said have it send to your forum private messenger.
aussiemcgr
ok ill try that, thanks

btw, how do i
QUOTE
echo out the data in the database
?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.