if you mean how do you create dynamic links then you could do something similar to this.
echo '<a href="'.$url.'" target="_blank">'.$url.'</a>';
where $url is result of of your db query.
I have created a simple dynamic page using Dreamweaver, php, and MySQL. The works it does is simple - user key in search keyword in the "search.php" file and the result will be shown in the "result.php" file. Data is GET from the remote server database.
Question is: there is one dynamic text (say recordset.XXX) need to be linked to another site (external site). How could I do that?
In simple, what my aim is want to build a result.php page the user will only see (a clickable) "XXX" and when they click on it, it would link them to another site - best would be open in new window. You got it, merchants (XXX) & deeplinks. As they come together in a csv file though in different column, how can I get use of this?
Cheers and thanks a lot for all help.
Cheers
YJ
if you mean how do you create dynamic links then you could do something similar to this.
echo '<a href="'.$url.'" target="_blank">'.$url.'</a>';
where $url is result of of your db query.
Cheers mxp but I am not quite with you. What I want indeed is a "recordset in another recordset" - like when you search something from Google, the result page shows list of related results (one recordset), but as a link (another recordset).
Example: in the CSV file from all merchants, there would have two fields, one as "product name" and the other is "deep link to product". What I want is to create a result page which show all product (have done that no problem), and shows as a link (deep link to product), i.e. something like:
Result:
recordset1.productname
but how could I make it as a link as well using the deep link given?
Hope this clarify my question. Thanks a lot. BIG CHEERS![]()
Cheers
YJ
if you want something like google ie search returns to be displayed like this
product1 - deep_link_to_product1
product2 - deep_link_to_product2
and so on then you need to use some kind of loop to return your results. i usually use a for loop, but you can use a while loop.
either way you need something like this
YOUR QUERY HERE
$result=mysql_query($query);
$num_results=mysql_num_rows($result);
for($i=1; $i <= $num_results; $i++){
$row=mysql_fetch_array($result)
$product_name=$row['product_name'];
$deep_link=$row['deep_link'];
echo $product_name.'-'.$deep_link;
}
the above assumes that the deep_links are given as scripts. (i havent used deep links myself so dont know what form they take)
if they are urls then you could replace the last line with something like
echo '<a href="'.$deep_link.'" target="_blank">'.$product_name.'</a>';
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks