Seating Reservation System - PHP + MYSQL

  • (6 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 6

82 Replies - 17707 Views - Last Post: 23 March 2013 - 09:19 AM Rate Topic: -----

#61 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 19 March 2013 - 06:39 AM

where does that $pswd string come from? itís certainly not the correct hash.
Was This Post Helpful? 0
  • +
  • -

#62 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 03:27 AM

I have no idea, is my hash function/salt not working?
It obviously what $pswd is set to when iv typed "password" in to the login.php . Which is what the password should actually be for that user.
Notice anything wrong with my code?
Was This Post Helpful? 0
  • +
  • -

#63 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 03:37 AM

well, the best I can think of is that you do a separate test of your hashing code (a so-called unit test). make a page where only the hash code is in and dump out every variable that you have there, so you can see the variablesí values when you step through the programme.
Was This Post Helpful? 0
  • +
  • -

#64 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 04:30 AM

View PostDormilich, on 20 March 2013 - 03:37 AM, said:

well, the best I can think of is that you do a separate test of your hashing code (a so-called unit test). make a page where only the hash code is in and dump out every variable that you have there, so you can see the variablesí values when you step through the programme.

Isnt that pretty much what im doing anyway? auth.php simply gets posted a string $pswd from a form, it then salts + md5's that $pswd string and compares it with an already salt+md5 password stored in db.

Arghh this isnt going to be easy. :unsure:
Was This Post Helpful? 0
  • +
  • -

#65 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 04:54 AM

my problem here is that I do not know the current code and what are the contents of the variables, so I canít get much more specific.
Was This Post Helpful? 0
  • +
  • -

#66 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 05:07 AM

View PostDormilich, on 20 March 2013 - 04:54 AM, said:

my problem here is that I do not know the current code and what are the contents of the variables, so I canít get much more specific.


what do you mean by current code?
my code is posted above in this topic, apart from the html form but thats just a usual text box with a submit button.
Was This Post Helpful? 0
  • +
  • -

#67 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 06:14 AM

current code = latest version. and even if there are dumps (added) in it, Iíd consider it a new version (because depending on where the dump is, you get different information).
Was This Post Helpful? 0
  • +
  • -

#68 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 06:49 AM

View PostDormilich, on 20 March 2013 - 06:14 AM, said:

current code = latest version. and even if there are dumps (added) in it, I’d consider it a new version (because depending on where the dump is, you get different information).


second time iv edited this now, fixed it twice! now works, thanks though var_dump() is a really valuable tool to know about when it comes to POSTing and passing through variables.

This post has been edited by carmex: 20 March 2013 - 06:59 AM

Was This Post Helpful? 0
  • +
  • -

#69 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 07:00 AM

Do you have any advice in the way of session destroy? going to need to implement it but I'm not sure how
Was This Post Helpful? 0
  • +
  • -

#70 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 07:45 AM

call session_destroy(), reset the cookie (into the past), empty $_SESSION.
Was This Post Helpful? 1
  • +
  • -

#71 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 07:50 AM

View PostDormilich, on 20 March 2013 - 07:45 AM, said:

call session_destroy(), reset the cookie (into the past), empty $_SESSION.


so ill make button thats action calls a function :

logout()
{
sessio_detroy();
empty $_SESSION;
}


something like that?
Was This Post Helpful? 0
  • +
  • -

#72 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 07:52 AM

er, the empty() function does something different.
Was This Post Helpful? 0
  • +
  • -

#73 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 439
  • View blog
  • Posts: 1,865
  • Joined: 30-April 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 09:51 AM

View PostDormilich, on 20 March 2013 - 02:52 PM, said:

er, the empty() function does something different.

PHP.net says:

Quote

Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals FALSE. empty() does not generate a warning if the variable does not exist.

Was This Post Helpful? 0
  • +
  • -

#74 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,226
  • Joined: 08-June 10

Re: Seating Reservation System - PHP + MYSQL

Posted 20 March 2013 - 12:42 PM

exactly, it tells you WHETHER a variable is empty, but it doesnít empty a variable.
Was This Post Helpful? 0
  • +
  • -

#75 carmex  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 21-February 13

Re: Seating Reservation System - PHP + MYSQL

Posted 21 March 2013 - 05:48 AM

'Dormilich'
another quick php question
foreach($_POST['seats'] AS $seat) 
		{
			if ($count > 0) 
			{
				$changeStatus .= " || "; // Next itteration
			}
//// Could you explain this part :     
			$changeStatus .= " ( rowId = '" . substr($seat, 0, 1) . "'"; //Reading posted string rowId
			$changeStatus .= " and columnId = " . substr($seat, 1) . " ) ";//Reading posted string coulmnId
			$count++;
////
		}
		$changeStatus .= " ) and status=$statusA"; // Where status is unchanged



I understand why and how this works as whole, i just dont actually understand what the bit I've seperated is doing is it literally breaking up the rowId and columnId from the seats[] array? quite confused.
thanks again
Was This Post Helpful? 0
  • +
  • -

  • (6 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 6