Peter.Cort
TF's First Dry Ice User!
- Messages
- 5,018
- Location
- Boston, MA
Hi all. Hopefully someone can fix my issue; been tearing my hair out for hours now trying to figure this out... What I'm trying to do is through a brief PHP function pull the amount of files in a directory, and then pass that number into a Javascript function so I can create an array with those numbers.
I'm trying super simple things to try and figure out why it isn't showing anything and this is the most basic of what I'm trying to do, so there must be some low level thing that I'm just balking on.
The result of this is an alert box with <?PHP echo $simple ?> in it. I've tried everything from single quotes around the php statement, write it as <?php echo $simple; ?>. Nothing works, it's just perpetually treated as a string and never grabbing the PHP variable. I'll give more code if necessary but I think this is enough. TIA...!
I'm trying super simple things to try and figure out why it isn't showing anything and this is the most basic of what I'm trying to do, so there must be some low level thing that I'm just balking on.
Code:
<?php $simple = "simple"; ?>
<html>
<head>
<script type="text/javascript">
<!--
alert("<?php echo $simple ?>");
-->
</script>
</head>
The result of this is an alert box with <?PHP echo $simple ?> in it. I've tried everything from single quotes around the php statement, write it as <?php echo $simple; ?>. Nothing works, it's just perpetually treated as a string and never grabbing the PHP variable. I'll give more code if necessary but I think this is enough. TIA...!