</form> <!-- JavaScript at the bottom for fast page loading --> <script src="js/jquery-1.9.1.min.js"></script> </body> </html> <?php if (isset($_POST['submit'])) { 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); $city = $_REQUEST["city"]; $email = $_REQUEST["email"]; $name = $_REQUEST["name"]; $slug = str_replace(' ', '.', $name); $state = $_REQUEST["state"]; $zip = $_REQUEST["zip-code"]; saveProfile($image, $city, $email, $name, $slug, $state, $zip); } } function saveProfile($image, $city, $email, $name, $slug, $state, $zip) { $result = mysql_query("INSERT INTO data (`image`,`city`,`email`,`name`,`slug`,`state`,`zip`) VALUES ('{$image}','{$city}','{$email}','{$name}','{$slug}','{$state}','{$zip}')"); if ($result) { echo "<br/>Image uploaded."; } else { echo "<br/>Image not uploaded."; } }
activate(); break; case 'reset_password': resetPassword(); break; case 'change_password': changePassword(); break; case 'add_user': addUser(); break; case 'get_profile': getProfile(); break; case 'save_profile': saveProfile(); break; case 'get_settings': getSettings(); break; case 'save_settings': saveSettings(); break; case 'get_current_event': return Events::getCurrentEvent(true); break; case 'new': newCalendarItem(); break; case 'upload': upload();
if (isset($_POST['update'])) { $name = addslashes(htmlentities(trim($_POST['name']))); $inst = addslashes(htmlentities(trim($_POST['institute']))); $gender = addslashes(htmlentities(trim($_POST['gender']))); $prof = addslashes(htmlentities(trim($_POST['prof']))); $accommodation = addslashes(htmlentities(trim($_POST['accom']))); $address = addslashes(htmlentities($_POST['address'])); $user_id = getAccountid($_SESSION['user']); if ($name == "") { $msg = "Please Enter Your Full Name.<br/>"; } if ($inst == 0) { $msg .= "Select your institution. <br/>"; } else { if ($name != "" && $inst != 0) { saveProfile($user_id, $name, $inst, $prof, $gender, $accommodation, $address); $success = "Your information is successfully updated !!"; } } } ?> <div id="main"> <div id="" style="width:540px; margin:20px auto; padding-top:10px;"> <!-- Box --> <div class="box"> <!-- Box Head --> <div class="box-head"> <h2 class="left">Your Personal Details </h2> </div> <!-- End Box Head -->