Jump to content

van_t

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

van_t's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am a newbie to PHP and I am not sure how to impliment this script. If the answer is correct, then It needs to simply continue on to the submission (where the submission accesses another php page where it does inserts on the other fields. I do not want to insert the values from the questions/answers. I have a form <form name="formname" method="post" action="inserttodb.php"> If the answer is wrong, this will not happen, but to display a text message on the page saying the answer is wrong. If the answer is correct, it will continue on to the inserttodb.php page where the other values in the form will get submitted. If you would like for me to post the scripting, please let me know. Thank you Terry
  2. Hello I have a page that contains a form. I have a mysql db I have a query that pull out and displays a random value from one field within a table (from column b). On the form I have a text field that requires user input. I need to formulate some code that will use the If statement, get the current value from the user input and compare that value to column c of the table/record (above). Ex: User input is Blah Column b in table value = "what do people say when they speak?" column c in table value = "Blah" $result - 1st query is something like 'select question from questions order by rand() Limit 1"; $bquery - 2nd query is somehting like 'select answer FROM questions WHERE question=$result"; Im hoping the above will give $bquery the value of the answer on the same row as the $result question. Then In my page I want to use an IF statement to compare the user-input to the value of $bquery. If the values do not match, then to simply prevent the submission of the record. Otherwise it will submit the record to the DB. I already have everything working to submit to the database, but I cannot figure out how to use the IF to compare the values or to bypass the submission if the values do not match. Any help would be great Thank you Terry
×
×
  • 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.