Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $link = mysql_connect($host, $username, $password);
- if (!$link) {die('Could not connect: ' . mysql_error());}
- mysql_select_db ($database);
- $title=$_POST['title'];
- $wlink=$_POST['wlink'];
- $description=$_POST['description'];
- $month=$_POST['month'];
- $year=$_POST['year'];
- $category=$_POST['category'];
- if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) {
- $tmpName = $_FILES['image']['tmp_name'];
- $fp = fopen($tmpName, 'r');
- $data = fread($fp, filesize($tmpName));
- fclose($fp);
- $query = "INSERT INTO rss ";
- $query .= "VALUES ('','$title','$category','$month/$year','$description','$wlink','`')";
- $results = mysql_query($query, $link);
- # (image) in .= before VALUES
- print "Thank you, your file has been uploaded.";
- mysql_close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement