# Can someone help me with this PHP form?

**URL:** <https://forum.kirupa.com/t/can-someone-help-me-with-this-php-form/238425>\
**Category:** programming\
**Created:** [September 11, 2007, 8:59am UTC](https://forum.kirupa.com/t/can-someone-help-me-with-this-php-form/238425 "2007-09-11T08:59:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilymc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lilymc/32/3676_2.png) [@lilymc](https://forum.kirupa.com/u/lilymc)\
**Post date:** [September 11, 2007, 8:59am UTC](https://forum.kirupa.com/t/can-someone-help-me-with-this-php-form/238425/1 "2007-09-11T08:59:25Z")

</div>

For a website I’m working on I need to create a quote request form. So I got a script for a basic PHP/feedback form and I’m just trying to add some additional fields.

I know it’s not that difficult, and I could probably figure it out myself with enough time 😊 … but if someone could help with this, it would be a lot quicker, and I’d really appreciate it.

Here’s the code the way it is now:

```php
<?
// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;

$mailto = 'me@myemail.com' ;

// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;

$subject = "Quote Form Reply" ;

// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;

$formurl = "http://www.starryskymedia.com/bnp/index.html" ;
$errorurl = "http://www.starryskymedia.com/bnp/error.html" ;
$thankyouurl = "http://www.starryskymedia.com/bnp/thankyou.html" ;

$uself = 0;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$headersep = (!isset( $uself ) || ($uself == 0)) ? "
" : "
" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
    header( "Location: $formurl" );
    exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
   header( "Location: $errorurl" );
   exit ;
}
if ( ereg( "[
]", $name ) || ereg( "[
]", $email ) ) {
    header( "Location: $errorurl" );
    exit ;
}

if (get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
}

$messageproper =

    "This message was sent from:
" .
    "$http_referrer
" .
    "------------------------------------------------------------
" .
    "Name of sender: $name
" .
    "Email of sender: $email
" .
    "------------------------- COMMENTS -------------------------

" .
    $comments .
    "

------------------------------------------------------------
" ;

mail($mailto, $subject, $messageproper,
    "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;

?>

```

The additional fields I want to add are:[LIST]  
[_]Number of Pages?  
[_]Number of Images?  
[\*]Will You Need BNP to Write Original Content?[/LIST]It might be better to have a drop-down box with numbers, but if that’s too much trouble, then never mind.

I don’t want to mess it all up, so if you could just show me where/what to add exactly, that would be great.

thank you!!
