NEED HELP - php string with javascript popitup quick fix easy money

Discussion in 'Programming' started by jackdaniels187, Feb 14, 2010.

Thread Status:
Not open for further replies.
  1. #1
    Alright I am trying to deal with a small issue.

    I need to have a javascript popup link echod by php.

    This is the code I have now. I know it doesn't work. the quotes just aren't in the right place, can someone figure it out? ill pay $5.00 to figure it out.

     print '<a href="unit_note1.php?id='.$unitid." onClick=\"return popitup(\'unit_note1.php?id='.$unitid.'\')">Click here</a>';  
    PHP:
    Here is another instance I am using this but it is setup as html

    <a href="unit_note1.php?id=<? print $unitid; ?>" onClick="return popitup('unit_note1.php?id=<? print $unitid; ?>')">Add note</a>
    HTML:
     
    jackdaniels187, Feb 14, 2010 IP
  2. jackdaniels187

    jackdaniels187 Peon

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 1
    As Buyer:
    100% - 0
    #2
    Figured it out...
     
    jackdaniels187, Feb 14, 2010 IP
  3. Dangy

    Dangy Well-Known Member

    Messages:
    841
    Likes Received:
    25
    Best Answers:
    2
    Trophy Points:
    155
    As Seller:
    100% - 1
    As Buyer:
    100% - 0
    #3
    You can't use php the way you are trying to use it.

    It can be used like
    <script>
          document.write("<?php echo 'hello!'; ?>");
          </script>
    Code (markup):
    But not inside an onClick function.
     
    Last edited: Feb 14, 2010
    Dangy, Feb 14, 2010 IP
Thread Status:
Not open for further replies.