![]() |
Using JAVASCRIPT in PHP--help!
I'm using KuraFire's hack right now on how to remove the register button for members and usercp for guests. Anyway, I've got it working fine but on my forums I use javascript roll-over buttons for these things. I have easily inserted the javascript code into PHP modifying it for PHP, but its not working because it needs the javascript info inlcluded in the headinclude to run. Anyway, can I reference to the template headinclude to receive this info somehow? Or can I just insert all the javascript stuff into the PHP file I'm editing at the top? Any help would be great ;)
|
hmm....I think your best bet is to just put the javascript into the headerinclude template....but if you want to put it in a php file, you need to first end it by adding "?>" then after you put in your js code you need to readd "<?" to contune it...but I still say your best bet is the headerinclude template ;)
|
Hmm...
Well, I've tried putting the javascript code at the top of the PHP file, or inserted inside by closing and opening the PHP tags around it--but that still doesn't work... And as for the headinclude, it's already in there but will the javascript code in my PHP file (global.php) know to look in the headinclude?? How does this look: Code:
$reg_ucp = "<a href=\"register.php?s=$session[sessionhash]&action=signup\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('register','','https://vborg.vbsupport.ru/images/registerroll.gif',1)\">". And here is the script that this code needs to run: Code:
<?php |
okey, this is what I think you should try....take out the following code from the php file and place it in the phpinclude template:
PHP Code:
Code:
<script language="JavaScript"> |
Muahahah, I just figured out my silly mistake. I had forgot that the original button still existed in the header file, and was using the id "register" which this new code relied on. And both can't use one id, so I erased the header and its fixed. I make the lamest mistakes sometimes..:p
Thanks for you help anyway! |
lol, sometimes it's little things that screws up the whole board :D
|
All times are GMT. The time now is 10:16 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|