PDA

View Full Version : I need PHP help (I'm willing to pay someone)



lilymc
November 11th, 2007, 04:24 AM
Hey you all. :) If anyone can help me, I just need to add a few fields and a checkbox to a quote form that is already made.

Let me know if you can help - for someone who is good at PHP, it probably won't take long. I can pay via paypal if you want.

thanks!

simplistik
November 11th, 2007, 10:15 AM
post up the form i'm sure someone will help, doesn't seem worth paying money IMO.

lilymc
November 15th, 2007, 07:59 AM
^ Thanks, I'll do that. There was someone who I thought was going to help with this, but I haven't heard back from him, so I really need to get some help... I can still pay someone for their time.

Here (http://businessnewsletterpress.com/quoteform2.html) is the temporary page the form is on. And the PHP is below... (it's not the whole thing, but the relevant part)

And what needs to be added is:

Company Name
Title
Logo Design Needed (this one needs to be a check box)


$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$pages = intval($_POST['pages']);
$images = intval($_POST['images']);
$written = intval($_POST['written']);
$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( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}

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

$messageproper =

"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"Number of pages: $pages\n" .
"Number of images: $images\n" .
"Number of original articles: $written\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;

mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
And here is the HTML... this part I do myself, but just in case you need it:


<form action="quoteform2.php" method="post" onSubmit="popupform(this, 'thankyou')">

<table width="458" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">Name:</td>
<td width="240">Comments or Special Requests:</td>
</tr>
<tr>
<td colspan="2"><input type="text" name="name" class="textfield"/></td>
<td rowspan="6"><textarea rows="15" cols="55" name="comments" class="messagefield"></textarea></td>
</tr>
<tr>
<td colspan="2">Email:</td>
</tr>
<tr>
<td colspan="2"><input type="text" name="email" class="textfield" /></td>
</tr>
<tr>
<td colspan="2"># of Original Articles:</td>
</tr>
<tr>
<td colspan="2"><input type="text" name="written" value="" class="numberfield"/></td>
</tr>
<tr>
<td width="109" height="15"># of Pages:</td>
<td width="109"># of Images:</td>
</tr>
<tr>
<td><input type="text" name="pages" value="" class="numberfield2"/></td>
<td><input type="text" name="images" value="" class="numberfield2"/></td>
<td align="right"><input name="submit" type="submit" value="Send"/>&nbsp;&nbsp;</td>
</tr>
</table>
</form>

simplistik
November 15th, 2007, 09:17 AM
in your php add


$company = $_POST['company'];
$title = $_POST['title'];
$logo = $_POST['logo'];

and


"Company of sender: $company\n".
"Title of sender: $title\n".
"Logo design: $logo\n".

in there proper places... it's self explainatory as they follow a pattern

then anywhere in your html you can add:


<input type="text" name="company" value="" />
<input type="text" name="title" value="" />
<input type="checkbox" name="logo" value="Yes" />

lilymc
November 15th, 2007, 11:16 PM
Thank you so much... I'll do that. I'll let you know how it goes.

thanks again!