0

we've got an issue on our new test site that i'd like you to be able to solve;

we have product pages; example page:
http://www.printsmarter.co.uk/newPrinttest/34-Brochures.html

there is a selection of menus on the screen that you can change select different options to show you a price.

issue is as follows; i want to be able to create url's for every product in the database for google adword purposes; for example if they click on the google ad they come direct to the page/selection from the table/drop downs that is what they want. currently we have got as far as creating the below link;

http://www.printsmarter.co.uk/newPrinttest/product.php?id=19&t=brochures&cat=34

this link will take you to the product, but the drop downs from the menus haven't changed, just the price and the quantity.

i need to know of a way of selecting from the database and it be able to change the drop downs from a specific url.

our problem is we need to populate a select option in order of the one we send.

possible?

hope that makes sense!

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by macneato
0

Ok I think im getting you. By default you already have all the information saved within your db im assuming.

So why don't you try something long these lines;

<?php

$recordId = $_GET['id'];

$query="SELECT * FROM products WHERE id='$recordId'";
$result=mysql_query($query);
$num=mysql_numrows($result); 
mysql_close();


	$i=0;
	while ($i < $num) {
	
	$f1=mysql_result($result,$i,"data");
	$f2=mysql_result($result,$i,"data2");
	$f3=mysql_result($result,$i,"data3");
	$f4=mysql_result($result,$i,"data4");


++$i;
} 

	if ( empty($f1) ) $f1 = "";

?>

<select id="item3" name="item3" value="<?php echo $f1; ?>">
    <option value="'170gsm matt'">170gsm matt</option>
    <option value="'150gsm gloss'">150gsm gloss</option>
    <option value="'130gsm gloss'">130gsm gloss</option>
</select>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.