943,170 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 123
  • PHP RSS
Sep 3rd, 2010
0

server side validation in php

Expand Post »
can u help me by sending me some example of validation tha how we can put server side validation in php just one example.........?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dev.vini is offline Offline
17 posts
since Aug 2010
Sep 3rd, 2010
0

Depends on data to be validated

Well depends on what kind of data you are validating, a quick example would be to validate a number within a certain range (e.g. Persons age, height, weight, etcetera).

PHP Syntax (Toggle Plain Text)
  1. <?php
  2. function range($min,$max,$val)
  3. {
  4. if ($val < $min) || ($val > $max)
  5. return 1; //Error, invalid data
  6. else
  7. return 0; //data validate properly
  8. }
  9. ?>
Reputation Points: 10
Solved Threads: 4
Light Poster
Triztian is offline Offline
28 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: two actions in a form
Next Thread in PHP Forum Timeline: how to use two functions in submit button..





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC