Jump to content

lastkarrde

Members
  • Posts

    165
  • Joined

  • Last visited

    Never

Everything posted by lastkarrde

  1. For small hacks/fixes/features jQuery is great. For a large Javascript application you will be better off in the long run using something like YUI, Dojo or ExtJS. See http://blog.rebeccamurphey.com/on-jquery-large-applications
  2. You could, or chmod that file so the user running apache (or your webserver) can read it.
  3. Radio buttons are for only one choice out of many options. Check/tick boxes are for many choices out of many options. What your asking doesn't make sense from a UI/usability perspective.
  4. Probably not. Domain name companies (particularly Godaddy) are notorious for trying to keep your business with them.
  5. I'm pretty sure you can remove your pages through Google's webmaster tools (more http://www.google.com/support/webmasters/bin/answer.py?answer=164734). If the pages do not exist Google should automatically remove them within a couple of months.
  6. Add the following line before your SQL statement $user = mysql_real_escape_string($_GET['user']); And then alter your SQL statement to read: "SELECT * FROM playerinfo WHERE user = '$user'"
  7. No. Keep things the way you are doing them. The benefit gained from code maintainability/readability is far greater than that of a minuscule performance hit. If you do start serving millions of requests, a bytecode cache such as APC will improve performance.
  8. Use url_encode and url_decode to pass information (such as strings with spaces and symbols) in the query string. So you would have: '&playerName=" . url_encode($player['name']) . "' and then on your points.php page, access the player name with $name = url_decode($_GET['playerName']);
  9. That doesn't guarantee the forms aren't empty. For example if the user had javascript disabled or the form was submitted by a bot, client validation does not work.
  10. You need to have a button to submit your form. An anchor will not do it. <input type="submit" name="submit" value="Test">
  11. You can check if fields are empty easily: //after the mysql_real_escape_string lines if($Name == '' || $Phone == '' || $Email == '' || $Postcode == '' || $Website == '') { //left a field blank }
  12. PHPTAL, Smarty and PHPTI are all worth a look at. Although I do recommend Twig for performance, stability (its fully tested) and ease of use .
  13. Sure. Because there is no "real" form submitting going on here the input elements could just as well be buttons or anchors. You can remove all the form markup. The jQuery (Javascript) listens to all click events on all elements that have the class approval (in this case its those input elements). When one is clicked, we extract the value attribute (Deny Contact Info[1,2,3,4]) and then call the window.open function with that value passed in the URL. $(document).ready(function(){ $(".approval").click(function(){ v = $(this).attr("value"); url = 'deny_approval.php?section=' + v; window.open(url, "myWindow", "status = 1, toolbar = no, scrollbars = yes, location = no, resizable = no, height = 600, width = 600, resizable = 0" ); }); });
  14. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="js/jquery-1.5.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $(".approval").click(function(){ v = $(this).attr("value"); url = 'deny_approval.php?section=' + v; window.open(url, "myWindow", "status = 1, toolbar = no, scrollbars = yes, location = no, resizable = no, height = 600, width = 600, resizable = 0" ); }); }); </script> </head> <body> <form action="" method="post" enctype="multipart/form-data"> <input class="approval" type="button" value="Deny Contact Info1" /><br /><br /> <input class="approval" type="button" value="Deny Contact Info2" /><br /><br /> <input class="approval" type="button" value="Deny Contact Info3" /><br /><br /> <input class="approval" type="button" value="Deny Contact Info4" /><br /><br /> </form>
  15. I only ever use Twig nowadays. Its a full featured templating language with a very basic syntax that only takes 5 minutes to learn. It has template inheritance which makes things like what your trying to do a breeze. For example you would just define a basic template with many blocks like : base.html <html> <head> <title>{% block title %}{% endblock %}</title> </head> <!-- define menu/sitewide features here --> {% block content %}{% endblock %} <!-- define footer/sidewide features here --> </html> All you would need to do to render any page on your website is: aboutus.html {% extends 'base.html %} {% block title %}About Us{% endblock %} {% block content %} About us content blah blah {% endblock %} Twig automatically (and somewhat magically) takes your about page and replaces the appropriate blocks into the base.html template. It then compiles all of this into straight PHP and caches the PHP code. So when you enable caching (a Twig configuration setting), it will render the straight PHP code making it as fast (if not faster) than a PHP templating solution. Useful links: Twig syntax & features Twig PHP API
  16. You need to set the name attribute of your inputs to all be exactly the same, deny_profile_approval.
  17. $_SERVER['DOCUMENT_ROOT'] ? Or define your own constant/variable/global specifying your root directory.
  18. Any (good) webhost that supports PHP 5.2.4+ supports Zend Framework.
  19. We will need the schema of your images table, right?
  20. http://www.google.com/search?client=ubuntu&channel=fs&q=css+button+look+like+a+link&ie=utf-8&oe=utf-8
  21. echo '<p onclick="popUp(\'$gmail\')">lkjlkjlkjlkjlkjlkj</p>';
  22. Howdy I wrote an article titled Why you should be using a PHP framework. I suggest you read that to see some of the features frameworks offer and also see the names/links to some of the bigger, more popular frameworks. I'd be happy to discuss any questions you have
  23. Access it with the array index? var_dump() $verified and $id in the loop
  24. The 'headers already sent' error message is basically telling you that your server has already started sending the HTML/css data in header.php to the client, and then your trying to send the header() redirect to the client. Why do you need to display HTML/css on a page that simply redirects? The user wouldn't see anything on that page anyway, would they?
×
×
  • 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.