Jump to content

poolhustler86

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by poolhustler86

  1. please ignore the above post, i hit the wrong button... my apologises.. basically in the form action i put the php self so it would refresh the page when the button is clicked, or enter is hit.. and in the method i put post..
  2. any chance i can see how ur script looks... compare to mine... cause it happens on alot of my forms.. and i just $_SERVER['php-self'];
  3. the form submits, processes on the same page and then redirects the user from header: location function... basically if the user clicks back, i dont mind if they see the previous page.. just dont want those warning messages, page expired messages... so when they do click refresh it resubmits the data again.
  4. After submitting a form via php, and i redirect the user to another page.. that works fine. however once the user clicks on the back button they get the warning page by the browser about form data has been already submitted... how can i avoid all together the user getting a page like that?
  5. how would i then call the function? im new to oop... and then use the return varailbe to give me the price... so i can then sumbit the data to another table.
  6. yep different columns within the database cause each item could be different margins / qty... i was just wondering if there was a better way to do it... cause that if statement will be going inside of a foreach array...
  7. I have a table in MySQL that holds the following data: item qty item margin carton qty cartin margin bulk qty bulk margin 1 1.33 50 0.95 100 0.50 when a customer submits via a form the qty they would like, is the best method to write out an if statment to test against which margin / qty it fits into best so i can calculate a price. or is there another way around it? i would just assume you do... example... customer qty = 10 if qty >= 1 get margin 1.33 else if qty >=50 get margin 0.95 else if qty >= 100 get margin 0.50 than caluclate the price... best method?
  8. once i do that... how would i pull out the id value and the qty value.. so i can insert it into a database if qty does not equal 0 or empty!
  9. thanks that works a treat... but say i have a form could have 1 row or 20 rows depending on the number of sizes... and i need to collect the id for that product, aswell as the qty.. html would be like this i guess? <input name='id[]' type='hidden' value='1'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='2'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='3'><input name='qty[]' type='text' value=''> or there could be <input name='id[]' type='hidden' value='1'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='2'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='3'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='4'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='5'><input name='qty[]' type='text' value=''> <input name='id[]' type='hidden' value='6'><input name='qty[]' type='text' value=''> cause i will be submitting the data to a shopping cart if their is a qty.
  10. <?php $id_array = array("1", "2", "3"); $qty_array = array("200","300","250"); foreach (($id_array as $id) && ($qty_array as $qty)) { echo "ID: " . $id . " QTY: " . $qty . "<br />"; } ?> i get the following error... Parse error: parse error, unexpected T_AS in C:\www\webroot\statrolls-pty-ltd\index.php on line 20 line 20 = the line with the foreach statement on it
  11. its a php coding problem.. database side is fine...
  12. ive never been good at arrays... so how do u get that data in an array() i feel so dumb.. but thats one part of programming i never picked up!
  13. its not here the code.. its at the office.. thats the problem... the table with the prices... and qty breaks.. are within a form... when the customers clicks add to cart.. and there is data entered into the different qty boxes for that one product... how do i get that data into mysql shopping cart table i have. (products might have one or twenty different colours or sizes...eg blue, green,red..) basically how do u get each qty box on the table to be a different field name and get them to insert in db.. i can do the insert part... its getting the data from the form... cause i would take the item code number and qty from the table. and insert into shopping cart!
  14. i need the logic for this part... the table is fine.. i know how to set up that in a way that would be suitable... at the end of the table there is a qty box... however.. there could be 1 qty box.. or there could be 20 qty box per one product.. depends on the number of different sizes / colours or products... how do u do that part.... i could do it all with manual numbers.. at ends of fields and have like 100+ variables already declared.. but thats just ugly!
  15. i do not believe its beyond my abilities... im just trying to get my head around the logic side of it... and a piece of sample code (cant find on the web) for how to create dynamic fields with different numbers so i can add into database if customer puts more than 1 qty in one different size...
  16. i already know how to build a cart... and creat payment gateways.. but i didnt have a product that has multiple sizes, etc.. is it just a loop with the collected data? i just dont know how to give each different row.. a field name different... etc.. thats the part im stuck on.. and how to get it to insert into a table in mysql.. the rows with data in them from one button.. i was going to do it.. with multiple add to cart buttons... but im trying to understand loops / foreach statements and everything like that basically i know how to insert / retrieve data and select data from databases... and make my system work.. but for multiple sizes of a product i cant get it to work.. ive tried for months...
  17. that may help... i will fiddle with that tomorrow... but how do you go about... collecting data from the table... when the user clicks add to cart... and insert it into the database.. it might be only one field.. but it could be 10 different colour variations..etc..
  18. creating the table part... cause sometimes some products dont have 2nd and third qty breaks... aswell as the button to loop through the records that have qtys in them and add them to another table in the database...
  19. id rather learn for my own benefits... it would be two tables... one table with product information... like the bullets..for description, and name... and then... another table with the qty breaks... i have down it with qty on each rows... but it doesnt look pretty... i want to know how to get it in that format...
  20. i cant use google checkout.. cause it will connect up to an internel order system...
  21. I am only just starting to get into php... and found this table i like on a major companies website (http://www.signet.net.au/Catalogue/browse.aspx?sid=586) basically i would like to know how they create this dynmaicly only the data table..where the prices are located. i have my ideas on how it would be created.. each in a single row in a database grouped up with a product... but i have no idea how to make sure i have the right qty when the user enters a qty in...to give them the right price... also.. how do you get the add to cart button... to add products to a database table.. if u enter qtys in 2 or more items... just asking how you would go about doing this... solutions / ideas would be most helpful!
  22. Hey Everyone... I have a question reguarding how to sort mysql results from a table. I have a table with a column (varchar) named prod_size_color... example data... 80mm x 80mm x 11.5mm - White 115mm x 80mm x 11.5mm - White Everytime i sort it by the prod_size_colour the 115mm x 80mm x 11.5mm - White appears first... the only way to stop that happening is to place a 0 infront of 80mm x 80mm x 11.5mm - White... Anyway I can sort it without placing 0 infront?
  23. thankyou for ur assistance... i will try that at the office tomorrow :) kinder just getting my head around php / sessions still :)
  24. One unique id for the whole time they are on the site.... when they leave and then they come back they get a new one....
  25. So that will keep everything unique for each time a visitor comes? even page after page?
×
×
  • 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.