Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. remove the comma after (username)
  2. How do you know how they look or taste? Ever ate one? 1) Store the current page a user is viewing 2) Query the database for rows that match the current page
  3. OP = Original Poster = You
  4. I'm pretty sure it worked (with register_globals = On) That's why you can't rely on it, if it's off your @#!$ed Here I rewrote your script: if (isset($_POST['submit'])) { $db = mysql_connect('localhost', 'example', 'example'); mysql_select_db('concierge', $db); $login = mysql_real_escape_string($_POST['login'], $db); $password = mysql_real_escape_string($_POST['password'], $db); $query = "SELECT privilage FROM auth WHERE login = '$login' AND password = '$password'"; $result = mysql_query($query, $db); if (0 === mysql_num_rows($result)) { header('Location: ../../index.php'); exit(0); } $row = mysql_fetch_assoc($result); $privilage = $row['privilage']; session_start(); $_SESSION['username'] = $login; $_SESSION['privilage'] = $privilage; if ('receptionist' === $privilage) { header('Location: ../../employees/receptionist/index2.htm'); exit(0); } if ('manager' === $privilage) { header('Location: ../../employees/managers/index1.htm'); exit(0); } if ('administrator' === $privilage) { header('Location: ../../admin/index.php'); exit(0); } }
  5. No, ever since you quit PHP it's development halted. Wishing for your return.
  6. How about just solving the error instead of excluding it? $submit = $_POST['submit']; ///////////////// if ($submit) { ///////////////// @paddyhaig: don't rely on register_globals setcookie('username', $_POST['username'], (time()-2592000), '/', '', 0); setcookie('privilage', $_POST['privilage'], (time()-2592000), '/', '', 0); This is not a good idea, use session's instead. Your error_reporting should be set to error_reporting(E_ALL); and ini_set('display_errors', 'Off'); These should be set in your php.ini for your production and development server (development server display_errors = On)
  7. Besides why would you allow 2 registrations for the same person?
  8. I think their are 2 main streams in the normalization process: 1) The Codd method Starts with NF0 which means all data in one table. Afterwards you apply the laws of Codd to become a NF3 or possibly an NF5 (NF3 is sufficient in most cases). Also note that in some circumstances denormalization will be applied if performance may benefit from it. Example: http://en.wikipedia.org/wiki/Database_normalization#Objectives_of_normalization 2) Don't the know the exact name of the second method but is commonly referred to as an ERD You start out by creating entities (little boxes with names in it, singular) and you try to find their relationships The diamond's in the picture represent relations, the circles are fields, the squares are table names.
  9. What framework do you use? Or is this something you build your own?
  10. Yes, I meant one master template file. I don't see the problem. You can call 400 billion controllers in one request if you like. It all depends on your logic. You could for example set it to use x as a default template and controller y could tell rendering should occur in template z. It all doesn't matter as it happens after all business logic has occured.
  11. In this case it's possible to have pre-defined stylesheets on your server and call them using JS <link id="sheet-screen" .. var link = document.getElementById('sheet-screen'); link.setAttribute('href', newSheet); The browser will automatically apply the new styles.
  12. Use a template instead of header.tpl and footer.tpl and fill in the required area's. If you use Smarty it's possible to use functions that will call template data (eg menu)
  13. " (double quotes) are able to parse $variables and newlines ' (single quotes) don't. Personally I use double quotes to notify the reader that it contains $variables or newlines otherwise single quotes, I find it more readable (and prettier, if that makes any sense in programming). $_SERVER['REMOTE_ADDR'] $_SERVER["REMOTE_ADDR"]
  14. ignace

    Education

    I know how you feel
  15. sheet.css.php #wrapper { width: <?php print $width ?>px; } <link href="sheet.css.php" .. Again, you have many options here it depends on how you architect your application. So, how did you architect your application?
  16. Then why is the original array internal pointer advanced by one?
  17. No, actually not. key() does not advance the internal array pointer. And the 111 is due to his code, not the above example. Which outputs 000 $data = array('cat','bat','rat','net'); echo key($data), '<br/>'; foreach($data as $key => $value) { echo 'key(): ', key($data), ' $key: ', $key, '<br/>'; } Outputs: 0<br/> key(): 1 $key: 0<br/> key(): 1 $key: 1<br/> key(): 1 $key: 2<br/> key(): 1 $key: 3<br/> foreach() advances the array pointer by 1?
  18. ignace

    Education

    If I remember correctly you studied for game developer but ended up as a web developer, that you in the end enjoyed more then what you studied for. Nevertheless your degree hasn't landed you a game developers job. What I'm saying is that it may be not the best example to give your kids.
  19. A 45 year old woman that has worked in her professional career probably with Windows and you serve Linux? WHAHAHA Just imagine what will happen when she will try to install Microsoft Office Or play tries to find solitaire for that matter
  20. http://www.templatemonster.com
  21. Like thorpe said your code is seriously flawed: if ($number < 20) This is what -sort of- happens when it executes 1. $number? 2. $number = null 3. $number = (int) null 4. $number = 0 5. $number < 20 6. true $number=mysql_query($sql); $number++; 1. $number = Resource #[iD] 2. $number++ 3. $number = 0 $number = mysql_query("UPDATE test SET time='$number' WHERE breeding='yes'") $number = Resource #[iD] 1) As you can see $number never goes higher then 0 2) If you are hoping $number will keep increasing with every request, you are dead wrong.
  22. What do you mean by is not decimal? not float? but is_integer?
  23. Yeah you could sell it as a template but you won't get more then $65 or if you are extremely lucky (and Photoshop skill level increases this luck) you can sell it as a unique template ~$1500 http://www.templatemonster.com
  24. $SERVER['CONTENT_LENGTH'] should be $_SERVER['CONTENT_LENGTH'] if ( $params['cust_country'] && $params['item_total'] ) should be if ( isset($params['cust_country']) && isset($params['item_total']) ) if ($status="fail") should be if ($status=="fail")
×
×
  • 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.