Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. $extract is not defined within that function.
  2. Within the functions section of the manual. Most newcomers don't. That's why it's such a trap. The bigger picture is that eventually you will be working with someone else's code. Now, lets say they have a function documented like so.... This says that the function foo excepts 1 argument, a string to be used within the function as $name. Now, if this function also relies upon a global $content you have no way of knowing about it and you cannot use the function without first defining $content somewhere. Functions accept arguments so that they are self documenting, sure, you could go and look at the code for the foo() function but you shouldn't have to.
  3. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=328777.0
  4. Functions accept arguments and return values, you use these to pass data in and get data out of functions. Using globals breaks a functions encapsulation and is considered poor design.
  5. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=328743.0
  6. trq

    Server Top list

    Sorry, but I don't see how this relates to us at all.
  7. trq

    Server Top list

    Try Google, this is a programmers board.
  8. The Exception class is (like the rest of PHP) written in C. Why do you need to see the code? The manual tells you what it provides.
  9. Justin, don't use globals in functions. They break the entire point of encapsulation. I didn't see the rest of your code in your post (didn't scroll down for whatever reason) but yeah, there is quite allot of issues within. I suggest your take a good look at the link that jcbones provided on scope and maybe start again.
  10. As you just stated. The Exception class is built into PHP so it's not defined in any basic.php file. The class you are looking at within basic.php likely extends the built in PHP Exception class.
  11. You might want to tell us what errors your getting then. I don't much like guessing games.
  12. There is nothing wrong with your code (excepting that www.google.com is not a valid url) . You better describe your actual problem. Where is $id defined?
  13. The class likely extends the built in Exception class.
  14. Have you got an open connection before calling this code? mysql_real_escape_string() requires a connection.
  15. Javascript doesn't actually update the HTML, just the DOM. Take a look at an Ajax driven page once some changes are made, the HTML remains as it was when it was initially served.
  16. That looks like an MD5 hash not encryption. A hash cannot be reversed.
  17. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=328704.0
  18. Nothing, you simply don't need that line. There is a sticky at the top of this board that covers this header error. it's probably the most common error newcomer come across.
  19. The undefined index error occurs because your query only selects the id from the database yet your trying to access a filed called 'active'. This error in turn generates output which causes your header error. ps: session_register() has long been deprecated and should no longer be used.
  20. Have you looked at how other systems using modules do it? It's not likely your going to find a tutorial on something so generic. How well do you know PHP? It's not really something that I would expect to find a tutorial about, it's more something that should be planned out yourself based completely on how the rest of your application works.
  21. Your missing the point. Classes do not replace functions. You cannot (or should not) simply convert a function to a class. Also, just because your code is within classes doesn't mean it is now OOP. Keep reading the book you have, it is probably the best PHP OOP book getting around, it may however take a few reads before you get it.
  22. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=328677.0
  23. What do you mean with this? Can you further elaborate? Which content are you talking about? "I cannot use a header redirect anymore because I'm echo'ing out in the header.php file for the navigation, which will echo out a profile and settings button ONLY if the user is logged in, it's basically a simple if statement with session variables." That content. Scripts that process user input should be in files that produce NO OUTPUT, this way, when they are done you can easily redirect your user to where they need to be. There is no point sending ANY output to the browser if all you are going to do is redirect the user somewhere else.
  24. Why are you sending content if all you are going to do is redirect? It makes no sense to do so.
×
×
  • 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.