DHTML Menu PHP/MySQL issues (with the tutorial)

A discussion group for Sothink DHTML Menu

Moderators: Nicole, Annie Liang, Cindyrae, SharonLee, BrendaHu, mjperry51, Bill_P, Moderator

Post Reply
Relative0
Member
Posts: 11
Joined: Wed Dec 02, 2009 1:20 pm
Location: Los Angeles, CA

DHTML Menu PHP/MySQL issues (with the tutorial)

Post by Relative0 » Sun Jan 10, 2010 9:36 am

I have been trying to get the example given here:

http://www.sothink.com/product/dhtmlmen ... /index.htm


The source code itself doesn't display a menu. I am guessing that is because there is nothing in the Database. So I tried inserting different things in the format requested. I see that the database info etc. is being drawn and that part is working, but the html/php page (I have tried both) is still coming up blank although the source code in page view looks all to be there.

So I tried just publishing the menu in to the page and calling the page a PHP page which then does work on executing the Database connection and query code.

I have pasted the actual source code that comes up under "view source" when I try to look at the PHP code.

I could really use help on this and have pretty much exhausted every tutorial on this I could find and examples on the SourceTec site that I could find.

Thanks,

Brian
-----------------------------------

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script type="text/javascript" id="sothink_dhtmlmenu"> <!--
 st_siteroot="file:///C|/Users/Steve/Desktop/Freelance/Tracy/Dev/generaltesting/menus/mainmenudb";
 st_jspath="./code/stmenu.js";
 if(!window.location.href.indexOf("file:") && st_jspath.charAt(0)=="/")
  document.write('<script type="text/javascript" src="'+st_siteroot+st_jspath+'"><\/script>');
 else
  document.write('<script type="text/javascript" src="'+st_jspath+'"><\/script>');
//--> </script>
</head>
<body>

