Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:52:57+00:00 2026-06-13T00:52:57+00:00

I have a submit type button called validate if user has allowed appeared in

  • 0

I have a submit type button called “validate” if user has allowed appeared in page.
validate button set a row in db as validated (TRUE)

i check first in db if validated field is true or false.

if false and isset($_POST[‘valid’]) i show up the button

                        <input <?php echo $disabledvalid; ?> type="submit" class="sub" name="valid"  id="valid" value = "validate"   />

after i put the UPDATE query which change validated field from FALSE to true.

When the page is processed the if is ignored and was executed update query?

How can i fix this problem?

                <form action="view_support.php" method="post">
            <?php

            //check if validated field is true or false
            $queryvalid = "SELECT validated FROM support WHERE suppid = $suppid";
            $risqueryvalid = pg_query($queryvalid);
            $row = pg_fetch_array($risqueryvalid);
            $suppvalidated = $row['validated'];
            //echo "supp " . $suppvalidated;



            //$suppvalidated == "f";
            unset($_POST['valid']);
            //if validated field is false show me validate button
            if ( $suppvalidated == FALSE && (isset($_POST['valid'])  ){ 
                $suppvalidated = 'true';


                    <input <?php echo $disabledvalid; ?> type="submit" class="sub" name="valid"  id="valid" value = "validate"   />
                <?php

                if(isset($_POST['valid'])){
                    $vquery = "UPDATE support SET validated = $suppvalidated WHERE suppid = $suppid";
                    $risvquery = pg_query($vquery);
                    if (!$risvquery) {
                        #die("Error during insert support");    
                        die("Errore nella query $risvquery: " . pg_last_error());
                    }
                    unset($_POST['valid']);
                }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:53:00+00:00Added an answer on June 13, 2026 at 12:53 am

    You are still in PHP mode when you write this line:

    <input <?php echo $disabledvalid; ?> type="submit" class="sub" name="valid"  id="valid" value = "validate"   />
    

    And where is your closing bracket for:

    if ( $suppvalidated == FALSE && (isset($_POST['valid'])  ){ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: $(document).ready(function() { $(input[type=button]).click(function () { $(#test).html(W3Schools); alert(Would submit: + $(this).siblings(input[type=text]).val()); $.ajax({
I have the following code: echo ' <td> <input type=button name=delete value=X onclick=clearSelection(this.form, '.$type.');this.form.submit();
I have a form with number of submit type as images. Each image has
I have a submit button that changes when the user hovers his mouse over
I have a text box in my page which the user will type something
I have a form with html browse type and a submit button. I chose
I am working with a decimal type in my application and have to submit
i have a submit page in html . when i submit the form data,
I have a submit button where I want a confirmation pop-up, doing this works
I have a submit button when i click on that button i am having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.