| | |
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 |
apache api array beginner binary body broken cakephp checkbox class cms code computing cron curl database date date/time delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime global google host href htaccess html image include insert ip javascript joomla limit link list login mail memmory memory menu mlm msqli_multi_query multiple mycodeisbad mysql navigation oop parameter parsing paypal pdf php problem query radio random recourse recursion regex remote script search seo server sessions sms snippet source space sql static syntax system table thesishelp tutorial update upload url validator variable video web webdesign wordpress xml youtube






