Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Neither of these are achievable on the client side.
  2. How do you know you want a class when you don't even know what they are or how they work?
  3. Firstly, the idea of globals and functions do not mix. Functions are there to isolate a piece of code into a reusable and abstract chunk, forcing them to use global variables breaks this idea entirely. Secondly, the main purpose of this functions seems to be to loop through a result set and display a table for each result. Why are you trying to force it to do something else as well? Functions should preform one specific task, and one specific task only.
  4. You just described what you need to do, where exactly are you stuck? Were not here to simply pump out code for people.
  5. Judging by the logs I would say PFMaBiSmAd has hit the nail on the head. What a PITA.
  6. Yes it's an option. 'Modify Post'. But only within a short period of time from the posts creation.
  7. PDO is a PHP extension. @op: You have just shown to yourself (using print_r()) that $result is an array. Why are you trying to use it like an object?
  8. Neither of those are programming languages. JavaScript will likely do what your after and yes, you could use the jQuery framework to make it easier.
  9. Not without using a programming language. HTML is a simple markup language.
  10. if both databases are on the same server you do not need 2 different connections. Just use mysql_select_db to switch between the two databases as needed.
  11. You are aware that PHP is used to extend servers functionality? Without a server there is no PHP unless your are writting simple cli scripts.
  12. I think the reason it's (Python) used allot in academic situations is because it is very clean and easy to see the point of a programs functionality. Python definitely stretches far beyond that however, entire OS infrastructures are built around it these days (see Portage) and most (if not all) Linux distributions depend on it being installed by default. I'm not sure how substantiated these clams are either. Iv'e seen (and used) web servers written in php (see Nanoweb) that are certainly robust enough to run most personal web sites.
  13. If you have the ability to install extensions ive had some success with a similar concept within one of my CMS's. http://aurore.net/projects/php-js/ php-js is a php extension embedding the Spidermonkey Javascript engine into php, thus allowing your users to provide plugin code written in Javascript using an API that you can define yourself.
  14. Indeed you would be. I don't have any links around, but there are numerous articles around the net about optimizing jQuery code. This is definitely one of those tips.
  15. You cannot call header() after output has been sent to the browser. You will need to put your processing code bofore the html.
  16. Pretty simple using jQuery. var data = ''; $.ajax({ url: 'something.php?name=jack', success: function(html) { data = html; } });
  17. Just about any of the so called scripting languages would suffice. Perl, Python, Ruby or whatever. If PHP is working for you I don't see any real reason to swap though, but it's always good to get a few languages under your belt. Python is a favorite of mine.
  18. So.... a registry. Hard coding methods like getDB() isn't very flexible. Take a look at overloading. http://php.net/manual/en/language.oop5.overloading.php
  19. Firstly, don't use <? tags, ever. Always use <?php Secondly, you have no call to session_start. Thirdly, values being assigned to variables do not need () braces. $foo=('blah'); should simply be $foo = 'blah'; die is a poor method of error trapping. Check for errors within an if() statement and handle gracefully. Lastly, what errors are you getting and have you tried echoing your query to see what is actually looks like?
  20. We don't do homework. Where exactly are you stuck?
  21. The $_SESSION array shouldn't really be treated any differently to any other array. $sql = "SELECT foo FROM bar WHERE boo = '{$_SESSION['whatever']}'"; Of course, if it is user submitted data within the $_SESSION array you will want to make sure to sanitize it.
×
×
  • 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.