#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    60
    Rep Power
    15
    Howdy all.
    It's Friday, X-Men opens tonight and I can't think straight. So I need a little help.

    I have the following code in a page to display an "onmouseovered" link if a certain var is true in a table.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><?if ($phorum=='yes') {
    echo "<a href='../phorum/list.php4?appno=$appno&entity=$entity&password=$password&num=$phorum_id' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage('document.messageboard','document.messageboard','../images/on_mssgboard.jpg','#955986178380')'><img name='messageboard' border='0' src='../images/off_mssgboard.jpg' width='173' height='16'></a>";
    }
    ?>[/code]

    Because of the way PHP handles single and double quotes, it needs to appear like this in PHP, BUT, the mouseover won't work because the javascript code needs to appear like this to do a mouseover (note the single/double quotes):

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><a href="../phorum/list.php4?appno=11355&entity=2000&password=test&num=1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('document.messageboard','document.messageboard','../images/on_mssgboard.jpg','#955986178380')"><img name="messageboard" border="0" src="../images/off_mssgboard.jpg" width="173" height="16"></a>[/code]

    Anyone have a clue as to how I can fix this? The mouseover has become a "selling feature" (go figure.) but I am very willing to trash it if it can't be done.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Use a backslash to escape your nested quotes:

    $sAlert = "alert ("Hi");";
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    1
    Rep Power
    0
    Have you thought to ESCAPE IT!? You use yes thats right to escape quotes!

Similar Threads

  1. windows XP chkdsk and file system problems
    By wey97 in forum Windows Help
    Replies: 26
    Last Post: August 3rd, 2005, 12:37 AM
  2. Popup problems from Flash in IE6
    By jmichels in forum Flash Help
    Replies: 19
    Last Post: January 6th, 2004, 04:27 PM
  3. DNS problems
    By banneaux in forum DNS
    Replies: 7
    Last Post: October 10th, 2003, 06:58 AM
  4. Replies: 0
    Last Post: August 26th, 2003, 08:50 PM
  5. Windows problems
    By Known_criminal in forum Windows Help
    Replies: 0
    Last Post: August 23rd, 2003, 08:23 PM

IMN logo majestic logo threadwatch logo seochat tools logo