jnsc.ch

Home

Linux

MP3

Symbian

Qt et C++

PHP Anglais

ISPConfig Anglais

Intranet

Valid XHTML
Valid CSS

PHP 4 Sessions and W3c Validation

I have a site wich uses sessions, when I tried to validate it I always get this error : general entity "PHPSESSID" not defined and no default entity. I found a solution to avoid this problm. If you have access to the php.ini of the serveur you can add this line:

code:
arg_separator.output = "&"

If you don't have acess to the php.ini of your webserver you can simply add this line to the top of your php Script

code:
ini_set('arg_separator.output', '&');

Phorum 5 with PHP 4.1.2

On the Phorum homepage you can read As of Phorum 5.0, PHP 4.2.0 (or later) is required
My hosting company was only providing PHP 4.1.2 so I tried to get it to work. In a first time I had some difficulties, I alwas got this error message:

error:
Warning: settype: invalid type in /var/www/web5/html/phorum/post.php on line 89
Warning: settype: invalid type in /var/www/web5/html/phorum/post.php on line 90
Warning: settype: invalid type in /var/www/web5/html/phorum/post.php on line 91
Warning: settype: invalid type in /var/www/web5/html/phorum/post.php on line 92

I just wrote this small patch and everything, worked fine phorum-5.0.9.patch, This Patch should only be used with Phorum 5.0.9

Eclipse PDT (PHP)

When I was in school we used Eclipse for Java, and I really liked this IDE. When Eclipse PDT (Eclipse for PHP) was released I had to give it a try, so I downloaded Eclipse PDT and launched it. Nothing related with PHP showed up, so I searched on the net and didn't find the answer. But now that I have found it myself I will share it with you

If you want to use Eclipse PDT for PHP you will need java > 1.5

I still had 1.4, and this is why the PHP Part (Project, Options, etc.) didn't show up In Eclipse. If you have the same problem the workaround is simple:

Install Java 1.5 or greater

Just launch Eclipse again and then everything should work well.

MySQL v 4.0 to 5.0

I once made a dump from a MySQL v 4.0 database. The import into a v 5.0 server was not easy, this is the dump statement that worked form me

command:
mysqldump -u root -p --add-drop-table --allow-keywords --complete-insert --default-character-set=latin1 --quote-names my_db_name > /tmp/my_db.sql

What is important her is the --allow-keywords option. In old MySQL version you where allowed to usetablenames like "date" that do not work anymore if you don't use the previous option.

The --complete-insert option adds the column name.

The --default-character-set=latin1 option was added because the new server was configure as default in utf-8.

And at least the --quote-names option is straightforward.