Can't retrieve data using php -


i trying retrieve data leave_balance.php , pass employee.php, data null.

here script leave_balance.php:

if($lid=="1")      $bal = $bal + $replacementleave; 

here script employee.php:

$bal = $rowe[bal]; 

then call $bal on html page:

<input type='text' value='$bal'> 

can help? thank you.

you can't directly use $bal otehr file. instead can use session variables. this-

employee.php:

session_start(); $_session['bal']= $rowe[bal]; 

leave_balance.php:

if($lid=="1")    $_session['bal'] = $_session['bal'] + $replacementleave; 



also, cannot use php variable inside html directly. use php var inside html text-

<input type='text' value="<?php echo $_session['bal']; ?>"> 

or, can echo html statement-

echo  "<input type='text' value='".$_session['bal']."'>"; 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -