Page 1 of 1

Call values

Posted: Mon Aug 02, 2010 1:15 am
by farzanhai
Hello guys...

I am a newbie to Php programming..

Ive got a prb.... I am creating a complaint system. i created a form that asks users to enter some values and the form values are simply saved...

Now when the administrator log in, it checks for new complaints. When new complaint is found, the admin of the particular dept reloads the values the user has entered. and then at the same time, another form is present on the same page that admin fills in the remaining fields.

when the admin clicks submit, the next page gives a detail of what the previous values are n the data that admin has loaded. the problem is on this page, the previous values that user had entered is not showing up. only the admin tht admin submitted is shown.

I tried to put the values in hidden variables so that i can call it for the review page. but i aint getting the values submitted by the user. only admin submitted values are loaded.

Is there by any chance, the submited $_POST values in form not allowing to load the previous value.

Any help in this regard.
Its kind a urgent..
Open for discussion and further info can be provided if required.

Re: Call values

Posted: Mon Aug 02, 2010 1:31 am
by Benjamin
Forum Rules wrote: 11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
You may also want to read:
  1. General Posting Guidelines
  2. Posting Code in the Forums
  3. PHP Manual
  4. PHP Tutorials

Re: Call values

Posted: Mon Aug 02, 2010 1:55 am
by lala
may be u can post your code so that others can know your problem.

if you want pass value to other page, add

Code: Select all

$value= ($_POST['value']);
It will work normally

Re: Call values

Posted: Mon Aug 02, 2010 2:10 am
by farzanhai
This is the first page that loads the values, then use hidden fields to call them to the next page. These values are loaded from the previous form that user has entered. Infact these values reside in database. Used a query to call them with the tracking number to get the precise data. then saved these values in hidden fields. But cant recall them in the 2nd page after the admin has submitted further data through a form.

Code: Select all

 <input type="hidden" name="submitted" >
<input name="trackingnumber" type="hidden" value="<?php print $_POST[$trackingNumber];?>" />
 <input type="hidden" name="fullname" value="<?php print $_POST[$deapartment_name]; ?>">
  <input type="hidden" name="directcontactnumber" value="<?php print $_POST['directcontactnumber']; ?>">
  <input type="hidden" name="email" value="<?php print $_POST['email']; ?>">
  <input type="hidden" name="nic" value="<?php print $_POST['nic']; ?>">
  <input type="hidden" name="address1" value="<?php print $_POST['address1']; ?>">
  <input type="hidden" name="address2" value="<?php print $_POST['address2']; ?>">
  <input type="hidden" name="department" value="<?php print $_POST['department']; ?>">  
  <input type="hidden" name="complaint" value="<?php print $_POST['complaint']; ?>">    
  
  <input type="hidden" name="address2" value="<?php print $_POST['address2']; ?>">
  <input type="hidden" name="department" value="<?php print $_POST['department']; ?>">  
  <input type="hidden" name="complaint" value="<?php print $_POST['complaint']; ?>">


This is the 2nd page that has a form that admin views the values entered by him. Here the values only from the admin entered form is displayd while the previous values are not loaded even with the above hidden values.

Code: Select all

