Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
Is there a way to get javascript to understand php variables. More specifically the UBBT variables.

Is it as simple as including the ubbt.inc.php file in the script?

Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Could you explain specifically what you want to do? I.e., what problem are you trying to solve?

Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
If you take a look at my site. (See sig)

I have a dhtml menu written in Javascript.

I am trying to move the navigation menu from the top of the forums to the dhtml menu. However when I attempt to use any variables from the UBBT the Javascript does not understand them.

So I was wondering if including a UBBT file will be able to pass the variables to the Javascript. Or am I going down the wrong path........

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I looked at your site, but am not sure what menu you're referring to.

PHP runs server-side, and Javascript runs client-side.

All I can think of is to modify the PHP script to output the Javascript, with the desired values included in the Javascript.

Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
Attachments
49706-badphp.gif (0 Bytes, 31 downloads)

Last edited by casper; 06/12/2002 9:45 AM.
Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Ok, my browser filter was blocking that menu. I can see it now.

This may take some time, but I'll see if I can spot the problem, unless someone else responds first.

Joined: Jan 2000
Posts: 796
MTO Offline
Addict
Addict
Offline
Joined: Jan 2000
Posts: 796
No way you will get that to work, sorry.

The javascript file you are using is not parsed by php, so no, it wont work.
You are refering to an external javascript file for the menu: [:"blue"] ../mmenu.js [/]
It wont work.

Maybe you could try embedding directly the javascript into your php page itself, but that is not a good thing... The way you have it now saves users from downloading the menu every single time they visit a page with the menu. If you include the script inside the php (where that specific thing would work) then download time will double, as they will need to download the javascript code along with the generated page every single time.

Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
Ok.

Thank You. I'll have to find another way......

I'll probably hard code the array's. One for registered users and one for unregistered and just "remember" where the admin pages are.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)