[thelist] PHP Mail variables?

Waller, Rio RWaller at fresno.ca.gov
Mon Dec 10 11:31:29 CST 2001


Hello Everyone,

I have built a basic html form for capturing data from the user.  I use two
forms:  The first form has all the javascript validation and it posts to the
Second Form that allows for the user to review their input.  In the second
form I have an action on the submit that will email the form information
once the user click submit, here is the code that:

    <?php
        if ($action == "send_mail") {
        Construct message from the form variables
        mail("sales at mydomain.com", "Online Form", $message) }
    ?>
        Thanks for  your business!

     <?php
        } else {
     ?>
        Display Form
     <?
        }
     ?>

What is so strange is that the variables that built the email message seem
to drop anything after the first space.  For example one field is company
name here is the code on the second form.

<?php echo $Company;?>
<input type="hidden" name="Company" value=<?=$Company?>>

So if you put "My Web Design" in the field you only get "My" in the email?

I was wondering about the scope of the form variables...I used hidden field
to make sure I have them defined on the second form.  I tired to use
different variable name but that didn't work either. If anyone can shed some
light on this I would be SO grateful!

Rio :-)
WebPerson
http://www.FresnoHumanServices.org <http://www.FresnoHumanServices.org> 






More information about the thelist mailing list