<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
<td height="30" align="center" > <?php print $department_name ?></td></tr>
<form name="registercomplaint" method="post" action="registrationresult.php" onSubmit="return validate(this);">
  <table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
    <tr> 
      <td width="100%" align="left"><table width="98%" height="332" border="0" cellpadding="2" cellspacing="1" class="forumline">
          <tr> 
            <th colspan="2" class="thCornerL" height="25" nowrap="nowrap">Complaint 
              Update&nbsp;- Preview</th>
          </tr>
          <tr> 
            <td height="28" colspan="2" align="center" class="catLeft"><span class="cattitle">Please 
              review your complaint details. If you want to modify the detail, 
              click on the 'Back' button. If you want to submit this complaint, 
              click on 'Submit' button.</span></td>
          </tr>
          <tr> 
            <td width="41%" height="22" align="right" valign="middle" class="row1">Full 
              Name :</td>
            <td width="59%" height="22" valign="middle" class="row1"><?php print $_POST[$department_name] ?></td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">Direct 
              Contact Number :</td>
            <td height="22" valign="middle" class="row1"><?php print $_POST[$department_id] ?></td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">Email :            </td>
            <td height="22" valign="middle" class="row1"><?php print $_POST['email'] ?></td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">Address 
              : </td>
            <td height="22" valign="middle" class="row1"><?php print $_POST['address1'] ?>            </td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">&nbsp;</td>
            <td height="22" valign="middle" class="row1"><?php print $_POST['address2'] ?></td>
          </tr>
           <tr> 
            <td height="22" align="right" valign="middle" class="row1">N.I.C. no :</td>
            <td height="22" valign="middle" class="row1"><?php print $_POST['nic'] ?></td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">Nature  :</td>
            <td height="22" valign="middle" class="row1"><?php print $_POST['naturenum'] ?></td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">Department 
              : </td>
            <td height="22" valign="middle" class="row1"> <?php print $_POST[$department_name] ?></td>
          </tr>
          <tr> 
            <td height="23" align="right" valign="middle" class="row1">Complaint 
              : </td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['complaint'] ?></td>
          </tr>
          <tr> 
            <td height="23" align="right" valign="middle" class="row1">Name of the Officer in Charge :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['oIncharge'] ?></td>
          </tr>
              <tr> 
            <td height="23" align="right" valign="middle" class="row1">Name of Police Officer to whom Complained :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['accusedOff'] ?></td>
          </tr>
              <tr> 
            <td height="23" align="right" valign="middle" class="row1">Name of Enquiry Officer :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['enquiryOff'] ?></td>
          </tr>
	    <tr> 
            <td height="23" align="right" valign="middle" class="row1">Date Of Final Report Submission :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['dateoffinal'] ?></td>
          </tr>
              <tr> 
            <td height="23" align="right" valign="middle" class="row1">Outcome of Final Report :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['outcomeenq'] ?></td>
          </tr>
 			<tr> 
            <td height="23" align="right" valign="middle" class="row1">Decision by the District Police Officer :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['decisiondpo'] ?></td>
          </tr>
          <tr> 
            <td height="23" align="right" valign="middle" class="row1">Incase police officer is found to be at fault :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['foundfault'] ?></td>
          </tr>
          <tr> 
            <td height="23" align="right" valign="middle" class="row1">Nature of Departmental Action Recommended :</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['actionRecommended'] ?></td>
          </tr>
          <tr> 
            <td height="23" align="right" valign="middle" class="row1">Outcome of the Departmental Action:</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['departAction'] ?></td>
          </tr>
          <tr> 
            <td height="23" align="right" valign="middle" class="row1">Outcome of Criminal Action:</td>
            <td height="23" valign="middle" class="row1"><?php print $_POST['criminalAction'] ?></td>
          </tr>
          <tr> 
            <td height="22" align="right" valign="middle" class="row1">&nbsp;</td>
            <td height="22" valign="middle" class="row1"></td>
          </tr>
          <tr> 
            <td height="64" colspan="2" align="center" valign="middle" class="row1"> 
              <input type="button" name="Reset" value="Back" style="width:100" onClick="history.back();"> 
              &nbsp;&nbsp;&nbsp; <input type="submit" name="Submit" value="Submit"  style="width:100">            </td>
          </tr>
        </table></td>
    </tr>
  </table>
  <input type="hidden" name="submitted" value="<?php print ($_POST['submitted']=="2")? "2" : "0" ; ?>" />
  <input type="hidden" name="fullname" value="<?php print $_POST['fullname']; ?>">
  <input type="hidden" name="directcontactnumber" value="<?php print $_POST['directcontactnumber']; ?>">
  <input type="hidden" name="email" value="<?php print $_POST['email']; ?>">
  <input type="hidden" name="nic" value="<?php print $_POST['nic']; ?>">
  <input type="hidden" name="address1" value="<?php print $_POST['address1']; ?>">
  <input type="hidden" name="address2" value="<?php print $_POST['address2']; ?>">
  <input type="hidden" name="department" value="<?php print $_POST['department']; ?>">  
  <input type="hidden" name="complaint" value="<?php print $_POST['complaint']; ?>">    
  
  <input type="hidden" name="address2" value="<?php print $_POST['address2']; ?>">
  <input type="hidden" name="department" value="<?php print $_POST['department']; ?>">  
  <input type="hidden" name="complaint" value="<?php print $_POST['complaint']; ?>">    
    
  <input type="hidden" name="oIncharge" value="<?php print $_POST['oIncharge']; ?>">
  <input type="hidden" name="enquiryOff" value="<?php print $_POST['enquiryOff']; ?>">
  <input type="hidden" name="accusedOff" value="<?php print $_POST['accusedOff']; ?>"> 

  <input type="hidden" name="depname" value="<?php print $_POST['depname']; ?>">  
  <input type="hidden" name="naturenum" value="<?php print $_POST['naturenum']; ?>">  
  
    <input type="hidden" name="gender" value="<?php print $_POST['gender']; ?>" /> 
    <input type="hidden" name="sourcenum" value="<?php print $_POST['sourcenum'];?>" /> 
    <input type="hidden" name="dateoffinal" value="<?php print $_POST['dateoffinal'];?>" /> 
    <input type="hidden" name="outcomeenq" value="<?php print $_POST['outcomeenq'];?>" /> 
    <input type="hidden" name="decisiondpo" value="<?php print $_POST['decisiondpo'];  ?>" />  
    
    <input type="hidden" name="appContacted" value="<?php print $_POST['appContacted'];?>" /> 
    <input type="hidden" name="actionRecommended" value="<?php print $_POST['actionRecommended'];?>" /> 
    <input type="hidden" name="departAction" value="<?php print $_POST['departAction'];?>" /> 
    <input type="hidden" name="criminalAction" value="<?php print $_POST['criminalAction'];  ?>" />  
    <input type="hidden" name="foundfault" value="<?php print $_POST['foundfault'];  ?>" />  
</form>