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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.