Jump to content

poolhustler86

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

poolhustler86's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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...
×
×
  • 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.