
Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Uh... why don't you do if ($result = mysql_query("SELECT COUNT(*) FROM signup WHERE username = '" . mysql_real_escape_string($_POST['username']) . "'")) { $res = mysql_fetch_array($result); $ok = (bool) $res[0]; } else { $ok = false; } ? Instead of linearly searching through all rows? Of course you'll need an index on the username field.
-
Are you referring to Zune HD? My understanding is its browser is based on IE 7 (but I could be wrong here). Seems like it's using something called Mobile IE6, which, as far as I can tell, does not follow the version numbers of the normal IE.
-
Likely you're not the server admin. Contact your host.
-
No, because that would also block 208.130.63.201, which is not part of that interval. Surely treating the IP address as a single unsigned integer (like it already is) would be easier. By the way, it's called an octet, not a quadrant.
-
The Zune Something is using IE6 as its rendering engine...
-
I don't quite understand your problem. Could you elaborate a bit or perhaps show some (pseudo)code?
-
You need to remember that an IP address is ONE unsigned integer, not four. The dotted representation is only for humans, not for computers. Represented as an unsigned integer in base 10, the IP address of phpfreaks.com (66.97.171.5) is: 1113697029 So imagine we want to ban 66.0.0.0/8 we are blocking the range 1107296256 (66.0.0.0) to 1124073471 (66.255.255.255). It is clear that 1107296256 <= 1113697029 <= 1124073471. Thus the PHP Freaks IP address is within the range and is banned. Assuming you have the four octets in variables $oc1, $oc2, $oc3, $oc4, the numeric representation of the IP address is given by: In case you're wondering, assuming $on are the four octets of a dotted IP address, the numeric representation is given by: $ip = ($o1 << 24) + ($o2 << 16) + ($o3 << + $o4;
-
I believe they are just sample IP addresses, ignace
-
If you want to block an IP address interval, just do like this (we'll assume the user IP address is in $userIpAddress): $lowerBound = '100.111.222.333'; $upperBound = '200.111.222.333'; $userIpAddressInt = ip2long($userIpAddress); if (ip2long($lowerBound) >= $userIpAddressInt && ip2long($upperBound) <= $userIpAddressInt) { echo 'go away'; }
-
Hence the reason why you would just outline the full ownership terms in the contract. No misunderstandings.
-
I don't think there is much I can show. You setup an SVN (or git, mercurial, CVS, etc.) repository. You commit all changes there. On the production server you do a checkout/update or an export of the repository. If you have experience with version control software you'll know what I mean, otherwise you probably won't. Even if you don't want to use this approach for deployment, I would recommending using some sort of version control regardless.
-
In fact, this is the footer on PHP Freaks: <div id="footer"> <p id="links">Designed by and developed by <a href="http://www.multimedia-technologies.com">Multimedia Technologies</a> and <a href="http://degeberg.com">Daniel Egeberg</a></p> <p>Copyright © PHP Freaks | <a href="http://www.thewebfreaks.com">The Web Freaks</a></p> </div> 81.43% of my visits come from phpfreaks.com. Then again, my website is shit, so there is not really anything to see there.
-
You mean kind of like on Google Books?
-
I think most people are willing to do that if you ask. Probably not Fortune 500 businesses, but small clients.
-
You could use SCP or SFTP, both of which are much more secure. Or you could store your files in an SVN repository and do an SVN export/checkout on the server via CLI (my preferred method; makes it much easier).
-
People are still using FTP these days?
-
Locked as duplicate/repeat topic.
-
Not really. All applications I develop I still maintain 100% ownership of the source code. The client is effectively purchasing a licence to use it. If you were to hand over the rights to the source code then your client could have the right to prevent you using that code in any other project you work on. Just like buying a copy of microsoft office. You have the licence to install and use the product but microsoft still owns the rights to the source code preventing you making modifications if it were available. There is a difference between buying a mass-distributed product that you can buy in a retail store and hiring a team of developers to write an entirely new product from scratch. I'll still hold on to my statement that you'll have to specify in the contract if you wish to retain partial of full ownership as a developer/designer. Note however, that the copyright of course only applies to the work as a whole, not parts of it. For instance, I'm reading a book right now, and there is a sentence that says "Suppose now that A and B are finite subsets of a universal set U." That sentence cannot be copyrighted. I could formulate that sentence entirely independently of that book, but it's highly unlikely that I would write the same book, or even a chapter in the book independently. Therefore, the "your client could have the right to prevent you using that code in any other project you work on" argument doesn't hold. He would prevent you from reusing the project in its entirety (and reasonably so, IMO), but not individual components that are too generic to be copyrighted anyway. Selling a license to a commercial product and selling custom development as a service are two entirely different things. No, of course not. You cannot reassign ownership of something you do not own. Nor can you sell something you do not own. I'm exclusively talking about code you specifically wrote for the client, or artwork you created for the client.
-
Are you sure about that? If I'm paying someone to create something for me, I think it's reasonable to expect that full ownership will be transferred too me unless otherwise stated in a contract. If I pay someone to build me a house, I expect that I'll actually own the house. I don't see why it's different with a website. Also, if you're at work and you write a piece of software. Obviously you'll not retain ownership of what you wrote. You did it on company time and they paid you to do it. As far as I'm concerned, it's not different just because you're a freelancer and isn't physically in the client's house (or whatever) doing it. If you want to retain partial or full ownership of things you did for a client you should specify it in the contract.
-
Perhaps check out this tutorial: http://www.phpfreaks.com/tutorial/working-with-checkboxes-and-a-database
-
Change session.save_path
-
I can come over and wave my magic wand if you wish. It usually works. No, seriously, what are you trying to do? How can we make it work if we don't know what it's supposed to do?
-
The path that PHP is configured to save sessions in does either not exist or is not writable/readable by the webserver.
-
Maybe a better place to start would be to familiarize yourself with how RSS feeds are built, the tag names that are used etc.?
-
You'd probably want to do: UPDATE users SET style = $styleId WHERE user_id = $userId Assuming of course that the user's ID is called user_id in the table and that you have two variables holding integers called $styleId and $userId.