| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | wts wrong here HEY i am trying to learn php and i tried making a small script that tells the user to type in a number...and checks if its an integer..if its not an integer it gives an error..but its not working...no matter wt they enter..it says that its not an integer here is the code PHP Code:
__________________ |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | hey i am sorry i dont know what that is i am new to php and the first tutorial i read was on gettype() and settype() so i tried messin with it but it dint work...duno wts wrong wid it?
__________________ |
| |
| | THREAD STARTER #5 (permalink) |
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | grr is anyone going to tell me whats wrong wid the script? i know php.net is a great site!!! i bought a BOOK and i am reading it the first chapter talked about this thing and i tried to play with it to learn and its not working as it should and i am asking someone to tell me HOW 2 FIX IT! not to tell me to go to that site to learn this or that !!
__________________ |
| |
| | #6 (permalink) |
| Account Suspended Join Date: Aug 2005
Posts: 379
![]() ![]() ![]() | Please enter some numbers..ONLY NUMBERS<br> <form action="<?$_SERVER[PHP_SELF]?>" method='post'><br> <input type='text' name='input'> <br> <input type='Submit' name='Submit' value='Submit'> </form> <? $stuff=$_POST['input']; $submit= $_POST['Submit']; $input=$_POST[input]; if (isset($submit)){ if (is_int($input)) { echo "You posted $stuff and its not an integer";} else {echo "thanks " ;} } else {} ?> |
| |
| | THREAD STARTER #9 (permalink) |
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | because i am trying to learn php so i need to know y its not working..i am not trying to create a script just learningand the other one dint work either learn.apkafuture.com/ops.php
__________________ |
| |
| | #11 (permalink) | ||||||||
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
and using is_int will produce the same result. Btw, to quote the PHP manual:????: NamePros.com http://www.namepros.com/showthread.php?t=184870
A good way to do it would probably be to do a preg_match PHP Code:
Last edited by SecondVersion; 04-07-2006 at 07:31 PM.
| ||||||||
| |