PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
callmecheez
Forum Newbie
Posts: 3 Joined: Wed May 28, 2008 10:13 am
Post
by callmecheez » Wed May 28, 2008 10:18 am
Hey guys, really sorry to ask as I'm sure its an irritatingly frequent query but I'm struggling with a feedback form.
I want a feedback form that'll have 4 or 5 fields, one to be text area; and have all info emailed to an address.
I've got an index.html:
Code: Select all
<form method="post" action="sendmail.php">
Name: <input name="name" type="text" /> <br />
Email Address: <input name="email" type="text" /><br />
ISS Username (if known): <input name="username" type="text" /><br />
Telephone Number: <input name="phone" type="text" /><br />
Message:<br />
<textarea name="message" rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>
and sendmail.php:
Code: Select all
<?php
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$username = $_REQUEST['username'] ;
$phone = $_REQUEST['phone'] ;
$message = $_REQUEST['message'] ;
mail( "callmecheez@gmail.com", "New helpdesk email",
"From: $name <$email>" );
"$message\nCustomer Username:$username\n".
"$message\nCustomer Contact Number:$phone\n".
"$message\nDescription: $message\n".
header( "Location: http://www.leeds.ac.uk/iss/contact_test/thankyou.html" );
?>
Been stuck with this all day, and just not knowledgeable enough to figure it out. Any help gratefully received.
callmecheez
Forum Newbie
Posts: 3 Joined: Wed May 28, 2008 10:13 am
Post
by callmecheez » Wed May 28, 2008 5:21 pm
I've pretty much sorted this now, almost.
Next question - how do I format my form? I'd like to align all the fields and tidy it up etc.
Many thanks
LSJason
Forum Commoner
Posts: 45 Joined: Mon May 12, 2008 4:43 pm
Post
by LSJason » Wed May 28, 2008 7:24 pm
callmecheez wrote: I've pretty much sorted this now, almost.
Next question - how do I format my form? I'd like to align all the fields and tidy it up etc.
Many thanks
You'd need to use tables or CSS...quickest way is with tables, most standards-compliant is with CSS. Here's the implementation with tables:
Code: Select all
<form method="post" action="sendmail.php">
<table>
<tr>
<td>Name:</td><td><input name="name" type="text" /></td>
</tr>
<tr>
<td>Email Address:</td><td><input name="email" type="text" /></td>
</tr>
... (and so on...)
</table>
</form>
callmecheez
Forum Newbie
Posts: 3 Joined: Wed May 28, 2008 10:13 am
Post
by callmecheez » Thu May 29, 2008 6:17 am
Thanks for all the help guys. . last question. . !
Anyone know why under firefox it looks fine:
But internet explorer has some yellow fields and the alignment is out?
Thanks again
LSJason
Forum Commoner
Posts: 45 Joined: Mon May 12, 2008 4:43 pm
Post
by LSJason » Thu May 29, 2008 8:26 am
That's the problem with tables--they aren't flush across all browsers. You can try playing with the align and valign properties to obtain the desired alignment.
As to the yellow fields, that's an Internet Explorer plugin for certain versions that allows you to automatically fill in the information (Form-Fill). That's something you can only disable on the client end, and there's no way to change that.
Jason