Jump to content

Acute Chaos

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Acute Chaos

  1. I'm building a members' site. I am a major noob so I am using various tutorials to get me through this but my lack of php know how has me stopped. I have two groups of users on this site. They both use the majority of the site but there are pages that only one group can access and other pages that only the other group can access. I have a session set to ensure they are logged in to access the site. Works fine. In my database I have a place that marks the status of the user and I thought if I set another session var specific to each group using that information I could check that before allowing access to their specific pages. Makes sense? Here is what I have: session_start(); if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) { header("location: access-denied.php"); exit(); How do I code: if "SESS_MEMBER_ID" and "SESS_STATUS - set to 'coach'" are both not set - access denied or if "SESS_MEMBER_ID" and "SESS_STATUS - set to 'player'" are both not set - access denied If this isn't the best way to go about it please say so as well!! Thanks so much in advance for your help. I really appreciate it!
  2. Rofl - Thanks - One of these days I'll get a handle on this but my god their is a lot to learn. Thanks a lot and holy wicked fast!! I'm sure I'll be back soon with another problem, hopefully as simple!!
  3. I am building a staff directory with little knowledge of what I'm doing and piecing together examples I have found online. Because I am a noob I can't get to where I want to go with this one. To search by 'Letter' I have a bunch of anchors coded at the page top e.g. <a href="?by=A">A</a> Then in the php I have: if(isset($_GET['by'])){ $letter=$_GET['by']; // - - - database connection stuff - - - $sql="SELECT id, f_name, l_name FROM user WHERE f_name LIKE '%" . $letter . "%' OR l_name LIKE '%" . $letter ."%'"; $result=mysql_query($sql); $numrows=mysql_num_rows($result); echo "<p>" .$numrows . " results found for " . "<i>" ."'" . $letter . "'". "</>" . "</p>"; // - - - and then the loop that displays it - - - My Problem is this - If I search for 'A' for example, every name in the database with a letter anywhere in it comes up. I only want names beginning with the letter 'A' to come up. Thanks for any help you can give me! I really appreciate it. If this is a bad way of going about it, let me know that too please and hopefully point me in a brighter direction.
  4. This seem pretty straight forward even for me so Thanks!! - I'll give it a whirl. I'm in a bit over my head so when I get tossed something extra I feel like my brain is going to explode.
  5. I've found examples out there but I am too much of a noob to get this going. I am setting up a db of users for a members' only site. One field will be for their email address BUT the client wants to block the members' from using one specific domain in their email address. i.e. If when the member is filling out the information, they put the email address as [email protected], they will get an error message that says something like "hey you can't use your "hotmail" account please use a different one." So I figure from the examples I've seen online I should use explode to separate the email address out? But when I look at the examples that are out there I don't know what the heck I'm looking at in half the code to be able to add this to the code that is validating the validity of the email address. Is there a simple way out of this for a tired blurry eyed noob? Thanks!
×
×
  • 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.