| | |
how to access accessing PHP variable in JavaScript
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
The simplest way is to have php write the info you want into the page as javascript, for ex:
PHP Syntax (Toggle Plain Text)
<script type="text/javascript" language="javascript"> <!-- <?php echo("firstVar = $var1;"); echo("2ndVar = $var2;"); ?> // --> </script>
•
•
Join Date: Jan 2008
Posts: 1
Reputation:
Solved Threads: 0
hey, you can do this simple things.
----------------------------------------------------------------------
function reset1()
{
//document.frmadd.intFaqCategoryTypeID.value='1';
document.frmadd.reset();
document.frmadd.intChatRoomCategoryId.value='<?php echo $intChatRoomCategoryId ; ?>';
document.frmadd.intEventId.value='<?php echo $intEventId ; ?>';
document.frmadd.intGroupId.value='<?php echo $intGroupId ; ?>';
document.frmadd.intMemberID.value='<?php echo $intAddedByMemberId ; ?>';
return false;
}
---------------------------------------------------------------------------------------------------------
u can reach me at hetalsagar@rediffmail.com
----------------------------------------------------------------------
function reset1()
{
//document.frmadd.intFaqCategoryTypeID.value='1';
document.frmadd.reset();
document.frmadd.intChatRoomCategoryId.value='<?php echo $intChatRoomCategoryId ; ?>';
document.frmadd.intEventId.value='<?php echo $intEventId ; ?>';
document.frmadd.intGroupId.value='<?php echo $intGroupId ; ?>';
document.frmadd.intMemberID.value='<?php echo $intAddedByMemberId ; ?>';
return false;
}
---------------------------------------------------------------------------------------------------------
u can reach me at hetalsagar@rediffmail.com
Last edited by hetalsagar; Jan 5th, 2008 at 12:54 am. Reason: Update
![]() |
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: Duplicate entry '' for key 2
- Next Thread: Templates in PHP
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms snippet soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube






