You are here: Re: PHP/Layers Problem « All PHP « IT news, forums, messages
Re: PHP/Layers Problem

Posted by Jim Michaels on 02/28/06 09:12

"HoDeHoo" <newaroundhere@hotmail.com> wrote in message
news:44036114$0$24749$882e0bbb@news.ThunderNews.com...
> Hi there,
>
> This may be more of an HTML problem than a PHP problem but as I am a
> beginnger at both I hope you will spare some compassion!
>
> I was up till 4 am last night and spent a solid 6 hours doing nothing but
> trying to understand and learn why the layers on the 2nd page of my script
> aren't working properly!
>
> The co-ordinates all look pretty bang on to me - especially Result +
> Status/2 which are both left aligned by their left co-ordinate but which
> rarely meet that way! (These layers contain the red bit of paper that
> shows
> the result of the round and then either the icons to play again or a
> congratulation to the end of the round message respectively.)
>
> It seems to be draws, rather than wins/losses that cause the positions to
> change - I'm not sure - I can't work it out for the life of me!
>
> I wouldn't ask if I thought I could work it out but I've been staring at
> if
> for so long without success that I am starting to think it's something
> beyond my expertise! I'm only just starting out with PHP and am working my
> way through a SAMS book at the moment - any help you can give me would be
> greatly appreciated!
>
> The page is at http://www.tastymota.com/psr/index.php but I presume you
> need
> to see the code and as far as I know that means I have to post this
> http://www.tastymota.com/psr/files.zip?
>
> Many many thanks for ANY help anyone can give me! I know the logic and the
> layout of the site may still be teething but these layers are my bug of
> the
> moment!
>
> Thanks again,
>
> Dave
>
> PS. Good luck with the game!

let me introduce you to the switch statement.
switch($val) {
case 1:
do something;
break;
case 2: case 3:
do something;
break;
default: //optional
do something;
break;
}
you should be using this instead of those if statements. you will be much
less error-prone.
also, on an if statement,
if (cond) {
}
is sufficient.
if (cond) {
} else;
is not necessary.

if you really do want to do an else if, in some cases you should use }
elseif (cond) {

get yourself a copy of the Extended CHM Manual and go over the Language
section. there's a lot of neat stuff you can do in there.

also, if you have a lot of plain HTML to output, it not a good idea to use
echo to do it. it's actually faster (ane better) to escape out of the
interpreter like this ?> <form ... > <input ...> </form> <?php

the result.php in your root directory needed a space netween the attributes
of the img file.
you are also missing </div> elements.

//the following code does absolutely nothing. why is it here?
$_POST[$pl_points];
$_POST[$comp_points];
$_POST[$pl_count];
$_POST[$pl_target];

in the root index.php file, you are missing a } at the end. I figured out
where to put it.
I don't know which set of files you are using. the ones in vtrack or the
root files. I suspect the ones in vtrack because it looks like it wouldn't
give a parse error.

your xhtml is not compliant. esp. the <br> elements, which should be <br />
<b> has been deprecated and replaced with <strong>

on index.php with the first if statement, there is no guarantee that
$pl_target is set, is there? if not, you are going to get warnings at least
from the interpreter output to your browser. in this case, you should use
if (isset($pl_target)) { and do something appropriate, like bow out of
displaying those variables.

if I am correct, xhtml tags require a space before the />

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация