| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #26 (permalink) |
| I'll do it ![]() Join Date: Dec 2005 Location: India
Posts: 6,927
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Use this PHP Code:
__________________ |
| |
| | #27 (permalink) | ||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft | ||||
| |
| | THREAD STARTER #28 (permalink) |
| NamePros Member Join Date: Jan 2007
Posts: 98
![]() | I found another one. If i try to enter this to my database it does not work. PHP Code: |
| |
| | #29 (permalink) |
| NamePros Regular Join Date: Jun 2004 Location: Iowa City
Posts: 705
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | what happens when you try this: Code: $query="INSERT INTO `filedetails` VALUES ('', '$type', '$title', '$description', '$links','0000000000')";
__________________ formally ninedogger ------ Want to talk to a stranger? -->| Click Here | TalkToAStranger.com | <-- Meet New Friends |
| |
| | #30 (permalink) | ||||
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,620
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ | ||||
| |
| | #31 (permalink) | ||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
You should not be using add slashes for data that is going to be output to the browser. The function was intended to make data safe for inputting into a database and will not make data safe for outputting to the user. The function you should be using is htmlspecialchars() or htmlentities(). Even if you use add slashes for data that is going to be input into the database it does not take into consideration of what database you are inserting too. Many characters for example that are special characters in mySQl will remain untouched and will alter how your query will run.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft | ||||
| |
| | #32 (permalink) | ||||
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,620
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ | ||||
| |
| | #33 (permalink) | ||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In mySQL you have characters such as -- which starts a comment and ; which ends a query (and anything after is a new query) however this 1 depends on the method you use for connecting. If you really want to make an SQL statement safe then use prepared statements. SQL injection is not possible when this method is used.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft | ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |