[request]for a basic website

06/11/2009 07:00 coreymills#1
just a basic website so that i can see how it all works in php and html
06/11/2009 07:13 EatMyChidori#2
[Only registered and activated users can see links. Click Here To Register...]
06/11/2009 07:18 Zeroxelli#3
If you'd like, I could probably write up some tutorials on PHP websites. Just leave me a reply and what to write, and I'd be happy to help you learn. :)
06/11/2009 07:19 coreymills#4
i just want to know how everything connects to everything
06/11/2009 07:28 Zeroxelli#5
Well, in PHP connections are simple. For example, the most basic is IRC.

PHP Code:
    $host 'irc.rizon.net';
    
$port 6667;
    
$socket socket_create(AF_INETSOCK_STREAMSOL_TCP);
    if (
socket_connect($socket$host$port))
    {
        echo 
"Connected to {$host}:{$port}\n";
        while (
$data trim(socket_read($socket128)))
        {
            echo 
"Data read: {$data}\n";
        }
    }
    else die (
'Failed to connect, check that the host IP is correct and the port is open.'); 
EDIT: And yes, I fking hate fsocket's x.x
06/11/2009 07:44 coreymills#6
wat i ment was how a registerpage would connect to mysql
06/11/2009 07:49 Zeroxelli#7
PHP Code:
    $server mysql_connect('localhost''root''test'); //'localhost' is the server, can be an IP. 'root' is the username, use whatever your is. 'test' is the password, again whatever yours is.
    
if (mysql_select_db('conqueremu')) //'conqueremu' is the database name
    
{
        
$query mysql_query('SELECT Level FROM characters WHERE Name=\'Ykage\''); // Select the value of 'Level' for the character with the in-game name of 'Ykage'
        
while ($row mysql_fetch_array($query)) // Fetch the array of results, in this case only one. So; we could use an if statement, but this is more generic.
        
{
            echo 
"Level of Ykage is {$row['Level']}\n"// Output it
        
}
    }
    else die (
mysql_error()); // We died because it's the wrong database, it doesn't exist?!! 
06/11/2009 07:51 coreymills#8
thanks that helps abit
06/11/2009 07:53 Zeroxelli#9
No problem, if you need anything else give me a shout.