Jump to content


Photo

valadation problam


  • Please log in to reply
6 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 20 August 2006 - 01:03 AM

i can not post the whole code as it's 1400 lines long sorry but the example is below cheers.

hi there all can you see why the valadation wont work please.

does not seem to valadate.
<?php

$name_lenth=strlen($name);
$password_lenth=strlen($password);

if(($name_lenth )||($password_lenth) > 15){

echo " sorry but name and password are only max 15 characters long ";

}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 20 August 2006 - 01:07 AM

if(($name_lenth )||($password_lenth) > 15){

should be

if(($name_lenth > 15) || ($password_lenth > 15)){


#3 Yesideez

Yesideez
  • Members
  • PipPipPip
  • Advanced Member
  • 2,334 posts
  • LocationDevon, UK

Posted 20 August 2006 - 01:07 AM

if ($name_lenth>15||$password_lenth>15) {

That work?
Not a pro just an enthusiast :)

if (empty($coffee)) {$coffee=new coffee();}

Please surround any code using the CODE tags - I rarely look at anything without them

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 20 August 2006 - 01:09 AM

what ones more better to use they both work or is it prefrence
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 20 August 2006 - 01:12 AM

They work exactly the same, some people find the parenthesis...()...easier to read, but the functionality is the same.

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 20 August 2006 - 01:23 AM

cheers.

what i need to now now is when you get a user to fill in a form and use exit and give them a link to go back and try agin do you use sessions to keep there old settings or do you get them to fill it all in agin .

or do you keep the most inportant in a session.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 20 August 2006 - 02:56 AM

What i do is if i run into any errors i store them in a $error variable via .= and if there were any errors echo $error and then have the form have the values they just submitted in it by echo the post variables like value="<?=$_POST['name'];?>" That way it doesnt validate but they dont have to retype everything...
Why doesn't anyone ever say hi, hey, or whad up world?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users