Jump to content

[SOLVED] Favourite


rascle

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/141495-solved-favourite/
Share on other sites

<?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.

Link to comment
https://forums.phpfreaks.com/topic/141495-solved-favourite/#findComment-740627
Share on other sites

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.