#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    WI, USA
    Posts
    6
    Rep Power
    0
    Trying to Have a hyperlink that will show the website address and be able to click on it and go directly to that site. I have tried several different methods and it keeps defaulting to my own URL any help would be greatly appreciated.

    Sample from page...

    $url = $row["Website"];
    $site = $row["Company"];

    $result = mysql_query ("SELECT * from table WHERE id=$id",$db);$row = mysql_fetch_array($result);

    printf("%sn<br>", $row["company"]);
    printf("%sn<br>", $row["Address"]);
    Printf("%sn<br>", $row["City"]);
    printf("%sn<br>", $row["State"]);
    printf("%sn<br>", $row["PostalCode"]);
    echo ("<a href='$url'>$site</a><br>n");
    printf("<b>Specialization:</b> %sn<br>", $row["specialization"]);

    Thanks
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Toronto, Canada
    Posts
    13
    Rep Power
    0
    put

    $url = $row["Website"];
    $site = $row["Company"];

    after

    $row = mysql_fetch_array($result);

    to select the url and site from database result. hope this helps.
  4. #3
  5. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    If $site does not start with http:// it will be assumed that the link is local. From your description that sounds like what is happening.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    WI, USA
    Posts
    6
    Rep Power
    0
    Thanks a lot that worked great! (thought I was going to have an Excedrin moment)

Similar Threads

  1. Flash in apache - wont work!
    By Fish_12345 in forum Apache Development
    Replies: 2
    Last Post: October 11th, 2004, 01:43 PM
  2. php script won't work inside "cgi-local" directory
    By Volitics in forum PHP Development
    Replies: 5
    Last Post: April 26th, 2004, 10:50 PM
  3. Experienced undergrad senior ... freelance work wanted
    By carrja99 in forum Hire A Programmer
    Replies: 0
    Last Post: January 28th, 2004, 11:32 PM
  4. I'll pay someone $150 to do some PHP work for me!
    By Noah Neiman in forum Hire A Programmer
    Replies: 16
    Last Post: January 23rd, 2004, 03:15 AM
  5. I need some specific php work done for my website
    By Noah Neiman in forum Hire A Programmer
    Replies: 1
    Last Post: January 20th, 2004, 11:31 PM

IMN logo majestic logo threadwatch logo seochat tools logo