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
https://forums.phpfreaks.com/topic/243001-deleting-security-code/
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
}
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.