Moved Here, sorry mods, I didn't see this forum until after I posted.
------
Hey guys, I'm having trouble with a page I'm doing in PHP. I'm brand new to PHP and am trying to learn it but I have to finish this page quickly and I need some help.
The page is here:
<!-- m --><a class="postlink" href="http://www.kc-mtm.com/portfolio/ccwc04/ccwc.php">http://www.kc-mtm.com/portfolio/ccwc04/ccwc.php</a><!-- m -->
The PHP I modified from this thread:
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=32068">http://www.htmlforums.com/showthread.ph ... adid=32068</a><!-- m -->
Here is my full source:
<!-- m --><a class="postlink" href="http://www.kc-mtm.com/portfolio/ccwc04/ccwc.txt">http://www.kc-mtm.com/portfolio/ccwc04/ccwc.txt</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.kc-mtm.com/portfolio/ccwc04/preface.txt">http://www.kc-mtm.com/portfolio/ccwc04/preface.txt</a><!-- m -->
Here's the cut down version:
<body>
<!--Background Images-->
<div ID="graphics">
<div ID="gr_top">
<img src=http://www.htmlforums.com/archive/index.php/"images/top.jpg">
</div>
<div ID="gr_bottom-left">
<img src=http://www.htmlforums.com/archive/index.php/"images/bottom-left.jpg">
</div>
<div ID="gr_video">
<?PHP
if (!$vidoedisplay){
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
}else{
if ($preface == "300k"){
include ("/videos/qt/300k/preface.php");
}
?>
</div>
<div ID="gr_bottom">
<img src=http://www.htmlforums.com/archive/index.php/"images/bottom.jpg">
</div>
<div ID="gr_bottom-right">
<img src=http://www.htmlforums.com/archive/index.php/"images/bottom-right.jpg">
</div>
</div>
<!--/Background Images-->
<table ID="maintable">
<tr>
<td rowspan="3" class="video-title">Preface</td>
<td class="video-format">QuickTime:</td>
<td class="video-size">56k</td>
<td class="video-size">100k</td>
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=300k">300k</a></td>
</tr>
<tr class="coming-soon">
<td class="video-format">Windows Media:</td>
<td class="video-size">56k</td>
<td class="video-size">100k</td>
<td class="video-size">300k</td>
</tr>
<tr class="coming-soon">
<td class="video-format">Real:</td>
<td class="video-size">56k</td>
<td class="video-size">100k</td>
<td class="video-size">300k</td>
<tr>
</table>
Here's the preface.php:
print "<embed src=http://www.htmlforums.com/archive/index.php/\"videos/qt/300k/preface.mov\" height=\"336\" width=\"240\" autoplay=\"true\" controller=\"true\" kioskmode=\"true\" loop=\"false\">";
And the Parse Error:
Parse error: parse error in /home/kcmtm02/public_html/portfolio/ccwc04/ccwc.php on line 205
Can anyone help me figure out what I'm doing wrong and how I might fix it.youre missing a }
if (!$vidoedisplay) {
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
} else {
if ($preface == "300k") {
include ("/videos/qt/300k/preface.php");
}
}
tip: always indent correctly so you dont miss any closing bracketsThanks, that did it!
So I guess my next question, when I click on my 300k link (the only live link on the right page) it's not doing what I hoped I thought it would. Basically I wanted to image of the montains on the left page to go away and the video to be there instead.
Specifically this is what I have:
<?PHP
if (!$vidoedisplay) {
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
} else {
if ($preface == "300k") {
include ("/videos/qt/300k/preface.php");
}
}
?>
This is to tell it that when I click on the specific link it will exchange video.jpg for the code from preface.php.
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=300k">300k</a></td>
That's the link that should trigger the change.
print "<embed src=http://www.htmlforums.com/archive/index.php/\"videos/qt/300k/preface.mov\" height=\"336\" width=\"240\" autoplay=\"true\" controller=\"true\" kioskmode=\"true\" loop=\"false\">";
That's the code I want to exchange it with.
Am I using the embed or print (should it be echo?) functions wrong? Could my problem be in the HTML rather than the PHP?
Thanks!if (!$vidoedisplay) {
should be
if (!$videodisplay) {One other thing, I already know my CSS is screwed up, so if the page layout look really bad, I'm working on it.illogique,
Now I really feel stupid That got me much closer though, but now in the box where the video should be I'm getting:
{ print ""; }
What should I have in their? Should it be just the HTML embed or should it still be PHP code?Originally posted by N2ChristTheKing
illogique,
Now I really feel stupid
and again...
you don't have <?php ?> in preface.phpOkay, so you need to have <?php ?> in the include? I was told that it just replaces the include so the end result would be:
<?PHP
if (!$vidoedisplay) {
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
} else {
if ($preface == "300k") {
print "<embed src=http://www.htmlforums.com/archive/index.php/\"videos/qt/300k/preface.mov\" height=\"336\" width=\"240\" autoplay=\"true\" controller=\"true\" kioskmode=\"true\" loop=\"false\">";
}
?>
I guess that's not how it works then. I'll try it again, thanks, I'm really sorry I'm so clueless, I'm trying to learn PHP, web-design isn't my job but I was asked to do it.It works!!! Thank you soooo much, I'm really sorry to bother you guys with my ignorance, here, thank you for bearing with me. I honestly can't thank you enough.look at the online docs of php for include
<!-- m --><a class="postlink" href="http://ca2.php.net/include/">http://ca2.php.net/include/</a><!-- m -->
but because preface.php is static, you don't need php, it could be only html.
then again, you could only have 1 file the include that will check variable and dispaly the correct image or video...Will do, thanks for the link.
I'm considering having only one file, but for the smaller video sizes I'll actually be including four images around the video so I'd rather people don't have to load all that extra code or at least keep it a little less cluttered.Although you might think your mistakes are silly, to the next person browsing this forum with a similar problem, this thread might just give the enlightenment that they need.
Run the page that is output from that script through the code validator at <!-- m --><a class="postlink" href="http://validator.w3.org/detailed.html">http://validator.w3.org/detailed.html</a><!-- m --> and see if you can get the HTML output to conform to, say, the HTML 4.01 Transitional standard. That would be a good next step.Okay, gotten the PHP fixed and working, and I had the whole QuickTime part of it up and working, but I made a planning mistake and am having to redo some thing for Windows Media to work. So in the process I've decided to try to get it to conform to XHTML Strict or at least Transitional, as well as fixing some CSS and other misc. problems.
The reason I'm posting is that before I add the table with the PHP links to the page it validates just fine, once I add it I get tons of errors and I'm not clear on what they actually mean.
The updated test page is here:
<!-- m --><a class="postlink" href="http://localhost/version_02/ccwc.php">http://localhost/version_02/ccwc.php</a><!-- m -->
And validation results here:
<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.kc-mtm.com%2Fportfolio%2Fccwc_xhtml_test%2Fccwc.php">http://validator.w3.org/check?uri=http% ... 2Fccwc.php</a><!-- m -->
Here's the problems I'm getting:
Note: The Validator XML support has some limitations.
Line 47, column 61: cannot generate system identifier for general entity "preface"
Line 47, column 68: reference not terminated by REFC delimiter
Line 47, column 68: reference to external entity in attribute value
Line 48, column 68: reference not terminated by REFC delimiter
Line 48, column 68: reference to external entity in attribute value
Line 49, column 68: reference not terminated by REFC delimiter
Line 49, column 68: reference to external entity in attribute value
Also see the attached 12k .gif screenshot (I didn't know how to format that right for the forum)
The code in question is:
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=qt_40k">40k</a></td>
These errors and the code continue on with more of the same, but I think that's the gist of it.
Is there a way to make this code conform to XHTML?
PS: I know none of the links work right now, I'm just getting this page working then I'll move on to those.all of these
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=qt_40k">40k</a></td>
need to be this
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=qt_40k">40k</a></td>Works perfect, thanks! :banger:
------
Hey guys, I'm having trouble with a page I'm doing in PHP. I'm brand new to PHP and am trying to learn it but I have to finish this page quickly and I need some help.
The page is here:
<!-- m --><a class="postlink" href="http://www.kc-mtm.com/portfolio/ccwc04/ccwc.php">http://www.kc-mtm.com/portfolio/ccwc04/ccwc.php</a><!-- m -->
The PHP I modified from this thread:
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=32068">http://www.htmlforums.com/showthread.ph ... adid=32068</a><!-- m -->
Here is my full source:
<!-- m --><a class="postlink" href="http://www.kc-mtm.com/portfolio/ccwc04/ccwc.txt">http://www.kc-mtm.com/portfolio/ccwc04/ccwc.txt</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.kc-mtm.com/portfolio/ccwc04/preface.txt">http://www.kc-mtm.com/portfolio/ccwc04/preface.txt</a><!-- m -->
Here's the cut down version:
<body>
<!--Background Images-->
<div ID="graphics">
<div ID="gr_top">
<img src=http://www.htmlforums.com/archive/index.php/"images/top.jpg">
</div>
<div ID="gr_bottom-left">
<img src=http://www.htmlforums.com/archive/index.php/"images/bottom-left.jpg">
</div>
<div ID="gr_video">
<?PHP
if (!$vidoedisplay){
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
}else{
if ($preface == "300k"){
include ("/videos/qt/300k/preface.php");
}
?>
</div>
<div ID="gr_bottom">
<img src=http://www.htmlforums.com/archive/index.php/"images/bottom.jpg">
</div>
<div ID="gr_bottom-right">
<img src=http://www.htmlforums.com/archive/index.php/"images/bottom-right.jpg">
</div>
</div>
<!--/Background Images-->
<table ID="maintable">
<tr>
<td rowspan="3" class="video-title">Preface</td>
<td class="video-format">QuickTime:</td>
<td class="video-size">56k</td>
<td class="video-size">100k</td>
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=300k">300k</a></td>
</tr>
<tr class="coming-soon">
<td class="video-format">Windows Media:</td>
<td class="video-size">56k</td>
<td class="video-size">100k</td>
<td class="video-size">300k</td>
</tr>
<tr class="coming-soon">
<td class="video-format">Real:</td>
<td class="video-size">56k</td>
<td class="video-size">100k</td>
<td class="video-size">300k</td>
<tr>
</table>
Here's the preface.php:
print "<embed src=http://www.htmlforums.com/archive/index.php/\"videos/qt/300k/preface.mov\" height=\"336\" width=\"240\" autoplay=\"true\" controller=\"true\" kioskmode=\"true\" loop=\"false\">";
And the Parse Error:
Parse error: parse error in /home/kcmtm02/public_html/portfolio/ccwc04/ccwc.php on line 205
Can anyone help me figure out what I'm doing wrong and how I might fix it.youre missing a }
if (!$vidoedisplay) {
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
} else {
if ($preface == "300k") {
include ("/videos/qt/300k/preface.php");
}
}
tip: always indent correctly so you dont miss any closing bracketsThanks, that did it!
So I guess my next question, when I click on my 300k link (the only live link on the right page) it's not doing what I hoped I thought it would. Basically I wanted to image of the montains on the left page to go away and the video to be there instead.
Specifically this is what I have:
<?PHP
if (!$vidoedisplay) {
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
} else {
if ($preface == "300k") {
include ("/videos/qt/300k/preface.php");
}
}
?>
This is to tell it that when I click on the specific link it will exchange video.jpg for the code from preface.php.
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=300k">300k</a></td>
That's the link that should trigger the change.
print "<embed src=http://www.htmlforums.com/archive/index.php/\"videos/qt/300k/preface.mov\" height=\"336\" width=\"240\" autoplay=\"true\" controller=\"true\" kioskmode=\"true\" loop=\"false\">";
That's the code I want to exchange it with.
Am I using the embed or print (should it be echo?) functions wrong? Could my problem be in the HTML rather than the PHP?
Thanks!if (!$vidoedisplay) {
should be
if (!$videodisplay) {One other thing, I already know my CSS is screwed up, so if the page layout look really bad, I'm working on it.illogique,
Now I really feel stupid That got me much closer though, but now in the box where the video should be I'm getting:
{ print ""; }
What should I have in their? Should it be just the HTML embed or should it still be PHP code?Originally posted by N2ChristTheKing
illogique,
Now I really feel stupid
and again...
you don't have <?php ?> in preface.phpOkay, so you need to have <?php ?> in the include? I was told that it just replaces the include so the end result would be:
<?PHP
if (!$vidoedisplay) {
print "<img src=http://www.htmlforums.com/archive/index.php/\"images/video.jpg\">";
} else {
if ($preface == "300k") {
print "<embed src=http://www.htmlforums.com/archive/index.php/\"videos/qt/300k/preface.mov\" height=\"336\" width=\"240\" autoplay=\"true\" controller=\"true\" kioskmode=\"true\" loop=\"false\">";
}
?>
I guess that's not how it works then. I'll try it again, thanks, I'm really sorry I'm so clueless, I'm trying to learn PHP, web-design isn't my job but I was asked to do it.It works!!! Thank you soooo much, I'm really sorry to bother you guys with my ignorance, here, thank you for bearing with me. I honestly can't thank you enough.look at the online docs of php for include
<!-- m --><a class="postlink" href="http://ca2.php.net/include/">http://ca2.php.net/include/</a><!-- m -->
but because preface.php is static, you don't need php, it could be only html.
then again, you could only have 1 file the include that will check variable and dispaly the correct image or video...Will do, thanks for the link.
I'm considering having only one file, but for the smaller video sizes I'll actually be including four images around the video so I'd rather people don't have to load all that extra code or at least keep it a little less cluttered.Although you might think your mistakes are silly, to the next person browsing this forum with a similar problem, this thread might just give the enlightenment that they need.
Run the page that is output from that script through the code validator at <!-- m --><a class="postlink" href="http://validator.w3.org/detailed.html">http://validator.w3.org/detailed.html</a><!-- m --> and see if you can get the HTML output to conform to, say, the HTML 4.01 Transitional standard. That would be a good next step.Okay, gotten the PHP fixed and working, and I had the whole QuickTime part of it up and working, but I made a planning mistake and am having to redo some thing for Windows Media to work. So in the process I've decided to try to get it to conform to XHTML Strict or at least Transitional, as well as fixing some CSS and other misc. problems.
The reason I'm posting is that before I add the table with the PHP links to the page it validates just fine, once I add it I get tons of errors and I'm not clear on what they actually mean.
The updated test page is here:
<!-- m --><a class="postlink" href="http://localhost/version_02/ccwc.php">http://localhost/version_02/ccwc.php</a><!-- m -->
And validation results here:
<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.kc-mtm.com%2Fportfolio%2Fccwc_xhtml_test%2Fccwc.php">http://validator.w3.org/check?uri=http% ... 2Fccwc.php</a><!-- m -->
Here's the problems I'm getting:
Note: The Validator XML support has some limitations.
Line 47, column 61: cannot generate system identifier for general entity "preface"
Line 47, column 68: reference not terminated by REFC delimiter
Line 47, column 68: reference to external entity in attribute value
Line 48, column 68: reference not terminated by REFC delimiter
Line 48, column 68: reference to external entity in attribute value
Line 49, column 68: reference not terminated by REFC delimiter
Line 49, column 68: reference to external entity in attribute value
Also see the attached 12k .gif screenshot (I didn't know how to format that right for the forum)
The code in question is:
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=qt_40k">40k</a></td>
These errors and the code continue on with more of the same, but I think that's the gist of it.
Is there a way to make this code conform to XHTML?
PS: I know none of the links work right now, I'm just getting this page working then I'll move on to those.all of these
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=qt_40k">40k</a></td>
need to be this
<td class="video-size"><a href=http://www.htmlforums.com/archive/index.php/"ccwc.php?videodisplay=yes&preface=qt_40k">40k</a></td>Works perfect, thanks! :banger: