Jump to content

offdarip

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by offdarip

  1. Thank You! You are a lifesaver! That worked like a charm.. I've been trying to get that right for soooo long.. Thank you again.
  2. Thanks I will check that out... and if they are in different places can they be changed to the same?
  3. Yes i am, my log in scripts and most of my web site is in php4 and just those few scripts and in 5
  4. Most of my website is written in php4. My hosting server has support for both 4 and 5 just by changing file extension. .php which is the default supports 4, .php5 of course supports 5. The problem I am having is that the pages with the .php5 extensions are not recognizing session variables. Is there something I should be doing differently in 5 for my session variables? For example a variable request like this returns 0 print $_SESSION['FULLNAME']; Please Help!! Thank you in advance?
  5. This is a comment script i made some editions to to suit my website and it updates database and shows comment on page when submitted but when you refresh the page or go directly to the comment page it does not show comments.. Any ideas? (and it was doing the same thing before i made the additions) Original Script came from http://www.9lessons.info/2009/09/comment-system-database-with-jquery.html My Script Below Table: //Posts Table CREATE TABLE posts ( post_id INT PRIMARY KEY AUTO_INCREMENT, post_title VARCHAR(200), post_dis TEXT ); //Comments Table CREATE TABLE comments ( com_id INT PRIMARY KEY AUTO_INCREMENT, com_name VARCHAR(100), com_email VARCHAR(100), com_dis TEXT, post_id_fk INT, FOREIGN KEY(post_id_fk) REFERENCES posts(post_id) ); comment.php <?php session_start(); require_once "scripts/connect_to_mysql.php"; $id = $_SESSION['LOGINID']; //$post_id value comes from the POSTS table mysql_query("select * from posts where post_id='$post_id'"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Comments with jQuery and Ajax</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" > $(function() { $(".submit").click(function() { var name = $("#name").val(); var email = $("#email").val(); var comment = $("#comment").val(); var post_id = $("#post_id").val(); var dataString = 'name='+ name + '&email=' + email + '&comment=' + comment+ '&post_id=' + post_id; if(name=='' || email=='' || comment=='') { alert('Please Give Valid Details'); } else { $("#flash").show(); $("#flash").fadeIn(400).html('<img src="ajax-loader.gif" />Loading Comment...'); $.ajax({ type: "POST", url: "commentajax.php", data: dataString, cache: false, success: function(html){ $("ol#update").append(html); $("ol#update li:last").fadeIn("slow"); $("#flash").hide(); } }); }return false; }); }); </script> <style type="text/css"> body { font-family:Arial, Helvetica, sans-serif; font-size:14px; } .comment_box { background-color:#D3E7F5; border-bottom:#ffffff solid 1px; padding-top:3px } a { text-decoration:none; color:#d02b55; } a:hover { text-decoration:underline; color:#d02b55; } *{margin:0;padding:0;} ol.timeline {list-style:none;font-size:1.2em;} ol.timeline li{ display:none;position:relative;padding:.7em 0 .6em 0;}ol.timeline li:first-child{} #main { width:500px; margin-top:20px; margin-left:100px; font-family:"Trebuchet MS"; } #flash { margin-left:100px; } .box { height:85px; border-bottom:#dedede dashed 1px; margin-bottom:20px; } input { color:#000000; font-size:14px; border:#666666 solid 2px; height:24px; margin-bottom:10px; width:200px; } textarea { color:#000000; font-size:14px; border:#666666 solid 2px; height:124px; margin-bottom:10px; width:200px; } .titles{ font-size:13px; padding-left:10px; } .star { color:#FF0000; font-size:16px; font-weight:bold; padding-left:5px; } .com_img { float: left; width: 80px; height: 80px; margin-right: 20px; } .com_name { font-size: 16px; color: rgb(102, 51, 153); font-weight: bold; } </style> </head> <body> <div id="main"> <div style="font-family:'Georgia', Times New Roman, Times, serif; font-size:2.0em; margin-bottom:10px "> </div> <div style="font-family:'Georgia', Times New Roman, Times, serif; font-size:1.0em; margin-bottom:10px "> </div> <ol id="update" class="timeline"> <?php $sql=mysql_query("select * from comments where post_id_fk='$post_id'"); while($row=mysql_fetch_array($sql)) { $name=$row['com_name']; $email=$row['com_email']; $comment=$row['com_dis']; $post_id_fk=$row['post_id_fk']; $post_id=$row['post_id']; $lowercase = strtolower($email); ?> <li class="box"> <img src="members/<?php print $id; ?>/pic1.jpg" class="com_img"> <span class="com_name"> <?php echo $name; ?></span> <br /> <?php echo $comment; ?></li> <?php } ?> </ol> <div id="flash"></div> <div style="margin-left:100px"> <form action="#" method="post"> <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>"/> <input type="text" name="title" id="name"/><span class="titles">Name</span><span class="star">*</span><br /> <input type="text" name="email" id="email"/><span class="titles">Email</span><span class="star">*</span><br /> <textarea name="comment" id="comment"></textarea><br /> <input type="submit" class="submit" value=" Submit Comment " /> </form> </div> </div> </body> </html> commentajax.php <?php session_start(); require_once "scripts/connect_to_mysql.php"; $id = $_SESSION['LOGINID']; if($_POST) { $name=$_POST['name']; $email=$_POST['email']; $comment=$_POST['comment']; $post_id=$_POST['post_id']; mysql_query("insert into posts(post_id) values ('$post_id')"); $post_id = mysql_insert_id(); mysql_query("insert into comments(com_name,com_email,com_dis,post_id_fk) values ('$name','$email','$comment','$post_id')"); } else { } ?> <li class="box"> <img src="members/<?php print $id; ?>/pic1.jpg" class="com_img"/><span class="com_name"> <?php echo $name;?></span> <br /><br /> <?php echo $comment; ?><br /><br /> </li>
  6. That is the only error showing and i am aware of the refresh i was just pointing that out that the login does work but the session_regenerate_id() part just errors out
  7. one other thing the error pops up when login is submitted but only stays for a second and redirects logged in... The 1st thing i check was if there was anything (spaces,etc.) before of after the <?php ?>
  8. This is all i have in the mysqlconnect.php <?php $db_host = "********"; // Username $db_username = "********"; // Password $db_pass = "*******"; //MySQL database $db_name = "*******"; // Run the connection here @mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); @mysql_select_db("$db_name") or die ("no database"); ?>
  9. Thank you for the tip, I changed it but that still did not correct the problem
  10. Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /hermes/bosweb/web263/b2638/ipw.mysite/public_html/header_tmpnite.php on line 27
  11. Thanks for the replies but still no good.. same error just bumped down to line 29 because of the addition to script.. Any other ideas?
  12. It says its coming from line 27 but line 27 is session_regenerate_id()
  13. Why am i Getting this? Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in ..... <?php if(isset ($_POST['email'])){ //Start session session_start(); require_once "scripts/mysqlconnect.php"; $remember = $_POST['remember']; // Added for the remember me feature // Make the posted variable SQL safe $email = eregi_replace("`", "", mysql_real_escape_string(strip_tags($_POST['email']))); $password = md5(eregi_replace("`", "", mysql_real_escape_string(strip_tags($_POST['password'])))); // Create query. !! You need to rename your 'username' column in your database to 'email' !! $qry = "SELECT * FROM members WHERE email='$email' AND password='$password' AND email_activated='1'"; // Run query $result=mysql_query($qry); //Check whether the query was successful or not if($result) { // If one row was returned (if there was a match) if(mysql_num_rows($result) == 1) { // Login Successful // Get a new session ID session_regenerate_id(); // Get the row as an array $member = mysql_fetch_assoc($result); // Create session variables $_SESSION['LOGINID'] = $member['loginid']; $_SESSION['EMAIL'] = $member['email']; $_SESSION['USERNAME'] = $member['username']; // Stop writing to the session session_write_close(); // Create a variable for the member ID, you can't include $member['id'] in the SQL statement $id = $member['loginid']; // Update the table with the current time mysql_query("UPDATE members SET last_log_date=NOW() WHERE loginid='$id'"); // Remember Me Section Addition... if member has chosen to be remembered in the system if($remember == "yes") { setcookie("idCookie", $id, time()+60*24*60*60, "/"); setcookie("usernameCookie", $username, time()+60*24*60*60, "/"); setcookie("emailCookie", $email, time()+60*24*60*60, "/"); setcookie("passwordCookie", $password, time()+60*24*60*60, "/"); } // Redirect to the members only page //header("location: ".$_SERVER['PHP_SELF'].""); /* Quick self-redirect to avoid resending data on refresh */ echo "<meta http-equiv=\"Refresh\" content=\"0;url=$HTTP_SERVER_VARS[php_SELF]\">"; return; exit(); } } else { die("Query failed"); } } ?> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; color: #0F0; } #apDiv1 { position:relative; width:241px; height:0px; z-index:1; left: -270px; top: 0px; } --> </style><div align="center"> <div id="apDiv1"> <form action="" method="post"> <p>Email <input type="text" name="email" id="email" size="15" /> </p> <p>Password <input type="password" name="password" id="password" size="15"/> </p> <p> Remember <input type="checkbox" name="Remember" id="Remember" /><input name="Submit" type="submit" value="Login"/> </p> </form> </div> <img src="/images/header.jpg" width="950" height="100" /> </div>
  14. i figured it out.. I knew it was something super simple and it was.. Thanks for the willingness to help tho
  15. the login portion of it works fine which is why i did not post that portion of the script. I need the member header because it provide tools and options only available for members and the guest header will allow user to log in. It redirects to the same page. Initially it shows it is logged in, but if i got to another page or refresh that page it goes back to the guest header and is logged out
  16. I have a header as a include at the top of each page. When a member is NOT logged in, it displays a header with login option and some non member links, when member IS logged in it displays a header with member options. That part of the script works fine, however when i log in on that page and the member header is displayed.. If i visit another page or refresh that page it loses the session like its been logged out and just displays the standard header. Any help would be greatly appreciated. index.php <?php session_start(); $path = (isset($_SESSION['LOGINID']) ) ? 'memberheader.php' : 'header_tmp.php'; include( $path ); ?> this is the auth script included in the member header memberheader.php <?php require_once('scripts/auth.php'); ?> auth.php (the actual auth script) <?php //Start session session_start();{ } if(!isset($_SESSION['LOGINID'])) { header("location: access-denied.php"); exit(); } ?> I didn't include login page because the login script works fine on each page except the ones with the multi header include. The pages that only include the memberheader works fine
  17. Thanks paulman88888 for you reply.. I'm not too fluent in php.. I'm working with it trying to get it going tho.. Thanks again
  18. I have a local event member system where users can be informed about different events. Users have a member page, etc. I have a list of events and i want users to be able to click on a "attend" link next to the event and the event will show up under their attending events on their member page. Can anyone help me with this or has anyone seen a similar script? Im thinking i will need to setup another mysql table for the events but any help would be greatly appreciated.
  19. As far as i can tell everything on the script is working excecpt the script detecting the logged in userid... when i send a message from user to user it does not up date the the "from" row of my mysql table. I think this part is part of the problem.. I've tried $userid='loginid'; which is the user id of my members table.. Please help me figure out what im doing wrong and thanks in advance the table CREATE TABLE `messages` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `title` VARCHAR( 255 ) NULL `message` TEXT NOT NULL , `from` INT( 11 ) NOT NULL , `to` INT( 11 ) NOT NULL , `from_viewed` BOOL NOT NULL DEFAULT '0', `to_viewed` BOOL NOT NULL DEFAULT '0', `from_deleted` BOOL NOT NULL DEFAULT '0', `to_deleted` BOOL NOT NULL DEFAULT '0', `from_vdate` DATETIME NULL , `to_vdate` DATETIME NULL , `from_ddate` DATETIME NULL , `to_ddate` DATETIME NULL , `created` DATETIME NOT NULL ) ENGINE = MYISAM ; mes1.php <?php class cpm { var $userid = ''; var $messages = array(); var $dateformat = ''; // Constructor gets initiated with userid function cpm($user,$date="d.m.Y - H:i") { // defining the given userid to the classuserid $this->userid = $user; // Define that date_format $this->dateformat = $date; } // Fetch all messages from this user function getmessages($type=0) { // Specify what type of messages you want to fetch switch($type) { case "0": $sql = "SELECT * FROM messages WHERE `to` = '".$this->userid."' && `to_viewed` = '0' && `to_deleted` = '0' ORDER BY `created` DESC"; break; // New messages case "1": $sql = "SELECT * FROM messages WHERE `to` = '".$this->userid."' && `to_viewed` = '1' && `to_deleted` = '0' ORDER BY `to_vdate` DESC"; break; // Read messages case "2": $sql = "SELECT * FROM messages WHERE `from` = '".$this->userid."' ORDER BY `created` DESC"; break; // Send messages case "3": $sql = "SELECT * FROM messages WHERE `to` = '".$this->userid."' && `to_deleted` = '1' ORDER BY `to_ddate` DESC"; break; // Deleted messages default: $sql = "SELECT * FROM messages WHERE `to` = '".$this->userid."' && `to_viewed` = '0' ORDER BY `created` DESC"; break; // New messages } $result = mysql_query($sql) or die (mysql_error()); // Check if there are any results if(mysql_num_rows($result)) { $i=0; // reset the array $this->messages = array(); // if yes, fetch them! while($row = mysql_fetch_assoc($result)) { $this->messages[$i]['id'] = $row['id']; $this->messages[$i]['title'] = $row['title']; $this->messages[$i]['message'] = $row['message']; $this->messages[$i]['fromid'] = $row['from']; $this->messages[$i]['toid'] = $row['to']; $this->messages[$i]['from'] = $this->getusername($row['from']); $this->messages[$i]['to'] = $this->getusername($row['to']); $this->messages[$i]['from_viewed'] = $row['from_viewed']; $this->messages[$i]['to_viewed'] = $row['to_viewed']; $this->messages[$i]['from_deleted'] = $row['from_deleted']; $this->messages[$i]['to_deleted'] = $row['to_deleted']; $this->messages[$i]['from_vdate'] = date($this->dateformat, strtotime($row['from_vdate'])); $this->messages[$i]['to_vdate'] = date($this->dateformat, strtotime($row['to_vdate'])); $this->messages[$i]['from_ddate'] = date($this->dateformat, strtotime($row['from_ddate'])); $this->messages[$i]['to_ddate'] = date($this->dateformat, strtotime($row['to_ddate'])); $this->messages[$i]['created'] = date($this->dateformat, strtotime($row['created'])); $i++; } } else { // If not return false return false; } } // Fetch the username from a userid, I made this function because I don't know how you did build your usersystem, that's why I also didn't use left join... this way you can easily edit it function getusername($userid) { $sql = "SELECT username FROM myMembers WHERE `loginid` = '".$userid."' LIMIT 1"; $result = mysql_query($sql); // Check if there is someone with this id if(mysql_num_rows($result)) { // if yes get his username $row = mysql_fetch_row($result); return $row[0]; } else { // if not, name him Unknown return "Unknown"; } } // Fetch a specific message function getmessage($message) { $sql = "SELECT * FROM messages WHERE `id` = '".$message."' && (`from` = '".$this->userid."' || `to` = '".$this->userid."') LIMIT 1"; $result = mysql_query($sql); if(mysql_num_rows($result)) { // reset the array $this->messages = array(); // fetch the data $row = mysql_fetch_assoc($result); $this->messages[0]['id'] = $row['id']; $this->messages[0]['title'] = $row['title']; $this->messages[0]['message'] = $row['message']; $this->messages[0]['fromid'] = $row['from']; $this->messages[0]['toid'] = $row['to']; $this->messages[0]['from'] = $this->getusername($row['from']); $this->messages[0]['to'] = $this->getusername($row['to']); $this->messages[0]['from_viewed'] = $row['from_viewed']; $this->messages[0]['to_viewed'] = $row['to_viewed']; $this->messages[0]['from_deleted'] = $row['from_deleted']; $this->messages[0]['to_deleted'] = $row['to_deleted']; $this->messages[0]['from_vdate'] = date($this->dateformat, strtotime($row['from_vdate'])); $this->messages[0]['to_vdate'] = date($this->dateformat, strtotime($row['to_vdate'])); $this->messages[0]['from_ddate'] = date($this->dateformat, strtotime($row['from_ddate'])); $this->messages[0]['to_ddate'] = date($this->dateformat, strtotime($row['to_ddate'])); $this->messages[0]['created'] = date($this->dateformat, strtotime($row['created'])); } else { return false; } } // We need the userid for pms, but we only let users input usernames, so we need to get the userid of the username function getuserid($username) { $sql = "SELECT loginid FROM myMembers WHERE `username` = '".$username."' LIMIT 1"; $result = mysql_query($sql); if(mysql_num_rows($result)) { $row = mysql_fetch_row($result); return $row[0]; } else { return false; } } // Flag a message as viewed function viewed($message) { $sql = "UPDATE messages SET `to_viewed` = '1', `to_vdate` = NOW() WHERE `id` = '".$message."' LIMIT 1"; return (@mysql_query($sql)) ? true:false; } // Flag a message as deleted function deleted($message) { $sql = "UPDATE messages SET `to_deleted` = '1', `to_ddate` = NOW() WHERE `id` = '".$message."' LIMIT 1"; return (@mysql_query($sql)) ? true:false; } // Add a new personal message function sendmessage($to,$title,$message) { $to = $this->getuserid($to); $sql = "INSERT INTO messages SET `to` = '".$to."', `from` = '".$this->userid."', `title` = '".$title."', `message` = '".$message."', `created` = NOW()"; return (@mysql_query($sql)) ? true:false; } // Render the text (in here you can easily add bbcode for example) function render($message) { $message = strip_tags($message, ''); $message = stripslashes($message); $message = nl2br($message); return $message; } } ?> mes2.php <?php // Load the config file! include('config.php'); // Load the class require('mes1.php'); // Set the userid to 2 for testing purposes... you should have your own usersystem, so this should contain the userid $userid=2; // initiate a new pm class $pm = new cpm($userid); // check if a new message had been send if(isset($_POST['newmessage'])) { // check if there is an error while sending the message (beware, the input hasn't been checked, you should never trust users input!) if($pm->sendmessage($_POST['to'],$_POST['subject'],$_POST['message'])) { // Tell the user it was successful echo "Message successfully sent!"; } else { // Tell user something went wrong it the return was false echo "Error, couldn't send PM. Maybe wrong user."; } } // check if a message had been deleted if(isset($_POST['delete'])) { // check if there is an error during deletion of the message if($pm->deleted($_POST['did'])) { echo "Message successfully deleted!"; } else { echo "Error, couldn't delete PM!"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Simple private Messaging</title> </head> <body> <?php // In this switch we check what page has to be loaded, this way we just load the messages we want using numbers from 0 to 3 (0 is standart, so we don't need to type this) if(isset($_GET['p'])) { switch($_GET['p']) { // get all new / unread messages case 'new': $pm->getmessages(); break; // get all send messages case 'send': $pm->getmessages(2); break; // get all read messages case 'read': $pm->getmessages(1); break; // get all deleted messages case 'deleted': $pm->getmessages(3); break; // get a specific message case 'view': $pm->getmessage($_GET['mid']); break; // get all new / unread messages default: $pm->getmessages(); break; } } else { // get all new / unread messages $pm->getmessages(); } // Standard links ?> <a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=new'>New Messages</a> <a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=send'>Sent Messages</a> <a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=read'>Read Messages</a> <a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=deleted'>Deleted Messages</a> <br /><br /> <?php // if it's the standart startpage or the page new, then show all new messages if(!isset($_GET['p']) || $_GET['p'] == 'new') { ?> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td>From</td> <td>Title</td> <td>Date</td> </tr> <?php // If there are messages, show them if(count($pm->messages)) { // message loop for($i=0;$i<count($pm->messages);$i++) { ?> <tr> <td><?php echo $pm->messages[$i]['from']; ?></td> <td><a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=view&mid=<?php echo $pm->messages[$i]['id']; ?>'><?php echo $pm->messages[$i]['title'] ?></a></td> <td><?php echo $pm->messages[$i]['created']; ?></td> </tr> <?php } } else { // else... tell the user that there are no new messages echo "<tr><td colspan='3'><strong>No new messages found</strong></td></tr>"; } ?> </table> <?php // check if the user wants send messages } elseif($_GET['p'] == 'send') { ?> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td>To</td> <td>Title</td> <td>Status</td> <td>Date</td> </tr> <?php // if there are messages, show them if(count($pm->messages)) { // message loop for($i=0;$i<count($pm->messages);$i++) { ?> <tr> <td><?php echo $pm->messages[$i]['to']; ?></td> <td><a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=view&mid=<?php echo $pm->messages[$i]['id']; ?>'><?php echo $pm->messages[$i]['title'] ?></a></td> <td> <?php // If a message is deleted and not viewed if($pm->messages[$i]['to_deleted'] && !$pm->messages[$i]['to_viewed']) { echo "Deleted without reading"; // if a message got deleted AND viewed } elseif($pm->messages[$i]['to_deleted'] && $pm->messages[$i]['to_viewed']) { echo "Deleted after reading"; // if a message got not deleted but viewed } elseif(!$pm->messages[$i]['to_deleted'] && $pm->messages[$i]['to_viewed']) { echo "Read"; } else { // not viewed and not deleted echo "Not read yet"; } ?> </td> <td><?php echo $pm->messages[$i]['created']; ?></td> </tr> <?php } } else { // else... tell the user that there are no new messages echo "<tr><td colspan='4'><strong>No sent messages found</strong></td></tr>"; } ?> </table> <?php // check if the user wants the read messages } elseif($_GET['p'] == 'read') { ?> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td>From</td> <td>Title</td> <td>Date</td> </tr> <?php // if there are messages, show them if(count($pm->messages)) { // message loop for($i=0;$i<count($pm->messages);$i++) { ?> <tr> <td><?php echo $pm->messages[$i]['from']; ?></td> <td><a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=view&mid=<?php echo $pm->messages[$i]['id']; ?>'><?php echo $pm->messages[$i]['title'] ?></a></td> <td><?php echo $pm->messages[$i]['to_vdate']; ?></td> </tr> <?php } } else { // else... tell the user that there are no new messages echo "<tr><td colspan='4'><strong>No read messages found</strong></td></tr>"; } ?> </table> <?php // check if the user wants the deleted messages } elseif($_GET['p'] == 'deleted') { ?> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td>From</td> <td>Title</td> <td>Date</td> </tr> <?php // if there are messages, show them if(count($pm->messages)) { // message loop for($i=0;$i<count($pm->messages);$i++) { ?> <tr> <td><?php echo $pm->messages[$i]['from']; ?></td> <td><a href='<?php echo $_SERVER['PHP_SELF']; ?>?p=view&mid=<?php echo $pm->messages[$i]['id']; ?>'><?php echo $pm->messages[$i]['title'] ?></a></td> <td><?php echo $pm->messages[$i]['to_ddate']; ?></td> </tr> <?php } } else { // else... tell the user that there are no new messages echo "<tr><td colspan='4'><strong>No deleted messages found</strong></td></tr>"; } ?> </table> <?php // if the user wants a detail view and the message id is set... } elseif($_GET['p'] == 'view' && isset($_GET['mid'])) { // if the users id is the recipients id and the message hadn't been viewed yet if($userid == $pm->messages[0]['toid'] && !$pm->messages[0]['to_viewed']) { // set the messages flag to viewed $pm->viewed($pm->messages[0]['id']); } ?> <table border="0" cellspacing="1" cellpadding="1"> <tr> <td>From:</td> <td><?php echo $pm->messages[0]['from']; ?></td> <td colspan="2"></td> </tr> <tr> <td>Date:</td> <td><?php echo $pm->messages[0]['created']; ?></td> <td colspan="2"></td> </tr> <tr> <td>Subject:</td> <td colspan="3"><?php echo $pm->messages[0]['title']; ?></td> </tr> <tr> <td colspan="4"><?php echo $pm->render($pm->messages[0]['message']); ?></td> </tr> </table> <form name='reply' method='post' action='<?php echo $_SERVER['PHP_SELF']; ?>'> <input type='hidden' name='rfrom' value='<?php echo $pm->messages[0]['from']; ?>' /> <input type='hidden' name='rsubject' value='Re: <?php echo $pm->messages[0]['title']; ?>' /> <input type='hidden' name='rmessage' value='[quote]<?php echo $pm->messages[0]['message']; ?>[/quote]' /> <input type='submit' name='reply' value='Reply' /> </form> <form name='delete' method='post' action='<?php echo $_SERVER['PHP_SELF']; ?>'> <input type='hidden' name='did' value='<?php echo $pm->messages[0]['id']; ?>' /> <input type='submit' name='delete' value='Delete' /> </form> <?php } ?> <form name="new" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <strong>To:</strong> <input type='text' name='to' value='<?php if(isset($_POST['reply'])) { echo $_POST['rfrom']; } ?>' /> <strong>Subject:</strong> <input type='text' name='subject' value='<?php if(isset($_POST['reply'])) { echo $_POST['rsubject']; } ?>' /> <strong>Message:</strong><br /> <textarea name='message'><?php if(isset($_POST['reply'])) { echo $_POST['rmessage']; } ?></textarea> <input type='submit' name='newmessage' value='Send' /> </form> </body> </html>
  20. I have a php include as a header on my main page... I want my main page to display a different include as header if user is logged in.. Please help.. Thanks in advance
  21. I figured it out.. i had to change the database names back to myMembers... Thank you soooo much!!!!!!!! I've been trying to figure this out forever literally... Thanks again
  22. Sorry, I haven't logged in, in a few days... Thanks for your help and research.. now i'm getting Query failed the only change i made to your script was adding the include for my connecting to mysql.. did i do something wrong?
  23. ok, I took that off.. still login failed
  24. i replaced $email = strip_tags($email); $password = strip_tags($password); $email = mysql_real_escape_string($email); $password = mysql_real_escape_string($password); $email = eregi_replace("`", "", $email); $password = eregi_replace("`", "", $password); with $email = eregi_replace(strip_tags($_POST['email'])); $password = eregi_replace(strip_tags($_POST['password'])); now i'm getting a login failed and i'm not quite sure how to write the script to echo $result, please help... Thanks I really appreciate it
  25. Please Help I can't figure out the problem
×
×
  • 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.