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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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