Sheila,

I am at the stage a bit like the nascent swimmer made to take his feet off
the bottom;  I've done that and I still can't swim!   Hope to do better with
this ;-).

First the form.   This will - I haven't got to it - be called by a php
script so the php should be read then.   If not 'I'll be back'.

I follow the principle  of the isset code, but don't yet grasp the code
itself.   I don't know how much of the script to show you, but here is the
first twenty or so lines.   I have already needed to set the top variables
and have now changed the $_REQUEST back for you to see::

<?php
include $_SERVER['DOCUMENT_ROOT'].'/layout.php';
                       //set some variables
            $email_error = false;
            $password_error = false;

switch ($_REQUEST['req']) {
  case "process" : // code to process signup input and place in database

         myheader("Become a member: step 2");

         //Validate all required fields were posted
         if(!$_POST['first_name'] ||
              !$_POST['last_name'] ||
               !$_POST['email_address'] ||
              !$_POST['email_address2'] ||
              !$_POST['username'] ||
              !$_POST['password'] ||
              !$_POST['password2'] ||
              !$_POST['bio']){

          $error = true;
          $errors = "<h4>Form Input Errors:".
                                "</h4>\n\n";

                if (!$_POST['first_name']) {
                  $errors .= "Missing first Name\n";
            }
            if (!$_POST['last_name']) {
                   $errors .= "Missing Last Name\n";
            }

I also came across the point that use of $_REQUEST has security issues, but
imagine that is if it is overused rather than used where it is the best
option.

Joseph

> Bj wrote:
> > ----- Original Message ----- 
> > From: "Smile-Poet"
> >
> >
> >>The problem is that this (the 'value=""' ' entry) appears on the form:
> >>
> >><?=$_POST['last_name'];?>
> >
> >
> > This means php isn't seeing the page before it's sent to the browser.
> >
> > I bet you are running this on your local PC.  And I bet you are
> > double-clicking the shortcut to open it, or just putting the page
address
> > into the browser (file://C:/pages/mypage.htm style of thing), or
smething
> > instead of browsing http://localhost/mypage.htm, so that when it first
shows
> > up it isn't getting processed by the Web server and therefore the php is
> > being seen and displayed by the browser instead of being processed by
php.
> >
>
> The pages need to be .php not .htm in order to be processed by the PHP
> interpreter.
>
> >
> >>And, although the form code has this
> >>
> >><input name="req" type="hidden"  id="req" value="process" >
> >>
> >>and the script has this
> >>
> >>switch ($_REQUEST['req']) {
> >>
> >>I get an error message that 'req' is not defined.
> >
> >
> > Looks to me like a dumb mistake by the script author proving (s)he never
> > tested it after writing it..  Should be $_POST['req'] - there is no
REQUEST
> > set of variables in php.
> >
>
> $_REQUEST does exist.
>
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.request
>
> The script is complaining about $_REQUEST['req'] which does not exist
> the first time through unless you add it to the URL:
>
>     http://localhost/mypage.php?req=somevalue
>
> That's not the best solution. Better would be to test if
> $_REQUEST['req'] exists and assign a value to a variable based on the
> result.
>
>     if (isset($_REQUEST['req']) {
>        $myRequest = $_REQUEST['req'];
>     } else {
>        $myRequest = 'somevalue';
>     }
>
> Then change the switch variable
>
>     switch ($myRequest) {
>
> Note that 'somevalue' needs to be the actual value needed to make the
> form display empty.
>
> I hope all this makes sense. It would be easier to explain with more of
> the script to look at.
>
>
> Sheila


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to