mrt003003 Posted April 20, 2011 Share Posted April 20, 2011 Hi there im trying to parse a url parameter in a hyperlink, i cant seem to get it to work, im sure its a problem with the braces. This is the original code: echo '<a href="http://localhost/swb/planet.php/"> <p class="rmoncalamari tmoncalamari">' . $moncalamari. "1-1-2-6".'</p></a>'; and i tried to modify it to parse the record id... echo '<a href="http://localhost/swb/planet.php?recordID= '$row_cats['CatName'];/"> <p class="rmoncalamari tmoncalamari">' . $moncalamari. "1-1-2-6".'</p></a>'; If you could help me that would be ace. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/234292-parse-a-url-parameter-hyperlink-in-an-echo/ Share on other sites More sharing options...
Muddy_Funster Posted April 20, 2011 Share Posted April 20, 2011 doesn't look like there is anything wrong with the braces,string is however malformed: echo '<a href="http://localhost/swb/planet.php?recordID= '$row_cats['CatName'];/"> <p class="rmoncalamari tmoncalamari">' . $moncalamari. "1-1-2-6".'</p></a>'; should look more like: echo '<a href="http://localhost/swb/planet.php?recordID='.$row_cats['CatName'].'/"> <p class="rmoncalamari tmoncalamari">' . $moncalamari. "1-1-2-6".'</p></a>'; Quote Link to comment https://forums.phpfreaks.com/topic/234292-parse-a-url-parameter-hyperlink-in-an-echo/#findComment-1204183 Share on other sites More sharing options...
mrt003003 Posted April 20, 2011 Author Share Posted April 20, 2011 Hi there, thaks for the reply thats geat! It doesnt quite work for me though although it does show the link when highlighted: http://localhost/swb/planet.php?recordID=Mon Calamari/ but doesnt parse the id to the query on the other page... the url also only says: http://localhost/swb/planet.php.... without the parsed record id. Could it be because of the / at the end of the Mon Calamari??? If so how do i adjust it, i find it confusing when done in an echo. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/234292-parse-a-url-parameter-hyperlink-in-an-echo/#findComment-1204195 Share on other sites More sharing options...
mrt003003 Posted April 20, 2011 Author Share Posted April 20, 2011 Ive done it... sorry i was being really stupid. Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/234292-parse-a-url-parameter-hyperlink-in-an-echo/#findComment-1204196 Share on other sites More sharing options...
Muddy_Funster Posted April 20, 2011 Share Posted April 20, 2011 no problem Quote Link to comment https://forums.phpfreaks.com/topic/234292-parse-a-url-parameter-hyperlink-in-an-echo/#findComment-1204199 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.