require_once('mysql.php'); $connection = mysql_connect($hostname_mysql,$username_mysql,$password_mysql) or die(mysql_error()); mysql_select_db($database_mysql, $connection) or die(mysql_error()); $title = $_POST['titleTF']; $entry = $_POST['entryTF']; $author = $_POST['authorTF']; $picname = "pictures/".$_FILES[picTF][name]; if ($picname !== "pictures/") { { @copy($_FILES[picTF][tmp_name], "c:/Apache2/htdocs/wiki/pictures/".$_FILES[picTF][name]) or die("Couldn't copy the file."); $sql = ("INSERT INTO tblWiki (title,pic,entry,author) VALUES ( '$title', '$picname', '$entry', '$author' )"); } } else { $sql = ("INSERT INTO tblWiki (title,entry,author) VALUES ( '$title', '$entry', '$author' )"); } $result = @mysql_query($sql, $connection); if($result) { ?>
Home | View All Entries } ?>