Have you tried to create or read a file with fopen, file_get_content or file_put_content and only getting permission denied. A reason for this error message can be that the file you are about to read/write already exists and with your account as owner. A quick, and safe, fix is to change the owner and group [...]
Archive for the ‘PHP’ Category
Download direct from ftp-server with php
For a web solution I am currently involved in I had a challenge where files from a FTP-server should be downloaded from the webserver. Thanks to a solution provided by NogDog to cesarcesar @ CodingForums.org in 2007 I managed to solve this. This is the solution: First you connect to your ftp-server $connection = ftp_connect($ftp_server); [...]
PHP vs ASP.Net
Well, this isn’t really a VS-blog-post, I just had a discovery while reading up on ASP.Net (Professional ASP.Net 2.0) and I see here that PHP has a way to go when it comes to make web development more productive. Yes we have more control on our code and so on, but the .Net Framework and [...]
Rapid Application Development under Linux
There are a few ways to develop applications under/for Linux. You can write cross platform applications using MonoDevelop, Real Basic and QT (not pronounced Cute, but Q.T. – yes, sort of like E.T….). Or you can use any other language and use IDEs like Komodo, Eclipse and so on. Coming from the Windows side of [...]
Twitter and zend framework
# twitter_index.php /** * This code shall update the twitter-status when a new graphic is posted * It will be using the Zend Framework */ $path = ‘/Zend/library/’; set_include_path(get_include_path() . PATH_SEPARATOR . $path); include “Zend/Service/Twitter.php”; # include “Rest/client.php”; # Connect to the twitter-service try { $twitter = new Zend_Service_Twitter(‘username’, ‘password’); echo “that’s nice \n”; echo [...]
A way to prevent SQL-injection
A little while back I wanted to check if there was another way to prevent SQL-injection than to run the mysql_real_escape_string function and other checks. What I did was to add a user that only had read and write access to the database. The user was not allowed to delete. I ran only a few [...]
IDE/Weaver/Studio Ramblings
On the Linux platform we (web) developers have quite a lot of texteditors or IDE (Integrated Development Environment) to choose from. What I miss are tools like Visual Studio and Dreamweaver. I know that we have MonoDevelop on the Linux (Windows and Mac)-side, but this is mostly a development environment for developing applications (and ASPX-websites). [...]
Exercise – creating table using css
Today I played around with css and the display: table / table-row / table-cell settings. And it worked out quite well. The reason for playing with this was to create a table without using the table-tag. I am not religious regarding using or not using the table-tag to render the page, but some are out [...]
My bookshelf
At the moment my bookshelf (and I am now stricktly writing about books related to programming) contains: PHP Professional PHP Programming (Wrox) (first PHP book that I bought) Programming PHP (O’Reilly) Web Database Applications with PHP and mySQL (O’Reilly) Object-Oriented PHP (No Starch Press) Latest additions: Advanced PHP Programming (Developer’s Library) CodeIgniter (Wrox) Professional Search [...]


PHP-Tip: Commenting your code
This really isn’t a PHP-tip, but more like a programming tip. But since I do most of my development in PHP (and some in C#, and some on VB) I put it up as a PHP-tip. So there. This post is all about commenting. Some do it, some don’t. I tend to do it. Sometimes [...]