Eliminating raw code being displayed in variable
Posted: Fri Sep 14, 2007 5:41 pm
I made this javascript, which is printing a js array, a php variable ($java) :
I am then inserting that variable into another like this:
This is creating the source for the image. And of course it outputs the full javascript code instead of printing the array when it is called upon in $image.
My question is how do I get the array name to show instead of the javascript code? I'm thinking it must be done with a function() . . .
This is how I'm using it:
After that I'm using an if else statement to resize the image if it's width and height exceed a certain amount. However when searching for image it looks for eg. http://website.com/images/<script type='text/javascript'>
document.write(photo[0])
</script>
as oppose to (what I want) http://website.com/images/photo1.jpg
Code: Select all
<script type='text/javascript'>
document.write(photo[0])
</script>Code: Select all
$image="$dir/$java";This is creating the source for the image. And of course it outputs the full javascript code instead of printing the array when it is called upon in $image.
My question is how do I get the array name to show instead of the javascript code? I'm thinking it must be done with a function() . . .
This is how I'm using it:
Code: Select all
//Gets the width and height of the image and outputs it
$theimage = getimagesize($image);
$width = $theimage[0];
$height = $theimage[1];document.write(photo[0])
</script>
as oppose to (what I want) http://website.com/images/photo1.jpg