Search found 61 matches

by jolinar
Thu Mar 22, 2007 10:09 am
Forum: Javascript
Topic: Javascript Date Selector
Replies: 6
Views: 1406

Javascript Date Selector

Quick question for the gurus here: Does anyone know how I'd go about using javascript to produce some kind of date selector? What I'm trying to do is to produce a facility to allow users to pick a day/month to arrange a service visit ( Project for a friend who's going to business as a freelance IT t...
by jolinar
Sun Mar 11, 2007 10:04 am
Forum: Miscellaneous
Topic: ASP.NET "The resource cannot be found."
Replies: 2
Views: 5759

ASP.NET "The resource cannot be found."

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Does anyo...
by jolinar
Fri Mar 09, 2007 6:51 am
Forum: PHP - Code
Topic: mysql_real_escape_string causing strange errors
Replies: 3
Views: 808

Problem's fixed now. I needed to change the escape_string function to this:

Code: Select all

function escape_string($input) {
		return mysql_real_escape_string($input);
	}
Works on my dev box and main site.
by jolinar
Thu Mar 08, 2007 9:15 am
Forum: PHP - Code
Topic: mysql_real_escape_string causing strange errors
Replies: 3
Views: 808

mysql_real_escape_string causing strange errors

Here's the problem, I'm trying to "clean" user input with mysql_real_escape_string(), for some reason, it's destroying all variables it touches. Here is a simplified version of the code I'm using: $connector = new DbConnector($dbuser,$dbpass,$dbname); foreach($_GET as &$tmp) { $tmp=$co...
by jolinar
Wed Feb 28, 2007 9:30 am
Forum: Databases
Topic: Efficient query for gallery front page
Replies: 3
Views: 811

Thanks feyd, the GROUP BY clause fixed it :D (I guess I'm still a numpty when it comes to SQL)
by jolinar
Wed Feb 28, 2007 9:07 am
Forum: Databases
Topic: Efficient query for gallery front page
Replies: 3
Views: 811

Efficient query for gallery front page

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Sorry the...
by jolinar
Wed Feb 28, 2007 8:57 am
Forum: Databases
Topic: database normalization
Replies: 10
Views: 1748

mikeq wrote:Database design is more art than science
I'd say it's a dark art more than anything else :lol:
by jolinar
Tue Feb 27, 2007 7:59 am
Forum: PHP - Code
Topic: Login Code... Will it work?
Replies: 18
Views: 3668

I stand corrected :(
by jolinar
Tue Feb 27, 2007 5:59 am
Forum: PHP - Code
Topic: Login Code... Will it work?
Replies: 18
Views: 3668

jolinar , your function is fine, but it is not enough. All data should be mysql_real_escape_string()-ed before putting it in a mysql_query(). If you have to stop and think if your check was enough, this means it's not enough. Your function is about validation , which is a part of the code logic lev...
by jolinar
Thu Feb 08, 2007 9:57 am
Forum: PHP - Code
Topic: Login Code... Will it work?
Replies: 18
Views: 3668

Looks good except why is the password just an md5() of the username? Agreed, you should use, at least, SHA1 (SHA256 if your server supports it, though this is often not the case) As for SQL injection, a simple routing that looks for "evil" input using something like regex could work. Here...
by jolinar
Wed Feb 07, 2007 7:24 pm
Forum: Databases
Topic: problem with ambiguous field names (mysql 4.1)
Replies: 2
Views: 900

Thanks :D "AKA Panama Jack"

Since it's my own project I'll rename the cols in question, preferably before the code police arrive :(
by jolinar
Wed Feb 07, 2007 4:43 pm
Forum: Databases
Topic: Is using, ORDER BY RAND() bad?
Replies: 10
Views: 1512

I'd suggest doing something along these lines:

Code: Select all

$random = rand();
$random segment = mysql_result($resultset,$random%mysql_numrows($resultset),"fieldname");
applied to all fields (or be lazy like me and create a routine to get everything from a for and bung it in an associative array)
by jolinar
Wed Feb 07, 2007 4:38 pm
Forum: Databases
Topic: problem with ambiguous field names (mysql 4.1)
Replies: 2
Views: 900

problem with ambiguous field names (mysql 4.1)

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Does anyo...
by jolinar
Tue Nov 21, 2006 9:08 am
Forum: PHP - Code
Topic: IE - Hard refresh needed to accept change in login status
Replies: 8
Views: 1782

Problem solved. It was this little piece of code:

Code: Select all

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
I tried commenting it out and it works fine. Of course I'm kinda worried about the security. I guess it's time for me to head over to the security section of the forum.
by jolinar
Tue Nov 21, 2006 8:15 am
Forum: General Discussion
Topic: What's your favourite PHP Editor?
Replies: 533
Views: 235121

PHP Designer 2005 Really good, at least good as far as I know. Agreed. I've recently started using PHP Designer (2007, kinda strange considering we're in 2006). Personally, I'm inclined to stick with the free version rather than the commercial version (since all my PHP is for my own personal use, o...