Jump to content

dwex

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Everything posted by dwex

  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.
  15. don't really have the codes for these at the moment but a rough example would be like this.. I will like to send all 3 users into the database with their information using a foreach loop <form method="POST" action="input.php"> <!-- Person #1 --> <input type="text" name="username[]" /> <input type="text" name="phonenum[]" /> <!-- Person #2 --> <input type="text" name="username[]" /> <input type="text" name="phonenum[]" /> <!-- Person #3 --> <input type="text" name="username[]" /> <input type="text" name="phonenum[]" /> <input type="submit" /> </form>
  16. I have six rows of text boxes for users to enter into. The fields are named like ROW1: invqty, invpart, invdesc, invlist, invprice, parttotal ROW2: invqty02, invpart02, invdesc02, invlist02, invprice02, parttotal02 ROW3: ... ROW4: ... How can I add these to variables so $invoiceqty = invqty, invqty2, invqty3, etc. $invoicepart = invpart, invpart02, invpart03, etc. and then loop through them, inserting all rows into a table until all data is INSERTED
  17. wow, that is some crazy a codes there .. gonna need to take some time to understand but anyway thanks for everyone!
  18. thx for the reply. It did insert more than 1 row into my database but the fields , name and price didnt quite make it in correctly. They turned out to be either 0 or 1.
  19. Sorry , But I'm not sure how do I go about using the foreach loop for this. $name = $_POST['name']; $price = $_POST['price']; $query = "INSERT into aaa SET name = '$name' , price = '$price' " ; $result = mysqli_query($link, $query) or die(mysqli_error($link));
  20. oh mine , it works now. I think the missing quotes around value='<?php echo $tab;?>'/> was the problem. thanks for your help guys!
  21. $tab = $_POST['table']; $HOST = 'localhost'; $USERNAME = 'root'; $PASSWORD = ''; $DB = 'pbstore'; $link = mysqli_connect($HOST,$USERNAME,$PASSWORD,$DB) or die(mysqli_connect_error()); $sql = "SELECT {$tab}_id , {$tab}_name , {$tab}_price , {$tab}_description , {$tab}_image , {$tab}_stock , {$tab}_time FROM {$tab}"; $result = mysqli_query($link, $sql) or die(mysqli_error($link)); $tab is working as I'm able to display the things I want on the page.
  22. Is there something wrong with the codes here? Edit button <form action='edititemadmin.php' method='get'> <input type='hidden' id='id' name='id' value=<?php echo $row["{$tab}_id"]?>/> <input type='hidden' id='table' name='table' value=<?php echo $tab;?>/> <br> <input type="submit" Value="Edit"/> </br> </form>
  23. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE _id = ''' at line 1
  24. thx for the reply. still the same error though :/
×
×
  • 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.