This topic is locked

Quick menu lin k to open in whole page

5/16/2008 12:17:43 PM
PHPRunner General questions
M
mmponline author

I received this code to show a quick menu of a specific field. It works great!!!

global $conn,$smarty;

$rowsearch=array();

$rstt = db_query("SELECT TropicProducts.Materials, Count(TropicProducts.Materials) AS CountOfMaterials FROM TropicProducts GROUP BY TropicProducts.Materials", $conn);

$ind=0;

while($data=db_fetch_array($rstt))

{

$rows=array();

$MaterialsName = str_Replace(" ","+",$data["Materials"]);

$rows["href"]="TropicProducts_list.php?a=search&value=1&SearchFor=".$MaterialsName."&SearchOption=Contains&SearchField=Materials";

$rows["1Materials_value"]=$data["Materials"]." (".$data["CountOfMaterials"].")<br>";

$rowsearch="<a href=\"".$rows["href"]."\">".$rows["1Materials_value"]."</a>";

echo $rowsearch;

}


How do I change the hyperlink part to open the result in a whole page (_top) Tried

$rowsearch="<a target="_top" href=\"".$rows["href"]."\">".$rows["1Materials_value"]."</a>";

but it gives a parse error.

D
Dale 5/16/2008

Just a shot here, but try remarking your extra quotes
your statement was

$rowsearch="<a target="_top" href=\"".$rows["href"]."\">".$rows["1Materials_value"]."</a>";
I might suggest

$rowsearch="<a target=\"_top\" href=\"".$rows["href"]."\">".$rows["1Materials_value"]."\"</a>\";
or something like that. I haven't done any kind of test with it.

It generally is a remarked quote somewhere..
Hope this helps

M
mmponline author 5/17/2008

Thanks DaleM, it works just fine.
Appreciate your help!