Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Could you explain what you mean a little more please? FYI or tags make your code a lot more readable, and more likely to get you help.
  2. I didn't notice you were declaring variable variables before. Your problem is you're declaring ${$k} as a new variable each time you pass $v through one of the functions. Try this: $v = strip_tags($v); $v = htmlentitiess($v); ${$k} = stripslashes($v); That will keep overwriting $v and then store the result with all 3 functions applied into ${$k} - although I should stress, escaping input data should be done on a per-input basis. Also, you should only apply htmlentities() when you're outputting the data - not while you're processing the data. I'd also suggest using the DBMS specific escpaing function as mentioned in my last post, at the point you insert the data into the database.
  3. Why are you looping through the array twice, and not just applying strip_tags() and addslashes() in the same loop? Anything you do after the loop(s) with the $_POST data will have been escaped, there's no need to use an IF conditional. FYI
  4. Since this is a Facebook application, why not use the Facebook Data Store API to save the scores? I doubt Facebook applications would have the server-side support for connecting to MS Access databases anyway.
  5. foreach ($array as $key => $val) is the same syntax as when you define an array with keys: "=>" is just an (array) assignment operator specific to PHP. As far as I know the only other popular language that uses it is PL/SQL from the Oracle platform, for naming parameters in procedure/function calls.
  6. Could you show some code?
  7. Those type of 'search engine friendly URLs' use the "mod_rewrite" Apache module (or Windows equivalent), to rewrite the URLs to pass in the values as parameters. For example if you have "example.com/page/my-page", the URL could be re-written to "example.com/page.php?name=my-page". The value is then retrieved within the PHP script (look into the $_GET and $_POST super globals) and the database is queried for a page with the name "my-page". If found the contents are retrieved are then 'dynamically' displayed within the page, to give the 'illusion' of multiple pages.
  8. Updating the value is easy: // Get the current value and cast as an integer $counter = (int) file_get_contents('./counter.txt'); // Set the new value $counter++; // Store in file (overwrites current contents) file_put_contents('./counter.txt', $counter); .. Not sure what you mean by this though?
  9. You mean remove all current session variables apart from two..? $save = array('var1', 'var2'); foreach ($_SESSION as $name => $value) { if (!in_array($name, $save)) { unset($_SESSION[$name]); } }
  10. Took about 10-15 seconds for me the first time, then 2-3 seconds after when I refresh. Edit: when I reloaded the page with YSlow the delay was with: http://www.rushhunt.com/images/resize.php/1.png?width=40&height=40%E2%84%91=/images/hunt/1.png
  11. Sometimes you have to consider the audience and way up whether it's worth the hassle to fix it. Not to stereotype the audience of this site, but I doubt many (if any) would stray away from the computer's default browser, IE. On the other hand if this is a site you plan to use in a portfolio, you may want to claim it's fully cross-browser compliant. In which case it's obviously worth fixing the issues. Just remember some of the browsers on Browershots probably have about 10 people world-wide using them (possibly downplaying them a bit, but you get the idea).
  12. Relevant, quality pages yeah. Google interprets a 'back-link' as a vote for your site (which is why people try to spam links to their sites on forums and such). Preferably you want the linking site to have a high page rank, whilst relevant to your site's content. The higher the rank and relevance of the linking site, the more influence/weight the back-link has on your ranking. There's other factors that affect it too, so you're best reading around a few articles to fully understand the process, and of course Google's constantly changing their ranking system.
  13. I was viewing the footer in FF3.6, which had the issue. The white block has gone, but the text input still looks a little wrong touching the bottom of the window. Browsershots is probably your best bet for testing cross-browser, it also has the options for different operating systems. IE8 has a compatibility view (tools > compatibility view) for you test in IE7, going from memory though I don't believe IE6 is an option. There's a few programs you can download too, "MultiIE" I think one's called, but I can say how accurate they are. As for the font, I had a quick play around in Firebug and found the following styles looked nicer: color: #333; font-family: 'Palatino Linotype'; font-size: 16px; Also added a 10px top margin to the title, to space it a little better.. Attached a screen-shot of the final result. [attachment deleted by admin]
  14. Forgot the attachment.. [attachment deleted by admin]
  15. In general I really like the website; the font, layout, colour scheme, etc. It suits the subject of the website well, and has that kind of 'class' about it. When you navigate away from the homepage however, the font ruins it for me - just doesn't seem to fit in. That's really the only negative I can find about the design, except for the footer's broken (see the attachment). Quick suggestion I could make with the mark-up would be to move the Google Analytics script block to the end of the body. That'll make the website load quicker and improve SEO slightly. You could also remove a lot of class names from elements by making better use of CSS selectors, which will reduce some of the bloat in the mark-up and improve your content : mark-up ratio. Those are fairly nit-picking suggestions though. Adam
  16. See if this helps: $('#characterlist').children('li').each(function() { if ($(this).text() == li.text()) { return false; } });
  17. Add HTML comments around your JavaScript: <script type="text/javascript"> <!-- // ... --> </script> That will cause the validator to ignore any mark-up it finds.
  18. Yeah, that's perfectly possible. Are you using the jQuery auto-complete plug-in? I had to do something similar a few months back with it.
  19. @Crayon Violent I've seen some of ManiacDan's posts in the past and I doubt he's here looking for help - "asking for handouts" as you put it. I see the ads myself, 5 in your last post, and they are very obtrusive. I think ManiacDan has every right to bitch if he's contributing to the community, as does everyone else who benefits this website.
  20. well you can modify it a bit to make it more aligned but the concept is same for all. The "concept" being they all use mail?
  21. There's nothing wrong with the W3C validtor; in-fact the W3C are who literally set the standards. Can you give an example of a tag they report incorrect, you believe to be right? There's nothing wrong with tables themselves, it's how you're using them. Tables are a bloated old-fashioned way of structuring web pages, plus they don't semantically describe the content they hold; DIVs and CSS should be used these days. In-line CSS is bad because web browsers are unable to cache it, unlike they would if they were externalised. Also having a large chunk of CSS within the header of your document reduces SEO.
  22. logicslab, That's going to result in two elements with the ID "div1", with the second appended as a child node of the first. Effectively resulting in the following HTML: <div align="center" id="div1"> some content i want to show twice <div align="center" id="div1">some content i want to show twice</div> </div>
  23. First thing I noticed, being on a weak connection at the moment, was the load time. The thumbnails for the games are all large images with width and height attributes set to re-size them. This is a waste, as in your case the browser still has to download about 25-30 of these large images and then re-size them all. If you create small thumbnails for each then you'll notice an increase in performance, plus they'll look better. Secondly.. I didn't really see any reason why someone might think to join (i.e. what benefit is there?), but gave the registration process a try anyway. The registration form looks almost identical to the login form, and are both requested from login.php? After registering I was given an internal server error, so I went back and tried the login form anyway. Strangely the 'invalid username / password' error was already there, and seems to be there permanently. My new username/password didn't work, and trying to register again came back saying my username was already taken? The mark-up is pretty poor to be honest. You have no DOCTYPE, 176 validation errors, loads of use of deprecated tags, incomplete HTML structure, a table-based layout, large amounts of in-line CSS and JavaScript, etc. A lot of work to be done to improve it. I'd give your site 3 out of 10.. And I'd question your legal rights to host those games?
  24. Adam

    merge data help

    You can join the barcodes and prices tables using left joins: select pro.productCode , pro.anotherColumn -- any other columns from products , pri.priceColumn -- any other columns from prices , bar.barcodeColumn -- any other columns from barcodes from products pro left join prices pri on (pro.productCode = pri.productCode) left join barcodes bar on (pro.productCode = bar.productCode); Obviously you'll need to modify it a little, but once done run and make sure it returns the data you want. I weren't sure if by merge you meant permanently within a new table, or for within a select statement; so if you want to physically join them then you can modify the query to create a table using the select statement: create table new_products select pro.productCode , pro.anotherColumn -- any other columns from products , pri.priceColumn -- any other columns from prices , bar.barcodeColumn -- any other columns from barcodes from products pro left join prices pri on (pro.productCode = pri.productCode) left join barcodes bar on (pro.productCode = bar.productCode);
  25. Could you explain what it is you're trying to do a little more? I'm not really following.
×
×
  • 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.