Jump to content

Gaab

New Members
  • Posts

    4
  • Joined

  • Last visited

Gaab's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, This is access.php: <?php // Include here your Database session_start(); $sql = $mysqli->query("SELECT user_level FROM imobiliare_users WHERE id=$id"); $user_level = $mysqli->query($sql); echo $user_level; if ($user_level =="editor") {$user_wert = "1";} if ($user_level =="admin") {$user_wert = "2";} ?> You take in the .php Files: <?php include 'access.php'; // only Admin: if($user_wert == "2") // This is the Query for the Admin { echo "This Looks only the Admin"; exit; } else { die("No Admin"); } // only Editor: if($user_wert == "1") // This is the Query for the Editor { echo "This Looks only the Editors"; exit; } else { die("No Editor"); } // If you want a Page for Admin and Editor say: if($user_wert >= "1") // This is the Query for the Editor and Admins ( All Ranks over the Number "1") { echo "This Looks only the Editors or Admins"; exit; } else { die("You a normal User."); } ?> I use for If Query's only numbers. You can say, the "normal" User is number 0.
  2. Hey, <?php session_start(); $sql = $mysqli->query("SELECT user_level FROM imobiliare_users WHERE id=$id"); $user_level = $mysqli->query($sql); echo $user_level; if ($user_level !="administrator" || $user_level !="editor") { die("You are not the proper user type to view this page"); } if ($user_level =="administrator"){ echo"See all of the Page"; exit; } if ($user_level =="editor"){ echo"See only newsletter in this Page"; exit; } ?> Is this what you mean?
  3. Hey, Can you give me the Code of the Input Boxes?
  4. <?php include('core/inc/init.inc.php'); if(isset($_GET['file_id'])) { $file_id=(int)$_GET['file_id']; $file=mysql_query("SELECT file_name, file_expiry FROM files WHERE file_id=$file_id"); if(mysql_num_rows($file)!=1){ echo'Invalid file Id'; }else{ $row=mysql_fetch_assoc($file); if ($row['file_expiry']<time()){ echo'This file has expired'; }else{ $path= file_get_contents('core/files/'.{$row['$file_name']}); header("Content-Disposition:attachment;filename=\"{$row['file_name']}\""); header('Content-type: application/force-download'); header('Content-Length:'.filesize($path)); header('Content-type: application/octetstream'); echo $path; } } } ?> Test this!
  5. Hey, I new here. I'll tell you briefly what about me: I live in Germany, Frankfurt am Main and I would like to learn PHP and English. My grammar in English is terrible :/ (I hope that you accept me so.) My English teacher is only talking to yourself... Glad to be here
×
×
  • 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.