Download presentation
Presentation is loading. Please wait.
1
CSE 102 Introduction to Web Design and Programming
Form Processing with PHP
2
PHP Hypertext Preprocessor, an open-source, server-side, HTML embedded scripting language used to create dynamic Web pages. PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP can perform any task that any CGI program can do and it was created in 1994.
3
hello.html <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " <html xmlns=" xml:lang="en" lang="en"> <head> <title>Web Page with Forms</title> <link rel="stylesheet" type="text/css" href="./css/form.css" /> </head> <body> <p style="font-weight: bold; font-size: larger"> Complete this form:</p> <form method="post" action="hello.php"> <pre> Full Name: <input id="name" name="name" size="35" /> <input id=" " name=" " size="35" /> <input type="submit" value="Send" /> </pre> </form> </body> </html>
4
form.css td.fla { background-color: #d2dbff } form label, form option
{ font-family: Arial, Helvetica, sans-serif } form input, form select { background-color: #eef }
5
<html xmlns="http://www. w3
<html xmlns=" xml:lang="en" lang="en"> <head><title>Hello</title></head> <body> <?php $name = $_POST['name']; $ = $_POST[' ']; print "<h3>Hello $name,</h3>"; print "<p>The address you sent is</p>"; print "<p>$ </p>"; ?> </body> </html> hello.php
6
JoinClub.html <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " <html xmlns=" xml:lang="en" lang="en"> <head> <title>Join club.com</title> <link rel="stylesheet" href=“css/form.css" type="text/css" title="form" /> </head> <body> <h2>Join <tt>club.com</tt></h2> <form method="post" action= "join.php" enctype="application/x-www-form-urlencoded"> <p style="font-weight: bold; font-size: larger">Join club.com</p> <pre> Full Name: <input id="name" name="name" size="35" /> <input id=" " name=" " size="35" /> <input type="submit" value= "Join Now" /> </pre> </form> </body> </html> JoinClub.html
7
<html xmlns="http://www. w3
<html xmlns=" xml:lang="en" lang="en"> <head><title>Thanks for Joining</title></head> <body style="background-color: white"> <?php $ = $_POST[' ']; $name = $_POST['name']; $club="ic.sunysb.edu"; $subject = "New Member club.com"; $my = $message = "Name: $name\n $ \n to join $club *****\n\n "; $headers = "From: Name of if(mail($ ,$subject,$message,$headers)) { print "<h3>Thank you $name. </h3>"; print "<p>Welcome to club.com. Your membership will be processed shortly. </p>"; print "<p>We will you at <code>$ </code> about your new membership at $club. </p>"; } else print "Doh! Your mail could not be sent."; ?> </body> </html> join.php
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.