<body> <form method="post" enctype="multipart/form-data"> <br/> <input type="file" name="image" /> <br/><br/> <input type="submit" name="sumit" value="Upload" /> </form> <?php if (isset($_POST['sumit'])) { if (getimagesize($_FILES['image']['tmp_name']) == FALSE) { echo "Please select an image."; } else { $image = addslashes($_FILES['image']['tmp_name']); $image = file_get_contents($image); $image = base64_encode($image); saveimage($image); } } displayimage(); function saveimage($image) { $con = mysqli_connect("localhost", "root", ""); mysqli_select_db($con, "db_statistics"); $qry = "insert into question_image (ImageType,ImageData) values ('png','{$image}')"; $result = mysqli_query($con, $qry); if ($result) { echo "<br/>Image uploaded."; } else { echo "<br/>Image not uploaded."; } }
<input type="file" name="image" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> <div id="chatlog"> </div> <?php if (isset($_POST['submit'])) { if (getimagesize($_FILES["image"]["tmp_name"]) == false) { echo "Please select an image"; } else { $image = addslashes($_FILES['image']['tmp_name']); $name = addslashes($_FILES['image']['name']); $image = file_get_contents($image); $image = base64_encode($image); saveimage($name, $image); } } //displayimage(); function saveimage($name, $image) { $result = mysql_query("insert into images (name,image) values ('{$name}','{$image}')"); } ?> </div> </div> </div> </div> </body>
<input type="file" name="images" > <br /> <br /> <input type="submit" value="upload" name="submit"> </form> <?php if (isset($_POST['submit'])) { if ($_FILES['images']['tmp_name'] == FALSE) { echo "UPload a image first"; } else { $file = $_FILES['images']['tmp_name']; $image = addslashes(file_get_contents($_FILES['images']['tmp_name'])); $image_name = addslashes($_FILES['images']['name']); move_uploaded_file($_FILES["images"]["tmp_name"], "photos/" . $_FILES["images"]["name"]); $location = "photos/" . $_FILES["images"]["name"]; saveimage($location, $image_name); } } RetriveImage(); function saveimage($location, $name) { include 'config.php'; $query = "insert into `images` (`Name`,`images_path`) values ('{$name}','{$location}')"; $result = mysql_query($query, $con); if ($result) { echo "file uploaded"; } else { echo "file not uploaded"; } mysql_close($con); }
echo '</div>' . "\n"; } function snyggve_get_latest() { $query = 'SELECT id, title FROM snyggve ORDER by ID DESC LIMIT 12'; $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__)); while ($data = mysql_fetch_assoc($result)) { $items[] = $data; } return $items; } if ($_GET['action'] == 'upload' && login_checklogin()) { $identifier = displace_image(); saveform($identifier); } elseif ($_GET['action'] == 'save' && login_checklogin()) { $id = saveimage(); jscript_location('?action=view_image&image_id=' . $id); } elseif ($_GET['action'] == 'view_image') { $user = view_image($_GET['image_id']); if (!view_album($user)) { echo '<h2>Senast uppladdat till Snyggve</h2>' . "\n"; snyggve_list_items(snyggve_get_latest()); } if (login_checklogin()) { uploadform(); } } elseif ($_GET['action'] == 'view_user' && is_numeric($_GET['user_id'])) { snyggve_intro(); view_album($_GET['user_id'], 'fulhack'); if (login_checklogin()) { uploadform();
<!--input class=" modal-action modal-close waves-effect waves-green btn-flat" type="submit" name="upload" value="Upload" onclick="upload()"--> <button class=" modal-action modal-close waves-effect waves-green btn-flat" type="submit" name="upload" onclick="upload()">Upload</button> <a href="#" class=" modal-action modal-close waves-effect waves-green btn-flat">Cancel</a> </div> </form> </div> <?php if (isset($_POST['upload'])) { if (!getimagesize($_FILES['image']['tmp_name']) == FALSE) { $image = addslashes($_FILES['image']['tmp_name']); $name = addslashes($_FILES['image']['name']); $image = file_get_contents($image); $image = base64_encode($image); $data = saveimage($name, $image, $id); } } function saveimage($photoname, $image, $id) { $db = new PDO('mysql:host=localhost;dbname=spoarts', "root", ""); $sql = "UPDATE clients SET photoName = ?, photo = ? WHERE UserID = ?"; $cmd = $db->prepare($sql); $cmd->execute(array($photoname, $image, $id)); $db = null; getimage($id); return "Image uploaded"; } function getimage($id) { $db = new PDO('mysql:host=localhost;dbname=spoarts', "root", "");
<div class="panel-body"> <form enctype="multipart/form-data" action="home.php" method="post" > <div class="form-group"> <?php if (!$crow[0]) { if ($_SESSION['SESS_GENDER'] != 'Male' && !$_SESSION['SESS_PICTURE']) { $url = 'ppicdeff'; } else { $url = 'ppicdefm'; } echo '<img class="img-thumbnail" height="100%" width="100%" src="$url.jpg"> '; $dimage = "{$url}.jpg"; $name = $url . '.jpg'; $dimage = file_get_contents($dimage); $dimage = base64_encode($dimage); saveimage($name, $dimage); } else { function displayimage() { $usern = $_SESSION['SESS_USERNAME']; $qry9 = "select picture from member WHERE username='******' "; $result9 = mysql_query($qry9); $row = mysql_fetch_row($result9); echo '<img class="img-thumbnail" height="100%" width="100%" src="data:image;base64,' . $row[0] . '"> '; } displayimage(); } ?> </div>
<?php session_start(); include 'travel_db_connect.php'; if (isset($_POST['sumit'])) { if (getimagesize($_FILES['image']['tmp_name']) == FALSE) { echo "Please Select An Image!"; } else { $image = addslashes($_FILES['image']['tmp_name']); $name = addslashes($_FILES['image']['name']); $email = $_SESSION['email']; $image = file_get_contents($image); $image = base64_encode($image); saveimage($email, $image); } } function saveimage($email, $image) { $qry = "UPDATE info SET image= '{$image}' WHERE email='{$email}'"; $result = mysql_query($qry); if ($result) { header("Location:countries.php"); } else { header("Location:photo_upload.php?msg=2"); } } ?>
if (isset($_POST['sumit'])) { if (getimagesize($_FILES['image']['tmp_name']) == FALSE) { echo "Please select a valid image."; } else { $Movie_Name = $_POST['Movie_Name']; $Singer_Name = $_POST['Singer_Name']; $Music_Dir_Name = $_POST['Music_Dir_Name']; $Hero_Name = $_POST['Hero_Name']; $Year_Released = $_POST['Year_Released']; $Language = $_POST['Language']; $Upload_song = $_POST['Upload_song']; $image = addslashes($_FILES['image']['tmp_name']); $name = addslashes($_FILES['image']['name']); $image = file_get_contents($image); $image = base64_encode($image); saveimage($Movie_Name, $Singer_Name, $Music_Dir_Name, $Hero_Name, $Year_Released, $Language, $Upload_song, $name, $image); //saveimage($name,$image); } } //displayimage(); function saveimage($FirstName, $Singer_Name, $Music_Dir_Name, $Hero_Name, $Year_Released, $Language, $Upload_song, $name, $image) { $con = @mysql_connect("localhost", "u372998677_stud", "password"); mysql_select_db("u372998677_stud", $con); $qry = "insert into Song_upload (Movie_Name,Singer_Name,Music_Dir_Name,Hero_Name,Year_Released,Language,Upload_song,Image_Name,Image) values ('{$FirstName}','{$Singer_Name}','{$Music_Dir_Name}','{$Hero_Name}','{$Year_Released}','{$Language}','{$Upload_song}','{$name}','{$image}')"; //$qry="insert into images (name,image) values ('$name','$image')"; $result = mysql_query($qry, $con); if ($result) { header('Location: http://www.riteshhota.16mb.com'); //echo "<br/>Image uploaded."; } else {
if (getimagesize($_FILES['image']['tmp_name']) == FALSE) { echo "Please select a valid image."; } else { $Title = $_POST['Title']; //$Movie_Name=$_POST['Movie_Name']; //$Singer_Name=$_POST['Singer_Name']; //$Music_Dir_Name=$_POST['Music_Dir_Name']; //$Hero_Name=$_POST['Hero_Name']; //$Year_Released=$_POST['Year_Released']; //$Language=$_POST['Language']; //$Upload_song=$_POST['Upload_song']; $image = addslashes($_FILES['image']['tmp_name']); $name = addslashes($_FILES['image']['name']); $image = file_get_contents($image); $image = base64_encode($image); saveimage($Title, $name, $image); //saveimage($name,$image); } } //displayimage(); function saveimage($Title, $name, $image) { $con = @mysql_connect("localhost", "u372998677_stud", "password"); mysql_select_db("u372998677_stud", $con); $qry = "insert into Slideshow (Title,Image_Name,Image) values ('{$Title}','{$name}','{$image}')"; //$qry="insert into images (name,image) values ('$name','$image')"; $result = mysql_query($qry, $con); if ($result) { header('Location: http://www.riteshhota.16mb.com'); //echo "<br/>Image uploaded."; } else {
} imagepng($tmp, $outtmpdir . $mapid . ".png"); imagecolordeallocate($tmp, $cbg); imagecolordeallocate($tmp, $cfg); imagedestroy($tmp); echo "."; } } //imagepng($mapfg, $mapid . "_fg.png"); //imagejpeg($map, $mapid . ".jpg"); //imagepng($map, $mapid . ".png"); imagecolortransparent($mapfg, imagecolorat($mapfg, imagesx($mapfg) - 1, imagesy($mapfg) - 1)); imagecopymerge($map, $mapfg, 0, 0, 0, 0, imagesx($mapfg), imagesy($mapfg), 100); imagedestroy($mapfg); saveimage($map, $mapid . ".jpg", true); if (isset($wmo[$zid])) { foreach ($wmo[$zid] as &$row) { $zonemap = imagecreatetruecolor(1024, 768); imagecopy($zonemap, $map, 0, 0, 0, 0, imagesx($map), imagesy($map)); imagecopy($zonemap, $row["maskimage"], $row["left"], $row["top"], 0, 0, imagesx($row["maskimage"]), imagesy($row["maskimage"])); saveimage($zonemap, $row["areaid"] . ".jpg", false); imagedestroy($zonemap); } } imagedestroy($map); status("done (" . intval($count * 100 / count($dbc)) . "%)\n"); } } ?> </pre>
function updateFacultyProfile() { if ($_POST) { if (isset($_POST[fpug]) && isset($_POST[fppg]) && isset($_POST[fpphd]) && isset($_POST[fptexp]) && isset($_POST[fpiexp]) && isset($_POST[fppaper_pub_nat]) && isset($_POST[fppaper_pub_int]) && isset($_POST[fppaper_presen_nat]) && isset($_POST[fppaper_pub_int]) && isset($_POST[fpphd_guide_proj]) && isset($_POST[fpmaster_guide_proj]) && isset($_POST[fpbooks_ipr]) && isset($_POST[fpprof_member]) && isset($_POST[fpconsultancy]) && isset($_POST[fpawards]) && isset($_POST[fpgrants]) && isset($_POST[fpprof_inter])) { if (isset($_POST[photocheck])) { $id = saveimage($_SESSION[fac_id]); queryMysql("Update FacultyProfile set image_id='" . $id . "' where fac_id='" . $_SESSION[fac_id] . "'"); } $query = "UPDATE FacultyProfile SET ug='" . sanitizeString($_POST[fpug]) . "'," . " `pg`='" . sanitizeString($_POST[fppg]) . "'," . " `phd`='" . sanitizeString($_POST[fpphd]) . "'," . " `exp_teach`='" . sanitizeString($_POST[fptexp]) . "'," . " `exp_ind`='" . sanitizeString($_POST[fpiexp]) . "'," . " `paper_national_pub`='" . sanitizeString($_POST[fppaper_pub_nat]) . "'," . " `paper_international_pub`='" . sanitizeString($_POST[fppaper_pub_int]) . "'," . " `paper_national_presen`='" . sanitizeString($_POST[fppaper_presen_nat]) . "'," . " `paper_international_presen`='" . sanitizeString($_POST[fppaper_presen_int]) . "'," . " `proj_guide_phd`='" . sanitizeString($_POST[fpphd_guide_proj]) . "'," . " `proj_guide_master`='" . sanitizeString($_POST[fpmaster_guide_proj]) . "'," . " `book_ipr_patent`='" . sanitizeString($_POST[fpbooks_ipr]) . "'," . " `prof_member`='" . sanitizeString($_POST[fpprof_member]) . "'," . " `consultancy`='" . sanitizeString($_POST[fpconsultancy]) . "'," . " `awards`='" . sanitizeString($_POST[fpawards]) . "'," . " `grants`='" . sanitizeString($_POST[fpgrants]) . "'," . " `prof_interaction`='" . sanitizeString($_POST[fpprof_inter]) . "' WHERE `fac_id`='" . $_SESSION[fac_id] . "'"; //echo '<br>'.$query; queryMysql($query); echo '<br><center>' . '<div class="success">' . 'Profile Successfully Updated</div></center><br>'; } } }