Exemplo n.º 1
0
<?php

require "database.php";
$names = ["Acadia", "Arches", "Badlands", "Big Bend", "Biscayne", "Bryce Canyon", "Carlsbad"];
$location = ["Maine", "Utah", "South Dakota", "Texas", "Florida", "Utah", "New Mexico"];
$date = ["1919-02-26", "1929-04-12", "1978-11-10", "1944-06-12", "1980-06-28", "1928-02-25", "1930-05-14"];
$area = [47389.67, 76518.98, 242755.94, 801163.21, 172924.07, 35835.08, 46766.45];
$dbc = new Mysql("parks_db", "national_parks", 2);
print_r($names);
$dbc->deleteTableInfo();
$dbc->newTable();
for ($i = 0; $i < count($names); $i++) {
    $dbc->openAndAdd($names[$i], $location[$i], $date[$i], $area[$i]);
    $dbc->reallyAdd("name", "location", "date_established", "area_in_acres");
}
Exemplo n.º 2
0
    $array["textbody"] = htmlspecialchars($_POST["textbody"]);
    $array["image"] = $img;
    return $array;
}
$jsonarray = jsonArray($imgFile);
print_r($jsonarray);
$mysql = new Mysql();
$json = new Json("test");
if ($securimage->check($_POST['captcha_code']) == false) {
    echo "Ding dong, you're wrong!";
    echo "Go <a href='javascript:history.go(-1)'>back</a> and try again.";
    exit;
} else {
    move_uploaded_file($_FILES["imgupload"]["tmp_name"], $imgFile);
    $mysql->openAndAdd($jsonarray["title"], $jsonarray["posted"], $jsonarray["textbody"], $jsonarray["image"]);
    $mysql->reallyAdd();
    $awesome = true;
}
if ($awesome) {
    echo "You did it!";
    $uploadsuccess = true;
} else {
    echo "OOPS. There was an error... (._.')";
}
if ($uploadsuccess == true) {
    //	header("Location: /testblog.php");
    echo "success";
}
?>
<!DOCTYPE html>
<html>
Exemplo n.º 3
0
<?php

require_once "databaseinsert.php";
$dbc = new Mysql("parks_db", "national_parks");
$dbc->addStuff(htmlspecialchars($_POST["parkname"]), htmlspecialchars($_POST["state"]), htmlspecialchars($_POST["established"]), htmlspecialchars($_POST["size"]), htmlspecialchars($_POST["description"]));
$dbc->reallyAdd("name", "location", "date_established", "area_in_acres", "description", $_POST["id"]);
header("Location: /national_parks.php?park=" . $_POST['id']);