Cannot get php script to enter data

Reply

Join Date: Oct 2007
Posts: 3
Reputation: jamez333 is an unknown quantity at this point 
Solved Threads: 0
jamez333 jamez333 is offline Offline
Newbie Poster

Cannot get php script to enter data

 
0
  #1
Oct 30th, 2007
I am trying to use this script to enter data into my database from an html form.
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3.  
  4. <html>
  5. <head>
  6.  
  7. <title>Item Entry - Opulentworx - Private</title>
  8.  
  9. </head>
  10.  
  11. <body>
  12.  
  13. <form action="/php/itemENTRY.php" method="post" id="itemENTERdb">
  14. <input type="text" id="itemNUM"/>Item #<br>
  15. <input type="text" id="quant"/>Quantity<br>
  16. <input type="text" id="date"/>Date<br>
  17. <input type="text" id="cost"/>Cost<br>
  18. <input type="text" id="ground"/>UPS Ground<br>
  19. <input type="text" id="3day"/>3 DAY UPS<br>
  20. <input type="text" id="2day"/>2 DAY UPS<br>
  21. <input type="text" id="nextDAY"/>Next DAY UPS<br>
  22. <input type="text" id="salesTAX"/>Sales Tax<br>
  23. <input type="text" id="dFEE"/>Design Fee<br>
  24. <input type="text" id="pFEE"/>Print Fee<br>
  25. <input type="text" id="markUP"/>Mark-UP<br>
  26. <input type="text" id="subTOT"/>Sub-Total<br>
  27. <input type="text" id="flTAX"/>FL Tax<br>
  28. <input type="submit" value="Save Date"/>
  29. <input type="reset" value="Reset Date"/>
  30. </form>
  31.  
  32.  
  33.  
  34. </body>
  35. </html>

  1. <?
  2. $link = mysql_connect("mysql","user","XXXXXXXX");
  3. if (!$link)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7.  
  8. mysql_select_db("prodINFO", $link);
  9. $sql="INSERT INTO 'table1' ('itemNUM', 'quant', 'date', 'cost', 'ground', '3day', '2day', 'nextDAY', 'salesTAX', 'dFEE', 'pFEE', 'markUP', 'subTOT', 'flTAX')
  10. VALUES ('$_POST["itemNUM"]', '$_POST["quant"]', '$_POST["DATE"]', '$_POST["cost"]', '$_POST["ground"]', '$_POST["3day"]', '$_POST["2day"]', '$_POST["nextDAY"]', '$_POST["salesTAX"]', '$_POST["dFEE"]', '$_POST["pFEE"]', '$_POST["markUP"]', '$_POST["subTOT"]', '$_POST["flTAX"]')";
  11. }
  12.  
  13. if (!mysql_query($sql,$link))
  14. {
  15. die('Error: ' . mysql_error());
  16. }
  17. echo "1 record added";
  18.  
  19. mysql_close($link);
  20.  
  21. ?>

can anyone tell me why it won't work?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Cannot get php script to enter data

 
0
  #2
Oct 31st, 2007
When you won't work. Tell us exactly what you mean?!
Last edited by iamthwee; Oct 31st, 2007 at 7:33 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: Cannot get php script to enter data

 
0
  #3
Nov 1st, 2007
general mistake :

change $_post tags to $_request

you already posted the values... why you post them again on page itemENTRY.php

funny
Do a favour, leave me alone
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC