Re: Problem with a script



Jerim79 wrote:
Here it is:

<?php

if($_SERVER['REQUEST_METHOD']=='POST'){

[snip]

If you know of a way to make the current code work, or if you have a
better idea of how to do this from top to bottom, please let me know.
I would like to also be able to carry over the user's selections, so
that they don't have to recheck each box, if they only left off one.

I don't mean to offend you or discourage you from working with PHP, but:
The way you coded the posted script gives me the impression you haven't
yet grasped and practiced with the basic building blocks of PHP or maybe
even programming in general. (See Rami's comments)

Reworking your huge script into something concise, correct and 'a common
sense coding practise' would probably result in a script hardly
comparable to yours, rendering it mostly useless as a learning
possibility. Commenting/correcting on a line by line basis would require
a post a mile longer than your is already.

If all you really want is a fix for a specific detail, give us only that
and leave out the rest.

Personally I think you may be helped more by leaving this spaghetti for
later, and start getting to grips with PHP's building blocks first. Get
a good (e-)book or tutorial site and begin with short examples and
experiments that help you understand the concepts and PHP's way of doing
things. I know they say PHP has a short learning curve, and compared to
some/many other languages it probably does, but trying to sail even the
simplest boat before you know bow from stern is not advisable.

If I am completely off the mark here, I'm sorry. I just can't find
anything in this post that proves me wrong.

Which books/sites are good/great/rubbish is mainly a subjective choice.
O'Reilly has a few that match MY taste, some are fond of the YOU-NAME-IT
for Dummies approach, others prefer a really dry & theoretical but very
exhausting summary. The pick is yours!

GL.

Sh.



.



Relevant Pages

  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... This is why I am thinking about rewriting my whole script in a C language. ... Perhaps there are different methods I could be using to speed up execution. ...
    (php.general)
  • Re: How to Add a Feeback Form
    ... I saw nothing in that script that indicates where the form is e-mailed to so ... Greg Maxey/Word MVP ... PHP or not. ... have the support available yet. ...
    (microsoft.public.frontpage.programming)
  • How best to show PHP source? (was: One page, multiple submit buttons)
    ... script to add to the top of a PHP script to enable showing its ... Maybe anybody submitting their own PHP code for critique here ... Anything posted to a newsgroup is a "snapshot" of what the ... there ought to be a FAQ for this ...
    (comp.lang.php)
  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... thinking about rewriting my whole script in a C language. ... execution of the code. ...
    (php.general)
  • Email form script
    ... I have a web form that posts to a .php ... who cannot run .php on their server. ... Or does anyone have a .asp script that will ... Thank you for choosing FormToEmail by FormToEmail.com ...
    (microsoft.public.scripting.jscript)