Tutoriel PHP
note
http://www.siteduzero.com/tutoriel-3-14649-proteger-un-dossier-avec-un-htaccess.html

Setup

Instal

Avec un apache fonctionnel
yum install php-cli install php
yum install php-mysql
yum install php-gd
Reference fedora
créer une page sous /var/www/html appelé info.php
Vi info.php
<??php phpinfo(); ?>?
Vous devrié voir a l'url correpondante les info sur votre versiosn de php

php in .html

Truc
vi /etc/httpd/conf/httpd.conf
# # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All .htaccess Truc pour pouvoir nomer les fichier php en html For web servers using PHP as apache module: Celui qui permet a apache de fonctionner avec php+php-cli AddType application/x-httpd-php .html .htm verifier avec ex1.html For web servers running PHP as CGI: AddHandler application/x-httpd-php .html .htm In case you wish to do the ASP mimick: For PHP as module: AddType application/x-httpd-php .asp OR For PHP as CGI: AddHandler application/x-httpd-php .asp

Step1 first code

CodeResult
<?php
echo "Hello from php<br>";
$txt="Hello World!<br>";
echo $txt
$x=16;
echo $x;
echo $txt."var:".$x."<br>";
echo "longuer de la string:".strlen("Hello world!");
echo "position de world:".strpos("Hello world!","world");
?>
Hello from php
Hello World!
16Hello World!
var:16
longuer de la string:12position de world:6

Step2 mysql

!!attention on ne peux pas crer de base de donnée chez free
il y'en a une par default du nom de vrotre utilistauer
CodeResult
<?php
$host="sql.free.fr"; 
$user="xxxx";
$password="xxxx";
echo "connection
"; $con = mysql_connect($host,$user, $password)or die(mysql_error());; if ($con){ echo "Connection: pass
"; } ?>

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'gadille'@'172.20.245.54' (using password: YES) in /mnt/129/sdb/8/f/gadille/doc/webLanguage/php/php.php on line 170
Access denied for user 'gadille'@'172.20.245.54' (using password: YES)