Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = "";
- $password = "";
- $hostname = "localhost";
- //connection to the database
- $dbhandle = mysql_connect($hostname, $username, $password)
- or die("Unable to connect to MySQL");
- //select a database to work with
- $selected = mysql_select_db("c9",$dbhandle)
- or die("Could not select examples");
- $status = $_REQUEST['status'];
- $uname = $_REQUEST['uname'];
- $uid = $_REQUEST['uid'];
- $email = $_REQUEST['email'];
- $pid = $_REQUEST['pid'];
- $uploaddir = "FOLDER PATH";
- $uploadfile = $uploaddir.basename($_FILES['userfile']['name']);
- if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
- $image = $_FILES['userfile']['name'];
- $success = "INSERT INTO `table`(`id`,`userid`,`name`,`image`,`status`, `email`,`pid`) VALUES ('','$uid','$uname','$image','$status','$email','$pid')";
- $true = mysql_query($success);
- $success1 = "INSERT INTO `table1`(`comment_post_ID`,`comment_author`,`comment_author_email`,`comment_content`) Values('$pid','$uname','$email','$status')";
- $true1 = mysql_query($success1);
- echo $status;
- } else {
- echo mysql_error();
- echo $image;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement