Results 1 to 9 of 9

Thread: Popup Menu

  1. #1
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Popup Menu

    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>";

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Assuming your page itself is in PHP (.php), you can dynamically generate any portion of the JavaScript using PHP, something like:

    Code:
    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.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Ndogg (10-17-2010)

  4. #3
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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.

  5. #4
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Bump...

  6. #5
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    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

  7. #6
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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.

  8. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    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.

  9. The Following User Says Thank You to traq For This Useful Post:

    Ndogg (10-17-2010)

  10. #8
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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

  11. #9
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •