Jump to content

jon1009

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by jon1009

  1. Scrap that Ive just looked into isset() and realised that its would only return true/false. So I went with the following that ok to use? <?php if(isset($_SESSION["cruise_id"])) { if($_SESSION["cruise_id"] != $page->id) { $_SESSION = ""; session_destroy() ; } } ?>
  2. Iam using the follow but cant seem to get it to work. If i remove the isset() it works but throws a error once the session has be destroyed. <?php if(isset($_SESSION["cruise_id"]) == $page->id) { }else{ $_SESSION = ""; session_destroy() ; }?>
  3. Hello All, Iam creating a shopping cart and basing the session content iam adding a add / remove to the product. First question is that a good away of doing it? Second would be Iam throwing a error if the $_session doesn't exist for both the session and the 'array_key_exists' Would best way to solve this be by wrapping it iin a if if($_SESSION["cart_products"]) {the code below} else {out put add button} $out = " <div class='row'> <form method='post' action='http://localhost/cart/'> <div class='medium-4 columns'> {$room->title} {$room->id} </div> <div class='medium-4 columns'> £{$room_cost_pp} p/p x {$room->room_spaces} guests = £{$room_cost} </div> <div class='medium-2 columns'> <input type='hidden' name='cabin_id' value='{$room->id}' /> <input type='hidden' name='cabin_name' value='{$room->title}'/> <input type='hidden' name='cabin_cost' value='{$room_cost}'/> <input type='hidden' name='return_url' value='{$current_url}' />"; $search_array = $_SESSION["cart_products"]; if (array_key_exists($room->id, $search_array)) { $out.="<input type='hidden' name='remove_code[]'' value='{$room->id}' /> <button type='submit' class='alert button'>Remove Cabin</button>"; }else { $out.="<input type='hidden' name='type' value='add' /> <button type='submit' class='success button'>Add Cabin</button>"; } Cheers Jon
  4. Hello Barand, Thanks for the reply. The only code I have from WorldPay is this link/ form action "https://secure-test.worldpay.com/wcc/purchase';return true;" and some hidden fields relating to the shop id. Ive tried putting that in the first case but couldn't get that to work.
  5. Hello All, I have created a form that has 2 buttons. Button 1 sends the content of the form via email Button 2 Redirects to WorldPay's Payment page. Which works great however I would like to send the contact of the form via email aswell if Button 2 is clicked. This needs to be done before the redirect kicks in. I've tried all sorts but not had any luck. snippets of my code below Button 1 PHP if ($_POST['submitted']) { $sent = wp_mail($to, $subject, $message, $headers); if($sent) my_contact_form_generate_response("success", $message_sent); //message sent! else my_contact_form_generate_response("error", $message_unsent);} //message wasn't sent else //no submitted button { HTML Button Code <input class="btn" type="submit" name="SUBMIT" value="Send Booking & Pay Deposit" onclick="bookingform.action='https://secure-test.worldpay.com/wcc/purchase';return true;"> <input class="btn" type="submit" name="submitted" value="Send Booking"> Cheers Jon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.