<a href="http://www.dhtml-menu-builder.com"  style="display:none;visibility:hidden;">Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com</a>
<script type="text/javascript">
<!--
stm_bm(["menu501d",900,"/code","blank.gif",0,"","",0,0,250,0,1000,1,0,0,"","",0,0,1,2,"default","hand","file:///C|/Users/Steve/Desktop/Freelance/Tracy/Dev/generaltesting/menus/mainmenudb",1,25],this);
stm_bp("p0",[0,4,0,0,2,3,0,7,100,"",-2,"",-2,50,0,0,"#999999","#E6EFF9","",3,1,1,"#000000"]);
<br />
<b>Deprecated</b>:  mysql_db_query() [<a href='function.mysql-db-query'>function.mysql-db-query</a>]: This function is deprecated; use mysql_query() instead in <b>C:\Users\Steve\Desktop\Freelance\Tracy\Dev\generaltesting\menus\mainmenudb\mainmenudb.php</b> on line <b>31</b><br />
stm_ai("p0i0",[1,"SGFM","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7,0,0,1,"#E6EFF9",0,"#FFD602",0,"","",3,3,1,1,"#E6EFF9","#000000","#000000","#000000","8pt Verdana","8pt Verdana",0,0,"","","","",0,0,0]);
stm_bpx("p1","p0",[1,4,0,0,2,3,0,0]);
<br />
<b>Deprecated</b>:  mysql_db_query() [<a href='function.mysql-db-query'>function.mysql-db-query</a>]: This function is deprecated; use mysql_query() instead in <b>C:\Users\Steve\Desktop\Freelance\Tracy\Dev\generaltesting\menus\mainmenudb\mainmenudb.php</b> on line <b>44</b><br />
stm_ep();
stm_ai("p0i0",[1," Brian","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7,0,0,1,"#E6EFF9",0,"#FFD602",0,"","",3,3,1,1,"#E6EFF9","#000000","#000000","#000000","8pt Verdana","8pt Verdana",0,0,"","","","",0,0,0]);
stm_bpx("p1","p0",[1,4,0,0,2,3,0,0]);
<br />
<b>Deprecated</b>:  mysql_db_query() [<a href='function.mysql-db-query'>function.mysql-db-query</a>]: This function is deprecated; use mysql_query() instead in <b>C:\Users\Steve\Desktop\Freelance\Tracy\Dev\generaltesting\menus\mainmenudb\mainmenudb.php</b> on line <b>44</b><br />
stm_ep();
stm_ep();
stm_em();
//-->
</script>

</body>
</html>

----------------------------------------------------------

User avatar
Bill_P
Guru
Posts: 1754
Joined: Mon May 10, 2004 3:53 am
Location: Rescue, CA, USA
Contact:

Post by Bill_P » Sun Jan 10, 2010 12:49 pm

Hi Brian,

Develop a menu that will display in your web page before you try to develop a dynamic menu. Enter a couple of menu items with normal text descriptions. Once you get your menu to display in your web page, you can follow Sothink's tutorial on developing a dynamic menu.

As an initial step in getting your menu to work, go to the "Getting Started" section of the Unofficial Resource Site and follow the suggestions in Step 3. For the Web Path, enter the absolute path to the location of your menu JavaScript and image files (i.e., http://yourdomain.com/code/). When you publish your menu, generate a JavaScript include file.

Regards,

Relative0
Member
Posts: 11
Joined: Wed Dec 02, 2009 1:20 pm
Location: Los Angeles, CA

Still having issues and am working with the EXACT tut files.

Post by Relative0 » Mon Jan 11, 2010 3:49 pm

Bill_P,

I have actually made many menus from both the DHTML, Tree Menu and JWScroller, I bought them all. I also am able to do the menu's by publishing an external .js file. Furthermore I can even go through:

http://www.sothink.com/product/javascri ... /phpdb.htm

and get it to work. The whole reason I resorted to databases for the DHTML is that I could not seem to modify the code correctly from the JWScroller so as to read from text file, (I would love to be able to do this though).

So I can get many things to work, just not this. Now what I did do is just unzipped the example code for the link I posted first. I created a database using the script in the tutorial and populated it with a couple of values. I wasn't sure about the CID and PID so I guessed what it should look like so that there are two level one cells and each has a child cell.

Attached is everything. I tried publishing genfile.php as javascript and running that too, changing both the name of the file and the path name of the file.

I know that I am connecting correctly to the DB as I am getting what seems to be full population of the database row values and get a complete HTML/PHP file as the </HTML> tag is in it. I don't get this when the username/password/db name is wrong.

I seriously think it might be something in the CID/PID values I put in as I had to populate the Database with something and I noticed on previous DHTML menu's that I generated that if I tried to edit the DHTML code and made a mistake, nothing at all would show. I however don't know what the Database values should be set to. I attached the .sql file so you can see what I am working with.

Anyways, I appreciate any help you can give me as I have been putting a lot of time and research in to this.

Thanks much,

Brian
You do not have the required permissions to view the files attached to this post.

User avatar
Bill_P
Guru
Posts: 1754
Joined: Mon May 10, 2004 3:53 am
Location: Rescue, CA, USA
Contact:

Post by Bill_P » Mon Jan 11, 2010 10:32 pm

Hi Brian,

I have a very busy week and I won't be able to provide the kind of help you're requesting. Perhaps one of the other members on this forum will be able to help you.

In the meantime, I wish you would take my suggestion and create a simple menu that works. If you followed the suggestions in my initial post, you would get rid of this:

Code: Select all

<script type="text/javascript" id="sothink_dhtmlmenu"> <!-- 
st_siteroot="file:///C|/Users/Steve/Desktop/Freelance/Tracy/Dev/generaltesting/menus/mainmenudb";
 st_jspath="./code/stmenu.js";
 if(!window.location.href.indexOf("file:") && st_jspath.charAt(0)=="/")
  document.write('<script type="text/javascript" src="'+st_siteroot+st_jspath+'"><\/script>');
 else
  document.write('<script type="text/javascript" src="'+st_jspath+'"><\/script>');
//--> </script>

and this:

Code: Select all

<a href="http://www.dhtml-menu-builder.com"  style="display:none;visibility:hidden;">Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com</a> 
<script type="text/javascript">
<!--
stm_bm(["menu501d",900,"/code"...

I think it's going to be very difficult for anyone on this forum to help you with database integration until you have a working menu.

You can also send an e-mail to support@sothink.com or submit a support request at http://www.sothink.com/support/index.php#ticket.

Regards,

User avatar
mjperry51
Guru
Posts: 1130
Joined: Tue Aug 05, 2003 6:39 pm
Location: Ohio
Contact:

Post by mjperry51 » Tue Jan 12, 2010 12:28 am

Brian --

I suggest you try to recreate the menu using the db defined in the tutorial. When you get that working substitute the specifics from your database and troubleshoot from there.

Once you know you have the PHP menu code working properly you can check to insure your own db connections and syntax is correct.
Mike
http://www.incitevisual.com
Not Sothink Support

Relative0
Member
Posts: 11
Joined: Wed Dec 02, 2009 1:20 pm
Location: Los Angeles, CA

Creating a simple menu that works

Post by Relative0 » Tue Jan 12, 2010 5:51 am

Bill,

As I mentioned, I have made menu's... perhaps when you said simple menu that works you meant one with the DB? I am not sure as that of course would beg the question, furthermore though I have all sorts of menu's that work, actually I just threw one up:

http://www.thinkinginnovate.com/test/Menu/KRM.html

So that whole siteroot thing, well I don't know what it is really supposed to do.... The one I just threw up also has an external JS file in the /Code folder. By the way I tried the absolute http:// paths, I just cant seem to get it to work.

Thanks for the reply though. I really am trying to take the steps necessary to get the thing working.

Brian

Relative0
Member
Posts: 11
Joined: Wed Dec 02, 2009 1:20 pm
Location: Los Angeles, CA

@Mike

Post by Relative0 » Tue Jan 12, 2010 5:56 am

Mike,

Thanks for the advice.... and that is exactly what I have been trying to do. If I could just get the example to work, then I could edit it to my likeing and put different elements in the DB for myself and test that out.

In the end, I think it is probably something simple but I have literally tried about 60 things in different combination's and such to try to get the thing to work.


Perhaps there is someone out there that will run my code and DB script and tell me which line in the code is messed up? As I mentioned to Mike, I have tried absolute http:// paths for the site-root, it however hasn't seemed to work. Maybe It does depend partially on the absolute links in conjunction with something else that I am not doing correctly. I however don't know what "something else" is.

Thanks,

Brian

User avatar
mjperry51
Guru
Posts: 1130
Joined: Tue Aug 05, 2003 6:39 pm
Location: Ohio
Contact:

Re: @Mike

Post by mjperry51 » Tue Jan 12, 2010 9:34 pm

Relative0 wrote:Mike,

Thanks for the advice.... and that is exactly what I have been trying to do. If I could just get the example to work, then I could edit it to my likeing and put different elements in the DB for myself and test that out.

In the end, I think it is probably something simple but I have literally tried about 60 things in different combination's and such to try to get the thing to work.


Perhaps there is someone out there that will run my code and DB script and tell me which line in the code is messed up? As I mentioned to Mike, I have tried absolute http:// paths for the site-root, it however hasn't seemed to work. Maybe It does depend partially on the absolute links in conjunction with something else that I am not doing correctly. I however don't know what "something else" is.

Thanks,

Brian

Brian -- the Site Root mode is Sothink's attempt to simplify the path structure for menus and their support files (js & images). It can however open up another can of worms.

You are better served by using the Resource Folder method. Here you specify (in site relative folders) the location of your menu images and .js files. If you keep all your site image files (including menu images) in a sub-folder names "images" located in your main site folder you specify "images/". If you want use Web URLS you would use "http://www.whatever.com/images/". Use the same syntax for script files.

You change from Site Root to Web Path by clicking on the small blue button at the top right of the bottom Settings box shown in the attached image. By default the program starts up in Site Root mode.

Fix that first, then we'll go from there. . .
You do not have the required permissions to view the files attached to this post.
Mike
http://www.incitevisual.com
Not Sothink Support

Post Reply