You are here: Re: [PHP] Still struggeling with my first script... « PHP « IT news, forums, messages
Re: [PHP] Still struggeling with my first script...

Posted by Ben on 10/15/05 03:40

twistednetadmin said the following on 10/14/05 17:15:
> All: Sorry..... I forgot to write what's wrong....stupid me...
> Mike:1) I'm not sure how to indent the code...

By putting spaces in front of some of the lines, it will make your code
much easier to read and your life much, much easier. At its most basic
you want to group lines within braces using indents so that you can
easily tell what code is included in a particular loop/conditional
statement. Here's a totally nonsensical example:

<?php
if($this==$that) {
// This is that, do something
print("<p>This is equal to that</p>\n");

foreach($otherThing AS $key => $value) {
// Now we're looping through all the other things
if($value!=$that) {
print("<p>That's the wrong value!</p>\n");
}
}

// After looping through all the other things do something else here
print("<p>Finished with all those other things</p>\n");

}

else {
// This is NOT that
print("<p>This is not that... how was I to know?</p>\n");
}
?>


> 2) I'm using Dreamweaver, but not to write the code for me. I'm not that
> lazy :). And that's not the way for me to learn.
> It's just rather annoying that all the tutorials I have tried seems to fail.
> How can I learn when I'm apparently given the wrong information.

Are you 100% certain that your php install is working properly? What
error messages are you receiving?

Make a page with only the following:

<?php phpinfo(); ?>

What do you see when you open it?

- Ben

 

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

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