Re: Couple of questions form a PHP newbie
| From: | Jonathan Villa | Date: | Sat, 12 Jul 2003 01:19:39 +0000 |
| Subject: | Re: Couple of questions form a PHP newbie | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154945@lists.php.net to get a copy of this message | ||
1. Text file or DB
My answer -> Learn how to use a database, it will make things much
easier
2. Checkbox
Try this:
<input type="checkbox" name="sports[]" value="Baseball">
<input type="checkbox" name="sports[]" value="Basketball">
<input type="checkbox" name="sports[]" value="Football">
<input type="checkbox" name="sports[]" value="Handballball">
then after submission, you could do the dump, or
foreach ($_POST["sports"] as $val)
echo $val;
On Fri, 2003-07-11 at 20:10, Jason Giangrande wrote:
> First question: I'm creating a custom content manager for a small
site.
> It will basically be used to store short articles (several paragraphs
> each). Now my question is, is storing these to a text file going to
> work or am I going to have problems later on when the file gets to be
a
> reasonable size. I ask this, because the only way I can seem to work
> with the text file is to read the entire file in and alter it that
way.
> Are there any ways to edit or remove one line of a text file without
> having to read the entire file first? Would I be better off using a
> database instead of a text file (keep in mind that I know nothing
about
> databases)?
>
> Question two: I've read in several books that html checkbox forms can
> pass multiple values to the server when more than one check box is
> selected if they have the same name. However, when I var_dump the
> $_POST variable that should contain them I only get one value. Anyone
> have any ideas why?
>
> Regards,
> Jason Giangrande
>