This topic is locked

Dynamic URL Based on other field contents

11/19/2007 6:16:28 PM
PHPRunner General questions
A
acpan author

Hi,
i have a list table that contain a URL that i want the logged-in user to click.

and on clicking, it popup another window where the path is dynamic

base on logged in user's parameters.
Here's the details.

  1. Table look like this:

    -----------------------------------------

    Account Name | Contact | URL Link

    -----------------------------------------
  2. URL Link is a http path with some part of it, concatentated with account name and contact:

    eg. http://www.ghome.com/Andrew/97620044
    I implemented dynamic URL using SQL View with the following SQL Query:

    SELECT `Account Name`, `Contact`, CONCAT("http://www.ghome.com/",`Account Name`,'Contact`) As `URL Link`
  3. The URL Link should be displayed as a picture. so that on clicking, the

    pop up window will be open and point to the URL address. (how to achieve this ?).
    I tried using view as hyperlink, but i can only put a name for the URL not an image or icon i want to display to the user.
    Thanks

    Dex

J
Jane 11/20/2007

Dex,
set up URL Link field as Custom on the "View as" settings dialog on the Visual Editor tab.

Here is a sample:

$str = "";

$str.= "<a href=\"".$value."\">";

$str.= "<img src=\"".$value."\" border=0>";

$str.= "</a>";

$value = $str;

A
acpan author 11/20/2007

Thanks Jane, that helped.