seany123 Posted June 23, 2009 Share Posted June 23, 2009 i know this is very rookie coding but i just cant remember how it would look. i want this... echo "[".$gng['tag']."]"; to have this link ../gang_profile.php?id=MANS%20GANG Quote Link to comment https://forums.phpfreaks.com/topic/163367-making-this-a-link/ Share on other sites More sharing options...
Maq Posted June 23, 2009 Share Posted June 23, 2009 It's a simple href, you really need to learn how to do things on your own, or at least try. I see you ask questions here on a daily basis when you haven't even made an attempt yourself... Try: Quote Link to comment https://forums.phpfreaks.com/topic/163367-making-this-a-link/#findComment-861967 Share on other sites More sharing options...
seany123 Posted June 23, 2009 Author Share Posted June 23, 2009 It's a simple href, you really need to learn how to do things on your own, or at least try. I see you ask questions here on a daily basis when you haven't even made an attempt yourself... Try: <a href="../gang_profile.php?id=MANS%20GANG"><?php echo "[".$gng['tag']."]";?></a> yeah i know how to do that... but i mean i want the whole thing side the echo... i get confused with all the "s and /s here is my attempt at what i was trying to do... echo "<a href=/"../gang_profile.php?id=MANS%20GANG">/"[/".$gng['tag']./"]/"</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/163367-making-this-a-link/#findComment-861998 Share on other sites More sharing options...
947740 Posted June 23, 2009 Share Posted June 23, 2009 Well then try using ' instead of \". And separate the variable from the string. echo "<a href='../gang_profile.php?id=MANS%20GANG'>[".$gng['tag']."]</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/163367-making-this-a-link/#findComment-862001 Share on other sites More sharing options...
mattal999 Posted June 23, 2009 Share Posted June 23, 2009 Or if you still want to use "s: echo "<a href=\"../gang_profile.php?id=MANS%20GANG\">[".$gng['tag']."]</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/163367-making-this-a-link/#findComment-862004 Share on other sites More sharing options...
Maq Posted June 23, 2009 Share Posted June 23, 2009 No need for all those double quotes, then you have to escape them. Just use a double quote for the entire string, so your variable will interpolate, single quotes for attributes, and curly brackets around your associative array to escape it: echo "[{$gng['tag']}]"; Quote Link to comment https://forums.phpfreaks.com/topic/163367-making-this-a-link/#findComment-862005 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.