The start to my forum - Printable Version +- 2DWorlds Forums (http://2dworlds.buildism.net/forum) +-- Forum: Off Topic (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=5) +--- Forum: Programming (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=30) +--- Thread: The start to my forum (/showthread.php?tid=7099) |
The start to my forum - Chaos - 07-22-2011 It's based off of 4chan NOTE: Jesus guys! I KNOW I AM JUST ECHOING THE DATA. I don't have a database set up yet and I need to brush up on SQL... HTML: [lua] <html> <div><p>Please complete this form to submit your post:</p> <form action="handle_post.php" method="post"> <p>First name: <input type="text" name="first_name" size="20" /></p> <p>Last name: <input type="text" name="Last_name" size="20" /></p> <p>Email: <input type="text" name="Email" size="20" /></p> <p>Posting: <textarea name="posting" rows="9" cols="30"></textarea></p> <input type="submit" name="submit" value="Send" /> </form> </body> </html> [/lua] PHP: [lua] <html> <?php ini_set ('display_errors', 1); $var = nl2br($var); $first_name = trim($_POST['first_name']); $last_name = trim($_POST['last_name']); $posting = nl2br($_POST['posting']); $email = trim($_POST['email']); $name = $first_name . '' . $last_name; print "<div>Thanks for posting $name! <p>$posting</p></div>"; //Get out the bad words!! $posting = str_irplace('badword', 'XXXXX', $posting); //make a link to another page $name = urlencode($name); $email = urlencode($_POST['email']); print "<p>Click <a href=\"thanks.php?name=$name&email=$email\"> here </a> to continue.</p>"; ?> </html> [/lua] PHP 2: [lua] <html> <?php $name = $_GET['name']; $email = $_GET['email']; print "<p>Thank you, $name. We will contact you at $email.</p>"; ?> </body> </html> [/lua] |