hi guys and gals,
I have just swallowed Build Your Own Database Driven Website Using PHP & MySQL, 3rd ed. by Kevin Yank and am half way through Larry Ullman's PHP and mySQL for dynamic web sites i got a little brave and tried to do some code myself as expected it did not work
I got
Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in /home/qncqnc/public_html/testbed/firstphp/index.php on line 10
when I posted it on my site
I tried using the include files style of writing as It is easier to track and change code apparently i will be trying object stuff but I thought I would get a start here
ok here is the monster long code where did I go wrong?
first the index page that calls the incude pages and is what people will see it is for an embeded movie page that can be seen in raw html at http://qnctv.com/beth
<?php
// set the title and end XHTML header
// page requires head, embed and footer.incs
$page_title='movie test';
include('./head.inc.php'); ?>
<script type="text/javascript">
function go(form)
{
location=form.selectmenu.value
}
</script>
<style type="text/css">
body {font-family: times new roman; text-align:center;}
a {text-decoration:none;}
img {border:none;}
a:active {color: green;}
a:hover {color: CCFFFF; font-style: bold;}
h1 {font-size: 30pt; font-style: bold;}
h2 {font-size: 20pt;}
h3 {font-size: 10pt;}
h4 {font-size: 8pt;}
h6 {font-size: 9pt;}
</style>
<?php
echo "</head>"; //end
//start body section
echo "<body link=99ccff vlink=purple bgcolor=#140f57 text=FFCC66>"; //end
//movie name, author and URL needed
$_movie_name='Beth'; //end
$_Authour='Beth'; //end
$_movie_URL='http://qnctv.com/beth/beth.wmv'; //end
//set introduction
echo "<h1>$_movie_name</h1>"; //end
//embeding the movie
include('./embed.inc.php'); //end
echo "<h6>by $_Authour</h6>"; //end
// a few spaces for style
echo "<br><br><br>"; //end
//navigation bar and legals
inculde('./footer.inc.php'); //end
//close the page
echo "</body> </html>"; //end
?>
now the include files
head.inc.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>
<?php echo $page_title: ?>
</title>
embed.inc.php
<object id='mediaPlayer' width="450" height="309"
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
<?php echo "<param name='fileName' value="$_movie_URL">";
// setting value URL of movie ?>
<param name='animationatStart' value='true'>
<param name='transparentatStart' value='true'>
<param name='autoStart' value="true">
<param name='showControls' value="true">
<param name="ShowStatusBar" value="true">
<param name='loop' value="0">
<?php echo "<embed type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
src="$_movie_URL" //the actual movie location
width="450"
height="309"
autostart="1"
displaysize='4'
autosize='0'
bgcolor='#140f57'
showcontrols="1"
showtracker='0'
ShowStatusBar='1'
showdisplay='0'
videoborder3d='0'
designtimesp='5311'
loop="0"> </embed> "; // actual embeding of $_movie_URL ?>
</object>
footer.inc.php just a navigation bar that I use nothing special at the moment
<table align="center">
<tr>
<td align="center">
<a href="http://www.qnctv.com/showsindex.htm"><h6>ENTERTAINMENT </h6></a>
</td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center">
<a href="http://www.qnctv.com/"><img src="http://www.qnctv.com/qnctv.gif" height="60"></a>
</td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center">
<a href="http://www.qnctv.com/conindex.htm"><h6 > CONCEPTS</a></h6 >
</td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"><a href="http://www.qnctv.com/advice"><h6>?</h6></a>
</td>
<td align="center">
<form align="center">
<select name="selectmenu" onchange="go(this.form)">
<option value=""><H6>DEBATES</H6></option>
<option value="">--------</option>
<option value="http://qnctv.com/forum/"><H6>FORUMS</H6></option>
<option value="">--------</option>
<option value="http://qnctv.com/forum"><H6>Index</H6></option>
<option value="http://qnctv.com/forum/index.php?act=Search&f="><H6>Search</H6></option>
</select>
</form>
</td>
<td align="center">
<a href="mailto:qnc@qnctv.com"><h6>@</h6></a>
<td align="center"> </td>
<td align="center"> </td>
</td>
</tr>
</table>
<div id="footer" align="center">
Copyright 2002 –
[code=php]
<?php echo "$_date('y')" "Qnctv.com ltd" "\ +" "$_Authour"\.;
//just a simple php generated copyright message for the authors and myself?>
ALL RIGHTS RESERVED </div>[/code]
That it thanks for getting to this point any help you can give is much appreciated.