Jump to content

add a text box form to buy button code:


roldahayes

Recommended Posts

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'---------------------

?>

Link to comment
https://forums.phpfreaks.com/topic/70457-add-a-text-box-form-to-buy-button-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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