New and Lost

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
steveeyes
Forum Newbie
Posts: 1
Joined: Sat Jan 22, 2005 6:28 pm

New and Lost

Post by steveeyes »

Hi. My first time posting. I tried several things, but I'm at the stage where I don't know what I'm doing wrong. I have a php chat script on my site. It is a very basic chat forum.

I wanted to incorporated some kind of news/announcement script so I downloaded another php script and installed it. When I try to use the include command in my chat script to include the news script, I keep getting errors.

First here is the chat scriipt.....below the script I'll show you the command I tried:

THE SCRIPT

Code: Select all

<?php

require_once("config.php");
sessionGarbageCollection();

// Get site title
$q = mysql_query("SELECT title FROM totalchat_settings WHERE id = '1'");
list($title) = mysql_fetch_row($q);


echo "
<HTML>
<HEAD>
<TITLE>".$title."</TITLE>
<meta name="description"content="A filipina lady online dating service for filipina ladies and asian ladies wanting a gentleman">
</HEAD>
<BODY bgcolor="#666666" background="bg.gif">
<div align="center"><a href="http://www.filipinaeyes.com">Filipina Eyes Home</a> | <a href="http://www.filipinaeyes.com/4images">Gallery</a> | <a href="http://www.filipinaeyes.com/Filipina-Ladies-Site-Map.htm">Lady Site Map</a> | <a href="http://www.filipinaeyes.com/online-dating-email-eyes.html">Send Email</a>
<h3>Online Dating Chat at Filipina Eyes</h3>
<strong>Members - To sign up, YOU MUST use the email you used to join Filipina Eyes. Request an Account to get started.</strong><br />
<strong> After signing up, YOU MUST send me an email to notify me for approval.</strong>
<p></p>
<OBJECT classid="clsid FPRIVATE "TYPE=PICT;ALT=" 27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=675 HEIGHT=525>
<PARAM NAME=movie VALUE="TotalChatrooms.swf">
<PARAM NAME=menu VALUE=false>
<PARAM NAME=quality VALUE=best>
<PARAM NAME="salign" VALUE="t" />
<PARAM NAME="wmode" VALUE="transparent" />
<EMBED src="TotalChatrooms.swf" menu=false quality=best bgcolor=#666666 WIDTH=675 HEIGHT=525 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED> 
</OBJECT>

</div>
</BODY>
</HTML>";

dbClose($conn);

?>
END OF SCRIPT

What i tried was the following:

<? include("/news/mynews.inc.php"); ?>

The mynews.inc.php is the script I'm trying to include in the script above. I put the script in a folder called news.

I keep getting this error:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/xxxxxxx/public_html/Lady-chat/index.php on line 42

Note that I put the xxxxxxxx in place of my user name.


Does anyone know what it is I'm doing wrong?

thanks and please be kind too a rookie tyring to learn.

steve


feyd | please use formatting!
hunterhp
Forum Commoner
Posts: 46
Joined: Sat Jan 22, 2005 5:20 pm
Contact:

Post by hunterhp »

Maybe you're trying to access the wrong folder. Have you tried <? include("../news/mynews.inc.php"); ?>

I'm mearly assuming your news directory is located at public_html/news, and not public_html/Lady-chat/news
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

the error isnt related to the include and its directory, its a parse error.


it sounds like you forgot a quote somewhere or you forgot to escape a quotes somewhere. you can look through your code and find it, the problem is ON or BEFORE line 42, like php told you. but heres some tips

you can use single quotes in php, then you dont need to escape all your double quotes

Code: Select all

<?php

echo '

<HTML>
<HEAD>
<TITLE>'.$title.'</TITLE>
<meta name="description"content="A filipina lady online dating service for filipina ladies and asian ladies wanting a gentleman">
</HEAD>
<BODY bgcolor="#666666" background="bg.gif"> 

';

?>
you can also just drop out of php

Code: Select all

<?php

// some php code

?>

<HTML>
<HEAD>
<TITLE><?php echo $title; ?></TITLE>
<meta name="description"content="A filipina lady online dating service for filipina ladies and asian ladies wanting a gentleman">
</HEAD>
<BODY bgcolor="#666666" background="bg.gif">
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yep missing some escaped double quotes.. a decent editor would show this pretty obviously:

Code: Select all

<OBJECT classid="clsid FPRIVATE "TYPE=PICT;ALT=" 27CDB6E-AE6D-11cf-96B8-444553540000"
is the error.
Post Reply