iamame Posted August 2, 2009 Share Posted August 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/ Share on other sites More sharing options...
Maq Posted August 2, 2009 Share Posted August 2, 2009 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"; Quote Link to comment https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/#findComment-888702 Share on other sites More sharing options...
iamame Posted August 2, 2009 Author Share Posted August 2, 2009 Thank you, been way to long since I have written anything in php the part I was up was the brackets Quote Link to comment https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/#findComment-888705 Share on other sites More sharing options...
Maq Posted August 2, 2009 Share Posted August 2, 2009 Thank you, been way to long since I have written anything in php the part I was up was the brackets 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? Quote Link to comment https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/#findComment-888706 Share on other sites More sharing options...
iamame Posted August 2, 2009 Author Share Posted August 2, 2009 I mean the part I messed up with was adding the {} to things I keep having typos left and right, but what you said fixed it perfectly so no worries Quote Link to comment https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/#findComment-888711 Share on other sites More sharing options...
Maq Posted August 2, 2009 Share Posted August 2, 2009 I mean the part I messed up with was adding the {} to things I keep having typos left and right, but what you said fixed it perfectly so no worries Oh ok great. Don't forget to mark solved. Quote Link to comment https://forums.phpfreaks.com/topic/168474-solved-echo-link-help/#findComment-888713 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.