Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. $userid = $_COOKIE['tempuser'];
  2.               $prodarray = array();
  3.               $sql = $db->prepare("SELECT * FROM basket where usercode = :userid");
  4.               $sql->bindParam(':userid', $userid, PDO::PARAM_STR, 30);
  5.               $sql->execute();
  6.               $result = $sql->fetchAll();
  7.               $numrows = $sql->rowCount();
  8.               $i=0;
  9.              
  10.               if ($numrows > 0)
  11.               {
  12.                 foreach($result as $row)
  13.                 {
  14.                 if ($row['contracttype'] != -1){
  15.                     $prodarray[$i]['contracttype'] = $row['contracttype'];
  16.                     $prodarray[$i++]['mobilenumber'] = $row['mobilenumber'];
  17.                 }
  18.                
  19.                 $forename = $row['forename'];
  20.                 $surname = $row['surname'];
  21.                 $contactnumber = $row['contactnumber'];
  22.                 $email = $row['email'];
  23.                 $occupation = $row['occupation'];
  24.                 $companyname = $row['companyname'];
  25.                 $companynumber = $row['companynumber'];
  26.                 $address = $row['address'];
  27.                 $postcode = $row['postcode'];
  28.  
  29.                 }
  30.               }
  31.              
  32.             setcookie("tempuser", substr(sha1(rand()), 0, 30),-86400,'/');
  33.             setcookie("tempuser", "",-86400,'/');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement