Welcome to Geeklog, Anonymous Thursday, May 02 2024 @ 05:49 am EDT

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


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:
 Quote

All times are EDT. The time is now 05:49 am.

  • 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