Jump to content

edemco

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by edemco

  1. I continue to work with the code, but I have not found a solution that works. Do you have any further thoughts or suggestions?
  2. Unfortunately, when I paste the code you provided into the rest of the code, I get a redirect error. When I remove the "header" line, program exits with a blank screen. I can change the "location" and refreshing the page makes it go to another "location". Without a "Yes", the page loops. (BTW: I changed the case to match in a prior rendition of the code, but thanks for point it out again.) There is more posting and updating that needs to be done after the "exit" in your code - I need to go past the code to complet the update sequence if there is a "Yes" in the checkbox. I'm trying to get the program to stop posting operations until the "required" checkbox is marked and not to post until verifying that the checkbox is marked. In this way the user is warned and continually refused until the checkbox is marked "Yes." Nothing should go to the database (as it is now). (BTW: I can get this code and other similar code to work outside of the rest of the code. I have a hunch that the code we are talking about is either not in the right place or does not interface well with the other code.) In my way of thinking, the code should stop the action with the first part of the "if" statement and allow continuance with "else." How can the database updating be stopped until the checkbox is marked?
  3. At first glance this looks good, but there must be some interference with the other code in the file, because I get a page redirect error. The code seems to get caught in a loop. The funny thing is that my code doesn't do that. I see the value of using && and doing an absolute check for "yes", but if "yes" isn't there, it should send the same page image back to the screen with an echo statement in place of the bla bla that says "you must agree." But, the problem still exists - it should stop if the checkbox is not marked. Instead, should the code be something like: This logic doesn't work either. I must be completely wrong.
  4. I guess I need to watch my levity ... it doesn't come through print very well :-\ Truthfully, I've spent a week of days working on this page and several others. I'm learning, but it takes time to absorb the learing through the fingers in into the brain These pages generally work as expected. The foundation work was paid for. If I need to get it done in a short time, I am not above paying for it to be done. But I need to learn, so I'm paying my dues by the minute. Here's what I understand: 1. Since, I am checking the contents of a checkbox in a form, with a submit button, I need to have php coding of the following form: 2. The checkbox is called for in the HTML code and currently functions to post "yes" to the databased field "agree." The code is: 3. The php code should check to see if "agree" is filled or blank; (isset ($_POST['agree'])) should see null if the checkbox is not marked and should pass to (!isset ($_POST['agree'])) where it should ECHO: "You need to agree ... All of this is in the attached file, but I know that it is hard to read. I hope this helps. I have a hunch that I am not putting something in the right place or misinterpreting the code. Any assistance would be appreciated. Thank you.
  5. Hello, :'( I didn't want to learn php; wish I could find a wysiwyg program to do basic coding ... so you know that I'm a noob. I have a php file that I've been working on. Most of the code was written by other people. I'm trying to add a checkbox that requires the user to agree to the terms of membership. The form works (for all other form entries) and it updates the database with "yes" in the field "agree" for the checkbox. What it doesn't do is verify that the checkbox is marked and prevent the user from continuing. At this time, the form updates regardles of the checkbox being marked or not. I have run out of hunches and need some expert eyes, please? [attachment deleted by admin]
×
×
  • 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.