Jump to content

KevinM1

Moderators
  • Posts

    5,222
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by KevinM1

  1. If you have 100 or so unique pages coded up, you should probably use a more robust system than a page controller. Look into MVC frameworks and how their routing systems work
  2. It's very... green. You should think of using some other colors rather than shades of the same one.
  3. This topic has been moved to PHPFreaks.com Questions, Comments, & Suggestions. http://www.phpfreaks.com/forums/index.php?topic=337006.0
  4. Ultimately, if you want the experience to be seamless, with no page refresh, you'll need to use JavaScript. Why? Because PHP exists only on the server, and has finished executing commands by the time a web page hits your screen. Because of those two things, it can't respond to client side actions. That's why PHP, by itself, always requires a page refresh. Also, try interacting with Facebook with JavaScript turned off. You may be in for a surprise.
  5. Uh... that's what AJAX is. AJAX is JavaScript which sends requests to the back end. The back end sends a response back to the JavaScript. The JavaScript then inserts the response into the current page in real time.
  6. Remember - GET has a character limit. Not ideal if someone is writing something long.
  7. Since the comment(s) will likely need to be persisted on the back end, AJAX is the only way to go to emulate a Facebook-like comment system.
  8. The problem with 'goto' is that it leads to spaghetti code - code that jumps from place to place, all layered and threaded with other such code. This makes the code hard to read, hard to edit, and hard to debug. Using 'goto' is a clear indication of bad design, and generally doing things wrong. Well formed code does not use 'goto'.
  9. Without a refresh, your only option is AJAX.
  10. Well, that's really part of what you need to figure out during your design phase. I mean, technically, you just need to assign the function invocation to a variable, like: $var = display_categories($categories['id'], $level+1); Which will capture and place the returned result in $var. That said, you likely won't be getting the value(s) that you want due to the way your function is currently written. You'd still need to merge them with the $array you return. On top of that, you'll have to make sure everything lines up during recursion.
  11. You need to capture the results of your recursive call to: display_categories($categories['id'], $level+1);
  12. I don't see a return $array; statement anywhere.... Regardless, you're also overwriting your $array during each loop. You might be looking for: $array[] = array(/* stuff */); which would create a two dimensional array.
  13. The following works: <!doctype html> <html lang="en-us" dir="ltr"> <head> <meta charset="utf-8" /> <title>Form submission test</title> </head> <body> <form name="myForm" action="" method="post"> <input name="submit" type="submit" value="Submit" /> </form> </body> <script type="text/javascript"> var oForm = document.forms["myForm"]; oForm.onsubmit = function() { return confirm("Do you wish to continue?"); } </script> </html>
  14. How are you invoking your confirmSubmit function?
  15. Have you tried simplifying it like: function confirmSubmit() { var r = confirm("Please confirm you have updated the divisors correctly"); if(r != true) { return false; } return true; }
  16. Regardless, to address ebmigue's other point, I don't think there's much we can do for the OP. He's obviously deficient in many areas, and nothing short of getting good resources (which we have at least one sticky topic for, if not more) and writing code will help him. Maybe he should go back to school for a couple years at a technical college, but since he just graduated, that's probably not a viable option. With no disrespect intended to the OP, he's at beginning hobbyist level right now and is essentially asking us to make him into a competent entry level programmer. That's outside the scope of what we do, and not realistic at all anyway. We're more than willing to help him (or anyone) with specific questions about specific code, but we're not in the business of mentoring.
  17. The entire book series, so far, has been superb. Even better, a new book is scheduled to come out next month. Where did the TV series end up this season? There's a certain part in A Feast for Crows that I can't wait for people to see. Mwahahahahaha
  18. Also, in the vast majority of cases, people will not respond if the question involves downloading and viewing attached files. Your best bet on getting an answer is to post the relevant code (meaning relevant, not your entire script) within either or tags.
  19. Again, generally speaking, things are normally done like: HTTP request is made to the server. Request is handled by a front controller which parses the request and retrieves the correct MVC controller. MVC controller loads the appropriate view, populated with model data if necessary. Form processing normally happens in a controller.
  20. He's saying that non-trivial websites are built in layers/tiers. The MVC (short for Model-View-Controller) pattern represents a particular kind of layered app. The most general idea is that your data is represented, in script, as Models, the View(s) is/are what the user sees as a web page, and the Controller(s) are the brains of the operation. By breaking a site up into these components, you can easily expand or modify the site itself, as each layer communicates with the others through limited and clear lines of communication. Most PHP frameworks implement the MVC pattern. That said, you can fudge it on your own by adhering to Separation of Concerns and having an idea of what each layer should do.
  21. That said, I'd do it differently for an e-commerce site. Separate password table, at the least, if not separate password db, and a better hash algorithm than MD5 or SHA1.
  22. In the database itself, as part of each user row, with a column name of Date Registered. Really, if your db is compromised, you have far more important things to worry about than whether your salt values are compromised.
  23. To be honest, I'm not even sure if the OP has his degree in web development. It sounds like he took a course or two because someone said "Hey, web development is easy $$" and expects to hit the ground running from there. AFAIK, there aren't web development bachelors programs, at least, not in my area of the US. The best are two-year associate degrees from technical colleges.
  24. What does $mypassword2 contain? Why are you calling kam3 on only the current password and not the new one? In any event, TeNDoLLA is right - you're not improving your security by calling md5 so many times. Also, a salt value should be unique to each password. The easiest solution would be to generate a timestamp when a user registers with your site. Use that as your salt (it's of sufficient length, and is unique for each user). Append and hash.
×
×
  • 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.