Page 1 of 1

Write href using php...?

Posted: Mon Jan 20, 2003 3:29 pm
by markwenham
When I try to use php to write an href link such as

Code: Select all

print  "<tr>
             <td><a href='$row&#1111;coWWW]' alt='$row&#1111;coWWW]'>$row&#1111;coName]</a></td>
       </tr>";
$row[coWWW] contains "www.msn.com", but the resulting link on the page
contains
http://localhost/www.msn.com

I am guessing that this is some sort of PHP ini variable - can anyone point
me in the right direction?

Thanks, Mark

Posted: Mon Jan 20, 2003 3:46 pm
by mydimension
if $row['coWWW'] does not cantain a leading "http://" then you need to add it yourself. otherwise the browser thinks its a relative url and not an absolute url.

Posted: Mon Jan 20, 2003 4:53 pm
by markwenham
$row[coWWW] contains http://www.msn.com
the script is adding http://localhost to the front.

Posted: Mon Jan 20, 2003 5:23 pm
by markwenham
Got it,
Thanks