Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The start to my forum
#1
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]
[Image: chaosthegreat.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)