Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1589 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Email Problem

Thread title: Email Problem
Closed Thread  
Page 2 of 2 < 1 2
    Thread tools Search this thread Display Modes  
02-22-2007, 08:43 PM
#11
AidanF is offline AidanF
Status: I'm new around here
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 18
iTrader: 0 / 0%
 

AidanF is on a distinguished road

  Old

Make a file named form.php
PHP Code:
<?php
If(!$_POST[submit]){//If form isnt submitted
//The form ect goes here make sure you name the submit button submit".
echo("
<form method=\"POST\" action=\"form.php\">
<input type=\"text\" name=\"name\" size=\"19\"><br>
<br>
<input type=\"text\" name=\"email\" size=\"19\"><br>
<br>
<textarea rows=\"9\" name=\"message\" cols=\"30\"></textarea>
<br>
<br>
<input type=\"submit\" value=\"Submit\" name=\"submit\">
</form>
"
);
}
else{
$message "The name of the person who sent this is: /n
$_POST[name] /n
their email is: /n
$_POST[email] /n
their message is /n
$_POST[message] 
$_POST[message]";
//the form was submitted so we contnue
mail'youremail@example.com''Email from the contact form''$message' );
echo(
"Thank you <a href=\"mailto:$_POST[email]>$_POST[name]</a> your message: <br> $_POST[message] has been emailed to the admin! ");
}
?>
I havent tested this i just wrote it quick in the message box it was just to show you how to do it
Thanx,
Aidan

02-22-2007, 08:52 PM
#12
RaZoR^ is offline RaZoR^
RaZoR^'s Avatar
Status: Member
Join date: Feb 2006
Location:
Expertise:
Software:
 
Posts: 191
iTrader: 1 / 100%
 

RaZoR^ is on a distinguished road

  Old

The header redirect would be the best. If you hit the back button, it should only take you back to the form page, not ask about HTTP POST data again.

I wouldn't do cookies because they can be disabled and I wouldn't do IPs because most users have dynamic addresses and so could simply disconnect and reconnect their Internet connection (and AOL are silly enough to give out used IPs from a pool over and over - you might get multiple users trying to submit shortly after each other only to find that they can't [I've seen it before!]).

If it's not for security reasons, then anything would work really. If it's just to stop say double posting on forums then any of the above mentioned would work fine. Sessions would be the other good alternative if you were looking at it from a security point of view.

My last idea is to require users to register on the site and log in. That way you could do the IP flood protection but with their username instead. But if it's just a contact form for site feedback and such, you might not want users registering just to send an email to you; it would put them off bothering.

02-26-2007, 01:16 AM
#13
deLive is offline deLive
Status: I'm new around here
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 8
iTrader: 0 / 0%
 

deLive is on a distinguished road

  Old

Either use a header or a javascript window.location .

Closed Thread  
Page 2 of 2 < 1 2


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed