Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Do you use CSS or JS to power the tabs? Can you show the code?
  2. I know the feeling, and like someone else said I'm sure everyone will go through it. On my first day I was introduced to the company's custom framework - which including the various applications is over about 500,000 lines - with only an outdated functional spec document for help. Was a tough few weeks, and to this day there's still parts of it I've not encountered, but loved the learning experience!
  3. What do you mean 'to check if they clicked'? The event is only triggered when the user clicks the target..?
  4. In answer to this; yes. You should always aim to perform development on a local web server. When all development is complete (and code reviewed, tested locally - depending on what your procedures are) you should then push to your UAT server, for testing on an identical - or close to - set-up as your production server. Once you're confident, you should then push to your production server.
  5. You need to read up on branches. They allow you to fork development and merge back in later, so that you can control what exactly goes into your live branch but still work on several developments at once. It's a good idea to regularly 'rebase' your more lengthy development branches onto the latest live, so that you're always working on an up-to-date version of the code base. When you do merge in development branches you should merge them in under a parent commit, so that you have a cleaner and more identifiable commit history. You'd be best building up a next/experimental branch as well, so that you can test what you're about to merge into your live branch before you actually do it. Have you considered writing a Git alias to handle rolling the files out? Or.. why not just checkout the live branch on your production server?
  6. You're forcing the user to download >2MB worth of data? Not such a problem on unlimited plans, but for those with limits (and especially for those with limits and slower connections) they certainly won't want that! Why does a banner even take 2MB?
  7. Take a look at the sticky on this board: HEADER ERRORS - READ HERE BEFORE POSTING THEM
  8. if (isset($hair) && $hair != 'Brunette' || $hair != 'Black' || $hair != 'Red' || $hair != 'Blonde' ){ In English this would be; if $hair is set (as MadTechie says, will always be true anyway) and $hair does not equal Brunette, or if $hair does not equal black, or if $hair does not equal red, or if $hair does not equal blonde, ... Even excluding the isset check, that statement would always evaluate to true.
  9. The maroon and light blue/white don't work for me. The banner seems quite oddly large, and the text in the header looks crammed into a small space. I like the brushed metal style background fading in though, fits the nature of the site well. I'd disagree. "Robert's Plumbing" doesn't tell you it's a plumbing service? Do you see Microsoft with a computer in their logo? Adding little 'clip-art' like that only reduces a company's professional web-image in my opinion. I'd say in terms of layout and structure, it's well done. There's some aesthetic changes that can be done to maker it better though, and the mark-up isn't perfect.
  10. I think they knew a little more then they tell you. From what I've heard, they didn't give instructions on anything to do, there were hardly any updates, and made false promises to have PSN back up on May 4th (Maybe they didn't lie b/c it was backup in Japan). Oh yeah, I have no doubt they'd have known more than they let on - what company doesn't? At first they did try to keep people in the know and said it would be back online within a couple of days, which was probably a mistake. Presumably after they re-launched it in Japan, they realised the extent of the intrusion and took it back down; keeping in favour of not saying much over giving false hope/information again. We can only guess really... As said the data actually exposed was stuff that's pretty much available else-where anyway, or useless on it's own. Any sensitive data like the password, was encrypted and is most likely useless to them -- especially after they re-launch the service and force every use to reset their password on the machine they created the account (or through email).
  11. Okay so in login.php, you verify that $error_ar isn't empty, every time reglardless of whether they submitted the form. Assuming it's not you then redirect them to processform.php. In processform.php you then attempt to authenticate them, based on the username and password you stored in the session in login.php. If they aren't authenticated you then redirect them back to login.php, which doesn't enter the validation because $_POST['submit'] is not set - which also means that $error_ar is not defined. So when you enter the $error_ar count check afterwards, it defaults to 0 and you redirect them back to processform.php.. Which still has the session values and then results in a redirect back to login.php, and so on. This logic needs correcting; perhaps by moving the error check in login.php to within the submit button condition's code? Also I'm guessing that either your authenticate method doesn't work, or you're providing invalid login details.. Edit Why are you splitting the logic and forcing the redirect like this anyway? Why not just perform it all within the same request, and then redirect once successful?
  12. That firefox error suggests you have an infinite loop in your redirect.
  13. Very possible. Though asking them to enter 1-10 for the question "what kind of student body size would you like?" doesn't sound right. Would you replace the 1-10 values with textual representiations; 1 - very small, 2 - small, 3 - kind of small, 4 - .. etc. ?
  14. If you write them both at the same time, you can just concatenate them within a string and use the new-line character ("\n") to put them on different lines: $new_rotation = $new_offer . "\n" . $new_lp; file_put_contents('rotation.txt', $new_rotation);
  15. It's a little loopy, but this appears to work: // Loop through each currency foreach ($currencies as $currency) { // Loop through the currencies again to access the others foreach ($currencies as $other_currency) { // Check it's not the same if ($currency == $other_currency) { continue; } // Check this pair doesn't already exist foreach ($currency_pairs as $currency_pair) { if (($currency_pair[0] == $currency && $currency_pair[1] == $other_currency) || ($currency_pair[1] == $currency && $currency_pair[0] == $other_currency)) { continue 2; } } // Add to pairs array $currency_pairs[] = array($currency, $other_currency); } } print_r($currency_pairs); Edit.. again I've actually written that so EUR - SEK, and SEK - EUR are classed as the same. To treat them differently, change the IF to this: if ($currency_pair[0] == $currency && $currency_pair[1] == $other_currency) { continue 2; } Edit.. again.. again Ha.. actually you can just remove the entire foreach loop there if that's the case.. the same order will never come up twice.
  16. Not sure I understand how US dollars can be considered a "pair" with Swedish kronor? Edit Sorry, just realised what you meant. Will reply again in a few minutes..
  17. If it's a time-out issue then you're not going to get around it by breaking it down -- in-fact although this can save memory, it generally increases the time needed. You can increase the time-out limit for that request only, which isn't really a security issue if you're expecting it to take longer, by using set_time_limit.
  18. You'd be better having the digits one per line, then using file to read the contents of the file into an array: $rotation = file('rotation.txt'); $rotation[0] // contains first number $rotation[1] // contains second number
  19. Couldn't have put it better, KingPhilip. Also people say they reacted slowly, but in truth they actually shut down the PSN as soon as they found out there had been an intrusion. Can you actually imagine having to make that decision? The impact it would have and the repercussions to follow.. Sure they didn't give updates as often as others, and didn't put it back up in the two or so days they said they would, but they didn't know exactly what had happened themselves. What do you want them to say? Plus if someone's sat hour after hour, just waiting for some scrap of hope from Sony's blog... well it's been said they need to get out more!
  20. Did you design this?
  21. Kind of, but I'd say they're for looping through the contents of an array - or object - as opposed to extracting values from them.
  22. You can do this a lot more gracefully with regex: $long_question = '12345678901234567890123456789012345 1234567890'; // 35 characters before space $short_question = preg_replace('/^(.{0,30}[^ ]*).*/', '$1', $long_question); echo $short_question; Personally I'd only add "..." to the end if the length of $short_question is actually smaller than $long_question.
  23. You need to use one of the fetch functions (mysql_fetch_array, mysql_fetch_assoc, ...) The resource only contains a reference to the data on the MySQL server.
  24. Unfortunately I don't know of a way to do this with CSS, however you can set the .scrollTop JavaScript property: window.onload = function() { document.getElementById('items').scrollTop = 100; } You'll need to add the "items" ID to your DIV for the above to work.
  25. I've never really used Greasemonkey myself, but from what I've read I doubt it. The scripts are executed by the plug-in as regular JavaScript, which won't leave a trace.
×
×
  • 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.