Jump to content

phppup

Members
  • Posts

    895
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by phppup

  1. I suppose one advantage to having a slow internet connection is that it allows me to see potential issues from a unique perspective. With that in mind, I've noticed that selecting images to upload is nearly instantaneous, regardless of size or quantity. However, these factors become enormous after clicking the upload button. There seems to be a gap between the clicking of the button and the actual start of the upload process. (Is the server actually organizing the files and preparing the selected files in the array?) The question is, how do I access the beginning and end of this gap (in order to add a loading GIF? Essentially, the page is already loaded. It's the file processing/compilation that I'm trying to intercept (or piggy-back). Also, can I control which files are uploaded first, second, etc.? I know I can change file names, but can I control the order of the actual upload. Ex: uploading IMG01, IMG23, IMG62. Desired renaming my01, my02, my03, respectively. I've tried beginning my PHP script with: if(!empty(natcasesort($_FILES['files']['name']))) But the actual uploading seems to be random.
  2. As mentioned, it's a hold-over of an old habit (although my database will probably be restructured next. LOL) Still, the double quotes were the only choice that didn't cause an error message. How do I get the variable in there? Or is it even worthwhile?
  3. After deciding to venture into the realm of prepared statements, I have this line in my script Everything was working fine. I reviewed my code to adjust it to my old habits, and realized that I had hardcoded the TABLE NAME rather than using a variable. I updated my code to and results from my SELECT statement vanished. Is the use of a variable for a table's name outdated? Even possible??
  4. Got it. (should names be case sensative) But AJAX is client side, so sanitizing is still highly recommended within PHP for the server side, right? On a related note, I've seen sanitizing examples that trim or remove HTML characters. Shouldn't an entry with such problems simply be rejected rather than repaired? Are the PHP sanitizing filters reliable on their own (to replace all the code that was required in the past)?
  5. Thanks. Any other basic tutorial links would be helpful too. While developing my script, I noticed that the username is NOT case sensative. (There is NO string-to-lowercase in my code, yet it is acting as if it exists) Did I miss a step in my database or table? Should username disallow case differences (which would limit the number of potential combinations)? Passwords come to mind too, of course.
  6. Day 2: making progress thanks to all I've learned here, but could REALLY use a link that would explain (in simplified terms) how to use AJAX in creating username availability. Thanks everyone.
  7. Ahhhh, now it's starting to make sense (I think). So either way, that piece of code needs to exist (if not too send, then to receive)? As a tangent, given two scripts to accomplish the same task, is AJAX any better or worse than a JSON ?
  8. I'll try that. But do I remove the Or redirect it with a $this (of some sort?
  9. I'm new to AJAX, and I'm working with some 3rd party code as a learning tool. Came across this section but: I would prefer NOT having a my_code.php file, but rather to include the PHP code as part of the single file that already contains all the other scripting. Can this be achieved? What do I need to put in the URL line to direct it to self-examine? Pros and cons of proceeding this way? Thanks folks.
  10. I'm no expert, but in an effort to assist, I would think some simple troubleshooting is in order. For starters, your code says: if($mail->send()){ header('Location: thank-you.html'); // redirect to 'thank you' page } else { $errorMessage = 'Oops, something went wrong. Mailer Error: ' . $mail->ErrorInfo; } So, my first question is: After you send a test email do you EITHER get redirected to the Thank You page OR see the ERROR? The answer to this question should at least get you started in a direction with analysis. PS: Experience has taught me to check inbox and SPAM folders. Also, there is sometimes a delay on receiving emails from strange addresses depending on your service provider.
  11. I'm not even sure I understand the question, BUT it seems from that you need to write a function that will analyze the calendar entries. The depth to which you go is up to you, but for starters you would need to determine which months have 30 days and which have 31. Just as there would be no acceptable MONTHS > 12, there is also no date of September 31 or October 32. Of course, February and Leap Years will be the biggest challenge. My solution: Tell the instructor that all inputs will come from drop-down menus and go get a coffee.
  12. Yup. Already realized that, and appreciate the insight. But aside from a message/disclaimer advocating that the user "Hurry before the name is removed" there's really not much else to be done. [I suppose I could INSERT the name immediately and DELETE it if registration isn't completed within a given timeframe, but that seems like a lot of work in the babe of "convenience"... LOL] I guess the overriding questions are still: is it worth the effort? Does it compromise the website's security?
  13. This IDEA would be implemented in a REGISTRATION form, NOT a sign in. The effort is strictly for user convenience to allow someone to check whether a username is available before completing additional steps to register. As for Little_Bobby_Tables, I would think that underscores in a name are harmless (and acceptable). So it's not about the name, but the additional characters that should be disallowed. My concern is the overall safety and security of the website, and NOT compromising it for user convenience. As for password strength, how much of that burden should be placed on the user? If a user wants a weak password (and knows it is weak), is there a reason that I should not allow it to be acceptable?
  14. That sounds a tiny bit contradictory. I mean, changing a message is simple enough, but the end result will be the same. Wouldn't a simple user be unfazed by the terminology? Wouldn't a seasoned hacker read right through the thin veil? Is this REALLY something to stay away from? Please also address my other questions within the post. Are there characters or names that users should find unavailable. Is it safe to allow a user access to the name ADMIN? Or PHP? etc. And what about code alternatives? Which are best? Which to avoid?
  15. I want to accomplish two things: save some server overhead and create a friendlier user experience. Thus, prior to form submission, the user should have the opportunity to check whether the chosen username is available. As I've begun researching the topic, I've discovered AJAX, Vue, and XMLHttpRequest alternatives. Any suggestions and alternatives that would give me guidance would be appreciated. Additionally, are there any characters that should be expressly prohibited from use in a username (or other input field) that could aid malicious hackers in causing harm to my website, database, and files?
  16. Sorry, I never used Fiddle, etc. The images would go behind. Going back to the "window blinds" metaphor, imagine you extended a closed blind on the ground. Now you place a pizza box on top of it. The slats may overlap top to bottom (that's my secondary issue), but you will visibly see the right and left portions of each slat running from either end toward the center. The positioning and sizing is not the problem, yet. The real issue is establishing a single container with a right wing and a left wing that is positioned as a single unit. One instance (slat) is fine. But, repetitions jumble or hide the images when the code is like this: It will function with ten <br> between each container, but the <br> causes displacement in other areas of the page. My thinking is that there's a triggering based on the size of the small image I am using. Once I 'clear' a certain placement. That is why I feel the problem is my use of ABSOLUTE and RELATIVE, but I haven't found a solution.
  17. At this point, which images to use, their size, etc. is not a concern (which is why I wanted a design that could offer flexibility later). What is a concern, is the ability of placing a table, form, or larger image in the center of the webpage as a central overlay. Additionally, if I wanted the lines of images to overlap (similar to the slats on a set of window blinds), then i believe the z-index comes into play (and is not functional without a "position" reference [think I read that somewhere]. I've gotten a reasonable result from the code that I posted initially. BUT, when I place a second container (id='second of many') into the mix [essentially duplicating the code], the entire flow goes haywire. I'm guessing it has to do with my use of ABSOLUTE and RELATIVE, but I cannot seem to find the correct combination on my own
  18. Probably as rudimentary as things can get, but I'll give it a try: On a webpage where X,Y,& Z each represent individual images. Left side ........................... Right side X X X X Z X X Z X Y Y X X Y Y Y Z X etc. with each side beginning at it's extreme end of page. Some overlap may occur, so a z-index capacity is necessary.
  19. Battlig with this code all weekend, and not getting the result I want. This bit of code should offer an understanding, but I'll explain more after removing the FAILED efforts. This sort of works, but really doesn't because when the code is REPEATED to create a second, third, etc. row, images are dislodged and hidden or lost completely. The end result that I am trying to achieve is: A set of images beginning from left to right. A set of images on the SAME axis/line beginning at right to left (heading for a collision midway). The ability to repeat this SINGLE double-ended row multiple times consecutively while maintaining the location of the images. NOTE: currently I have kinda achieved my goal with <br /> but this is NOT acceptable because other elements on the page get shifted rather than being layers that are positioned accordingly on the page. The ability to successfully repeat the process has been the kink that unravels the process.
  20. In a PHP file [php_one.php], I wrote some PHP code that contained a form. I used ECHO to write the HTML inside of the PHP tags. On another PHP page [php_two.php], I wanted to show the code that was used to create the first page [php_one.php]. My first effort provided an interesting result, since the PHP code was readable. However, all HTML code was visible in its executed form. There was an actual input field and a submit button (not the code used to produce them) in the context of my coding. I have tried using: file_get_contents("FILE") $array = file("FILE") readfile("FILE") All results were similar and carried the same problem. How can I view code so that even the HTML is visible as code?
  21. Can I establish the binding by using the PDO prepared statement while all other code is procedural?
  22. In lieu of prepared statements, will this work effectively? Is it overkill? $username = mysqli_real_escape_string($conn,$_POST["username"]); $username = strip_tags(trim($username)); Can I write it this way: $username = mysqli_real_escape_string($conn,strip_tags(trim($_POST["username"]))); Are prepared statements a guarantee for defeating an injection attack? Or should they be used in conjunction with the above (or other) coding to bolster a database's defenses?
  23. @requinix YES, I am beginning to think that low grade server fees come with a high price. I suppose I should be happy that I've excelled to the point of catching the errors and seeking [something closer to] perfection. Although it may have been easier when I didn't notice these mistakes and was simply happy to have a result generated. LOL
  24. @Barand (and others) YES, I implemented error reporting and saw the warning [described above]. This brings me back to my initial question: Why isn't the correct coding be accepted?
  25. <input type="submit" id="click1" name="click1" value="SUBMIT">
×
×
  • 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.