Thred.
Join Waitlist Source Code
<?php
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
error_reporting(E_ALL);
?>
<?php
if(isset($_POST['submit']) && isset($_POST['email']) && isset($_POST['portfolio'])){
$curl = curl_init();
$data = array(
'email' => $_POST['email'],
'portfolio' => $_POST['portfolio']
);
$JSON = json_encode($data, TRUE);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.backendless.com/87A275B6-E49B-9514-FF45-B2487622DC00/24AF042B-1A36-C991-FFB7-DF7952895400/data/Waitlist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $JSON,
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
$ch = curl_init("http://caseycorvino.co/waitlist.html");
curl_exec($ch);
}
} else {
echo "ERROR: Invalid Arguments"."\n";
}
?>
Fetch Waitlist Source Code
<?php
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
error_reporting(E_ALL);
?>
<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
position: absolute;
width: 400px;
left: calc(50% - 200px);
top: 80px;
}
td p{
padding-left: 20px;
}
table, th, td {
border: 1px solid black;
height: 40px;
font-weight:normal;
}
th{
font-size: 20px;
}
</style>
<title>_ T H R E D</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="desktop.css" />
<link rel="stylesheet" href="blocks.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="script/about.js"></script>
</head>
<body>
<header>
<a href="."><p class="title">
Thred.
</p></a>
<div class="menu" style="display: none">
<a href="about.html"><div class="boxed_button">About</div></a>
<a href="projects.html"><div class="boxed_button">Projects</div></a>
<a href="mailto:thred.master@gmail.com"><div class="boxed_button">Contact</div></a>
</div>
</header>
<div class="half_tall box white" >
<form id="waitlist_form" action="join_waitlist.php" method="POST">
<input type="email" name="email" placeholder="Email" required></input><br><br>
<input type="text" name="portfolio" placeholder="Instagram Handle OR Portfolio URL" required></input>
<br><br><br>
<input type="submit" id="submit_button" name="submit" value="Join Waitlist"></input><br><br>
</form>
<a href="show_waitlist.php"><div class="boxed_button" style="position: absolute; bottom: 100px; left: calc(50% - 50px)"id="submit_button">Source Code</div><a>
</div>
</div>
<div class="half_tall rightside" style="top: 80px">
<table style="top: 80px">
<tr><th>Waitlist</th></tr>
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.backendless.com/87A275B6-E49B-9514-FF45-B2487622DC00/24AF042B-1A36-C991-FFB7-DF7952895400/data/Waitlist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
$arr = json_decode($response, true);
//print_r($arr);
foreach ($arr as $key => $value) {
echo "<tr><td><p>" . $value["email"] . "</p></td></tr>";
}
}
?>
</table>
</div>
<a><div class="arrow">⇓</div></a>
<div class="full_quarter gray" id="footerShort">
<a href="mailto:thred.master@gmail.com"><div class="boxed_button" id="foot_contact">Contact</div></a>
<div id="tags">
<p class="leftside" id="mobile_right">15 January 2018</p>
<p class="rightside">Created by Casey Corvino</p>
</div>
</div>
</body>
</html>