BenTheDesigner's Profile
Reputation: 20
Excellent
- Group:
- Members
- Active Posts:
- 147 (0.15 per day)
- Joined:
- 22-September 09
- Profile Views:
- 4,915
- Last Active:
Nov 22 2011 11:01 PM- Currently:
- Offline
My Information
- Member Title:
- Dedicated Member
- Age:
- 24 years old
- Birthday:
- July 21, 1987
- Gender:
-
Male
- Location:
- Plymouth, Devon
- Interests:
- Web Design, JQuery, (X)HTML, CSS, Web Standards, PHP, Adobe CS4, Typography, UI Design
Contact Information
- E-mail:
- Private
- Website URL:
-
http://www.bentadiar.co.uk
- Skype:
-
ben.tadiar
Users Experience
- Experience:
- Advanced
- Area of Expertise:
- Web Designer
Latest Visitors
-
SkyteMedia 
21 Dec 2011 - 21:15 -
opegonsdion 
19 Jan 2011 - 07:51 -
andyl 
18 Jan 2011 - 23:53 -
admin-jag 
18 Jan 2011 - 07:24 -
webdesigner93 
19 Jul 2010 - 14:44 -
Ocular Harmony 
07 Mar 2010 - 22:34 -
JamesW 
07 Mar 2010 - 21:00 -
empek 
06 Mar 2010 - 05:34 -
shaunbaker 
07 Feb 2010 - 23:10 -
Sunlust 
20 Jan 2010 - 17:30
Posts I've Made
-
In Topic: Line break using php
22 November 2011 - 11:01 PM
Jock, on 19 November 2011 - 04:11 PM, said:It makes view source nicer...
echo "<ul>\n"; foreach($members as $member) { printf("\t<li>%s</li>\n", $member); } echo "</ul>";
Though I wouldn't add line feeds deliberately if the only advantage is pretty source code. It also forces PHP to interpret more escape sequences and parse variables.
As an example, a good use of newlines would be if you required your application to write log files, maybe for Exceptions thrown by the application. New lines would separate these log entries and make them easily readable. -
In Topic: Downloading a CSV File Using PHP...
22 November 2011 - 10:50 PM
Hi Gareth,
By 'log in' do you mean via FTP/SFTP or using HTTP Basic Authentication, OAuth etc? They are all very different and will require appropriate advice. -
In Topic: Can't retrieve details via. GET
22 November 2011 - 10:36 PM
Hi Matt,
I hate to rain on your parade, but there are a few comments I'd like to make about your code that could help you prevent problems in the future.
The first is the fact that you're using the out of date mysql_* functions that were superseded by the mysqli extension which has been available since PHP 5.0.0 (2004). MySQLi, or MySQL Improved, provides enhanced security in the form of prepared statements, and an object-oriented interface which results in cleaner, more maintainable code - just two of the reasons to convert. Personally I'd recommend PDO for it's portability and overall wider range of features.
The second is that you're not sanitising or validating user input. GET/POST can contain anything the user wishes - it is your responsibility to escape this data and you should NEVER rely on hoping the user does not enter a value that could potentially be used in an SQL injection. Always, always, always sanitise - it is bad system design not to. In this specific case you should be calling mysql_real_escape_string and casting the variable to the type it will be used as (I'm guessing int).
Hope this helps you,
Ben
/rant
Help




Find My Content
Display name history
Comments
BenTheDesigner has no profile comments yet. Why not say hello?