Jump to content

VikiC

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

About VikiC

  • Birthday 08/30/1985

Profile Information

  • Gender
    Female
  • Location
    Ireland

VikiC's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank for your reply. I'm trying to keep it as simple as possible, basically hour slots between certain times during the day. If the slot is taken it will show as unavailable. It is part of a web site for a leisure centre, users will have to log in to use the booking facilities. There will also have to be an admin side so that staff can view bookings etc. Below is a rough guide of what i have gathered so far. Fitness Instructor booking This part of the site should allow logged in users to make appointments with a fitness instructor for a personal session. 3 different instructors available between the hours of 10am – 4pm. - 1 hour slots. One Member to One Fitness Instructor in One Session Once slot has been booked it should show as unavailable. Tables Tbl_member (mem_id, mem_title, mem_fname, mem_sname, mem_age, mem_address, mem_city_town, mem_p_code, mem_country, mem_email, mem_phone, mem_mob_phone) Tbl_inst_booking (inst_booking_id, inst_id, mem_id, inst_booking_start, inst_booking_fin) Tbl_instructor (inst_id, emp_id, inst_name, inst_available) Tbl_employee (emp_id, emp_fname, emp_sname, emp_role, emp_contact) Facility Booking This part of the site should allow logged in users to book a facility. Facilities below available between the hours of 9am – 6pm. – 1 hour slots One member books one facility at any one time Once slot has been booked it should show as unavailable. Facilities available: 8 Courts - Main Hall 35m X 28m 2 Small Halls 4 Squash Courts Tables Tbl_member (mem_id, mem_title, mem_fname, mem_sname, mem_age, mem_address, mem_city_town, mem_p_code, mem_country, mem_email, mem_phone, mem_mob_phone) Tbl_fac_booking (fac_booking_id, fac_id, mem_id, fac_booking_start, fac_booking_fin) Tbl_facility (fac_id, mem_id, fac_name, fac_price)
  2. Hello I’m trying to create a simple facility booking system using PHP/MYSQL for a leisure centre as part of my final year project. I’ve been looking online for the best way to do this and I can’t find anything of use. Does anyone have any idea what would be the best / easiest way to do this? I don’t have much experience using PHP/MySQL so don’t really know where to start. Any advice or help will be much appreciated.
  3. Well i dont think it has to be written completely from scratch lol found an ok tutorial on it with source code but it doesnt want to work for me. What was your project on? Yeah tell me about it my tutor is as useful as a chocolate fireguard
  4. Hi Yeah it'd have to be my own, its for my final year project :S
  5. Does anyone know any "easy to follow" shopping cart tutorials? Thanks in advance.
  6. I now get: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\checklogin.php on line 26 Fatal error: SQL: SELECT * FROM tbl_user WHERE username='' and password='', Error: Unknown column 'username' in 'where clause' in C:\xampp\htdocs\checklogin.php on line 26
  7. Hi I'm having a bit of bother with my login. I created a login using this tutorial http://www.phpeasystep.com/phptu/6.html and it works perfectly. So i have attempted to change it to meet my own database. So basically i've changed the database, table names etc to meet my own. I haven't changed any other lines. When i run it i get an error message: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\checklogin.php on line 26 The code is below: <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="final year project"; // Database name $tbl_name="tbl_user"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $mem_username=$_POST['mem_username']; $mem_password=$_POST['mem_password']; // To protect MySQL injection (more detail about MySQL injection) $mem_username = stripslashes($mem_username); $mem_password = stripslashes($mem_password); $mem_username = mysql_real_escape_string($mem_username); $mem_password = mysql_real_escape_string($mem_password); $sql="SELECT * FROM $tbl_name WHERE username='$mem_username' and password='$mem_password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $mem_username and $mem_password, table row must be 1 row if($count==1){ // Register $mem_username, $mem_password and redirect to file "login_success.php" session_register("mem_username"); session_register("mem_password"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> Line 26 is $count=mysql_num_rows($result); I'm baffled as to why the test database worked. I tried another test database but got the same error. baffled.com Hope someone can help MOD EDIT: . . . tags added.
  8. Hi Does anyone know any good tutorials for creating a registration page for a website? Thanks in advance.
  9. Got sorted. This tutorial http://www.phpeasystep.com/phptu/6.html was spot on after a few changes. Thanks for the advice guys i'm sure i'll be back for more
  10. Thanks i'll give this a go. First time using PHP/MySQL...tried a couple of different tutorials, no luck.
  11. Yeah it just doesn't do anything, i refresh it, it stays the same.
  12. Hi. I'm having a little problem creating a login using PHP. Looked at several tutorials and not having much luck. I've created a database in MySql called "member" with a username and password field just to test but don't appear to be getting as far as that. I'm also using XAMPP. So basically the PHP so far is five different pages. "config.inc" contains: <?php $hostname = 'localhost'; // Your MySQL hostname. Usualy named as 'localhost', so you're NOT necessary to change this even this script has already online on the internet. $dbname = 'member'; // Your database name. $username = 'root'; // Your database username. $password = ''; // Your database password. If your database has no password, leave it empty. // Let's connect to host mysql_connect($hostname, $username, $password) or DIE('Connection to host is failed, perhaps the service is down!'); // Select the database mysql_select_db($dbname) or DIE('Database name is not available!'); ?> "index.php" contains: <?php // Inialize session session_start(); // Check, if user is already login, then jump to secured page if (isset($_SESSION['username'])) { header('Location: securedpage.php'); } ?> <html> <head> <title>PHPMySimpleLogin 0.3</title> </head> <body> <h3>User Login</h3> <table border="0"> <form method="POST" action="loginproc.php"> <tr><td>Username</td><td>:</td><td><input type="text" name="username" size="20"></td></tr> <tr><td>Password</td><td>:</td><td><input type="password" name="password" size="20"></td></tr> <tr><td> </td><td> </td><td><input type="submit" value="Login"></td></tr> </form> </table> </body> </html> "loginproc.php" contains: <?php // Inialize session session_start(); // Include database connection settings include('config.inc'); // Retrieve username and password from database according to user's input $login = mysql_query("SELECT * FROM user WHERE (username = '" . mysql_real_escape_string($_POST['username']) . "') and (password = '" . mysql_real_escape_string(md5($_POST['password'])) . "')"); // Check username and password match if (mysql_num_rows($login) == 1) { // Set username session variable $_SESSION['username'] = $_POST['username']; // Jump to secured page header('Location: securedpage.php'); } else { // Jump to login page header('Location: index.php'); } ?> "securedpage.php" contains: <?php // Inialize session session_start(); // Check, if username session is NOT set then this page will jump to login page if (!isset($_SESSION['username'])) { header('Location: index.php'); } ?> <html> <head> <title>Secured Page</title> </head> <body> <p>This is secured page with session: <b><?php echo $_SESSION['username']; ?></b> <br>You can put your restricted information here.</p> <p><a href="logout.php">Logout</a></p> </body> </html> "logout.php" contains: <?php // Inialize session session_start(); // Delete certain session unset($_SESSION['username']); // Delete all session variables // session_destroy(); // Jump to login page header('Location: index.php'); ?> BASICALLY - when i go into this and enter the username and password the same page index.php stays. Apologies for the length of this post, just wanted to get the info in. Also have checked that MySql server is running etc. Finaly Year Project Student here and i don't want to fall at the first hurdle so any help is appreciated
×
×
  • 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.