| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Apr 2004 Location: Australia
Posts: 814
![]() ![]() ![]() ![]() | 250np$ For simple php script Hey, i need a script that checkes a value what somones typed up to see if its = to somthing in the database. just like checking for a username to put to a password. Thanks QBert |
| |
| | #2 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | This would be form.html Code: <form name="checker" method="POST" action="domain.com/check.php"> <p>Username: <input type="text" name="username" size="20" value="<?php echo $username; ?>"><br> <input type="submit" value="Check" name="doit"></p> </form> PHP Code:
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |
| | #4 (permalink) | ||||
| québécois libre Join Date: Oct 2003 Location: Trois-Rivieres, Québec
Posts: 558
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Hi Crusader, Why are you checking for <? and ?> ? PHP Code: $username = addslashes($username); With your code I could post in the username field something like '; DELETE FROM usernames And break you Matt
| ||||
| |
| | #5 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | Err. Yeah, you're right. Ignore the <? ?> and strip out special characters instead.
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |