Jump to content

zhshero

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by zhshero

  1. i added this there and all it did was set all users to 0 mysql_query("UPDATE `users` SET statusB='25A' AND user_id");
  2. so i should be adding it here? function logout () { //session must be started before anything session_start (); //if we have a valid session if ( $_SESSION['logged_in'] == TRUE ) { //unset the sessions (all of them - array given) unset ( $_SESSION ); //destroy what's left session_destroy (); } //It is safest to set the cookies with a date that has already expired. if ( isset ( $_COOKIE['cookie_id'] ) && isset ( $_COOKIE['authenticate'] ) ) { /** * uncomment the following line if you wish to remove all cookies * (don't forget to comment ore delete the following 2 lines if you decide to use clear_cookies) */ //clear_cookies (); setcookie ( "cookie_id", '', time() - KEEP_LOGGED_IN_FOR, COOKIE_PATH ); setcookie ( "authenticate", '', time() - KEEP_LOGGED_IN_FOR, COOKIE_PATH ); } //redirect the user to the default "logout" page header ( "Location: " . REDIRECT_ON_LOGOUT ); } or in logout.php ?
  3. is it possible to update data in mysql when a user clicks logout?
  4. i re did it, had to add the userfinal but not sure if I'm using it right <?php require_once('../settings.php'); checkLogin('1 2'); $userfinal = get_main_P($_SESSION['user_id']); $id=$_GET["msgs"]; mysql_query("DELETE FROM messages WHERE message_id='$id' AND to_user = '$userfinal'"); ?>
  5. i take this code works, but other members, can delete messages that isn't there's how would i go about on making it so it only delete's there own messages and can't delete others?
  6. i trying to delete messages out of my message database but im not sure if i'm using this code right or there stuff missing to it :S delete.php <?php require_once('settings.php'); checkLogin('1 2'); $id=$_GET["msgs"]; mysql_query("DELETE messages FROM messages WHERE message_id='$id'"); ?> link usages to delete <a href="delete.php?msgs=<? echo $row['message_id'] ?>">[X]</a>
  7. Thanks you to i figured it out would of taken me days
  8. I need help figuring out why it dose this \/ here the page <?php require_once('../settings.php'); checkLogin('1 2'); ?> <? $userfinal = get_username($_SESSION['user_id']); // get the messages from the table. $get_messages = mysql_query("SELECT message_id FROM messages WHERE to_user='$userfinal' ORDER BY message_id DESC") or die(mysql_error()); $get_messages2 = mysql_query("SELECT * FROM messages WHERE to_user='$userfinal' ORDER BY message_id DESC") or die(mysql_error()); $num_messages = mysql_num_rows($get_messages); // display each message title, with a link to their content echo '<center><ul>'; for($count = 1; $count <= $num_messages; $count++) { $row = mysql_fetch_array($get_messages2); //if the message is not read, show "(new)" after the title, else, just show the title. $id=$_GET["delete_id"]; mysql_query("DELETE * FROM messages WHERE message_id='$id' "); if($row['message_read'] == 0) { ?> <head> <title>ZhsHero Friends</title> <link href="/themes/theme1/default.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1>ZhsHero Friends</h1> <h2>Menu</h2> <ul> <li class="first"><a href="home.php" accesskey="1" title="">Home</a></li> <li><a href="mymembers.php" accesskey="2" title="">members</a></li> <li><a href="#" accesskey="3" title="">Services</a></li> <li><a href="#" accesskey="4" title="">About</a></li> <li><a href="#" accesskey="5" title="">Contact</a></li> </ul> </div> <div id="content"> <div id="colOne"> <h3><?php echo 'Welcome ' . get_username ( $_SESSION['user_id'] ) . ''; ?></h3> <ul class="list"> <img src="<? echo get_main_P ( $_SESSION['user_id'] ) ?>" border=1 width="150" height="150"> </ul> <p> </p> <h3>news box</h3> <p>new box comming soon</p> </div> <div id="colTwo"> <p> <form> <a href="read_message.php?messageid=<? echo $row['message_id'] ?>"> <img src="<? echo $row['user_photo'] ?>" width="50" height="50" /> <a href="read_message.php?messageid=<? echo $row['message_id'] ?>"> <? echo $row['message_title'] ?></a> <font color="red">(unread)</font> </a> <? }else{ ?> <br> <a href="read_message.php?messageid=<? echo $row['message_id'] ?>"> <img src="<? echo $row['user_photo'] ?>" width="50" height="50" /> <a href="read_message.php?messageid=<? echo $row['message_id'] ?>"> <? echo $row['message_title'] ?></a> <font color="green">(read)</font> </a> <? }} echo '</ul>'; echo '<form name="newmsgfrm" method="post" action="new_message.php">'; echo '<input type="submit" value="Send a New Message">'; echo '</form>'; echo '<form name="backfrm" method="post" action="index.php">'; echo '<input type="submit" value="Back to Home">'; echo '</form>'; ?> </form> </p> </div></div> <div id="footer"> <p>Copyright (c) 2006 Sitename.com. All rights reserved. Design by <a href="http://freecsstemplates.org/">Free CSS Templates</a>.</p> </div> <div style="font-size: 0.8em; text-align: center;"> <br /> Design downloaded from Zeroweb.org: <a href="http://www.zeroweb.org">Free website templates, layouts, and tools.</a><br /> <br /> </div> </body> </html>
×
×
  • 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.