Dimava
Thu 16th May '02, 9:10pm
<html>
<head>
<title>News Submission</title>
</head>
<?php include("../templates/header.htm"); ?>
<?
require("config.php");
if ( $date == "") {
// input form
include("templates/news_input.php");
}
if ( $date != "") {
// processing unit
$link = mysql_pconnect( "localhost", $user, $pass );
mysql_select_db( $db, $link );
function uploadProg($filename1,$filename1_name){
$destination="../images/newsimages";
copy($filename1,$destination."/".$filename1_name);
include("templates/uploaded.php");
}
function main(){
}
switch ($action) {
case "uploadProg":
if ($filename1=="none") {
echo("<h1>No File Selected....</h1>");
break;
}
uploadProg($filename1,$filename1_name);
break;
default:
main();
break;
}
$image = ("images/newsimages/".$filename1_name);
$query = "INSERT INTO 'news' ( 'id', 'name', 'date', 'username', 'description', 'source', 'image' ) values( '', $name, $date, $username, $description, $source, $image )";
mysql_query($query);
include("templates/news_added.php");
}
include("../templates/footer.htm");
?>
</html>
I get the picture to upload, but I can't get it to save the stuff into the database
thanks
Dimava
<head>
<title>News Submission</title>
</head>
<?php include("../templates/header.htm"); ?>
<?
require("config.php");
if ( $date == "") {
// input form
include("templates/news_input.php");
}
if ( $date != "") {
// processing unit
$link = mysql_pconnect( "localhost", $user, $pass );
mysql_select_db( $db, $link );
function uploadProg($filename1,$filename1_name){
$destination="../images/newsimages";
copy($filename1,$destination."/".$filename1_name);
include("templates/uploaded.php");
}
function main(){
}
switch ($action) {
case "uploadProg":
if ($filename1=="none") {
echo("<h1>No File Selected....</h1>");
break;
}
uploadProg($filename1,$filename1_name);
break;
default:
main();
break;
}
$image = ("images/newsimages/".$filename1_name);
$query = "INSERT INTO 'news' ( 'id', 'name', 'date', 'username', 'description', 'source', 'image' ) values( '', $name, $date, $username, $description, $source, $image )";
mysql_query($query);
include("templates/news_added.php");
}
include("../templates/footer.htm");
?>
</html>
I get the picture to upload, but I can't get it to save the stuff into the database
thanks
Dimava