PDA

View Full Version : print php code in ddlevelsmenu js file



arab4des
05-29-2009, 04:18 PM
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

Nile
05-29-2009, 11:26 PM
Is this topic solved? If not, please change the topic title. Your php is wrong, it should be:


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]

arab4des
05-30-2009, 03:09 PM
Is this topic solved? If not, please change the topic title. Your php is wrong, it should be:


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

arab4des
05-31-2009, 12:45 PM
still not solved !!

Nile
05-31-2009, 01:09 PM
Ok, rename your document ddlevelsmenu.php. At the top of your page add this:


<?php
header('Content-type: text/javascript');
?>

arab4des
06-01-2009, 12:02 PM
thx , it's work

Nile
06-01-2009, 12:03 PM
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"