a problem

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

Post Reply
kujtim
Forum Commoner
Posts: 35
Joined: Sat Oct 25, 2003 4:00 am
Location: kosovo
Contact:

a problem

Post by kujtim »

html page is


<html>

<head>
<title></title>
</head>

<body>

<form method="post" action="testphp.php">
Emaili: <input name="email" type="text" /><br />
Kujt : <input name="email1" type="text" /><br />
Subjekti : <input name="sub" type="text" /><br />
Mesazhi: <br />
<textarea name="message" rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>

</body>

</html>


php page is

<html>

<head>
<title></title>
</head>

<body>

<?php


$email = $_REQUEST['email'] ;
$emailto = $_REQUEST['email1'] ;
$subject = $_REQUEST['sub'] ;
$message = $_REQUEST['message'] ;

mail( $emailto, $subject, $message, "From: $email" );

?>

<td width="53" height="0"> <div align="center"><b>
Your message has been succescfuly sent to :<?echo $emailto ;?>

<form action="testhtml.php" method="post">
<input type="submit" value="Back">



</body>

</html>

i vant thet
if the user didn't fill in the email text box to recive a mesage
sory but you forgat to write you email

i don't want thet the email to be sent if any of this text areas are empty...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You need to test to make sure fields are not empty then - have a look at [php_man]empty[/php_man]().

Mac
Post Reply