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 Releases
CMS Releases
[Addon] Tags [RevCMS]
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="brsy" data-source="post: 90615" data-attributes="member: 2912"><p>I found a quick error just by glancing at the code. For one, if you want to redirect a user to a specific page, it's</p><p>[PHP]header("Location: me");</p><p>// the following is not valid PHP to the extent of my knowledge:</p><p>Redirect("me");[/PHP]</p><p> </p><p>Please wait about 5 minutes while I fix everything within the code, and make it more efficient. Do not use the code in the first post, as it will throw errors like a mofo.</p><p> </p><p>----------EDIT----------</p><p>Here is the corrected code, something might be wrong, as I deleted loads of shit that I thought were useless. I am also watching a basketball game, so that increases the chances of this being fucked up. If there is an error, just let me know the error and I'll correct it. Like my post if I helped <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p>[PHP]<?php</p><p>$fetch_tags = mysql_query("SELECT tag,id FROM user_tags WHERE user_id = '".$_SESSION['user']['id']."' ORDER BY DESC LIMIT 20") or die(mysql_error());</p><p>$tags_num = mysql_num_rows($fetch_tags);</p><p> </p><p> $randomq[] = "What is your favourite food?";</p><p> $randomq[] = "Who is your favourite actor?";</p><p> $randomq[] = "What kind of music do you like?";</p><p> $randomq[] = "What is your favourite sport?";</p><p> $randomq[] = "Who is your favourite actress?";</p><p> $randomq[] = "What is your favourite colour?";</p><p> $randomq[] = "What is your favourite band?";</p><p> $randomq[] = "What is your favourite TV show?";</p><p> $randomq[] = "Which football team do you support?";</p><p> $randomq[] = "What is your favourite football team?";</p><p> $randomq[] = "Your favourite cartoon?";</p><p> $randomq[] = "What is your favourite video game?";</p><p> $randomq[] = "What's your favourite pastime?";</p><p> $randomq[] = "What kind of mood are you in right now?";</p><p> $randomq[] = "What is your favourite movie?";</p><p> $randomq[] = "What is your favourite time of year?";</p><p> </p><p>$chosen = rand(0,count($randomq)-1);</p><p> </p><p> $do = $_GET['do'];</p><p> if($do != "") {</p><p> mysql_query("DELETE FROM user_tags WHERE id = '".$do."'");</p><p> header("Location: me");</p><p> }</p><p> </p><p> if(isset($_POST['newtag'])) {</p><p> $tag = mysql_real_escape_strings(htmlspecialchars($_POST[newtag]));</p><p> }</p><p> </p><p> if(strlen($_SESSION['user']['id']) < 1 || strlen($tag) < 1) {</p><p> header("Location: me");</p><p> }</p><p> else {</p><p> mysql_query("INSERT INTO user_tags (user_id, tag) VALUES ('" . $_SESSION['user']['id'] . "', '" . $tag . "')");</p><p> header("Location: me");</p><p> }</p><p> ?>[/PHP]</p></blockquote><p></p>
[QUOTE="brsy, post: 90615, member: 2912"] I found a quick error just by glancing at the code. For one, if you want to redirect a user to a specific page, it's [PHP]header("Location: me"); // the following is not valid PHP to the extent of my knowledge: Redirect("me");[/PHP] Please wait about 5 minutes while I fix everything within the code, and make it more efficient. Do not use the code in the first post, as it will throw errors like a mofo. ----------EDIT---------- Here is the corrected code, something might be wrong, as I deleted loads of shit that I thought were useless. I am also watching a basketball game, so that increases the chances of this being fucked up. If there is an error, just let me know the error and I'll correct it. Like my post if I helped :) [PHP]<?php $fetch_tags = mysql_query("SELECT tag,id FROM user_tags WHERE user_id = '".$_SESSION['user']['id']."' ORDER BY DESC LIMIT 20") or die(mysql_error()); $tags_num = mysql_num_rows($fetch_tags); $randomq[] = "What is your favourite food?"; $randomq[] = "Who is your favourite actor?"; $randomq[] = "What kind of music do you like?"; $randomq[] = "What is your favourite sport?"; $randomq[] = "Who is your favourite actress?"; $randomq[] = "What is your favourite colour?"; $randomq[] = "What is your favourite band?"; $randomq[] = "What is your favourite TV show?"; $randomq[] = "Which football team do you support?"; $randomq[] = "What is your favourite football team?"; $randomq[] = "Your favourite cartoon?"; $randomq[] = "What is your favourite video game?"; $randomq[] = "What's your favourite pastime?"; $randomq[] = "What kind of mood are you in right now?"; $randomq[] = "What is your favourite movie?"; $randomq[] = "What is your favourite time of year?"; $chosen = rand(0,count($randomq)-1); $do = $_GET['do']; if($do != "") { mysql_query("DELETE FROM user_tags WHERE id = '".$do."'"); header("Location: me"); } if(isset($_POST['newtag'])) { $tag = mysql_real_escape_strings(htmlspecialchars($_POST[newtag])); } if(strlen($_SESSION['user']['id']) < 1 || strlen($tag) < 1) { header("Location: me"); } else { mysql_query("INSERT INTO user_tags (user_id, tag) VALUES ('" . $_SESSION['user']['id'] . "', '" . $tag . "')"); header("Location: me"); } ?>[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
[Addon] Tags [RevCMS]
Top