Results 1 to 14 of 14
  1. #1
    CoP Dynamis
    Join Date
    Oct 2006
    Posts
    286
    BG Level
    4

    BG PHP Programmers - Need a little help

    I helped out the guy asking for C++ the other month and I was wondering if anyone could point me in the right direction on a little issue I'm having as web development isn't my main area of expertise.

    I'm applying for a PHP coding job and they've assigned me some exercises to text my skills. Most of it was easy enough but I'm stumped on one question. I just cant work out what they're getting at.

    Any help would be greatly appreciated:

    With regards to a registration web form:
    The client reports that visitors to the website are complaining that they see a message when refreshing the registration page after submitting their details and seeing an error message. You investigate and find that this is because the form fields are POSTed to the script and the browser prompt the visitor to resubmit their details if they refresh the page. How could you adjust the system to avoid this happening without changing to use a GET request.

  2. #2
    Salvage Bans
    Join Date
    Jan 2005
    Posts
    871
    BG Level
    5

    Only php programmed for a couple years, but to me it sounds like whoever created this hypothetical form that works like shit didn't write rules to validate the data properly?

    It really depends what the error message is to be honest. The question is worded horribly.

  3. #3
    E. Body
    Join Date
    Jun 2006
    Posts
    2,181
    BG Level
    7
    FFXIV Character
    Bro Teampill
    FFXIV Server
    Gilgamesh
    FFXI Server
    Ifrit

    YUMMY COOKIES.

    Just a guess. Fuck web scripts. If you can't compile it, it can suck muh balls.

  4. #4
    Banned.

    Join Date
    Oct 2006
    Posts
    10,115
    BG Level
    9

    Indeed validate both server and client side input or there is a POSTBACK state to check if the request is a refresh i think

  5. #5
    Pay No Attention to the Man Behind the Curtain
    Join Date
    Jan 1970
    Posts
    3,491
    BG Level
    7
    FFXIV Character
    Ragns Meuhie
    FFXIV Server
    Gilgamesh
    FFXI Server
    Bahamut
    Blog Entries
    172

    AJAXify that shit.

  6. #6
    i'm awesome.
    Join Date
    May 2005
    Posts
    9,218
    BG Level
    8

    All answers are wrong, they simply want you to redirect after form submission. You could be weird and check the location for post parameters and redirect based on that too (js).

  7. #7
    Ridill
    Join Date
    May 2005
    Posts
    13,568
    BG Level
    9

    Just a thought: if you can't complete the exercises assigned, perhaps you're not cut out for the job?

  8. #8
    Onto plan B...
    Join Date
    Aug 2008
    Posts
    913
    BG Level
    5
    FFXI Server
    Sylph

    Quote Originally Posted by aurik View Post
    Just a thought: if you can't complete the exercises assigned, perhaps you're not cut out for the job?
    I wrote up a pretty long reply earlier that summed up to this, but erased it. As a computer engineer who was also looking for jobs and getting railed by comp sci questions, I don't know why you would try to receive outside help on this. This is going to be a job where you have to do this kind of stuff daily. Not trying to be rude, mean, or flame, but I'm not sure why you would try to get help from someone knowing full well it's going to make you look like an ass when you get the job. You're going to be required to do this kind of stuff daily... Not particularly a situation I would wanna be in. Also, I wish I had these kind of questions in interviews; they always ask us to write some sorting algorithm off the top of our head on a white board. Hell, Nvidia gave you a quiz if you went to their booth at the career fair that basically asked you to explain how a GPU worked and in what order it renders things. I just handed them back the quiz after answering one question out of four and said, "I don't know enough."

  9. #9
    Chram
    Join Date
    Jun 2006
    Posts
    2,737
    BG Level
    7

    Quote Originally Posted by Fairy-Killer View Post
    I wrote up a pretty long reply earlier that summed up to this, but erased it. As a computer engineer who was also looking for jobs and getting railed by comp sci questions, I don't know why you would try to receive outside help on this. This is going to be a job where you have to do this kind of stuff daily. Not trying to be rude, mean, or flame, but I'm not sure why you would try to get help from someone knowing full well it's going to make you look like an ass when you get the job. You're going to be required to do this kind of stuff daily... Not particularly a situation I would wanna be in. Also, I wish I had these kind of questions in interviews; they always ask us to write some sorting algorithm off the top of our head on a white board. Hell, Nvidia gave you a quiz if you went to their booth at the career fair that basically asked you to explain how a GPU worked and in what order it renders things. I just handed them back the quiz after answering one question out of four and said, "I don't know enough."
    You're selling yourself and the OP short with this attitude.

    Newsflash, in computer engineering no one knows what they're doing, we all just make it up as we go along , that's the norm.

    You NEVER get to a point where you feel like you know wtf is going on, never.

    The most successful among us are those who accept this, and realize our value is not in knowing anything, it's in knowing how to eventually find a solution through any means. That's why computer engineering is a lifelong commitment to constantly re-educating yourself.
    Also let's be realistic, as far as 99% of companies are concerned, computation is fucking magic, and very few people are any good at it. The daily workload for most programming teams involves a coordinated effort in stumbling around in the dark until they eventually get something that works, not knowing how to do one thing isn't going to make you look like an ass, and learning how to do that, even if you have to ask, is what the profession is essentially all about.

  10. #10
    Onto plan B...
    Join Date
    Aug 2008
    Posts
    913
    BG Level
    5
    FFXI Server
    Sylph

    Quote Originally Posted by Darus Grey View Post
    You're selling yourself and the OP short with this attitude.

    Newsflash, in computer engineering no one knows what they're doing, we all just make it up as we go along , that's the norm.

    You NEVER get to a point where you feel like you know wtf is going on, never.
    No, I understand this. But interview questions that test your very basic understanding of a language shouldn't be something you need help on when your job is going to require you to do much more complex problem solving. But I know what you're getting at; I wouldn't have chosen computer engineering as my profession if I wanted to always know the answer or never encounter anything new or befuddling.

  11. #11
    Ridill
    Join Date
    May 2005
    Posts
    13,568
    BG Level
    9

    Quote Originally Posted by Darus Grey View Post
    You're selling yourself and the OP short with this attitude.

    Newsflash, in computer engineering no one knows what they're doing, we all just make it up as we go along , that's the norm.

    You NEVER get to a point where you feel like you know wtf is going on, never.

    The most successful among us are those who accept this, and realize our value is not in knowing anything, it's in knowing how to eventually find a solution through any means. That's why computer engineering is a lifelong commitment to constantly re-educating yourself.
    Also let's be realistic, as far as 99% of companies are concerned, computation is fucking magic, and very few people are any good at it. The daily workload for most programming teams involves a coordinated effort in stumbling around in the dark until they eventually get something that works, not knowing how to do one thing isn't going to make you look like an ass, and learning how to do that, even if you have to ask, is what the profession is essentially all about.
    Nah.

  12. #12
    Chram
    Join Date
    Jun 2006
    Posts
    2,737
    BG Level
    7

    Considering how desperate companies are for engineers, they'll take anyone they can get who shows aptitude for being able to pick it up. I'm just saying I don't think the OP is really in the wrong in anyway...

    No more wrong than you or I are, when you consider the fact that 90%+ of our "Breakthroughs" come from google... or finding a solution on Github these days.

  13. #13
    Ridill
    Join Date
    May 2005
    Posts
    13,568
    BG Level
    9

    Not sure what kind of software engineering you're into, but probably less than 1% of my work involves searching the web. And that <1% is probably dominated by googling for API information from msdn.

  14. #14
    CoP Dynamis
    Join Date
    Oct 2006
    Posts
    286
    BG Level
    4

    I did fine on the rest of the stuff, my PHP, SQL and XHTML/CSS is fine, I just wasn't 100% sure what they were getting at with that one question. My friends in web development weren't either, I have even got multiple conflicting answers here Plus the job is a junior role, they know I am new to web development and that i will be using every available resource to bring myself up to speed.

    In the end I went with an answer to use AJAX and javascript to validate before submission to reduce the likelihood that the user will have to re-enter any data after submission, and to use a redirect after server side validation. The company were happy with my answers and I have a final interview next Thursday.

    Thanks for people that were helpful

Similar Threads

  1. BG Crafting, I need help finding a button/fastener
    By Tyche in forum General Discussion
    Replies: 4
    Last Post: 2011-12-22, 14:02
  2. BG MATH I need your help with Statistics.
    By Patb in forum General Discussion
    Replies: 1
    Last Post: 2010-01-26, 13:27
  3. bg /auto/ i need your help
    By Demosthenes11 in forum General Discussion
    Replies: 16
    Last Post: 2009-04-20, 14:41
  4. Need a little advice, BG.
    By Dmitry in forum General Discussion
    Replies: 61
    Last Post: 2008-06-17, 08:24
  5. Need a little help with a c++ project
    By Mayareira in forum General Discussion
    Replies: 50
    Last Post: 2008-02-14, 00:57