if (move_uploaded_file($nombreTmp, "imagenes/{$nombre}")) { //echo '<script> alert(" Exito al ingresar su imagen"); </script>'; //echo "<script> window.location='index.php'; </script>"; } } else { echo '<script> alert(" Error al ingresar la imagen"); </script>'; echo "<script> window.location='usuarios.php'; </script>"; } $fname = $_POST['first_name']; $lname = $_POST['last_name']; $email = $_POST['email']; $lugar = $_POST['lugar']; $coordenada_x = $_POST['coordenada_x']; $coordenada_y = $_POST['coordenada_y']; $imagen = $nombre; $res = $con->insert($fname, $lname, $email, $lugar, $coordenada_x, $coordenada_y, $imagen); if ($res) { ?> <script> alert('Usuario registrado con exito...'); window.location='usuarios.php' </script> <?php } else { ?> <script> alert('error en el registro de usuario...'); window.location='usuarios.php' </script> <?php }
if (isset($_POST['btn-save'])) { $VehicleID = $_POST['VehicleID']; $Model = $_POST['Model']; $YEAR = $_POST['YEAR']; $LOCATION = $_POST['LOCATION']; $Availability_type = $_POST['Availability_type']; $DailyRate = $_POST['DailyRate']; $WeeklyRate = $_POST['WeeklyRate']; $Cflag = $_POST['Cflag']; $Mflag = $_POST['Mflag']; $Vflag = $_POST['Vflag']; $Tflag = $_POST['Tflag']; $Lflag = $_POST['Lflag']; $Sflag = $_POST['Sflag']; $OwnerID = $_POST['OwnerID']; $res = $con->insert($VehicleID, $Model, $YEAR, $LOCATION, $Availability_type, $DailyRate, $WeeklyRate, $Cflag, $Mflag, $Vflag, $Tflag, $Lflag, $Sflag, $OwnerID); if ($res) { ?> <script> alert('Car has been successfully added...'); window.location='index.php' </script> <?php } else { ?> <script> alert('error adding car...'); window.location='index.php' </script> <?php }
<?php include_once 'dbconn.php'; $con = new DB_con(); // data insert code starts here. if (isset($_POST['btn-save'])) { $fname = $_POST['first_name']; $lname = $_POST['last_name']; $city = $_POST['city_name']; $res = $con->insert($fname, $lname, $city); if ($res) { ?> <script> alert('Record inserted...'); window.location='index.php' </script> <?php } else { ?> <script> alert('error inserting record...'); window.location='index.php' </script> <?php } } // data insert code ends here. ?> <!--
<?php // Controller 1 !! require __DIR__ . '/dbMySql.php'; $con = new DB_con(); require __DIR__ . '/view.php'; if (!empty($_POST['fname']) and !empty($_POST['lname']) and !empty($_POST['keywords']) and !empty($_FILES['rezume']['tmp_name'])) { if (isset($_POST['submit'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $keywords = $_POST['keywords']; $rezume = $_FILES['rezume']['name']; $con->insert($fname, $lname, $keywords, $rezume); // __Cunstruct function@ avtomat kmiana MYSQL in $target_file = __DIR__ . '/uploads/' . basename($_FILES['rezume']['name']); $uploadOk = 0; // false $fileType = pathinfo($target_file, PATHINFO_EXTENSION); if ($fileType == "txt" or $fileType == "pdf" or $fileType == "doc" or $fileType == "docx") { $uploadOk = 1; } else { echo 'Your File format it must be TXT or PDF or DOC.'; } if ($uploadOk == 1 and is_uploaded_file($_FILES["rezume"]["tmp_name"])) { move_uploaded_file($_FILES['rezume']['tmp_name'], $target_file); } else { echo 'Sorry, there was an error uploading your file.'; } } } else { $error = 'Please, set all fields !!';
<?php include_once 'dbMySql.php'; $con = new DB_con(); // data insert code starts here. if (isset($_POST['btn-save'])) { $fname = $_POST['fname']; $sname = $_POST['sname']; $gender = "M"; $email = $_POST['email']; $icu_code = $_POST['icu_code']; $icu_rating = $_POST['icu_rating']; $fide_rating = $_POST['fide_rating']; $blitz_rating = $_POST['blitz_rating']; $federation = $_POST['federation']; $res = $con->insert($email, $fname, $sname, $gender, $icu_code, $icu_rating, $fide_rating, $blitz_rating, $federation); if ($res) { ?> <script> alert('Registration Record inserted...'); window.location='reg_list.php' </script> <?php } else { ?> <script> alert('error inserting registration record...'); window.location='reg_add.php' </script> <?php }
$errorArray[$key] = "Invalid email address entered"; } else { $email = filter_var($email, FILTER_SANITIZE_EMAIL); } break; } } /*Check if there are no errors If no errors then.... Connect to database with the $con object. invoke the insert() function of the DB_class insert data... create session variables or get the primary key */ if ($hasError !== true) { if ($con->insert($name, $email, $country, $dob)) { $sent = true; $_SESSION["name"] = $name; $_SESSION["email"] = $email; $_SESSION["country"] = $country; $_SESSION["dob"] = $dob; /*Sent user confirmation e-mail*/ $message = "Thank you for signing up."; $to = $email; $subject = "Message from signup form"; $msg = "Name: {$name}<br />Email:<br />Message: {$message}"; $headers = "MIME-Version 1.0 \r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1 \r\n"; $headers .= "From: Sign-up team"; $mailSent = mail($to, $subject, $msg, $headers); if ($mailSent) {