Search found 38 matches

by Sander
Sat Sep 17, 2005 5:19 pm
Forum: General Discussion
Topic: Zend Studio stopped recognizing PHP files
Replies: 0
Views: 369

Zend Studio stopped recognizing PHP files

In the project list, you only see the type of files you can edit in Zend Studio. If you would have a folder with some PHP and image files, only the PHP files would show up in the project list. The 'File System', on the other hand, displays all files. Anyway, the problem is that the project list sudd...
by Sander
Fri Sep 16, 2005 4:06 pm
Forum: PHP - Code
Topic: header()
Replies: 2
Views: 409

header()

I'm getting the idea that you can do rather a lot with the header() function. Redirect, HTTP authentication, cache control and probably a lot more that I don't know anything about. I've done some searching on Google to see what more you can do with it; perhaps some of it can come in handy sometime. ...
by Sander
Thu Sep 15, 2005 4:24 pm
Forum: PHP - Code
Topic: Error handling?
Replies: 5
Views: 797

You can make your own error handler using set_error_handler.
by Sander
Wed Aug 31, 2005 1:48 pm
Forum: PHP - Code
Topic: Question regarding mysql
Replies: 2
Views: 873

Re: Question regarding mysql

Termina wrote:I have no idea how to see if a query returns null though. :/
You can do that like this:

Code: Select all

if(!mysql_num_rows($query))
That basically counts the rows returned by the query. If no user exists with that email account, no rows are returned.
by Sander
Thu Aug 25, 2005 8:24 am
Forum: PHP - Code
Topic: [SOLVED] My form has errors - any suggestions??
Replies: 26
Views: 1259

The first one is the correct query.

It comes out like that because the variable $keywordsearch contains 'unix'.
by Sander
Wed Aug 24, 2005 4:22 pm
Forum: PHP - Code
Topic: Help? Store a variable for later call?
Replies: 6
Views: 631

Just so you know, PHP also has comments: // You use them like this: // blaat You also don't have to use the <php tag around every single line. It would make your code much easier to read: <? // Actual CATEGORY SNIFFER Begin $psb_category_id = get_category($cat); // If category is parent, list it if ...
by Sander
Wed Aug 24, 2005 3:29 pm
Forum: PHP - Code
Topic: Does GetHostByName($REMOTE_ADDR) ever fail to get IP? (nt)
Replies: 13
Views: 1043

I know, but some 10 year old kid who doesn't know anything about the internet can also spam. If he sees a feedback form and tries to send a few messages with it, he hasn't got a clue about how the site knows that he already sent a message once. He just gives up and leaves the site. If you can't stop...
by Sander
Wed Aug 24, 2005 3:08 pm
Forum: PHP - Code
Topic: Does GetHostByName($REMOTE_ADDR) ever fail to get IP? (nt)
Replies: 13
Views: 1043

Heh, yeah. Still, it's the most secure way to do this. You can't rely on the IP or on cookies. What I would do is to both store the IP and put a cookie on the user's computer. If some stupid spammer does not knows about cookies, he can't do anything. If some stupid spammer doesn't knows about tracki...
by Sander
Wed Aug 24, 2005 2:58 pm
Forum: PHP - Code
Topic: Login Script Problem
Replies: 14
Views: 773

jayshields wrote:thanks for your input but as you can see in the login section, i start the session just before i assign the variables to the session array.
There's your problem, you're only starting the session in the login section :wink:
by Sander
Wed Aug 24, 2005 2:57 pm
Forum: Site News
Topic: You're not using MD5 anymore, are you?
Replies: 45
Views: 73134

Okidokie, Feyd his implementation it is :) Thanks for all the feedback guys (And, of course, thanks for Feyd for the great script :) )
by Sander
Wed Aug 24, 2005 2:44 pm
Forum: Site News
Topic: You're not using MD5 anymore, are you?
Replies: 45
Views: 73134

I actually ment more secure than "md5(md5($var));", but I guess it also counts for "md5($var);" :) However, with new md5 compromises being found daily, and with processing power growing *every* day, AND with a perfectly working sha256 implementation in PHP, and Javascript, there ...
by Sander
Wed Aug 24, 2005 2:35 pm
Forum: PHP - Code
Topic: Get the first and last id key from a query?
Replies: 5
Views: 907

Or even better, change

Code: Select all

$row = mysql_fetch_array($result);

to

Code: Select all

$row = mysql_fetch_assoc($result);
:)
by Sander
Wed Aug 24, 2005 2:34 pm
Forum: PHP - Code
Topic: Does GetHostByName($REMOTE_ADDR) ever fail to get IP? (nt)
Replies: 13
Views: 1043

You can prevent it by making the users login. Once they're logged in, you can easily identify them by their unique ID in the database.
by Sander
Wed Aug 24, 2005 2:24 pm
Forum: PHP - Code
Topic: Simple MySQL Question - How to update/insert
Replies: 22
Views: 3434

ezenu wrote:This seems to work & is better. I was thinking there might be a way to do this in 1 step, sortof like C++ STL Maps
Yup, there is a way.

Replace Into
by Sander
Wed Aug 24, 2005 2:06 pm
Forum: PHP - Code
Topic: Login Script Problem
Replies: 14
Views: 773

What the error means is that either you never started the session, or that the session was already destroyed (In any case, there isn't an active session). Are you sure you did a session_start() ? You always have to start the session, even when you only want to destroy it. Another reason could be tha...