views:

27

answers:

1

Hello,

In the code below, I would like to make the word that prints out as the variable "$submittor" a hyperlink to "http://www...com/.../members/index.php?profile=$submittor" .

I can't get it to work; I think I'm doing the formatting wrong.

How can I do it?

Thanks in advance,

John

echo '<div class="sitename3name">Submitted by '.$submittor.' on '.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</div>';
A: 

You've left out the link.

$link="<a href='http://www...com/.../members/index.php?profile=$submittor&gt;$submittor&lt;/a&gt;";
echo '<div class="sitename3name">Submitted by '.$link.' on '.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</div>'; 
dnagirl
I think @John wanted the link to be a link to the profile page of `$submittor`. So you'd need something like `$link="<a href='http://example.com/index.php?profile=$submittor'>$submittor</a>"`
psmears
@psmears: I think you caught me in the editing cycle. His URL had just shown up and I was fixing my answer to reflect it.
dnagirl
Hmmm.... this looked promising, but when I added it, it made some of the other code (that is not included in this question) not print.
John
@dnagirl: Fair enough :) @John: You'll have to give more details. The code posted by dnagirl is correct - perhaps you could post *all* of the code you're having trouble with? And the result of "View Source" in the browser so we can see what the result is?
psmears