Jump to content

Deleting security code


rjcfan4ever

Recommended Posts

I'd wanna delete the security code of my guestbook script but I don't know exactly what to delete, can you maybe help me?

 

Here is the script:

<?php 
session_start();

if( isset($_POST['submit'])) {
   if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {
	// Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
	echo 'Thank you. Your message said "'.$_POST['message'].'"';
	unset($_SESSION['security_code']);
   } else {
	// Insert your code for showing an error message here
	echo 'Sorry, you have provided an invalid security code';
   }
} else {
?>
<h1>Guestbook with Captcha</h1>
<form action="form.php" method="post">
<table>
<tr>
	<td>Name</td><td> <input type="text" name="name" id="name" /></td>
</tr>
<tr>
	<td>Email</td><td> <input type="text" name="email" id="email" /></td>
</tr>
<tr>
	<td valign="top">Message</td><td> <textarea rows="5" cols="30" name="message" id="message"></textarea></td>
</tr>
<tr>

</tr>
<tr>
	<td><td valign="top">Security Code</td><td>
	<img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /><br />
	<input id="security_code" name="security_code" type="text" />
	</td></td><td>
	<input type="submit" name="submit" value="Submit" />
	</td>
</tr>
</table>
</form>

<?php
}
?>

Link to comment
Share on other sites

Try this. I didn't test it though. Just removed the parts I mentioned in my previous post

<?php 
session_start();

if( isset($_POST['submit'])) {
     // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
     echo 'Thank you. Your message said "'.$_POST['message'].'"';

} else {
?>
<h1>Guestbook with Captcha</h1>
<form action="form.php" method="post">
<table>
<tr>
	<td>Name</td><td> <input type="text" name="name" id="name" /></td>
</tr>
<tr>
	<td>Email</td><td> <input type="text" name="email" id="email" /></td>
</tr>
<tr>
	<td valign="top">Message</td><td> <textarea rows="5" cols="30" name="message" id="message"></textarea></td>
</tr>
<tr>

</tr>
<tr>
	<td
	<input type="submit" name="submit" value="Submit" />
	</td>
</tr>
</table>
</form>

<?php
}
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.