PHP code examples for beginners
Hello World
<?php echo "Hello World!";
Send Mail
<?php
mail("to@exampe.com", "my mail subject", "and all mail body text comes here");
List Files in a Directory
<?php
$open_dir = opendir(".");
while( $file = readdir($open_dir) ){
echo "$file <br />";
}
Make a MySQL connection
<?php
mysql_connect("localhost", "username", "password");
mysql_select_db("your_database_name");
Bookmark/Search this post with
Tags:
Similar entries
- How to override php mail function to catch abuse / spammer
- Yahoo Mail Plus + Pop and Mozilla Thunderbird emptied my Inbox, need restore
- Backup all MySQL databases automagicly with the PHP admin script
- We can't provide service under the Gmail name in Germany
- E-Mail validation with Java and regular expressions (regex)
- My Yahoo Email Account Hacked, how can I get it back?
- What is difference between POP, IMAP and Webmail
- Check password strength / safety with PHP and Regex
- Repair all mysql databases-tables with PHP
- Drupal does not send Email on Hosteurope
- Mysql Dump import export restore
- Simple Hello World Module for Drupal 6
- Web2 style secure & flexible free php contact form with easy setup
- Replace string in big database or large text file
- Configure phpMyAdmin to login automagicly without prompted for username and password
- need help for customizing PHP-grep files search
- Url manipulation with mod_rewrite and php-catcher for beginners
- Search in text files recursively with PHP - Grep
- Filezilla and plain-text clear, unsecure password storage
- Include both php/ html files, catch & assign output to a string variable

Comments
Post new comment