PHP

  • Forum PHP Paris 2008

    The 2008 edition of the French PHP users welcomes once again unique
    speakers : Zak Greant, from Foo Associates, Laura Thompson from Mozilla, and
    Lukas Smith, Core PHP Developper.

    Set in Paris, on December 8th and 9th 2008, by the
    Association Française des Utilisateurs de PHP (French PHP User Group,
    http://www.afup.org/),
    the Forum PHP 2008 focuses on the themas of Professional Web Services,
    and PHP large scale projects.


FORM

Form Action
<form method=”POST” action=”<?php echo $SCRIPT_NAME ?>”>
<html><body>
<form METHOD=”POST” ACTION=”GetFormValue.php”>
Name: <input TYPE=”TEXT” NAME=”Name”/>
Memo: <textarea NAME=”Comment” ROWS=”4″ COLS=”40″ WRAP=”PHYSICAL”> </textarea>
<input TYPE=”SUBMIT”/>

</form></body>
<!– GetFormValue.php –>
<?php echo “Name=$Name”;
echo “Text=$Comment”;
?>

Form based Email

<form action=”sendemail.php” method=post name=form1>
Name: <input name=toname size=35/>
E-mail: <input name=tomail size=35/>
CC: <input name=cc size=35/>
BCC: <input name=bcc size=35/>
<select name=priority>
<option value=1>Highest</option>
<option value=2>High</option>
<option selected value=3>Normal</option>
<option value=4>Low</option>
<option value=5>Lowest</option>
</select>
Subject: <input name=subject size=35/>
Message: <textarea cols=50 name=body rows=7></textarea>
<input name=Submit type=submit value=Submit/>
</form></body></html>

<!– sendemail.php –>
<html><body>
< ?php
$message= ” ” ;
if (empty ( $toname) || empty ( $tomail) ) {
die ( “Recipient is blank! “) ;
}else{ $to = $toname . ” <” . $tomail . “>” ; }
if ( empty ( $subject) ) { $subject=” “; }
if (($priority>0) && ($priority<6)) {
$mailheader = “X-Priority: “. $priority .”\n”;
}
$mailheader.= “From: ” . “Sales Team <sales @yourdomain.com>\n”;
$mailheader.= “X-Sender: ” . “support@yourdomain.com\n”;
$mailheader.= “Return-Path: ” . “support@yourdomain.com\n”;
if (!empty($cc)) { $mailheader.= “Cc: ” . $cc .”\n”;}
if (!empty($bcc)) { $mailheader.= “Bcc: ” . $bcc .”\n”; }
if (empty($body)) { $body=” “; }
$result = mail ($to, $subject, $body, $mailheader);
echo “<b>Mail sent to “. “$to”;
echo $subject;
echo $body;
echo $mailheader;
if ($result) {
echo “<p><b>Email sent successfully!</b></p>”;
}else{ echo “<p><b>Email could not be sent. </b></p>”;}
?>

</b><b>To</b>: < ?php echo $toname . ” [". $tomail . " ]“;?>
<b>CC</b>: < ?php echo $cc;?>
<b>BCC</b>: < ?php echo $bcc; ?>
<b>Priority</b>: < ?php echo $priority;?>
<b>Subject </b>: < ?php echo $subject;?>
<b>Message</b>: < ?php echo $body;?>
</body></html>

Form Based Query
Form Checkbox
Form Data
Form Select
Form TextArea
Form Validation
Hidden Field
Self Call Form
TextBox


Post your comment

secret
Enter the letters you see above.