Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Error with "My Tags"
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ColourfulConnor" data-source="post: 392111" data-attributes="member: 72764"><p>Basically the CMS I'm using allows the user to create Tags but I was not given a table for it so I created my own and to the most part it actually worked, the player can now create a tag BUT I don't think that tag is being assigned to that player, for some reason when the player selects the "My Tags" page, it does show the tag but when clicking the "Tags" page it displays, here is the code for the "My Tags"</p><p></p><p>No Errors are Appearing.</p><p></p><p><strong>"My Tags"</strong></p><p>[CODE]<div id="mytags" style="display:none;"></p><p> <?php</p><p> $getTags = mysql_query("SELECT * FROM user_tags WHERE user_id = '". $_SESSION['user']['id'] ."' ORDER BY id DESC LIMIT 15");</p><p> while($row = mysql_fetch_array($getTags)) {</p><p> </p><p> if(mysql_num_rows($getTags) < 1) {</p><p> echo '<div class="noTags">You have not yet added any tags!</div>';</p><p> } else {</p><p> echo '<div class="tag"> </p><p> <form action="" method="POST" name="delete" style="margin-top:5px;margin-right:0px;float:left;"></p><p> <input type="text" id="id" name="id" value="'.$row['id'].'" hidden="hidden"/></p><p> <input type="submit" class="inputDelete" value="" name="delTag"/></p><p> </form>'.</p><p> $row['tag'].'</p><p> </div>';</p><p> if(isset($_POST['delTag'])) {</p><p> $select = mysql_query("SELECT * FROM user_tags WHERE user_id ='". $_SESSION['user']['id'] ."'");</p><p> $fetch = mysql_fetch_assoc($select);</p><p> </p><p> if($row['user_id'] != $_SESSION['user']['id']) {</p><p> echo 'You can not delete tags that are not yours!';</p><p> } else {</p><p> $del = mysql_query("DELETE FROM user_tags WHERE id = '".$_POST['id']."' AND</p><p> user_id = '".$_SESSION['user']['id']."'") or die(mysql_error());</p><p> if($del) {</p><p> header('Refresh:0');</p><p> echo '<script type="text/javascript"></p><p> document.getElementById("randomtags").style.display = "none";</p><p> document.getElementById("mytags").style.display = "block";</p><p> document.getElementById("addtag").style.display = "none";</p><p> </script>';</p><p> }</p><p> }</p><p> }</p><p> }</p><p> }</p><p> ?></p><p> </div>[/CODE]</p><p></p><p><strong>Create Tag</strong></p><p>[CODE] <div id="addtag" style="display:none;"></p><p> <form action="#" method="POST"></p><p> <input type="text" name="tag-name" placeholder="Voeg een tag toe" style="float:left;width:59%"/></p><p> <input type="submit" name="addTags" value="Voeg toe" style="width:32.5%;float:right"/></p><p> </form></p><p> <?php</p><p> if(isset($_POST['addTags'])) {</p><p> </p><p> echo '<script type="text/javascript"></p><p> document.getElementById("randomtags").style.display = "none";</p><p> document.getElementById("mytags").style.display = "none";</p><p> document.getElementById("addtag").style.display = "block";</p><p> </script>';</p><p> </p><p> if(empty($_POST['tag-name'])) {</p><p> echo '<font color="red">You did not tag!</font>';</p><p> } else {</p><p> $user = mysql_real_escape_string(stripslashes(addslashes($_SESSION['user']['id'])));</p><p> $tag = mysql_real_escape_string(stripslashes(addslashes(htmlspecialchars($_POST['tag-name']))));</p><p> </p><p> $add = mysql_query("INSERT INTO user_tags (user_id, tag) VALUES ('".$user."', '".$tag."')") or die(mysql_error());</p><p> if($add) {</p><p> echo '<font color="green">Tag has been Added!<a href="">Refresh</a></font>';</p><p> } else {</p><p> echo '<font color="red">Whoops! Something went wrong. Try again.</font>';</p><p> }</p><p> }</p><p> }</p><p> ?></p><p> </div></p><p> </div></p><p> </div>[/CODE]</p><p></p><p><strong>Screenshots: </strong>[SPOILER="Screenshots"]</p><p><strong>Add Tag</strong></p><p><strong><img src="https://s30.postimg.org/m3thezi9d/newtag.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></p><p><strong>Community Tags</strong></p><p><strong><img src="https://s28.postimg.org/ivouxr89p/Community_Tags.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></p><p><strong>My Tags</strong></p><p><strong><img src="https://s27.postimg.org/oina4ixtv/My_Tags.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></p><p><strong>Tag Database</strong></p><p><strong><img src="https://s23.postimg.org/hh9lu2vwb/tag_database.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></p><p>[/SPOILER]</p></blockquote><p></p>
[QUOTE="ColourfulConnor, post: 392111, member: 72764"] Basically the CMS I'm using allows the user to create Tags but I was not given a table for it so I created my own and to the most part it actually worked, the player can now create a tag BUT I don't think that tag is being assigned to that player, for some reason when the player selects the "My Tags" page, it does show the tag but when clicking the "Tags" page it displays, here is the code for the "My Tags" No Errors are Appearing. [B]"My Tags"[/B] [CODE]<div id="mytags" style="display:none;"> <?php $getTags = mysql_query("SELECT * FROM user_tags WHERE user_id = '". $_SESSION['user']['id'] ."' ORDER BY id DESC LIMIT 15"); while($row = mysql_fetch_array($getTags)) { if(mysql_num_rows($getTags) < 1) { echo '<div class="noTags">You have not yet added any tags!</div>'; } else { echo '<div class="tag"> <form action="" method="POST" name="delete" style="margin-top:5px;margin-right:0px;float:left;"> <input type="text" id="id" name="id" value="'.$row['id'].'" hidden="hidden"/> <input type="submit" class="inputDelete" value="" name="delTag"/> </form>'. $row['tag'].' </div>'; if(isset($_POST['delTag'])) { $select = mysql_query("SELECT * FROM user_tags WHERE user_id ='". $_SESSION['user']['id'] ."'"); $fetch = mysql_fetch_assoc($select); if($row['user_id'] != $_SESSION['user']['id']) { echo 'You can not delete tags that are not yours!'; } else { $del = mysql_query("DELETE FROM user_tags WHERE id = '".$_POST['id']."' AND user_id = '".$_SESSION['user']['id']."'") or die(mysql_error()); if($del) { header('Refresh:0'); echo '<script type="text/javascript"> document.getElementById("randomtags").style.display = "none"; document.getElementById("mytags").style.display = "block"; document.getElementById("addtag").style.display = "none"; </script>'; } } } } } ?> </div>[/CODE] [B]Create Tag[/B] [CODE] <div id="addtag" style="display:none;"> <form action="#" method="POST"> <input type="text" name="tag-name" placeholder="Voeg een tag toe" style="float:left;width:59%"/> <input type="submit" name="addTags" value="Voeg toe" style="width:32.5%;float:right"/> </form> <?php if(isset($_POST['addTags'])) { echo '<script type="text/javascript"> document.getElementById("randomtags").style.display = "none"; document.getElementById("mytags").style.display = "none"; document.getElementById("addtag").style.display = "block"; </script>'; if(empty($_POST['tag-name'])) { echo '<font color="red">You did not tag!</font>'; } else { $user = mysql_real_escape_string(stripslashes(addslashes($_SESSION['user']['id']))); $tag = mysql_real_escape_string(stripslashes(addslashes(htmlspecialchars($_POST['tag-name'])))); $add = mysql_query("INSERT INTO user_tags (user_id, tag) VALUES ('".$user."', '".$tag."')") or die(mysql_error()); if($add) { echo '<font color="green">Tag has been Added!<a href="">Refresh</a></font>'; } else { echo '<font color="red">Whoops! Something went wrong. Try again.</font>'; } } } ?> </div> </div> </div>[/CODE] [B]Screenshots: [/B][SPOILER="Screenshots"] [B]Add Tag [IMG]https://s30.postimg.org/m3thezi9d/newtag.png[/IMG] Community Tags [IMG]https://s28.postimg.org/ivouxr89p/Community_Tags.png[/IMG] My Tags [IMG]https://s27.postimg.org/oina4ixtv/My_Tags.png[/IMG] Tag Database [IMG]https://s23.postimg.org/hh9lu2vwb/tag_database.png[/IMG] [/B] [/SPOILER] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Error with "My Tags"
Top