Jump to content

Site Security


dropfaith

Recommended Posts

  • 2 weeks later...

okay now everything coming from db goes thru this

 

$Id = mysql_escape_string(trim(htmlentities($_GET['Id'])));

 

 

and going in goes thru

 

 

$Contact = mysql_real_escape_string(trim(stripslashes($_POST['Contact'])));

and my contact form now does this then escapes all details from the post before emailing me

So i think im ready for another round as hard as you can go for security

					<form method="post" action="template/contact.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />

                     <p><label>Name: </label>
                     <input type="text" name="name" size="40" /><br /></p>
                     <p><label>Subject: </label>
                     <select name="subject" style="width:150px;">
                        <option value="Advertise">Advertise</option>
                        <option value="Support">Support</option>
                        <option value="Web_Design">Web Master</option>
                        <option value="Problem">Problem</option>
                     </select>
                     <br /></p>
                     <p>
                     <label>Email:</label>
                     <input type="text" name="email" size="40" /><br /></p><p>
                     <label>Comments:</label><textarea rows="5" name="message" cols="30"></textarea><br /></p>
	     <input type="hidden" name="myemail" value="&#100;&#114;&#111;&#112;&#102;&#97;&#105;&#116;&#104;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;" />
                     <p><input type="submit" name="submit" value="Send!"/></p>

                  </form>

 

Link to comment
Share on other sites

i think for the most part the contact form is solved

 

this is now my email

 

<input type="hidden" name="myemail" value="&#100;&#114;&#111;&#112;&#102;&#97;&#105;&#116;&#104;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;" />

but yea if you feel like scanning go for it im always up for improving plus the recipes section and the stories section have a voting system which im leeary about

 

(ps i know you can vote as often as you want  but thats not my concern right now

 

oh and i think i deleted the phpfreaks phpfreaks account so

you can use my test account

 

currently

admin

phpfreaks

 

alot of the edit stuff now requires the session to be set its still in the works as its not redirecting yet but yea security then the real function

 

Link to comment
Share on other sites

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