Results 1 to 5 of 5

Thread: Syntax error??

  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Syntax error??

    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??

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    photos[0]="<#ITEMVALUE55>"
    Huh? This looks like no PHP that I've ever seen...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •