Jump to content

Parse a url parameter hyperlink in an echo


mrt003003

Recommended Posts

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 :)

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>';

 

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 :)

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.