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 Submitting Form
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="JayC" data-source="post: 308857" data-attributes="member: 36373"><p>Alright heres the whole thing divided up:</p><p>JavaScript</p><p>[CODE] <script type="text/javascript" src="http://code.jquery.com/jquery-git.js"></script></p><p> <script type='text/javascript'></p><p> $(window).load(function(){</p><p> $('#choose').change(function(){</p><p> var image = $("#choose option:selected").data('image');</p><p> $('#selected').attr("src", image);</p><p> });</p><p> });</p><p> </script>[/CODE]</p><p>Form</p><p>[CODE]</p><p><form name="form" action="" method="post"></p><p> <span title="Pick Your Room">Room ID: </span><br /></p><p> <select name="room_id"></p><p> <?php</p><p> $getRoomInfo = mysql_query('SELECT id,caption FROM rooms WHERE id AND owner = "'.USER_NAME.'"');</p><p>while($roomInfo = mysql_fetch_array($getRoomInfo))</p><p>{</p><p> echo '<option value="'.clean($roomInfo['id']).'">'.$roomInfo['id'].' - '.clean($roomInfo['caption']).'<br /></option>';</p><p>}</p><p>?></p><p> </select><br /><br /></p><p> <select id="choose"></p><p> <option selected="selected">Choose Image</option></p><p> <option data-image="http://aeon-hotel.net/r63/c_images/groups/POKE1.gif"> Image One </option></p><p> <option data-image="http://aeon-hotel.net/r63/c_images/groups/ES079.gif"> Image Two </option></p><p> <option data-image="http://aeon-hotel.net/r63/c_images/groups/ES078.gif"> Image Three </option></p><p> </select><br /></p><p> <img id="selected" src="http://placehold.it/50x50/aaaaaa" /><br></p><p></p><p> </p><p> <span title="Name">Group name: </span><br /></p><p> <input type="text" name="name" /><br /><br /></p><p> </p><p> <span title="Desc">Group Description: </span><br /></p><p> <textarea name="desc" rows="4" cols="40"></textarea><br /><br /></p><p> </p><p> <span title="Priv">Group Privacy: </span><br /></p><p> <select name="priv"></p><p> <option value="open">Open</option></p><p> <option value="blocked">Blocked</option></p><p></select><br /><br /></p><p></p><p> <span title="Stat">Group Status: </span><br /></p><p> <select name="stat"></p><p> <option value="open">Open</option></p><p> <option value="locked">Locked</option></p><p> <option value="closed">Closed</option></p><p></select><br /><br /></p><p> </p><p> <input type="submit" name="Groups" value="Create" class="submit"></p><p></form>[/CODE]</p><p>PHP</p><p>[CODE]</p><p><?php</p><p></p><p></p><p>if(isset($_POST['Groups']))</p><p>{</p><p> $rid = filter($_POST['room_id']);</p><p> $name = filter($_POST['name']);</p><p> $desc = filter($_POST['desc']);</p><p> $Priv = filter($_POST['priv']);</p><p> $Stat = filter($_POST['stat']);</p><p> $badge = filter($_POST['choose']);</p><p> </p><p> $hope = dbquery("SELECT * FROM rooms WHERE id='".$rid."'");</p><p> $room = dbquery("SELECT * FROM groups WHERE roomid='".$rid."'");</p><p> $room2 = mysql_fetch_assoc($room);</p><p> $hope2 = mysql_fetch_assoc($hope);</p><p> </p><p> if(mysql_num_rows($room) > 1)</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>Room already has a group</strong></div></center>';</p><p> }elseif(strstr($desc, "<") || strstr($desc, ">") || strstr($desc, "?") || strstr($desc, "&") || strstr($desc, "#") || strstr($desc, "@") || strstr($desc, "*") || strstr($desc, "%")) {</p><p> echo '<center><div class="rounded rounded-red"><strong>Why are you trying to exploit?</strong></div></center>';</p><p> }elseif(strstr($name, "<") || strstr($name, ">") || strstr($name, "?") || strstr($name, "&") || strstr($name, "#") || strstr($name, "@") || strstr($name, "*") || strstr($name, "%")) {</p><p> echo '<center><div class="rounded rounded-red"><strong>Why are you trying to exploit?</strong></div></center>';</p><p> }elseif(is_numeric($name))</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>No numbers in the group name please</strong></div></center>';</p><p> }elseif($hope2['owner'] != $users->Id2name(USER_ID))</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>That room doesn\'t belong to you.</strong></div></center>';</p><p> }elseif(strlen($name) < 1 || strlen($name) > 12)</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>The Group Name must be between 1 - 12 characters.</strong></div></center>';</p><p> }elseif(strlen($desc) > 120)</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>The Group Desc must be less than 120 characters.</strong></div></center>';</p><p> }elseif($Priv != "open" && $Priv != "blocked")</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>Privacy Invalid Response</strong></div></center>';</p><p> }elseif($Stat != "open" && $Stat != "closed" && $Stat != "locked")</p><p> {</p><p> echo '<center><div class="rounded rounded-red"><strong>Status Invalid Response</strong></div></center>';</p><p> }else</p><p> {</p><p> dbquery("INSERT INTO groups (name,desc,badge,owner_id,created,roomid,locked,privacy) VALUES ('".$name."','".$desc."','".$badge."','".USER_ID."','" . date('j F Y h:i') . "','".$rid."','".$Priv."','".$Stat."')");</p><p> echo '<center><div class="rounded rounded-green"><strong>Your bot has been added, unload your room and bam your bot is there! :)</strong></div></center>';</p><p> }</p><p>}</p><p>?>[/CODE]</p></blockquote><p></p>
[QUOTE="JayC, post: 308857, member: 36373"] Alright heres the whole thing divided up: JavaScript [CODE] <script type="text/javascript" src="http://code.jquery.com/jquery-git.js"></script> <script type='text/javascript'> $(window).load(function(){ $('#choose').change(function(){ var image = $("#choose option:selected").data('image'); $('#selected').attr("src", image); }); }); </script>[/CODE] Form [CODE] <form name="form" action="" method="post"> <span title="Pick Your Room">Room ID: </span><br /> <select name="room_id"> <?php $getRoomInfo = mysql_query('SELECT id,caption FROM rooms WHERE id AND owner = "'.USER_NAME.'"'); while($roomInfo = mysql_fetch_array($getRoomInfo)) { echo '<option value="'.clean($roomInfo['id']).'">'.$roomInfo['id'].' - '.clean($roomInfo['caption']).'<br /></option>'; } ?> </select><br /><br /> <select id="choose"> <option selected="selected">Choose Image</option> <option data-image="http://aeon-hotel.net/r63/c_images/groups/POKE1.gif"> Image One </option> <option data-image="http://aeon-hotel.net/r63/c_images/groups/ES079.gif"> Image Two </option> <option data-image="http://aeon-hotel.net/r63/c_images/groups/ES078.gif"> Image Three </option> </select><br /> <img id="selected" src="http://placehold.it/50x50/aaaaaa" /><br> <span title="Name">Group name: </span><br /> <input type="text" name="name" /><br /><br /> <span title="Desc">Group Description: </span><br /> <textarea name="desc" rows="4" cols="40"></textarea><br /><br /> <span title="Priv">Group Privacy: </span><br /> <select name="priv"> <option value="open">Open</option> <option value="blocked">Blocked</option> </select><br /><br /> <span title="Stat">Group Status: </span><br /> <select name="stat"> <option value="open">Open</option> <option value="locked">Locked</option> <option value="closed">Closed</option> </select><br /><br /> <input type="submit" name="Groups" value="Create" class="submit"> </form>[/CODE] PHP [CODE] <?php if(isset($_POST['Groups'])) { $rid = filter($_POST['room_id']); $name = filter($_POST['name']); $desc = filter($_POST['desc']); $Priv = filter($_POST['priv']); $Stat = filter($_POST['stat']); $badge = filter($_POST['choose']); $hope = dbquery("SELECT * FROM rooms WHERE id='".$rid."'"); $room = dbquery("SELECT * FROM groups WHERE roomid='".$rid."'"); $room2 = mysql_fetch_assoc($room); $hope2 = mysql_fetch_assoc($hope); if(mysql_num_rows($room) > 1) { echo '<center><div class="rounded rounded-red"><strong>Room already has a group</strong></div></center>'; }elseif(strstr($desc, "<") || strstr($desc, ">") || strstr($desc, "?") || strstr($desc, "&") || strstr($desc, "#") || strstr($desc, "@") || strstr($desc, "*") || strstr($desc, "%")) { echo '<center><div class="rounded rounded-red"><strong>Why are you trying to exploit?</strong></div></center>'; }elseif(strstr($name, "<") || strstr($name, ">") || strstr($name, "?") || strstr($name, "&") || strstr($name, "#") || strstr($name, "@") || strstr($name, "*") || strstr($name, "%")) { echo '<center><div class="rounded rounded-red"><strong>Why are you trying to exploit?</strong></div></center>'; }elseif(is_numeric($name)) { echo '<center><div class="rounded rounded-red"><strong>No numbers in the group name please</strong></div></center>'; }elseif($hope2['owner'] != $users->Id2name(USER_ID)) { echo '<center><div class="rounded rounded-red"><strong>That room doesn\'t belong to you.</strong></div></center>'; }elseif(strlen($name) < 1 || strlen($name) > 12) { echo '<center><div class="rounded rounded-red"><strong>The Group Name must be between 1 - 12 characters.</strong></div></center>'; }elseif(strlen($desc) > 120) { echo '<center><div class="rounded rounded-red"><strong>The Group Desc must be less than 120 characters.</strong></div></center>'; }elseif($Priv != "open" && $Priv != "blocked") { echo '<center><div class="rounded rounded-red"><strong>Privacy Invalid Response</strong></div></center>'; }elseif($Stat != "open" && $Stat != "closed" && $Stat != "locked") { echo '<center><div class="rounded rounded-red"><strong>Status Invalid Response</strong></div></center>'; }else { dbquery("INSERT INTO groups (name,desc,badge,owner_id,created,roomid,locked,privacy) VALUES ('".$name."','".$desc."','".$badge."','".USER_ID."','" . date('j F Y h:i') . "','".$rid."','".$Priv."','".$Stat."')"); echo '<center><div class="rounded rounded-green"><strong>Your bot has been added, unload your room and bam your bot is there! :)</strong></div></center>'; } } ?>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Error Submitting Form
Top