SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php message on page

    I'm using the following php code:

    PHP Code:
    <?php {
    echo 
    '<a href="#" onclick="window.open(\'345.php?recordid41='.$Recordset1->Fields('col1').\'&recordid62a=4&recordid62b=4\', \'popup\',\'width=\'+(screen.availWidth-100)+\',height=\'+(screen.availHeight-100)+\',scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes, menubar=yes,status=yes,left=50,top=50\'); return false"><img src="sub2/forms1.gif" alt="Open Forms" width="18" height="17" hspace="1" vspace="1" border="0"></a>';
    }
    ?>
    And it works just like it is suppose to except that I get this message on the page when viewed online.

    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in c:\inetpub\wwwroot\test2\183.php on line 204

    Does anyone know what this means?

  2. #2
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    //assign this to a variable first
    $album $Recordset1->Fields('col1');

    echo 
    '<a href="#" onclick="window.open(\'345.php?recordid41=' .$album. \'&recordid62a=4&recordid62b=4\', \'popup\',\'width=\'+(screen.availWidth-100)+\',height=\'+(screen.availHeight-100)+\',scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes, menubar=yes,status=yes,left=50,top=50\'); return false"><img src="sub2/forms1.gif" alt="Open Forms" width="18" height="17" hspace="1" vspace="1" border="0"></a>'

  3. #3
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help. It worked in my first example but still having problems in the following code that I use else work in my site:

    PHP Code:
    <?php
    $employer 
    $Recordset1->Fields('col1');
    if (
    $Recordset1->Fields('col21') == ){
    if (
    $Recordset1->Fields('col11') == ){
    echo 
    '<a href="#" onclick="window.open(\'345.php?recordid1='.$employer.'&recordid62a=3&recordid62b=1\', \'popup\',\'width=\'+(screen.availWidth-100)+\',height=\'+(screen.availHeight-100)+\',scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes, menubar=yes,status=yes,left=50,top=50\'); return false"><img src="sub2/forms1.gif" alt="Open Forms" width="18" height="17" hspace="1" vspace="1" border="0"></a>';
    }else
    {
    echo 
    '<a href="#" onclick="window.open(\'345.php?recordid1='.$employer.'&recordid62a=3&recordid62b=2\', \'popup\',\'width=\'+(screen.availWidth-100)+\',height=\'+(screen.availHeight-100)+\',scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes, menubar=yes,status=yes,left=50,top=50\'); return false"><img src="sub2/forms1.gif" alt="Open Forms" width="18" height="17" hspace="1" vspace="1" border="0"></a>';
    }
    }
    ?>
    This code doesn't show any errors but leaves out the link completely. Nothing shows up in the page. I'm thinking there must be something in the if statement that's causing the problems because it's pretty much identical to the other...other than the "if" statement.

  4. #4
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The echo's alone in a PHP page work fine for me:
    http://www.webinfractions.com/sp_test.php
    PHP Code:
    <?
    echo '<a href="#" onclick="window.open(\'345.php?recordid1='.$employer.'&recordid62a=3&recordid62b=1\', \'popup\',\'width=\'+(screen.availWidth-100)+\',height=\'+(screen.availHeight-100)+\',scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes,   menubar=yes,status=yes,left=50,top=50\'); return false"><img src="sub2/forms1.gif" alt="Open Forms" width="18" height="17" hspace="1" vspace="1" border="0"></a>'

    echo 
    '<a href="#" onclick="window.open(\'345.php?recordid1='.$employer.'&recordid62a=3&recordid62b=2\', \'popup\',\'width=\'+(screen.availWidth-100)+\',height=\'+(screen.availHeight-100)+\',scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes,   menubar=yes,status=yes,left=50,top=50\'); return false"><img src="sub2/forms1.gif" alt="Open Forms" width="18" height="17" hspace="1" vspace="1" border="0"></a>'
    ?>
    Put an else in the main if (not the nested one) and just have it echo something to see if the first if is evaluating to false.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  5. #5
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried it again and it's working now. Not sure what was wrong, I might have had an extra bit of text in somewhere, not sure. But it's working now. Thanks for all the help!


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
  •