You are here: Re: Here is the code « PHP Programming Language « IT news, forums, messages
Re: Here is the code

Posted by John on 09/10/07 16:21

>>> I would do some validation of the POST data before sending possibly
malicious data to myself.



Can you write out how I would do validation in the code?


Thanks for all of the help so far.




Also I tried this and named it mail.php:


<?php

if (isset($_POST['Send']))
{

$to = 'primster7@gmail.com';
$subject = 'Request from Website';

$myEmail = "A new request was sent:\n";
foreach ($_POST as $key => $value)
$myEmail .= $key.". ".$value."\n";

mail ($to, $subject, $myEmail);
}
?>


with the } line but it didn't send me the email.



I have this for the form:



<form
class="cssform" action="mail.php" method="post">
<p>
<label for="user">Name:</label>
<input type="text" id="user" value="" />
</p>
<p>
<label for="emailaddress">Email Address:</label>
<input type="text" id="emailaddress" value="" />
</p>
<p>
<label for="phone">Phone Number:</label>
<input type="text" id="phone" value="" />
</p>
<p>
<label for="call">Best Time To Call:</label>
Morning:
<input type="radio" name="call" />
Afternoon:
<input type="radio" name="call" />
Night
<input type="radio" name="call" />
</p>
<p><label for="call">Subject:</label>
<select name="web">
<option value="">Website Quote</option>
<option selected value="">Tech Support</option>
</option>
</select>
<br><br><br>
<p><label for="comments">Comments:</label>
<textarea name="comments" rows="" cols=""></textarea>


<div style="margin-left: 150px;">
<input type="submit" value="Submit" />
<input type="reset" value="Reset" />
</div>
</form>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация