hi folks,
html coder here, new and terrified * of php!!
aaaaaa!
i'm trying to bury a JS script to rotate a photo, in a page i converted from
html to php.
the conversion went well, it was to use a php session cookie to stop the
repeating of an embedded video file on a per session basis;
i amended the php code to display a still pic if the session cookie value
was nil.
worked fine.
thought I'd try integrating a tested and true JS image random rotator script
into the echo command, but the problem was the syntax of the single quotes
and double quotes needed in the doc.write and variable sequences in the JS.
i tried escaping the double quotes (my echo used double quotes), but to no
avail.
here's the JS CODE i use in the tail end of my PHP. "picnumber" is the
variable holding the randomly assigned number that chooses the picture.
any help much appreciated..
+++++++++++++++ +
{ echo "
<script language='JavaS cript1.2'>
<!-- begin
document.write( \"'<img src='images/swap/'+ picnumber + '.jpg'>\");
// end -->
</script>
"; }
+++++++++++++++ +++++++++++
thanks
html coder here, new and terrified * of php!!
aaaaaa!
i'm trying to bury a JS script to rotate a photo, in a page i converted from
html to php.
the conversion went well, it was to use a php session cookie to stop the
repeating of an embedded video file on a per session basis;
i amended the php code to display a still pic if the session cookie value
was nil.
worked fine.
thought I'd try integrating a tested and true JS image random rotator script
into the echo command, but the problem was the syntax of the single quotes
and double quotes needed in the doc.write and variable sequences in the JS.
i tried escaping the double quotes (my echo used double quotes), but to no
avail.
here's the JS CODE i use in the tail end of my PHP. "picnumber" is the
variable holding the randomly assigned number that chooses the picture.
any help much appreciated..
+++++++++++++++ +
{ echo "
<script language='JavaS cript1.2'>
<!-- begin
document.write( \"'<img src='images/swap/'+ picnumber + '.jpg'>\");
// end -->
</script>
"; }
+++++++++++++++ +++++++++++
thanks
Comment