Log in

View Full Version : Syntax error??



baysidegraphics
07-27-2007, 08:15 PM
I am using the DHTNL Slide Show script at http://www.dynamicdrive.com/dynamici...dhtmlslide.htm
and would like to pull images from my database in a php call.

The current java script reads:
===============================================

<script type="text/javascript">

/***********************************************
* DHTML slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var photos=new Array()
var photoslink=new Array()
var which=0

//define images. You can have as many as you want:

photos[0]="gallery/front.jpg"
photos[1]="gallery/front2.jpg"
photos[2]="gallery/corner1.jpg"
photos[3]="gallery/corner2.jpg"

=================================================

I want to replace the "gallery/front.jpg" statements with"
<#ITEMVALUE55>

I have tried many variations including:

photos[0]="<#ITEMVALUE55>"
or
photos[0]='<#ITEMVALUE55>'

but none work! ANy thoughts??

Twey
07-27-2007, 08:19 PM
photos[0]="<#ITEMVALUE55>"Huh? This looks like no PHP that I've ever seen...

baysidegraphics
07-27-2007, 08:31 PM
It's being used in a script builder that has field identifiers like the following:

[Item55]
ItemName=Image1
ItemType=Image
DefaultValue=&#37;Image1%

The problem seems to be in the syntax because when I use it in-line like:

<img src='<#ITEMVALUE55>' width=100 height=75>

it works great, but that's just html and I think since this slide show script is java it does not recognize the formatt.

Twey
07-27-2007, 08:58 PM
The script is not Java. It is Javascript, a derivative of ECMAScript, an interpreted, loosely-typed, functional or imperative, prototype-based language, as opposed to Java, which is compiled to a binary form, strongly-typed, imperative, and class-based. It is unusual to find two nominally imperative languages more different.

Script builder or no, <#varname> is not valid PHP code. I can't see how PHP could process it.

thetestingsite
07-27-2007, 10:26 PM
It could be possible that they are using some sort of find/replace function as well. That could be where the <#varname> is coming from. Not likely, but possible nonetheless.