Jump to content

dwex

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dwex's Achievements

Member

Member (2/5)

0

Reputation

  1. thanks for the reply. Nevermind, it's kinda hard to explain this 1.
  2. thx for the replies. I wanna store the value of the quantity select drop down box into a variable. <td valign="top"><b>Quantity: </b> <select name='quantity'> <?php for($i=1; $i<=$stk; $i++){ echo '<option name="$i[]">'; echo $i; echo '</option>'; } ?> </select></td>
  3. and also sort. Like I can click the headers of a table and it will sort out the content by number or alphabet that belongs to header's column
  4. like if I'm displaying a hundred entries , my website will be super long in length so I wanna break those hundred entries into maybe like 12 per page . Then click next page or the page number to view the next 12.
  5. wow.. that looks so much neater. Think I know what you guys meant now. Thanks alot for your time guys !
  6. something like that. -- -- Table structure for table `headbands` -- CREATE TABLE `headbands` ( `headbands_id` int(250) NOT NULL auto_increment, `headbands_name` varchar(250) collate latin1_general_ci NOT NULL, `headbands_price` varchar(250) collate latin1_general_ci NOT NULL, `headbands_description` varchar(1000) collate latin1_general_ci NOT NULL, `headbands_image` varchar(250) collate latin1_general_ci NOT NULL, `headbands_stock` int(255) NOT NULL, `headbands_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`headbands_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=15 ; -- -- Dumping data for table `headbands` -- -- -------------------------------------------------------- -- -- Table structure for table `helmet` -- CREATE TABLE `helmet` ( `helmet_id` int(255) NOT NULL auto_increment, `helmet_name` varchar(255) collate latin1_general_ci NOT NULL, `helmet_price` int(255) NOT NULL, `helmet_description` varchar(1000) collate latin1_general_ci NOT NULL, `helmet_image` varchar(255) collate latin1_general_ci NOT NULL, `helmet_stock` int(255) NOT NULL, `helmet_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`helmet_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; -- -- Dumping data for table `helmet` -- -- -------------------------------------------------------- -- -- Table structure for table `shirts` -- CREATE TABLE `shirts` ( `shirts_id` int(250) NOT NULL auto_increment, `shirts_name` varchar(100) collate latin1_general_ci NOT NULL, `shirts_price` varchar(150) collate latin1_general_ci NOT NULL, `shirts_description` varchar(1000) collate latin1_general_ci NOT NULL, `shirts_image` varchar(250) collate latin1_general_ci NOT NULL, `shirts_stock` int(255) NOT NULL, `shirts_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`shirts_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=20 ;
  7. it's just a bunch of that but different products like vest , helmet etc. I want each and every item to be have a different ID even if they are in different tables in the database.
  8. My table looks like this.. `guns_id` int(255) NOT NULL auto_increment, `guns_name` varchar(255) collate latin1_general_ci NOT NULL, `guns_price` int(255) NOT NULL, PRIMARY KEY (`guns_id`) I want to add a product key that is unique through out the whole database as I have other products other than guns aswell.
  9. if yes , how do I use the ipn. Do I need to create an ipn page?
  10. without mysql_query("INSERT INTO users (email, password) VALUES('". mysql_escape_string($email) ."', '".md5($password)."' ) ") or die(mysql_error());
  11. I just did the ipn page to store paypal transactions into my database but it doesnt seem to be working. Is there anything else that i need to do other than creating the ipn page? <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("pbstore") or die(mysql_error()); // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // PAYMENT VALIDATED & VERIFIED! $email = $_POST['payer_email']; $name = $_POST['item_name']; mysql_query("INSERT into sales (name, email) VALUES('".$name."', '".$email."')")or die(mysql_error()); mysql_query("INSERT INTO users (email, password) VALUES('". mysql_escape_string($email) ."', '".md5($password)."' ) ") or die(mysql_error()); } else if (strcmp ($res, "INVALID") == 0) { // PAYMENT INVALID & INVESTIGATE MANUALY! } } fclose ($fp); } ?>
  12. from the customer so that I can record the transaction into my database seeing as the pay button is on paypal and not on my any of my site.
  13. Okay , I managed to bring in all informations into the database except the image? This is how my foreach loop looks like. foreach ($_POST['name'] as $row=>$name) { $item = $name; $type = $_POST['tabledrop'][$row]; $price = $_POST['price'][$row]; $des = $_POST['description'][$row]; $stk = $_POST['stock'][$row]; $file = $_POST['pbimage']['name'][$row]; $target_path = "C:/xampp/htdocs/paintball/itemimages/"; $target_path = $target_path . basename( $_FILES['pbimage[]']['name[]']); if(move_uploaded_file($_FILES['pbimage[]']['tmp_name[]'], $target_path)) { echo "The file ". basename( $_FILES['pbimage[]']['name[]']). " has been uploaded/"; } $query = "INSERT into $type SET {$type}_name = '$item' , {$type}_price = '$price' , {$type}_image = '$file', {$type}_description = '$des' , {$type}_stock = '$stk' , {$type}_time = NOW()" ; $result = mysqli_query($link, $query) or die(mysqli_error($link)); }
  14. think I got it already , thanks for viewing.
×
×
  • 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.