Results 1 to 7 of 7

Thread: print php code in ddlevelsmenu js file

  1. #1
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default print php code in ddlevelsmenu js file

    1) Script Title:
    ddlevelsmenu
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
    3) Describe problem:
    i have record in my db for site path , and i want to echo this filed before image path .
    the code :-
    downarrow : ["<echo $setting[0]['siteurl'];?>images/arrow-down.gif", 11,7], //[path_to_down_arrow, arrowwidth, arrowheight]
    rightarrow: ["<echo $setting[0]['siteurl'];?>images/arrow-right.gif", 12,12], //[path_to_right_arrow, arrowwidth, arrowheight]
    but it don't work by my code
    how can i do that ,
    regards
    Last edited by arab4des; 05-30-2009 at 03:07 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Is this topic solved? If not, please change the topic title. Your php is wrong, it should be:
    Code:
    downarrow : ["<?php echo $setting[0]['siteurl'];?>images/arrow-down.gif", 11,7], //[path_to_down_arrow, arrowwidth, arrowheight]
    rightarrow: ["<?php echo $setting[0]['siteurl'];?>images/arrow-right.gif", 12,12], //[path_to_right_arrow, arrowwidth, arrowheight]
    Jeremy | jfein.net

  3. #3
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Nile View Post
    Is this topic solved? If not, please change the topic title. Your php is wrong, it should be:
    Code:
    downarrow : ["<?php echo $setting[0]['siteurl'];?>images/arrow-down.gif", 11,7], //[path_to_down_arrow, arrowwidth, arrowheight]
    rightarrow: ["<?php echo $setting[0]['siteurl'];?>images/arrow-right.gif", 12,12], //[path_to_right_arrow, arrowwidth, arrowheight]
    thx for your help but it don't work

    the result in interface

    %3C?php echo $setting[0]['siteurl'];?>images/arrow-right.gif

    code not run

  4. #4
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    still not solved !!

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Ok, rename your document ddlevelsmenu.php. At the top of your page add this:
    Code:
    <?php
    header('Content-type: text/javascript');
    ?>
    Jeremy | jfein.net

  6. #6
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thx , it's work

  7. #7
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Glad to help you! Your welcome!

    It seems your topic is solved... Please set the status to resolved.. To do this:
    Go to your first post ->
    Edit your first post ->
    Click "Go Advanced" ->
    Then in the drop down next to the title, select "RESOLVED"
    Jeremy | jfein.net

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
  •