![]() |
Tutoriel PHP | ![]() |
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
| Code | Result |
|---|---|
<?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 |
| Code | Result |
|---|---|
<?php $host="sql.free.fr"; $user="xxxx"; $password="xxxx"; echo "connection |
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) |