Skip navigation.

Hello World

Artemhp personal blog

Posts tagged with "webmaster"

First PHP site

, , ,

So... I have been working on my first web-site on php for three weeks. But work is not over, I hope that finish will be on this Sunday and I'll show you it :smile: But now It's look like CMS.. I meen it is CMS, couse I can power any html template with my program... Now I'm making web-site only for my pleasure, It's like hobby. But maybe some time I will get any money for this)) but I don't thinks so - my future specialisation will be chemical enginering. Some code from index page:

<?php include ('config.php'); $result = mysql_query("SELECT id, title, link, editor, cont FROM about WHERE link='history'", $db); $myrow = mysql_fetch_array($result); if (!count($_GET)){ /*Рандомно виводить фан-фіки*/ $numbers = array('news','fanfics/1','fanfics/2','fanfics/3'); srand((float)microtime() * 1000000); shuffle($numbers); $file = $numbers[0]; $_GET['hp'] = 'news'; } $pages = array_keys($_GET); if($pages[0]!="hp"){ $subdir = $pages[0]."/"; $file = 'submenu'; }else{ $subdir=""; if(!isset($file)) $file = 'submenu'; } if (isset($_GET['hp'])) { $page=$_GET['hp']; if (isset($page)) { include ('blocks/'.$file.'.php'); echo "

"; /*Виводимо контекст*/ $result = mysql_query("SELECT cont FROM $page WHERE link='index'", $db); $myrow = mysql_fetch_array($result); echo $myrow['cont']; echo "
"; } } if (!isset($_GET['hp'])) { include ('blocks/'.$file.'.php'); echo "
"; $page = array_keys($_GET); $page2 = array_values($_GET); /*Виводимо контекст*/ $result = mysql_query("SELECT * FROM {$page[0]} WHERE link='{$page2[0]}'", $db); $myrow = mysql_fetch_array($result); echo $myrow['cont']; echo "
"; } ?>

With ukrainian comments ))