roldahayes Posted September 24, 2007 Share Posted September 24, 2007 Hi there, cuttently we have this code which generates a buy button on a page. where the "product_ref" call the data. Is there an easy way to add a text box with one of these codes so a number can be entered in to post to the cart as well so the item can be personalised? <?php //the folowing lines contain the code that should be used with each link that you want to create change the values of $strProd_REF $strCar_ID as you need to //--------------'LINK CODE'--------------------- $strProd_REF = "VGA89"; $strCar_ID = "all"; $sqlSelect = "SELECT Prod_ID FROM products WHERE Prod_REF = '" . $strProd_REF . "' AND Car_ID = '" . $strCar_ID . "' "; // assign the basic sqlquery $sqlquery = $sqlSelect; //get the result set $result = mysql_query($sqlquery); while ($row = mysql_fetch_assoc($result)) { echo "<a href=\"basket.php?src=".urlencode($_SERVER['REQUEST_URI'])."&productID=" . $row["Prod_ID"] . "\"><img src=2003/buy.gif width=68 height=17 border=0></a>"; //end make while } $row = ""; mysql_free_result($result); //--------------'END LINK CODE'--------------------- ?> Quote Link to comment https://forums.phpfreaks.com/topic/70457-add-a-text-box-form-to-buy-button-code/ Share on other sites More sharing options...
cooldude832 Posted September 24, 2007 Share Posted September 24, 2007 No because you don't have a form, the link is an anchor tag that sends data via get to that next page saying buy what ever is there. You have to readjust it so it was a submit button and then you can add all the input types you like. Quote Link to comment https://forums.phpfreaks.com/topic/70457-add-a-text-box-form-to-buy-button-code/#findComment-353985 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.