Jump to content

perrij3

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by perrij3

  1. This is the code that I used on a mobile website I just finished. The website I worked on works fine on a iPod, iPhone, iPad and Android devices. <meta name="HandheldFriendly" content="true" /> <meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes" /> Hope this helps.
  2. Thanks Fenway for the help. What I needed to do was not use a WHERE statement, but instead use an AND statement. You were correct that I needed to place it in a different location than were I was using the WHERE statement.
  3. I forgot to add that the version of MySQL I am using is MySQL 5.0.81.
  4. OK, I got it to work somewhat when I added WHERE (pp.PrayerDate = '$date' to the bottom of the SQL statement. Now, this has recreated another issue. I really don't know how to solve this problem. The have 3 tables in this database (time, user, prayer). Time has all the times one can pray during. User is just data about a user. Prayer is where I am storing information about when a person is going to pray. What I am trying to do is when a person is signed up for a spot, to display their username. If nobody is signed up for this spot, I want it to say available. What it looks like is something like this: 12:00am Available 12:20am User1 12:40am User2 1:00am Available and so on for the day. With the SQL I have right now, it will only display where users have signed up for, but it will not show the times that are available. If I take out the WHERE statement, I will get all my time slots, but the same user will be displayed no matter what day I select. So the above example will display on every day, not just on the day that person is praying on. Could someone help point me in the right direction on how to solve this problem? Thanks for your time and help.
  5. I am having an issue with my left join SQL statement. Here is what I have so far: $sql = "SELECT pt.TimeID, pt.Time, pp.FK_UserID, pp.FK_TimeID, pp.PrayerDate, pu.UserID, pu.UserName FROM time AS pt LEFT JOIN prayer AS pp ON pt.TimeID = pp.FK_TimeID LEFT JOIN user AS pu ON pp.FK_UserID = pu.UserID"; The issue that I am having is I need to just retrieve information just for a certain date. Right now it will just displays the same information for each day, I need it to change depending on what day the user selects. I'm just not sure where to insert the following code (if this is how one is suppose to do it). WHERE pp.PrayerTime = $date I have tried placing it at the end of the above statement as well as right after 'FROM time AS pt'. Could someone please help me figure out how to just display one date worth of information?
  6. Does anyone know if my problem could be a setting within my php.ini file? Is there a setting there that controls the header function?
  7. I developed a website a few months ago and I am now having an issue with logging into it. The place that it is hosted just did some upgrades to their servers and for some reason, now my login page doesn't work correct. I do know that it connects to the database, receives the information, and the session is set. The problem is that it doesn't forward itself to the next page. The way I know that the session has started is I have manually typed in the URL of the menu page (the page it is suppose to go to once the user logs in). I am completely stumped on what is wrong here. I have other pages that use the same method to go to the next page once a user fills in a form and they work correctly. Here is the code I use //process the script only if the form has been submitted if (array_key_exists('login', $_POST)) { //start the session session_start(); include('include/connection.php'); //clean the $_POST array and assign to shorter variables nukeMagicQuotes(); $username = trim($_POST['username']); $pwd = trim($_POST['pwd']); //connect to the database as a user $conn = dbConnect(); //prepare username for use in SQL query $username = mysql_real_escape_string($username); //get the username's details from the database $sql = "Select * FROM user WHERE Username = '$username'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); if (sha1($pwd.$row['Salt']) == $row['pwd']) { $_SESSION['authenticated'] = 'abc'; } //if no match, destroy the session and prepare error message else { $_SESSION = array(); session_destroy(); $error = 'Invalid username or password'; } //if the session variaable has been set, redirect if (isset($_SESSION['authenticated'])) { //get the time the session started $_SESSION['start'] = time(); header('Location: homepage.php'); exit; } } When I hit the login button, all i get is the information from the header.php file (which contains the <head> information) and the URL says it's still the index file. Any help would be greatly appreciated. The PHP version they are now using is 5.2.9. I'm not sure what the previous version was, but it was a PHP 5.x.x version.
×
×
  • 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.