SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unescape this nasty string for me...!

    I have the following line inserted inside a PHP script -

    PHP Code:
    $results[$i-1]['wav']='<a href="#" onClick="MyWindow="'popup_m.php?songID=".trim($res[$i]['Indexes'])."','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=325,height=336,left=0,top=0'";; return false;"><img src="/images/speaker.gif" border="0"></a>' 
    I'm having trouble escaping all of the single/double quotes as I keep trying every possible combination I can think of and it always doesn't escape properly. Can someone assist and help?

    Thanks.
    My 2 Cents (or is that 2.2 Cents including GST?)

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Break this up into several steps. Once you have it working, THEN refactor it down to a one-line operation.

    In short, if you are having problems doing too many things at once: don't do too many things at once!
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •