This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('../_includes/connect.php'); | |
//should uploading the file be dependent on a successful insert? or vice-versa? | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
//get posted form data | |
$userID = isset($_REQUEST['userID']) ? $_REQUEST['userID'] : '1'; | |
$title = isset($_REQUEST['title']) ? $_REQUEST['title'] : 'not_set'; | |
$src = isset($_FILES['fileInput']) ? $_FILES['fileInput']['name'] : 'not_set'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//upload.php | |
// *** chmod of 'uploads' folder to 777 *** | |
//create an array for the results | |
$responseArray = [ "file" => "upload.php" ]; | |
if (isset($_FILES['upload_file'])) { | |
if(move_uploaded_file($_FILES['upload_file']['tmp_name'], "../deleteMe/" . $_FILES['upload_file']['name'])){ | |
//echo $_FILES['upload_file']['name']. " OK"; | |
$responseArray["response"] = "success"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'mysqli_connection.php'; | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
//define table | |
$tbl = "photos"; | |
$joinsTbl = "joins"; | |
$catsTbl = "categories"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/upload.php | |
echo("this is upload.php"); | |
//let's get the file info and upload it | |
if (isset($_FILES['fileInput'])) { | |
echo(', got a file!!' . $_FILES['fileInput']['name']); | |
if(move_uploaded_file($_FILES['fileInput']['tmp_name'], "../uploads/" . $_FILES['fileInput']['name'])){ | |
echo $_FILES['fileInput']['name']. " OK"; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
move_uploaded_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//upload.php | |
// *** chmod of 'uploads' to 777 *** | |
if (isset($_FILES['upload_file'])) { | |
if(move_uploaded_file($_FILES['upload_file']['tmp_name'], "../uploads/" . $_FILES['upload_file']['name'])){ | |
echo $_FILES['upload_file']['name']. " OK"; | |
} else { | |
echo $_FILES['upload_file']['name']. " KO"; | |
} | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/serialize_data.php | |
require_once '../_includes/connect.php'; | |
//turn off error reporting for production | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
//create an array for JSON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../../_includes/connect.php'; | |
header('Content-type: application/json; charset=utf-8'); | |
//define table | |
$tbl = "users";//change table name as required | |
//write query | |
$query = "SELECT $tbl.userID, $tbl.userName, $tbl.userEmail, $tbl.lastSeries FROM $tbl"; | |
//prepare statement, execute, store_result | |
if($displayStmt = $mysqli->prepare($query)){ | |
$displayStmt->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../../_includes/connect.php'; | |
$userName = $_REQUEST["userName"]; | |
$userEmail = $_REQUEST["userEmail"]; | |
$lastSeries = $_REQUEST["lastSeries"]; | |
//define table | |
$tbl = "users";//change to your table i.e. John_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
);*/ |
NewerOlder