| | |
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 |
# 5.2.10 access action address alexa apache api array auto autoincrement broken cakephp checkbox class classes clean clients cms code cron curl database date dehasher destroy directory dissertation domain dynamic echo$_get[x]changingitintovariable... email encode error errorlog fairness fatalerror file folder form function functions google href htaccess html image include indentedsubcategory ip javascript joomla legislation limit link load local login masterthesis memberships menu multiple multipletables mysql mysqlquery newsletters oop open passwords paypal pdf persist php popup provider query radio random script search secure server sessions simple sockets source space spam sql system table tutorial upload url user variable video voteup web youtube






