Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.