rsammy Posted January 11, 2007 Share Posted January 11, 2007 i am trying to post some variables to the previous screen. i am trying to display fileds on current screen and then hiding and displaying a button based on a flag value from the database.this is my code...[code] <table width="562" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="49" valign="top"> <hr> <? if ($visit_type == ICN) { print (" <font class='inputLbl'>STATUS: </font><font class='plnTxtBl'>$visit_status </font><br> <font class='inputLbl'>VISIT DATE:</font><font class='plnTxtBl'> $dcn_dov </font><br> <font class='inputLbl'>VISIT TIME:</font><font class='plnTxtBl'> $visit_time </font><br> <font class='inputLbl'>ATTENDING PROVIDER:</font><font class='plnTxtBl'> $phy_fname $phy_lname </font><br> <font class='inputLbl'>LOCATION:</font><font class='plnTxtBl'> $visit_loc </font><br> <font class='inputLbl'>ROOM NUMBER:</font><font class='plnTxtBl'> $visit_room_no </font><br> <font class='inputLbl'>DIAGNOSIS: </font><font class='plnTxtBl'>$diag_diag </font><br> <font class='inputLbl'>PROCEDURE: </font><font class='plnTxtBl'>$proc_proc </font><br> <font class='inputLbl'>MEDICATION: </font><font class='plnTxtBl'>$med_med </font><br> <font class='inputLbl'>IMAGING: </font><font class='plnTxtBl'>$dcn_img </font><br> <font class='inputLbl'>FOLLOW UP NOTES: </font><font class='plnTxtBl'>$dcn_foll </font><br> <font class='inputLbl'>SEE CONSULTANT: </font><font class='plnTxtBl'>$dcn_cons </font><br> <font class='inputLbl'>SEE PROVIDER: </font> <font class='plnTxtBl'>$dcn_doc </font><br> <font class='inputLbl'>TRANSACTION ID:</font><font class='plnTxtBl'> $visit_palm_db_id </font><br><br><br><br><br><br><br><br><br> <font class='inputLbl'>POSTED FOR BILLING:</font><font class='plnTxtBl'> $dcn_posted_for_billing </font><br> <font class='inputLbl'>APPROVED FOR BILLING:</font><font class='plnTxtBl'> $dcn_approved_for_billing </font><br><br><br> "); if ($dcn_posted_for_billing =="No") { if ($dcn_approved_for_billing =="Yes") { $requestforApproval='No'; print("<input class='sbttn' type='submit' name='action' value='Remove from Billing Batch' onClick=\"location.href='billingMgtList.php'\">"); } else { $requestforApproval='Yes'; print("<input class='sbttn' type='submit' name='action' value='Approve for Billing' onClick=\"location.href='billingMgtList.php'\">"); } } else { $requestforApproval='Yes'; } } ?> <p> </p></td> </tr> </table></td> <td width="15"> </td> </tr> <tr> <td width="15"> </td> <td width="15"> </td> </tr> <tr> <td width="15" height="85"><img src="../images/clear.gif" width="15" height="8"></td> <td width="15" height="85"><img src="../images/clear.gif" width="15" height="1"></td> </tr> <tr> <td colspan="3" height="2"> <div align="center"> <form name="fax" method="post" action="PrintRecorddetails.php" onSubmit="return validate()"> <div align="center"> <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666"> <tr> <td> </td> <td> </td> </tr> </table> <p> <input type="hidden" name="visit_id" value="<? print ("$visit_id"); ?>"> <input type="hidden" name="visit_type" value="<? print ("$visit_type"); ?>"> <input type="hidden" name="visit_time" value="<? print ("$visit_time"); ?>"> <input type="hidden" name="visit_status" value="<? print ("$visit_status"); ?>"> <input type="hidden" name="visit_loc" value="<? print ("$visit_loc"); ?>"> <input type="hidden" name="visit_loc" value="<? print ("$visit_room_no"); ?>"> <input type="hidden" name="pat_first_name" value="<? print ("$pat_first_name"); ?>"> <input type="hidden" name="pat_last_name" value="<? print ("$pat_last_name"); ?>"> <input type="hidden" name="pat_phy_id" value="<? print ("$pat_phy_id"); ?>"> <input type="hidden" name="phy_fname" value="<? print ("$phy_fname"); ?>"> <input type="hidden" name="phy_lname" value="<? print ("$phy_lname"); ?>"> <input type="hidden" name="pat_dob" value="<? print("$pat_dob"); ?>"> <input type="hidden" name="pat_ssn" value="<? print("$pat_ssn"); ?>"> <input type="hidden" name="pat_sex" value="<? print ("$pat_sex"); ?>"> <input type="hidden" name="enter_date" value="<? print ("$enter_date"); ?>"> <input type="hidden" name="activate_date" value="<? print ("$activate_date"); ?>"> <input type="hidden" name="visit_timestamp_received" value="<? print ("$visit_timestamp_received"); ?>"> <input type="hidden" name="visit_palm_db_id" value="<? print ("$visit_palm_db_id"); ?>"> <input type="hidden" name="username" value="<? print ("$USER_NAME"); ?>"> <input class="sbttn" type="submit" align="center" name="action" value="Print-Friendly Page"> </p> </div> </form> </div></td> </tr> </table></td> </tr> </table> <p> </p></td> </tr> <tr> <td align="left" valign="top" width="276"> </td> <td colspan="3" width="624"> </td> </tr></table>[/code]is this code correct? in this code - how do i post the value of "$requestforApproval" to billingMgtList.php in this block of code: if ($dcn_posted_for_billing =="No") { if ($dcn_approved_for_billing =="Yes") { $requestforApproval='No'; print("<input class='sbttn' type='submit' name='action' value='Remove from Billing Batch' onClick=\"location.href='billingMgtList.php'\">"); } else { $requestforApproval='Yes'; print("<input class='sbttn' type='submit' name='action' value='Approve for Billing' onClick=\"location.href='billingMgtList.php'\">"); } } else { $requestforApproval='Yes'; }I am stuck here. not sure if i can do a post here. if yes, how can i? i need to post the value for the variable "$requestforApproval" to billingMgtlist.phpi also need to post another couple of variables too from the same block of code. is thispossible? if yes, how? if not, alternatives?help pleeeeeeaaaaaaaase ??? Quote Link to comment https://forums.phpfreaks.com/topic/33673-help-with-posting/ Share on other sites More sharing options...
DarkendSoul Posted January 11, 2007 Share Posted January 11, 2007 You could actually add information to the url and retrieve it on the other end by means of $_GET, your code would then be :* Error in code fixed[code]<?php if ($dcn_posted_for_billing =="No") { if ($dcn_approved_for_billing =="Yes") { $requestforApproval='No'; print("<input class='sbttn' type='submit' name='action' value='Remove from Billing Batch' onClick=\"location.href='billingMgtList.php?approved=no'\">"); } else { $requestforApproval='Yes'; print("<input class='sbttn' type='submit' name='action' value='Approve for Billing' onClick=\"location.href='billingMgtList.php?approved=yes'\">"); } } else { $requestforApproval='Yes'; }?>[/code]Then in billingMgtList.php use $_GET['approved'].Another way to do this is with $_SESSIONs[s]Give me 2 seconds and i'll get you a session tutorial[/s]Session tutorial : [url=http://www.tizag.com/phpT/phpsessions.php]http://www.tizag.com/phpT/phpsessions.php[/url] Quote Link to comment https://forums.phpfreaks.com/topic/33673-help-with-posting/#findComment-157804 Share on other sites More sharing options...
rsammy Posted January 11, 2007 Author Share Posted January 11, 2007 thanx for ur reply!now, in this line: print("<input class='sbttn' type='submit' name='action' value='Approve for Billing' onClick=\"location.href='billingMgtList.php?approved=yes'\">");can i use my variable as is?say something like this...print("<input class='sbttn' type='submit' name='action' value='Approve for Billing' onClick=\"location.href='billingMgtList.php?$requestforApproval=yes'\">");?????im still not comfy with php. need some kinda spoon feeding here! Quote Link to comment https://forums.phpfreaks.com/topic/33673-help-with-posting/#findComment-157825 Share on other sites More sharing options...
DarkendSoul Posted January 11, 2007 Share Posted January 11, 2007 no you would need to use ?approved=yesthen when you call the function on the next page you use $_GET['approved']But if you already have all variables as $requestforApproval in your next text file you could add the following before $requestforApproval is called.$requestforApproval = $_GET['approved']; Quote Link to comment https://forums.phpfreaks.com/topic/33673-help-with-posting/#findComment-157833 Share on other sites More sharing options...
rsammy Posted January 11, 2007 Author Share Posted January 11, 2007 thanx Quote Link to comment https://forums.phpfreaks.com/topic/33673-help-with-posting/#findComment-157899 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.