PDA

Click to See Complete Forum and Search --> : TOTALLY stuck on php/forms. Please help!!


grynch
11-01-2004, 11:34 PM
Hi guys. I have created a form on my site:
www.vistaone.ca/order.htm (http://www.vistaone.ca/order.htm)
I am reading up on php and trying to figure out how to get it so people can fill in this form and the info will be emailed to me. I just can't figure it out. I have been refered to some php reading on the web which I am doing. In the meantime we are losing business because I can't get the damn form working!
Is it possible for someone to walk me thru exactly what to do? My dad sent me a php tag and told me to upload it to my site, which I did. It is here:
www.vistaone.ca/phpinfo.php (http://www.vistaone.ca/phpinfo.php)
This means nothing to me. Where do I put this file? How do I tie it into the form itself? I am SO LOST!!!!
ANY help would be greatlt appreciated. I intend to read into it and learn what is actually happening so I can figure it out for myself. But in the meantime a quick fix would just rock.
Thank you!

Big Perm-dizzle
11-01-2004, 11:55 PM
on my site this is named printquotescript.php
<?php

// headers for the email listed below

$headers .= 'From: $name <$email>\n'; // your email client will show the person's email address like normal
$headers .= 'Content-Type: text/plain; charset=iso-8859-1\n'; // sets the mime type
$recipient = 'sales@conceptprint.com, design@conceptprint.com'; // enter YOUR email address here
$subject = 'Quote for a Printing Project'; // this is the subject of the email

$msg = wordwrap( $msg, 1024 );
$msg .= ' \nPhone: ' . $phone;
$msg .= ' \nCompany Name: ' . $company;
$msg .= ' \nHow will the artwork be delivered?: ' . $artwork;
$msg .= ' \nPrinted Quanity: ' . $quanity;
$msg .= ' \nhow many colors needed: ' . $colors;
$msg .= ' \nPMS colors needed: ' . $PMS;
$msg .= ' \nWhat kind of Paper? Weight?: ' . $paper;
$msg .= ' \nSpecial Paper Instructions: ' . $instructions;
$msg .= ' \nIs Binding needed?: ' . $binding;
$msg .= ' \nIf yes, what kind of binding?: ' . $bindingkind;
$msg .= ' \nVarnish or Metallic Ink: ' . $varnish;
$msg .= ' \nDocument size (folded): ' . $folded;
$msg .= ' \nDocument size (unfolded): ' . $unfolded;
$msg .= ' \nWill this project be shipped?: ' . $shipped;
$msg .= ' \nIf yes, please specify the address : ' . $address;
$msg .= ' \nMisc Job info and Instructions: ' . $specialinstructions;


mail($recipient, $subject, stripslashes($msg), $headers); // the mail() function sends the message to you

//Once the data is entered, redirect the user to give them visual confirmation
header('location: printquotethanks.php');
?>

www.hirethisdesigner.com (http://www.hirethisdesigner.com) - portfolio
www.conceptprint.com (http://www.conceptprint.com) - the company I work for

Big Perm-dizzle
11-01-2004, 11:57 PM
then make the form part of printquote.php


<form name='form' method='post' action='printquotescript.php'>
<table width='419' height='450' border='0' align='center' cellpadding='4' cellspacing='2' bgcolor='#FFFFFF' summary=''>
<tr align='center' valign='middle' bgcolor='#999999'>
<td height='124' colspan='2'> <h1></h1>
<table width='100%' border='0' cellspacing='3' cellpadding='0'>
<tr>
<td height='50' valign='bottom'> <h1 align='center'><font color='#FFFFFF'>Please
fill in all text fields and give us

as much info as you can on your project.</font></h1>
<h1 align='center'><font color='#FFFFFF'>(if you are
unsure about your job please just leave that area
blank)</font></h1>
<h1 align='center'><font color='#FFFFFF'>Thanks, Concept's
Sales Department</font></h1></td>
</tr>
</table>
<h1></h1></td>
</tr>
<tr>
<td width='190' valign='top' align='right'> <h1></h1></td>
<td width='215' valign='top' align='left'> <h1> </h1></td>
</tr>
<tr>
<td width='190' valign='middle' align='right'> <h1 align='left'>Full
Name:<font color='#FF0000'>*</font></h1></td>
<td width='215' valign='top' align='left'> <h1 align='left'>
<input type='text' name='name' size='25' maxlength='200' />
</h1></td>
</tr>
<tr>
<td width='190' valign='middle'> <h1 align='left'>Email Address:<font color='#FF0000'>*</font></h1></td>
<td width='215' valign='top' align='left'> <h1 align='left'>
<input type='text' name='email' size='25' maxlength='100' />
</h1></td>
</tr>
<tr>
<td width='190' valign='middle'> <div align='left'>
<h1>Telephone:<font color='#FF0000'>*</font></h1>
</div></td>
<td valign='top' align='left'><div align='left'>
<input name='phone' type='text'size='25' maxlength='100' />
</div></td>
</tr>
<tr>
<td width='190' valign='middle'> <div align='left'>
<h1>Company Name:<font color='#FF0000'>*</font></h1>
</div></td>
<td valign='top' align='left'><div align='left'>
<input name='company' type='text'size='25' maxlength='100' />
</div></td>
</tr>
<tr>
<td width='190' height='35' valign='middle'> <h1>

</h1></td>
<td height='35' align='left' valign='top'></td>
</tr>
<tr>
<td valign='middle'> <h1>If yes, how will the artwork be supplied
to us? </h1></td>
<td valign='middle' align='left'><h1>
<input <?php if (!(strcmp('BY CD','yes'))) {echo 'CHECKED';} ?> type='radio' name='artwork' value='by CD'>
CD
<input <?php if (!(strcmp('C/R Art','yes'))) {echo 'CHECKED';} ?> type='radio' name='artwork' value='C/R Art'>
C/R Art
<input <?php if (!(strcmp('BY FTP','yes'))) {echo 'CHECKED';} ?> type='radio' name='artwork' value='By FTP'>
FTP</h1></td>
</tr>
<tr>
<td valign='middle'> <h1>Number of Pages in the document?</h1></td>
<td valign='middle' align='left'> <h1>
<input name='pages' type='text' 'size='8' maxlength='8' />
</h1></td>
</tr>
<tr>
<td valign='middle'> <h1>Quanity Desired</h1></td>
<td valign='middle' align='left'><h1>
<input name='quanity' type='text' 'size='12' maxlength='12' />
</h1></td>
</tr>
<tr>
<td valign='middle'> <h1>Number of Colors - please specify the PMS numbers</h1></td>
<td valign='middle' align='left'> <h1>
<select name='colors'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
</select>
<input name='PMS' type='text' 'size='18' maxlength='20' />
</h1></td>
</tr>
<tr>
<td valign='middle'> <h1>What kind of Paper? Weight?</h1></td>
<td align='left' valign='middle'><h1>
<input name='paper' type='text' 'size='25' maxlength='100' />
</h1></td>
</tr>
<tr>
<td valign='middle'><h1>Special Paper instructions</h1></td>
<td align='left' valign='middle'><textarea name='instructions' cols='24' rows='5' wrap='PHYSICAL'></textarea></td>
</tr>
<tr>
<td valign='middle'> <h1>Is Binding needed?</h1></td>
<td><h1>
<input <?php if (!(strcmp('Is binding needed?','yes'))) {echo 'CHECKED';} ?> type='radio' name='binding' value='yes'>
Yes
<input <?php if (!(strcmp('Is binding needed?','no'))) {echo 'CHECKED';} ?> type='radio' name='binding' value='no'>
No</h1></td>
</tr>
<tr>
<td valign='middle'> <h1>If yes, what kind of binding?</h1></td>
<td valign='top' align='left'><input name='bindingkind' type='text' 'size='25' maxlength='100' /></td>
</tr>
<tr>
<td valign='middle'> <h1>Varnish or Metallic Ink</h1></td>
<td valign='middle' align='left'><h1>
<input <?php if (!(strcmp('Varnish','yes'))) {echo 'CHECKED';} ?> type='radio' name='varnish' value='yes'>
Yes
<input <?php if (!(strcmp('Varnish','no'))) {echo 'CHECKED';} ?> type='radio' name='varnish' value='no'>
No</h1></td>
</tr>
<tr>
<td valign='middle'> <h1>Document size (folded)</h1></td>
<td><input name='folded' type='text' 'size='15' maxlength='15' /></td>
</tr>
<tr>
<td valign='middle'> <h1>Document size (unfolded)</h1></td>
<td valign='top' align='left'><input name='unfolded' type='text' 'size='15' maxlength='15' /></td>
</tr>
<tr>
<td valign='middle'> <h1>Bleeds</h1></td>
<td valign='top' align='left'><h1>
<input <?php if (!(strcmp('Bleeds:','yes'))) {echo 'CHECKED';} ?> type='radio' name='bleeds' value='yes'>
Yes
<input <?php if (!(strcmp('Bleeds:','no'))) {echo 'CHECKED';} ?> type='radio' name='bleeds' value='no'>
No</h1></td>
</tr>
<tr align='center'>
<td align='left' valign='middle'> <h1>Will this project be shipped?</h1></td>
<td align='left' valign='middle'> <h1>
<input <?php if (!(strcmp('Shipped:','yes'))) {echo 'CHECKED';} ?> type='radio' name='shipped' value='yes'>
Yes
<input <?php if (!(strcmp('Shipped:','no'))) {echo 'CHECKED';} ?> type='radio' name='shipped' value='no'>
No</h1></td>
</tr>
<tr align='center'>
<td align='left' valign='middle'><h1>If yes, please specify
the address </h1></td>
<td align='left' valign='middle'><textarea name='address' cols='24' rows='4'></textarea></td>
</tr>
<tr align='center'>
<td align='left' valign='middle'> <h1>When is this project deadline?</h1></td>
<td align='left' valign='middle'> <h1>
<input name='deadline' type='text' 'size='15' maxlength='15' />
</h1></td>
</tr>
<tr align='center'>
<td align='left' valign='middle'> <h1>Misc Job info and Instructions</h1></td>
<td align='left' valign='middle'> <textarea name='specialinstructions' cols='24' rows='5' wrap='PHYSICAL'></textarea></td>
</tr>
<tr align='center'>
<td colspan='2' valign='top'><h1>

Concept has a full staff of graphic designers

availiable for an additional charge.



</h1></td>
</tr>
<tr align='center'>
<td colspan='2' valign='top'> <input type='submit' name='Submit2' value='Submit'/>
<input type='reset' name='Reset2' value='Reset' /> </td>
</tr>
</table>
</form>

www.hirethisdesigner.com (http://www.hirethisdesigner.com) - portfolio
www.conceptprint.com (http://www.conceptprint.com) - the company I work for

Big Perm-dizzle
11-01-2004, 11:58 PM
once the form is processed then it will send the viewer to printquotethanks.php so you will need to have that setup too

www.hirethisdesigner.com (http://www.hirethisdesigner.com) - portfolio
www.conceptprint.com (http://www.conceptprint.com) - the company I work for

Benjamin
11-02-2004, 02:48 AM
The key thing to remember is that you have 3 main things going on here.

(1) The form is in html and draws the text boxes etc for them to put their input in.
(2) Then you need a bunch of code to retrieve that info from the form when they press 'send'. This is usually done by using the POST method.
(3) Finally the PHP function 'mail' actually sends off the email.

The tricky part to get your head round is that the main script is usually called twice. The first time it only draws the form and the second time it does the processing, but will repeat the form if there was some missing information.

http://www.jackfruitdesign.com/
Om Namah Shivaya