Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- echo "POST variables<br>";
- var_dump($_POST);
- echo "<br><br>SESSION variables<br>";
- var_dump($_SESSION);
- $itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
- if ($itemcount == 0) {
- header("Location: "."error.php?msg=".rawurlencode("Please add items to your shopping cart before checking out."));
- exit;
- }
- echo "POST email value: ".($_POST['email'])."<br>";
- if (!isset($_POST['email'])) { // <-- FAILS HERE
- header("Location: "."error.php?msg=".rawurlencode("We did not find your information, please enter the needed information again."));
- exit;
- }
- echo "server request method: ".$_SERVER['REQUEST_METHOD'];
- if ($_SERVER['REQUEST_METHOD'] == 'POST')
- {
- $_SESSION['shipname'] = $_POST['shipname'];
- $_SESSION['shipaddress'] = $_POST['shipaddress'];
- $_SESSION['shipzip'] = $_POST['shipzip'];
- $_SESSION['shipcity'] = $_POST['shipcity'];
- $_SESSION['shipstate'] = $_POST['shipstate'];
- $_SESSION['paymenttype'] = "PayPal";
- header("Location: "."thankyou.php");
- }
- $shipname = isset($_SESSION['shipname']) ? $_SESSION['shipname'] : '';
- $shipaddress = isset($_SESSION['shipaddress']) ? $_SESSION['shipaddress'] : '';
- $shipzip = isset($_SESSION['shipzip']) ? $_SESSION['shipzip'] : '';
- $shipcity = isset($_SESSION['shipcity']) ? $_SESSION['shipcity'] : '';
- $shipstate = isset($_SESSION['shipstate']) ? $_SESSION['shipstate'] : '';
- ?>
- POST variables
- array(11) {
- ["lastname"]=> string(6) "dfgdfg"
- ["email"]=> string(22) "kelliemmarsh@gmail.com"
- ["city"]=> string(8) "van nuys"
- ["fax"]=> string(0) ""
- ["state"]=> string(2) "WA"
- ["firstname"]=> string(5) "dfbdf"
- ["address2"]=> string(0) ""
- ["phone"]=> string(12) "509-555-1414"
- ["zip"]=> string(5) "90266"
- ["address"]=> string(14) "123 any street"
- ["Continue"]=> string(8) "Continue"
- }
- SESSION variables
- array(8) {
- ["cart"]=> array(4) {
- [0]=> array(6) {
- [0]=> string(6) "ch-002"
- [1]=> string(6) "ch-002"
- [2]=> string(0) ""
- [3]=> string(0) ""
- [4]=> string(0) ""
- [5]=> string(0) ""
- }
- [1]=> array(6) {
- [0]=> string(26) "Fish Wavy Stripe Turquoise"
- [1]=> string(26) "Fish Wavy Stripe Turquoise"
- [2]=> string(0) ""
- [3]=> string(0) ""
- [4]=> string(0) ""
- [5]=> string(0) ""
- }
- [2]=> array(6) {
- [0]=> int(1)
- [1]=> int(2)
- [2]=> string(0) ""
- [3]=> string(0) ""
- [4]=> string(0) ""
- [5]=> string(0) ""
- }
- [3]=> array(6) {
- [0]=> string(5) "10.99"
- [1]=> string(5) "10.99"
- [2]=> string(0) ""
- [3]=> string(0) ""
- [4]=> string(0) ""
- [5]=> string(0) ""
- }
- }
- ["itemcount"]=> int(2)
- ["shipname"]=> NULL
- ["shipaddress"]=> NULL
- ["shipzip"]=> NULL
- ["shipcity"]=> NULL
- ["shipstate"]=> NULL
- ["paymenttype"]=> string(6) "PayPal"
- }
- POST email value: kelliemmarsh@gmail.com
- server request method: POST
- if (empty($_POST['email'])) {
- header("Location: "."error.php?msg=".rawurlencode("We did not find your information, please enter the needed information again."));
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement