Jump to content

revraz

Members
  • Posts

    6,911
  • Joined

  • Last visited

    Never

Everything posted by revraz

  1. I dont know ASP, but I'm sure it uses something similiar.
  2. So where is Cust coming from? Change $_SESSION['type'] = ($row['user']==1)?"Cust":"Emp"; to $_SESSION['type'] = ($row['user']==1)?"admin":"user"; Then echo those out.
  3. Yes, it is a concern, which is why you want to validate it.
  4. You are relying on Sessions, if its not the first line, Sessions won't work.
  5. The thing is, you don't have Admin listed as something to compare to. How many Roles do you have, what are their numbers in your DB, and what are their names.
  6. So your row doesn't match your session. Lets see your code again for what it's comparing. Is it still $_SESSION['type'] = ($row['user']==1)?"Cust":"Emp";
  7. You need session_start(); at the top of each page in order for the $_SESSION variables to pass.
  8. $_GET
  9. Include will include it as many times as you call it Include_once will only call it once Require will provide a different error if the file does not exist
  10. Echo $_SESSION['type'] and $row['user'] to see what they contain.
  11. Look at this thread and see how they are posting to the DB http://www.phpfreaks.com/forums/index.php/topic,94674.0.html you could also do it other ways.
  12. There are quite a few threads here in the last few days about them. You should be able to find some posts with examples. If not, post a follow up and I'll write something up for you.
  13. I would create links like table.php?table=tablename And then your PHP code uses GET to get the tablename, and based on that, you can do your seperate queries and output them.
  14. Your Insert statement is incorrect in regards to your $_POST variables.
  15. For me, using CSS.
  16. This might help http://www.phpfreaks.com/forums/index.php/topic,167842.0.html
  17. The : acts as a Else. So if row user =1 then its a Emp, otherwise it's a Cust.
  18. What I would do is just set a $_SESSION variable when they log in to Admin=True or along those lines and then just check it on any page you need Admin rights.
  19. And you want to keep the <br> tags in the DB?
  20. if ($extention != 'csv')
  21. session_start(); needs to be the first line of code on every page.
  22. Which is exactly what I did on the first page of posts.
  23. echo $username echo $checkname see what they contain
  24. $checkun = mysql_query("SELECT username FROM users WHERE username='$username'") or die (mysql_error()); $checkname = mysql_num_rows($checkun) or die (mysql_error()); if($checkname > 0) {print 'Username found!';} else {print 'Username can be used!';}
×
×
  • 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.