Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 05:02 pm EST
Geeklog Forums
PHP in static pages
earnest
Anonymous
Can someone show me how to pass a variable into a staticpage so that all I have to do is type {variablename} and the contents show.
I am building some javascript in php that needs to show in the top of my staticpage. I have tried calling php like this
var notecontents=new Array();
begintag='<div class="notes">';
<?PHP $retval = CUSTOM_notes();
print $retval; ?>
closetag='</div>';
</script>
This works, except that when I print $retval it actually displays on the screen. I only want the contents of $retval to show as part of the javascript.
:helpme:
I am building some javascript in php that needs to show in the top of my staticpage. I have tried calling php like this
Text Formatted Code
<script type="text/javascript">var notecontents=new Array();
begintag='<div class="notes">';
<?PHP $retval = CUSTOM_notes();
print $retval; ?>
closetag='</div>';
</script>
This works, except that when I print $retval it actually displays on the screen. I only want the contents of $retval to show as part of the javascript.
:helpme:
9
9
Quote
All times are EST. The time is now 05:02 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content