Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-28-2004, 12:21 PM   #1
whee
Confirmed User
 
Join Date: Sep 2002
Location: http://www.nightstation.com
Posts: 1,375
Form validation in PHP

Form validation in PHP

When someone enters a string similar to this in my address input field:

Some street 98, 1'st floor.

I get an error due to the ' char. It's substituted by / and a space!
This is no good...

Does anyone have the valid php ereg function to disable or replace the illigal chars like ' & // $ etc etc... ?

If someone enters something like this in a form that submits it to a php page, it errors on me big time.

__________________
http://www.nightstation.com
whee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 12:38 PM   #2
Anothers
Confirmed User
 
Join Date: Nov 2001
Location: Poland
Posts: 219
try addslashes();


example

<? php

echo "This is correct field value: ".addslashes($_POST["form_field"]);

?>


Edited: there is space between '<?' and 'php' - just remove it to get it work

Edited 2: whe your form method is GET then change $_POST to $_GET

Last edited by Anothers; 08-28-2004 at 12:42 PM..
Anothers is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-28-2004, 01:03 PM   #3
whee
Confirmed User
 
Join Date: Sep 2002
Location: http://www.nightstation.com
Posts: 1,375
Great idea... Thanks!
__________________
http://www.nightstation.com
whee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.