Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Thank you for this but the dealid is got from the URL. Is not in the form Commented Nov 11, 2011 at 2:19
  • It is working, however I want to get the product.php?id=1 instead of having it in a textbox Commented Nov 11, 2011 at 2:26
  • 1
    To pass the id get parameter from product to add-to-db.php, you can easily echo it out in a hidden form variable: <input type='hidden' name='id' value='<?php echo $_GET['id'] ?>' />. This will include it in the POST to add-to-db.php Commented Nov 11, 2011 at 2:30
  • Yes this is how I have it now. But is there any way to make use of the id of the url directly instead of having it through a textbox ? Commented Nov 11, 2011 at 2:32
  • 1
    yeah, you could always append it to your post target... it's messy but: $.post("add-to-db.php?id=<?php echo $_GET['id'] ?>", $("#myform").serialize(), function (data){ ... }); Commented Nov 11, 2011 at 2:34