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 3780606
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:50:19+00:00 2026-05-19T10:50:19+00:00

I am new here and I have a question. I have a problem that

  • 0

I am new here and I have a question. I have a problem that I can’t figure it out with _POST. I have been searching for hours before start writing! As far as I can see I haven’t done any of the mistakes that are posted for other similar question (form action…, name attribute…,etc). Please, can you check my code below to tell me what am I doing wrong??

I use xampp 1.7.3 on windows 7.


<?php require("includes/header.php"); ?>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?><head>
<script type="text/javascript">

function theChecker()
{
 if(document.getElementById('checker').checked){
     document.getElementById('submitter').disabled=false;
 }
 else{
     document.getElementById('submitter').disabled=true;
 }
}
</script>

</head>

<?php require("includes/body_no_menus.php"); ?>

<div align="center">
<form name="signup" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

 <?php

 echo "<hr/>
<table width='600' border='0'>
  <tr>
    <td width='237'>Κωδικός οικοδομής</td>
    <td width='351'><input name='building_id' type='text' id='building_id' size='30' maxlength='40' />*</td>
  </tr>
  <tr>
    <td>Κωδικός διαμερίσματος</td>
    <td><input name='apartment_id' type='text' id='apartment_id' size='30' maxlength='40' />*</td>
  </tr>
  <tr>
   <td></td>
    <td height='31' colspan='2' ><label>
     <input name='send' type='submit' value='Αποστολή' />
    </label></td>
    </tr>

</table>
";
?>
</form>
</div>


<p>

<?php 

if(isset($_POST['send'])) {
 // Check input / Required fields
 $building_id = check_input($_POST['building_id'],"Εισάγετε τον κωδικό της οικοδομής!");
 $apartment_id = check_input($_POST['apartment_id'],"Εισάγετε όνομα χρήστη!");

 $query = "SELECT  idTENANT,FNAME,LNAME,BUILDING_ADMIN,PHONE FROM TENANT,APARTMENT, BUILDING
    WHERE  TENANT.APARTMENT_ID = APARTMENT.idAPARTMENT
    AND    APARTMENT.BUILDING_ID = BUILDING.idBUILDING
    AND  idAPARTMENT = '$apartment_id'
    AND  idBUILDING = '$building_id'";
 $result=mysql_query($query) or die ("Couldn't execute query.");
 $row = mysql_fetch_array( $result );  

 $id = $row['idTENANT'];
 $fname = $row['FNAME'];
 $lname = $row['LNAME'];
 $apartment = $row['APARTMENT_ID'];
 $phone = $row['PHONE'];
 if($row['BUILDING_ADMIN'] == 0)
  $admin = "ΟΧΙ";
 else
  $admin = "ΝΑΙ";
echo " <hr />
<table width='300' border='0'>
    <tr>     
     <td>Όνομα</td>           
  <td>$fname</td>   
 </tr>
    <tr>     
  <td>Επίθετο</td>          
  <td>$lname</td>   
 </tr>
    <tr>     
     <td>Όνομα χρήστη</td>        
     <td><input name='username' type='text' size='30' maxlength='20' />*</td>   
    </tr>
    <tr>     
  <td>Κωδικός χρήστη</td>      
  <td><input name='password' type='password' size='30' maxlength='20'/>*</td>   
 </tr>
    <tr>     
  <td>Επαλήθευση κωδικού</td>    
  <td><input name='verify_password' type='password' size='30' maxlength='40'/> *</td> 
 </tr>
    <tr>     
  <td>Διαχείριση οικοδομής</td>  
  <td>$admin</td>   
 </tr>
    <tr>     
  <td>Τηλέφωνο</td>            
  <td>$phone</td>   </tr>

    <tr>   
  <td></td>
  <td><input name='checkterms' type='checkbox' id='checker' onclick='theChecker()' value='Ναι'/>
    <label>Έχω διαβάσει και αποδέχομαι τους όρους χρήσης.</label> *</td>
   </tr>
   <tr>
    <td></td>
     <td><input type='submit' name='complete'  id='submitter' value='Ολοκλήρωση εγγραφής' disabled/></td>
  </tr>
</table>
";
}

if(isset($_POST['complete'])) {
 // Password match
 if ($password != $verify_password)
 {
   echo '<font color="red">Οι κωδικοί δεν ταιριάζουν</font>';
 }//if
 else 
 { 
  // Execute MySQL commands
  $query = "UPDATE TENANT SET USERNAME = '$un', PASSWD='$pw' WHERE idTENANT='$id'";
  $result=mysql_query($query) or die ("Couldn't execute query.");
  header("Location: main_login.php");
 }//else
}//if
?>

</p>
<?php require("includes/footer.php"); ?>

The first _POST (if(isset($_POST[‘send’]))…) works perfectly. But if(isset($_POST[‘complete’])) {… does nothing. I ve tried to echo some data to see if my connection doesn’t work, but its the _POST…

Please help me!!!!

Thanks for your time!

  • 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-05-19T10:50:19+00:00Added an answer on May 19, 2026 at 10:50 am

    The second set of form elements (username, password, verify_password, checkterms, complete) are not inside any html form element. Clicking the second button does not post the form to server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My colleague here argues that new programmers must learn ASP first, before they learn
I have been asked to post a new question about how to correctly sort
Here is my current question: I'm guessing that my problem (described below) is being
Based on my previous question here my new concern is how do I unit
Im new into that asp.net thing, but here goes. I got at ImageButton, and
I have the following generic question Here is a my generic message interface. public
I realize that this is probably a very basic question, but I have spent
I am new here so first of all my greetings to you I am
I'm starting a new project here (Windows Forms). What's the best option today for
I'm missing something here: $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry $objSearcher.Filter =

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.