PDA

View Full Version : Popup Menu



Ndogg
10-13-2010, 04:44 AM
1) Script Title: Pop-It Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/popit.htm

3) Describe problem: How do I make it so in the links in the javascript, I can have a php var used there. Like this:

linkset[0]+="<a href='Inbox/inbox.php?to=".$name."'>Send Message</a>";

ddadmin
10-13-2010, 07:23 AM
Assuming your page itself is in PHP (.php), you can dynamically generate any portion of the JavaScript using PHP, something like:


linkset[0]+="<a href='Inbox/inbox.php?to=<?echo '.' . $name;?>'>Send Message</a>";

As long as the final output when you view source is identical to as if you've manually embedded the JavaScript on your page, it will work.

Ndogg
10-14-2010, 05:44 AM
Thats exactly what I did, along with several other changes. :(


Mine is setup as so:

The main file where the popup is at is a .php file with the popup menu css and java in a include .php file.

Ndogg
10-15-2010, 09:57 PM
Bump...

traq
10-16-2010, 01:39 AM
what is your php outputting? ddadmin's suggestion should work just fine. Please post the code and the output, and we can try to see what's going wrong

Ndogg
10-16-2010, 07:27 PM
When I use that way it just says error and the popup doesnt open. But it doesnt say what the error is, in the bottom left of IE where its says 'Done' it has a little yellow caution sign.

traq
10-17-2010, 12:45 AM
what does the php script output? what does your source code look like?

if you'd like to know more about the javascript errors, you should try firefox and use firebug or one of the other developer extensions.

Ndogg
10-17-2010, 05:55 AM
Ahh man, that was a sad multiple day error :( I had the include above the variable so the variable wasnt set in the include file.

Thanks for trying guys

traq
10-17-2010, 03:36 PM
no prob