-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
Login/logout For Admin And Regular Users
Muddy_Funster replied to gromstone's topic in PHP Coding Help
OK, I'll have a look at you link in the morning, but for now, I's suggest that, for speed and simplicity, pass a status variable through the session array to identify admin / user. set this variable by nesting another if inside your login that checks if($_POST['username'] == "adminUserName"){$_SESSION['status'] = 'admin';} else{$_SESSION['status'] = 'user';} you would need to change it to suit your username for the admin user. Once this is set you can then check against $_SESSION['status'] to see what options to provide at the points that would require it.- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
No. you never "put" a value into an auto_inc field - ever. (just for future refference). @ OP - I was talking about your table structure, not you code.
-
that's.....a damn good point!lol I never even looked at it from that angle, all that needs to be in the ticket table is unique id, user id, raffle id (although if you are recycling the raffle tickets for each raffle then obviously this isn't needed either)
-
Your loop should now give output. As you are using post to send the data, you really should address the $_POST array directly (just replace $_REQUEST with $_POST)
-
You know, if people don't stop trying to insert nothing into auto_inc fields, I'm going to cry! if you were to change your line of code that starts $query to this : $sql = <<<QRY INSERT INTO vanderbilt_adhd_diagnostic ( id, Patient_Name, Date_Recieved, Date_Of_Birth, Age, Grade, Attention_To_Detail, Sustaining_Activites, Listening, Following_Instructions, Organization, Mental_Effort, Loses_Items, Easily_Distracted, Forgetful, Fidgets, Leaves_Seat, Runs_About, Difficulty_Engaging, On_The_Go, Talks_Excessivly, Blurts_Answers, Difficulty_Waiting, Interrupts, Argues, Loses_Temper, Refuses_To_Comply, Deliberately_Annoys, Blames_Others, Touchy, Angry, Spiteful, Bullies, Starts_Fights, Cons_Others, Skips_School, Physically_Cruel, Stolen_Items, Destroys_Property, Uses_Weapons, Cruel_Animals, Arson, Forced_Entry, Stays_Out, Run_Away, Rape, Fearful, Afraid_Of_New_Things, Worthless, Guilty, Lonely, Depressed, Self_Conscious ) VALUES ( '', '$Patient_Name', '$Date_Recieved', '$Date_Of_Birth', '$Age', '$Grade', '$Attention_To_Detail', '$Sustaining_Activites', '$Listening', '$Following_Instructions', '$Organization', '$Mental_Effort', '$Loses_Items, '$Easily_Distracted', '$Forgetful', '$Fidgets', '$Leaves_Seat', '$Runs_About', '$Difficulty_Engaging', '$On_The_Go', '$Talks_Excessivly', '$Blurts_Answers', '$Difficulty_Waiting', '$Interrupts', '$Argues', '$Loses_Temper', '$Refuses_To_Comply', '$Deliberately_Annoys', '$Blames_Others', '$Touchy', '$Angry', '$Spiteful', '$Bullies', '$Starts_Fights', '$Cons_Others', '$Skips_School', '$Physically_Cruel', '$Stolen_Items', '$Destroys_Property', '$Uses_Weapons', '$Cruel_Animals', '$Arson', '$Forced_Entry', '$Stays_Out', '$Run_Away', '$Rape', '$Fearful', '$Afraid_Of_New_Things', '$Worthless', '$Guilty', '$Lonely', '$Depressed', '$Self_Conscious' ) QRY; $query = mysql_query($sql) or die(mysql_error().",<br /><br />Occured when trying to run <br />$sql"); then not only will the error have a more practical line number refference (showing you that the $Loses_Items line is the one that is a problem as you have not closed the string wrapper - as DavidAM has pointed out) but you will also see the query exactly as it is being sent to the database, making it easier again to find what the problem is. You do seriously need to look into normalising your structure though. This is not even close to being well designed.
-
I'm going to assume you are getting a blank page, not because of the level of error reporting, but simply because the $_REQUEST super global array is in fact empty (or at the very least, does not contain the key's that you are trying to output, but that should give an error/warning about undefined index values or some such). as you arn't attempting to send any information to the screen other than what would/should/could be in this array. try my suggestion above and let us know what you get back.
-
Login/logout For Admin And Regular Users
Muddy_Funster replied to gromstone's topic in PHP Coding Help
ohhhh...that's not even close to me making fun of you! so, my question still stands, what exactly is the issue you are having with the admin/user split? give us details, specifics, as much as you can - the more info we have the better and quicker we can provide productive help.- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
I'm with Psycho - why in the name of everything that is sinful (it's a way bigger list than all that is holy) would you ever activly insert a null value into a table? if null is allowed, it should be a default value and nothing should be inserted into that field in the event that nothing is indeed being inserted into that field. during an update, fair enough, but for an insert?
-
By magic I guess....
-
here's a thought, just before your for loop at the bottom of your process page add in var_dump($_POST);
-
LIMIT 1?? How many times do you think it would try to insert if that wasn't there?
-
Login/logout For Admin And Regular Users
Muddy_Funster replied to gromstone's topic in PHP Coding Help
ok, so you have the login page, and it's all working happy as you like, the problem is now identifying admin from non-admin right? what is it exactly that's going wrong here? oh, and this typo: made me smile- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
Still not getting how tickets are associated to a raffle, and why not juat have a field that contains the number of tickets that said badge number has and add or subtract from it depending on performance?
-
can we see your code as it is now, after the changes PFMaBiSmAd suggested?
-
your.....running.....queries.......inside.......a.......loop.....!!!
-
<<---- points at a .htaccess file
-
Login/logout For Admin And Regular Users
Muddy_Funster replied to gromstone's topic in PHP Coding Help
yeah, ok I get that. So what's the actual problem at the moment? and, if I may ask, why have you elected not to use a database?- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
Login/logout For Admin And Regular Users
Muddy_Funster replied to gromstone's topic in PHP Coding Help
Break it down for us gromstone. The three fundimentals that need to be coverd when a problem occurs : What the code is supposed to do. What the code is actualy doing. Any and all errors that are being shown - if it's a plain blank page, and you view source and it is also blank, then you need to turn on error reporting. looking at your post #4 for example, you have an else statement there if the validation fails. Here's some options : The code could be erroring out, it could be producing the validation fail message when it shouldn't, it could be accepting validation when it shouldn't, it could be that the validation is fine, but the saveChanges() procedure call isn't doing what it should, it could be that the saveChanges() procedure is being called and doing what it should and the validation fail message is being shown. I'm not actualy trying to be nasty or anything, I'm just facetious by nature.- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
there is no space between the underscores after FILE
-
Login/logout For Admin And Regular Users
Muddy_Funster replied to gromstone's topic in PHP Coding Help
Can I just point out that simply saying "it doesn't work" is right up there on the pointless scale along side "it's broken", "it's not doing what I want it to" and actualy not saying anything at all?- 23 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
Not strictly true - different people respond better to different forms of learning stimulation. It may be that you learn better by playing about with things, but you can't rightly generalise that all learning by all people is better done the same way simply because it works for you. Incidently - your view profile page on the forum in your sig is a 404 - not found
-
possible, yes, could you attach a small sample of the actual raw data file?
-
What are tick_plus and tick_minus about? And how are you linking the tickets to the actual raffle?
-
Help With Creating Admin Functions In Php/mysql
Muddy_Funster replied to teenwolf's topic in PHP Coding Help
A little more info please... are you using sessions? do you have any access level information stored in your database? how are you currently splitting the admin and user roles? -
crypt() using the blowfish algorithm seems to be the method of choice. see here (if you hav't already) http://php.net/manual/en/function.crypt.php for usage