rascle Posted January 19, 2009 Share Posted January 19, 2009 Hi I have created a favourite link where when you click on the button it adds the game url to a mysql db however there is an error. As well as adding the game url it also adds part of the code which i dont want - <a href="http://www.rasclerhys.com/ragdollcannonremake.php?">Ragdoll Cannon Remake </a><br /><a href="<?php echo $url; ?>"><?php echo $name; ?></a><br /> That is what appears in the mysql db and i want to get rid of "<a href="<?php echo $url.... " Here is the favourites code - <?php include "config.php"; if($logged[id]){ echo '<div id="gameoptionsmenu"><form name="add" action="addfav.php" method="POST"> <input type="hidden" value="<?php echo $name; ?>" name="fav"> <input type="hidden" value="<?php echo $url; ?>" name="fav2"> <input type="submit" class="submit" value="+ Add To Favourites +"> </form>'; } ?> Thanks Quote Link to comment https://forums.phpfreaks.com/topic/141495-solved-favourite/ Share on other sites More sharing options...
Zhadus Posted January 19, 2009 Share Posted January 19, 2009 <?php include "config.php"; if($logged[id]){ echo '<div id="gameoptionsmenu"><form name="add" action="addfav.php" method="POST"> <input type="hidden" value="' . $name . '" name="fav"> <input type="hidden" value="' . $url . '" name="fav2"> <input type="submit" class="submit" value="+ Add To Favourites +"> </form>'; } ?> That should do it for you. When you are within an echo statement, you merely need to break and input the variable, as opposed to echoing again. Please use the starting and end [\code] tags in the future. Quote Link to comment https://forums.phpfreaks.com/topic/141495-solved-favourite/#findComment-740627 Share on other sites More sharing options...
rascle Posted January 22, 2009 Author Share Posted January 22, 2009 Ok Thanks Quote Link to comment https://forums.phpfreaks.com/topic/141495-solved-favourite/#findComment-743319 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.