Web Hosting Talk







View Full Version : Simple PHP questions with using $strings


kenfused
08-13-2004, 06:07 PM
Hello
I'm trying to make my script more generalizable to different sites.
For example

$site="yourwebsitename";

.$output="<a href=\"www.$site.com/script.php\"> Link</a>

Instead of www.yourwebsitename.com/script.php for th link,
I get www.$site.com/script.php

I know it's simple, but what am I doing wrong?
Thanks

Jakiao
08-13-2004, 06:30 PM
Change it to

$output .="<a href=\"www.$site.com/script.php\"> Link</a>";

If that fails, try that change $site to " . $site . ".

kostagr33k
08-13-2004, 09:50 PM
$output="<a href=\"www\.$site.com/script\.php\"> Link</a>";

or

$output="<a href=\"www.".$site.".com/script.php\"> Link</a>";

Kosta

overulehost
08-14-2004, 03:39 AM
Originally posted by kostagr33k
$output="<a href=\"www\.$site.com/script\.php\"> Link</a>";

or

$output="<a href=\"www.".$site.".com/script.php\"> Link</a>";

Kosta

that should work, usually it is the "" that goes wrong..