Yes, W3Schools is good.
Get yourself a host, or use WAMP on your laptop / desktop to test with PHP functionality. Use
PHP.NET to search for different functions and learn how arrays be very useful.
Just for fun, I will do a little coding here.
<?php
// This is a comment
/* This is a long tail comment
You can explain as much as you want about your code
And it will not be rendered by the PHP Pre Processor
Just make sure you end it ! */
/* Below Is A Little Script To Welcome New Users To WMS */
/*
Note: I have not included connection to db, this is a very simple procedure that can be learned at W3Schools. */
// Define welcome message
$welcome_message = "Welcome To Webmater Sun";
// Get IP From User
$ip = $_SERVER['REMOTE_ADDR'];
// Set timestamp
$time = time();
// Check if ip exists in db
$selectIp = mysql_query("SELECT * FROM ips WHERE ip='$ip'");
// Count how many results are returned
$count = mysql_num_rows($selectIp);
// If no rows are returned, enter ip into db and echo message
if($count == "0") {
// Insert IP into db
$insertIP = mysql_query("INSERT INTO ips (ip, added) VALUES ('$ip', '$time')")
// Echo message, notify user
echo $welcome_message;
// IP already exists, no need to welcome
} else {
// Do Nothing
// However, you could add a count and +1 to every visit from IP
}
?>
Well I had my fun for now!
Cheers!
Inquestor