Jump to content

[SOLVED] Echo Link Help


iamame

Recommended Posts

Ok something really simple I can't get to work.  I am trying to echo a link with $inf1 and $inf2 appended to it, but I just can't type it out right...

 

What I have is completely wrong, so all I had at the moment was this...

echo "<a href="http://site.com/index.php?txt= .$ran2.$ext;">Text Link</a>"

 

I know it's something like that but I don't know how it would be done correctly.

 

If anyone could help with this simple problem I am having I would be very thankful.

Link to comment
https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/
Share on other sites

A few tips/issues:

 

- You want to use double quotes for the primary string (like you did).

- You want to use single quotes for attributes with the inner HTML in your echo (so your variables will interpolate).

- Finally, you want to use curly brackets to distinguish your variables, so each are viewed as separate.

 

Try:

 

echo "Text Link";

Thank you, been way to long since I have written anything in php the part I was up was the brackets :D

 

Brackets?  Not sure what you're referring to.  If you're referring to the french braces as 'brackets' then you will still have to escape the inner double quotes.  Can I see your final code?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.