SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am having some problems with including some html code into my PHP page. I get the same error message every time: "Parse error: parse error in /home/...../public_html/bearshare.inc on line 3"
    Can someone help me?

    Here is the code that is in the main PHP page (test.php):

    <?php
    include("bearshare.inc");
    ?>

    Here is the code that is in the included file (bearshare.inc):

    <?php
    echo( "
    <img src="bearshare.gif" width="150" height="36" alt="">
    <div align="center"><FORM ACTION="http://www.gnutella.it/search1.php3" METHOD="GET"><INPUT TYPE="TEXT" NAME="inputstr"> <INPUT TYPE="HIDDEN" NAME="firstrow" VALUE="1"><INPUT TYPE="HIDDEN" NAME="maxage" VALUE="7200" SELECTED> <INPUT TYPE="HIDDEN" NAME="lang" VALUE="en"> <INPUT TYPE="HIDDEN" NAME="qtimeout" VALUE="90"> <INPUT TYPE="SUBMIT" NAME="submit" VALUE=Search> <INPUT TYPE="RADIO" NAME="ftype" VALUE="1" CHECKED> MP3 <INPUT TYPE="RADIO" NAME="ftype" VALUE="4"> All file types</FORM></div>
    <hr width="95%" align=center>
    <div align="center"><TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0><TR valign="TOP"><TD>
    <a href="http://www.fast.no/">
    <img src="http://www.fast.no/images/fastlogo80.gif" align="middle"
    alt="FAST MP3 Search" border="0"></a></TD><TD>
    <FONT COLOR="#528294" FACE="verdana,helvetica,sans-serif" SIZE="+1"><B>
    MP3 Search</B></FONT></TD><TD valign="BOTTOM">
    <form action="http://mp3.lycos.com/cgi-bin/search" method="GET">
    <INPUT TYPE="hidden" NAME="form" VALUE="lycosnet">
    <input size="30" name="query">
    <input type="submit" value="Search">
    </form>
    </TD></TR></TABLE></div>
    \n" );
    ?>

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, the main problem you have is that you have quotes inside of quotes, you must escape them:

    PHP Code:
    <?
    echo 
    <img src='bearshare.gif' width='150' height='36' alt=''> 
    <div align='center'><FORM ACTION='http://www.gnutella.it/search1.php3' METHOD='GET'>
    <INPUT TYPE='TEXT' NAME='inputstr'> <INPUT TYPE='HIDDEN' NAME='firstrow' VALUE='1'>
    <INPUT TYPE='HIDDEN' NAME='maxage' VALUE='7200' SELECTED> 
    <INPUT TYPE='HIDDEN' NAME='lang' VALUE='en'> 
    <INPUT TYPE='HIDDEN' NAME='qtimeout' VALUE='90'> <INPUT TYPE='SUBMIT' NAME='submit' VALUE=Search>

     <INPUT TYPE='RADIO' NAME='ftype' VALUE='1' CHECKED> MP3 <INPUT TYPE='RADIO' NAME='ftype' VALUE='4'> 
    All file types</FORM></div> 
    <hr width='95%' align=center> 
    <div align='center'><TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0><TR valign='TOP'><TD> 
    <a href='http://www.fast.no/'> 
    <img src='http://www.fast.no/images/fastlogo80.gif' align='middle' 
    alt='FAST MP3 Search' border='0'></a></TD><TD> 
    <FONT COLOR='#528294' FACE='verdana,helvetica,sans-serif' SIZE='+1'><B> 
    MP3 Search</B></FONT></TD><TD valign='BOTTOM'> 
    <form action='http://mp3.lycos.com/cgi-bin/search' method='GET'> 
    <INPUT TYPE='hidden' NAME='form' VALUE='lycosnet'> 
    <input size='30' name='query'> 
    <input type='submit' value='Search'> 
    </form> 
    </TD></TR></TABLE></div> 
    "

    ?>
    Hope this helps,

    Peter

    EDIT: I checked the code and it works on my PC so just copy and paste!
    Last edited by petesmc; Feb 17, 2001 at 17:26.

  3. #3
    SitePoint Addict Shantra's Avatar
    Join Date
    Feb 2001
    Location
    Norway
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is solved by PETESMC. Thanks!!!

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem...


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
  •