Professional Web Applications Themes

Help !!! a bit of javascript mixed with PHP - PHP Development

Cruddy code examples on the net... ported into my program and don't work... any idea's? echo '<a href="javascript : void(0)" onClick="window.open("club_info.php?clubcode="'.$c ode.'","mypage","width=300 ,height=300,toolbar=0,resizable=0,scrollable=1");" ><img src="'.$badge.'" width="50" height="50" border="0" ALT="'.$name.'">'</a>';...

  1. #1

    Default Help !!! a bit of javascript mixed with PHP

    Cruddy code examples on the net... ported into my program and don't work...
    any idea's?

    echo '<a href="javascript: void(0)"
    onClick="window.open("club_info.php?clubcode="'.$c ode.'","mypage","width=300
    ,height=300,toolbar=0,resizable=0,scrollable=1");" ><img src="'.$badge.'"
    width="50" height="50" border="0" ALT="'.$name.'">'</a>';


    Domestos Guest

  2. #2

    Default Re: Help !!! a bit of javascript mixed with PHP

    > Cruddy code examples on the net... ported into my program and don't 

    psychic ability is alluding me at the moment so may be best if you say what
    is happening instead of just saying it is not working.

    1 thing that is wrong is the fact that you have an extra ' before </a>


    Peter Guest

  3. #3

    Default Re: Help !!! a bit of javascript mixed with PHP

    Domestos wrote: 

    It almost works (just remove the "'" sign before "</a>").
    The problem is that this PHP code generates invalid HTML.
    The solution is:
    1. Look at the HTML code it generates.
    2. Fix the HTML code.
    3. Copy and paste the correct HTML code into your PHP code.

    If you are unable to do the 1 and 2, then try learning HTML before trying
    to use PHP.

    Where did you get the code from anyway?


    Hilarion


    Hilarion Guest

  4. #4

    Default Re: Help !!! a bit of javascript mixed with PHP

    Hilarion wrote: 
    >
    > It almost works (just remove the "'" sign before "</a>").
    > The problem is that this PHP code generates invalid HTML.
    > The solution is:
    > 1. Look at the HTML code it generates.
    > 2. Fix the HTML code.
    > 3. Copy and paste the correct HTML code into your PHP code.
    >
    > If you are unable to do the 1 and 2, then try learning HTML before
    > trying to use PHP.[/ref]

    See the guy's other post and you'll understand better...

    --
    Tony Garcia
    Web Right! Development


    Tony Guest

  5. #5

    Default Re: Help !!! a bit of javascript mixed with PHP

     

    Sorry Tony - have I upset you in some way??


    Domestos Guest

  6. #6

    Default Re: Help !!! a bit of javascript mixed with PHP

    "Hilarion" <onet.pl> wrote in
    message news:d9se53$msr$onet.pl... 
    >
    > It almost works (just remove the "'" sign before "</a>").
    > The problem is that this PHP code generates invalid HTML.
    > The solution is:
    > 1. Look at the HTML code it generates.
    > 2. Fix the HTML code.
    > 3. Copy and paste the correct HTML code into your PHP code.
    >[/ref]

    Yes, the php will work correctly once the extra ' is removed. Still the
    javascript is incorrect. To fix the javascript, OP should convert some
    double qoutes that are broken to single qoutes and adjust the mis-placed
    comma. Here's what the code generates:

    <a href="javascript: void(0)"
    onClick="window.open("club_info.php?clubcode="",my page,width=300
    ,height=300,toolbar=0,resizable=0,scrollable=1");" ><img src=""
    width="50" height="50" border="0" ALT=""></a>

    The thing is, double qoutes inside double quotes is ual harrasment, and
    that makes me a saaaaad panda. What it _should_ generate:

    <a href="javascript: void(0)"
    onClick="window.open('club_info.php?clubcode=','my page,width=300
    ,height=300,toolbar=0,resizable=0,scrollable=1');" ><img src=""
    width="50" height="50" border="0" ALT=""></a>

    Long story short: here's a code that should work (I tested and it did work)

    echo "<a href='javascript: void(0)'
    onClick=\"window.open('club_info.php?clubcode=$cod e', 'mypage',
    'width=300, height=300,toolbar=0,resizable=0,scrollable=1');\" >
    <img src='$badge' width='50' height='50' border='0' ALT='$name'></a>";

    --
    "I am pro death penalty. That way people learn
    their lesson for the next time." -- Britney Spears

    com


    Kimmo Guest

Similar Threads

  1. mixed ink swatch?
    By Glenn_Burns@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 2
    Last Post: August 30th, 07:28 PM
  2. ASP-to-RTF - Mixed Languages
    By Arnold Shore in forum ASP
    Replies: 0
    Last Post: September 30th, 01:08 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139