Jump to content

stuart7398

Members
  • Posts

    98
  • Joined

  • Last visited

    Never

Everything posted by stuart7398

  1. this is the logout page [code ]<?php //Start session session_start(); //Unset the variable SESS_MEMBER_ID stored in session unset($_SESSION['SESS_MEMBER_ID']); ?>
  2. Hi. the members area of my site seem to automatically logout after 45 minutes of inactivity. i can't find anywhere in the files how to reduce this time to 15 minutes. has it anything to do with the following session? as this is the only file that directs to the 'you have been logged out page. what can i add to the following code to achieve this task. thanks, stu. <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: access-denied.php"); exit(1); } ?>
  3. That's what I thought. Thanks, for confirming my thoughts. Stuart.
  4. Hi. When a user leaves a field empty on my form, I don't want the field to show as empty on the display page. How do I get the field to NOT display at all? using MySql and php Thanks, Stuart.
  5. Hi. I have a members area. when a member logs in I want their links such as 'Profile' Personal Details' to appear in the left navigation area. how do I achieve this without losing half the page to unregistered members unless logged in? Any help is appreciated. Thanks, Stu. <?php require_once('auth.php'); ?> <code> <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: access-denied.php"); exit(); } ?> </code>
  6. Hi. I am learning to understand MySql, and how to run an efficient Database. Tell me if I am wrong, or on the right track? I have a Database, Then I have a Table within this Database. This Database then Joins to other Tables with different Data, within the same Database. OR Do I set up individual Databases and link to these individual Databases to extract Data? There will be 30 colunms with little data such as 'name' 'location' 3 images 1 description area with around 300 words. Your help is appreciated. Thanks, Stuart.
  7. Hi. Thanks. Manual sounds better. This is the code displaying images linking to a detailed profile. <code> $data = mysql_query("SELECT * FROM `members` ORDER BY `join_date` DESC LIMIT 10") OR DIE (mysql_error()); while($info = mysql_fetch_array($data)) { Print "<p><a href='../member_profile.php?id=".$info['member_id']."'>".$info['name'] ." <img src=/pages/images/".$info ." width='80px' border='0'/><i>".$info['location']."</i></a></p>"; </code> Thanks, Stuart.
  8. Hi. I allow users to create a profile of themselves. However, before going online they must pay. So, my user has a profile, a couple of days later they maybe add a picture. Now they want their profile to go online. How do I authorize their profile to go online, where do I start with this? Any suggestions / tutorials appreciated. Thanks, Stuart.
  9. If someone wants your site, they will get it. Putting up barriers will give the web developer a challenge, and the customer / user a headache. Focus your energies on developing and improving your site / business. The other solution is not to put it on the internet. Good luck.
  10. Hi. my database will have around 50 fields. 3 will be for 3 x images 1 will be a 300 word description the rest will be things like 'name' 'color' what is the best way to set this databse up? one table with many fields or seperate tables and would i use 'Joins' to connect the tables? i'm trying to keep it as simple as possible. your input and suggestions are apprecaited. Thanks, Stuart.
  11. Hi. Thanks for you input. I'm not looking to update the 'id' number, i'm looking to display it. thanks. Update Account Account Number: user account id number Personal Details First Name update field Mobile update field Phone 2 update field Address update field
  12. thanks, i'll have a go at that.
  13. Hi. I'm trying to add the 'id' number to this 'UPDATE' form. It doesn't work as I assume mysql thinks it's updating. What do I use to enter the 'id' number or other data for that matter? AND Can if anyone spots faults / security issues or ways to reduce the code, which would be helpful. Examples / suggestions / code all appreciated Thanks, Stuart. $username = "$SESS_MEMBER_ID"; if(isset($_POST['save'])){ $firstname = mysql_real_escape_string($_POST['firstname']); $mobile = mysql_real_escape_string($_POST['mobile']); $phone_2 = mysql_real_escape_string($_POST['phone_2']); $login = mysql_real_escape_string($_POST['login']); mysql_query("UPDATE members SET firstname='$firstname', mobile='$mobile', phone_2='$phone_2', login='$login' WHERE member_id = '$SESS_MEMBER_ID'"); } [b]Print "<div class='account'>"; Print "<br /><h3>My Account</h3>"; Print "Account Number:<span class='my_account'> ".$info['member_id']."</span>";[/b] list($firstname, $mobile, $phone_2, $login) = mysql_fetch_array(mysql_query("SELECT firstname, mobile, phone_2, login FROM members WHERE member_id = '$SESS_MEMBER_ID'")); Print "<div class='account'>"; Print '<br /><h3>Update Account</h3>'; Print "<h3>Personal Details</h3>"; Print '<form method="post" action="">'; Print '<p>First Name <span class="my_account"><input type="text" name="firstname" size="24" value="'.$firstname.'" /></span></p>'; Print '<p>Mobile <span class="my_account"><input type="text" name="mobile" size="24" value="'.$mobile.'" /></span></p>'; Print '<p>Phone 2 <span class="my_account"><input type="text" name="phone_2" size="24" value="'.$phone_2.'" /></span></p>'; Print '<p>Login <span class="my_account"><input type="text" name="login" size="24" value="'.$login.'" /></span></p>'; Print '<p> <input type="submit" value="Update" name="save" /></p>'; Print '</form></div>'; Print ' '.$firstname.' '.$mobile.' '.$login.' '.$phone_2.' '; ?> --fenway edit: really, use code blocks!!!
  14. Hi. I'm learning how to update mysql data using a form. I'm not sure if I am sending the form to the correct location. I'm currently learning this mysql through trail and error, however I can no longer sit here for 20 hours figuring out something minor. Code / suggestions / examples / corrections appreciated. Thanks, Stuart. This is where users come to update their details <?php require '../conn/config.php'; require '../conn/opendb.php'; $username = "$SESS_MEMBER_ID"; if(isset($_POST['save'])){ $firstname = mysql_real_escape_string($_POST['firstname']); $pin = mysql_real_escape_string($_POST['pin']); mysql_query("UPDATE members SET firstname='$firstname', pin='$pin' WHERE username='$username'"); } list($firstname, $pin) = mysql_fetch_array(mysql_query("SELECT firstname FROM members WHERE member_id = '$SESS_MEMBER_ID'")); echo ' <form method="post" action="members/acc-updated.php"> <p>First Name <input type="text" name="firstname" size="24" value="'.$firstname.'" /></p> <p>pin <input type="text" name="pin" size="24" value="'.$pin.'" /></p> <p> <input type="submit" value="save data" name="save" /> </p> </form> '; ?> This is where I have sent the above form to, but no data is showing at all, or as updated ?php require '../conn/config.php'; require '../conn/opendb.php'; $username = "$SESS_MEMBER_ID"; if(isset($_POST['save'])){ $firstname = mysql_real_escape_string($_POST['firstname']); $pin = mysql_real_escape_string($_POST['pin']); mysql_query("SELECT members SET firstname='$firstname', pin='$pin' WHERE username='$username'"); } list($firstname, $pin) = mysql_fetch_array(mysql_query("SELECT firstname FROM members WHERE member_id = '$SESS_MEMBER_ID'")); echo ' <p>account updated</p> '; ?> --fenway: code blocks are wrapped in square brackets, not <>
  15. Thanks. I've noticed the form 'action' empty. where do i post the form to? tutorial / suggestions / ideas appreciated Stuart.
  16. Hi. I wondering how i show if a user is 'online' or 'offline' do i place something in the session? if so , Code / Example / Tutorial would be apprectied. Thanks, Stuart. <code> <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: access-denied.php"); exit(); } ?> </code>
  17. Hi. I have a members area. I'm trying to allow my users to update their details. Any positive suggestions / examples / corrections appreciated. Thanks, Stuart. I'm getting the following error: <code> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/users/abc/html/abc.com/abc/update-account.php on line 16 </code> <code> <?php require '../conn/config.php'; require '../conn/opendb.php'; $username = "$SESS_MEMBER_ID"; if(isset($_POST['save'])){ $firstname = mysql_real_escape_string($_POST['firstname']); $pin = mysql_real_escape_string($_POST['pin']); mysql_query("UPDATE members SET firstname='$firstname', pin='$pin' WHERE username='$username'"); } list($firstname, $pin) = mysql_fetch_array(mysql_query("SELECT firstname, FROM members WHERE member_id = '$SESS_MEMBER_ID'")); echo ' <form method="post" action=""> <p>First Name <input type="text" name="firstname" size="24" value="'.$firstname.'" /></p> <p>pin <input type="text" name="pin" size="24" value="'.$pin.'" /></p> <p> <input type="submit" value="save data" name="save" /> </p> </form> '; ?> </code>
  18. I don't have anything because I'm not sure where the starting point is. Thanks for the last helpful suggestion. Stu.
  19. Hi. I have a members area. the user can upload and display data. Now I want the user to update their own details. I'm looking for example code or a starting point? WHERE – SELECT – INSERT ?? Any help appreciated. Thanks, Stuart.
  20. Hi. Can anybody assist me as to how i automically log a user out after a certain amount of time due to the user being inactive, say after 15 minutes then redirected to the login page with a message. The code would be very helpful. Where do i start? thanks, Stuart. <code> <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: access-denied.php"); exit(); } ?> </code>
×
×
  • 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.