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
Software Development
Programming
Programming Q&A
Syntax error
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="vRory" data-source="post: 196818" data-attributes="member: 2857"><p>[PHP]<?php $pagerank = 4; include "templates/header.php"; ?></p><p> </p><p> <div id="site_content"></p><p> <?php include "templates/sidebar.php"; ?></p><p> <div id="content_container"></p><p> </p><p> <div id="content"></p><p> <h1>{hotelName} Hotel ASE :: Give VIP!</h1><hr/></p><p> <?php</p><p> if(isset($_POST['give']) && $_SESSION['user']['rank'] >= $pagerank)</p><p> { </p><p> if(mysql_num_rows(mysql_query("SELECT * FROM users WHERE username = '".filter($_POST['username'])."'")))</p><p> {</p><p> mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'admin_vip.php', '".date("D, d F Y H:i", time())."'), '".filter($_POST['username'])."' ")or die(mysql_error());</p><p> </p><p> $getInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE username = '".filter($_POST['username'])."'"))or die(mysql_error());</p><p> if ($getInfo['rank'] == 1)</p><p> {</p><p> mysql_query("UPDATE users SET rank = '2' WHERE username = '".filter($_POST['username'])."'")or die(mysql_error());</p><p> </p><p> </p><p> }</p><p> @Mus("updatevip"." ".$getInfo['id']);</p><p> echo '<div class="alert alert-success">'.$_POST['username'].' is now VIP!</div>';</p><p> </p><p> </p><p> }</p><p> </p><p> else</p><p> {</p><p> echo '<div class="alert alert-error">User does not exist.</div>';</p><p> }</p><p> </p><p> }</p><p> </p><p> </p><p> ?></p><p> </p><p> <form method="post"></p><p> <table class="table table-bordered table-condensed"></p><p> <tr></p><p> <td>Username</td></p><p> <td><input type="text" name="username" /></td></p><p> </tr></p><p> <tr></p><p> <td></td></p><p> <td><input type="submit" value="VIP User" name="give"/></td></p><p> </tr></p><p> </table></p><p> </form></p><p> </div></p><p> </div></p><p> </div></p><p> </p><p><?php include "templates/footer.php"; ?>[/PHP]</p><p>This is the page i use for giving a user vip, this makes a record of whom is given vip i tried adding the users name to the record and i get this error</p><p></p><p> </p><p>The query is this as shown above:</p><p>[PHP]mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'admin_vip.php', '".date("D, d F Y H:i", time())."'), '".filter($_POST['username'])."' ")or die(mysql_error());</p><p>[/PHP]</p></blockquote><p></p>
[QUOTE="vRory, post: 196818, member: 2857"] [PHP]<?php $pagerank = 4; include "templates/header.php"; ?> <div id="site_content"> <?php include "templates/sidebar.php"; ?> <div id="content_container"> <div id="content"> <h1>{hotelName} Hotel ASE :: Give VIP!</h1><hr/> <?php if(isset($_POST['give']) && $_SESSION['user']['rank'] >= $pagerank) { if(mysql_num_rows(mysql_query("SELECT * FROM users WHERE username = '".filter($_POST['username'])."'"))) { mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'admin_vip.php', '".date("D, d F Y H:i", time())."'), '".filter($_POST['username'])."' ")or die(mysql_error()); $getInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE username = '".filter($_POST['username'])."'"))or die(mysql_error()); if ($getInfo['rank'] == 1) { mysql_query("UPDATE users SET rank = '2' WHERE username = '".filter($_POST['username'])."'")or die(mysql_error()); } @Mus("updatevip"." ".$getInfo['id']); echo '<div class="alert alert-success">'.$_POST['username'].' is now VIP!</div>'; } else { echo '<div class="alert alert-error">User does not exist.</div>'; } } ?> <form method="post"> <table class="table table-bordered table-condensed"> <tr> <td>Username</td> <td><input type="text" name="username" /></td> </tr> <tr> <td></td> <td><input type="submit" value="VIP User" name="give"/></td> </tr> </table> </form> </div> </div> </div> <?php include "templates/footer.php"; ?>[/PHP] This is the page i use for giving a user vip, this makes a record of whom is given vip i tried adding the users name to the record and i get this error The query is this as shown above: [PHP]mysql_query("INSERT INTO `cms_housekeeping_logs` (userid,ip_address,page,time,extra_data) VALUES ('".$_SESSION['user']['id']."', '".$_SERVER['REMOTE_ADDR']."', 'admin_vip.php', '".date("D, d F Y H:i", time())."'), '".filter($_POST['username'])."' ")or die(mysql_error()); [/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Syntax error
Top