Yeah I had it set up from the start..

PilotID
with Auto increment..

Scott

    try this
    remember to change connect info

      When I try it now I get a parse error on line 120

          $mail .= "<b>$key</b>: ".nl2br($value)." <br>";
      

        on the end of line 118

        change the " to '' (double quote to 2 single quotes)

          here is what I have:

          echo 'Your Pilot ID# is XYZ'.$PilotID.";
          foreach ($_POST as $key => $value){
              $mail .= "<b>$key</b>: ".nl2br($value)." <br>";
          }
          $mail .= "
          

          I didnt know if that was for the <br> or for a different line

            echo 'Your Pilot ID# is XYZ'.$PilotID.''; //CHANGE 
            foreach ($_POST as $key => $value){ 
                $mail .= "<b>$key</b>: ".nl2br($value)." <br>"; 
            } 
            $mail .= "
            

            only change was making the double quote after $PilotID." into two single quotes $PilotID.''

              ok filled out the form and it all worked but the id never changed..
              and the email didnt have the ID in it at all..

              Here is the page to see the results of the DB..

              http://panamva.com/test2.php

                what are all fields in the database table, and what order

                spelling and capitalization counts!

                🙂

                  rewrote a couple lines

                  try this and let me know if it works

                  also, when you call the information

                  use stripslashes for the fields i added them in

                    Parse error: parse error, expecting T_VARIABLE' or'$'' in /home/httpd/vhosts/panamva.com/httpdocs/form1.php on line 93

                    here is my line 93:

                    $fullname = addslashes(&_POST['fullname'];)
                    

                      move the ; to the outside of the ) sorry

                      on all lines with the addslashes

                        Same thing...
                        Same error:

                        panamva.com/form1.php

                        thanks
                        Scott

                        I appreciate your troubles with this

                          lines 93 - 101

                          $fullname = addslashes($_POST['fullname']);
                          $state = addslashes($_POST['state']);
                          $country = addslashes($_POST['country']);
                          $email = $_POST['email'];
                          $passwd = $_POST['passwd'];
                          $birthdate = addslashes($_POST['birthdate']);
                          $vatsim = addslashes($_POST['vatsim']);
                          $bviaccount = addslashes($_POST['bviaccount']);
                          $hub = addslashes($_POST['hub']);

                            Thank you,

                            form and email work, no PilotID..

                            hmmm I hope you realize I appreciate your help.
                            SCott

                              replace this

                              Here are the contents of the form:<br /><br />
                              Your Pilot ID# is XYZ'.$PilotID.'<br >/";

                              already edited, just replace the 2 lines that this covers

                                Question:

                                Do you want the ID to always contain four numbers.

                                For example, which is more correct:

                                xyz0001
                                xyz1

                                Because at the moment, you will get the later.

                                I saw this:

                                echo 'Your Pilot ID# is XYZ'.$PilotID.''; //CHANGE 
                                

                                Woud it not be better to change it to.

                                echo 'Your Pilot ID# is XYZ'.$PilotID; //CHANGE 
                                

                                The ending '' provided no output, and so were pointless.

                                Also, why not check the setting of magic_quotes_gpc before actually add slashes to the $_POST variables, otherwise they may get slashed twice. Maybe something like this:

                                <?php
                                // No support for multi-dimensional arrays (because probably not needed, easy to add if it is)
                                // Pass variable by reference.
                                function slashit(&$variable)
                                {
                                    if(!magic_quotes_gpc())
                                    {
                                        if(is_array($variable))
                                        {
                                            while(list($key,$value) = each($variable))
                                            {
                                                $variable[$key]=addslashes($value);
                                            }
                                            @reset($variable);
                                        }
                                        else
                                        {
                                            $variable=addslashes($variable);
                                        }
                                    }
                                }
                                
                                // Example
                                slashit($_POST);
                                ?>
                                

                                Also, $PilotID is an uninitialized variable - I think that is a mistake (and a security concern).

                                The format of the ID is only for show, there is no effect to the database. Is this what you want?

                                  4 days later

                                  Sorry it took so long to get back to you, I had to fly out of state for a family funeral. I will see if I can check this out today and see what I can get to work..

                                  thanks
                                  Scott

                                    Hey Guys (gals)
                                    I'm still stuck on this.. anyone have any other ideas..?

                                    thanks
                                    Scott

                                      tested, fully functional

                                      works on my home database, hope it does for you as well

                                      if you change name of form1.php, make sure you change the <form action>

                                      enter your database information