Jump to content

jutaro

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by jutaro

  1. Look at your actual database to see what is in the "type" field (if that field exists?). Perhaps it is using a number system 1= truck, 2= car, 3=bus ... etc.. Rather then "car" "truck" You can't select something that isn't there. Sorry if I missed something, but I don't have time to read through everything posted right now. Good luck!
  2. What I do is .... Grab the data when user logins. Serialize the information I want to hold in my session. $userinfo = $row['userid'].','.$row['privs']; $_SESSION['user'] = base64_encode(serialize($userinfo)); If you are using a header or template system you would then just unserialize the session and define variables with the values... Example: // Fetch User Information $member = unserialize(base64_decode($_SESSION['user'])); $mdata = explode(',',$member); // Assign User Info define ("USERID",$mdata[0]); define ("PRIVS",$mdata[1]); Now on any of your pages you can do : // Check User Permissions if (PRIVS < "3") { // Check to see if user is LEVEL 3 or higher @header("Location:index.php?p=denied");// Send them to denied page die("<script>window.location='index.php?p=denied';</script>"); //js redirect backup }
  3. You're Comment /* was never closed. Your mail statement is never ran. Or so looks at what you pasted.
  4. Thanks. Sorry for recommending bad practice. In all of the applications I handle it is always on my own dedicated servers. Never really had to worry about stuff not working. Thought something like that would be a good thing to have on all servers.
  5. Do what he said ^^^^ On another note, instead of using <?php echo $value ?> you can use the shortcut <?=$value?>
  6. I know, I was just doing a simple example. If he wants to know about headers the link to the mail function was provided.
  7. $to = "email@email.com"; $subject = "Subject"; $msg = "Message."; $from = "FROM: Mail Form <do.not.respond@site.com>"; mail($to,$subject,$msg,$from); And your form Method is going to a file with a space in it. Don't put spaces in your filename. Also, I personally don't like lettings Users decide what my mail statement says who it's coming from. I don't have data off the top of my head of why it's a bad idea, but I recall reading there is security issues with doing that. Only thing that does for you is makes it so you can reply. I'd rather just copy their email out of the email I receive and do the email myself. Looks like you got your code from someone else. Perhaps a tutorial of some sort. I would definitely suggest following the link revraz provided so you can familiarize yourself with the function you are using.
  8. Well I was referring to how I was going to handle adding and editing the alerts and stuff with my original plan. I will just have to change that around a bit. At first I was going to just have a select box where you could hold CTRL and select all the users attending, but with this method it would require a lot of checks when/if you edit an alert. You create an alert with users 1, 3, 5. It stores alert It stores alert to users for each user, 1, 3, 5 You edit Alert and remove user 1 and add user 2 With the original way of using a select box for the users I would have to check for existing records for all users for that alert, delete 1 in this case and then add 2. But I will just make the Users an additional part of the alerts where you can add multiple users that way, but when you edit it if you want to delete a user you just click delete next to that user. I could be over-thinking this a lot though. I'll figure it out. Thanks :-) .
  9. Thanks! That's what I was thinking. It will involve a lot more work in the back-end though.. For my particular uses anyways. But it will be worth it!
  10. So, I have made a package that handles all of our prospects, clients, and project management for the most part and I am slowly adding more and more features, but just now I hit a wall and I am looking for input. The system has multiple users (The Staff), each which has its own Calendar and Alerts(reminders, automated alerts from the system). I have a users table, and I have an alerts table. My question is this: What is the best way to handle this data if the alerts are capable of being assigned to MULTIPLE users? Currently my table is setup to take the UserID and AlertID. Obviously, that is best used for just one user. Here are a few scenarios that I am familiar with.... 1.) Simply just duplicate the alert for each user it's assigned to. Duplicate data sucks though. 2.) Create another table for alerts_to_users which will just hold the branching data to bring the two together. But again, this will have many many records for just one alert (assigned to multiple people) 3.) Change the UserID field on the alerts to a text field and just store each UserID separated by a delimiter which I can later parse. Does anyone else know a better way to handle this? I want to avoid duplicate data. I don't want to have complex queries that slows the entire system down. And #3 would require a lot of processing of data which could slow it down quite a bit. Thanks for your help in advance
  11. Shouldn't the code below return as Failed because !!!! is not a valid email address? I may be wrong, but I could've sworn it used to function that way. Now my server is coming back with Success even though that is obviously not going to send. if (mail('!!!','Test Message','This is my message.','FROM: Name<email@email.com>')) { echo "Success"; } else { echo "Failure"; }
×
×
  • 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.