3 Replies - 576 Views - Last Post: 12 May 2010 - 10:23 PM Rate Topic: -----

#1 stshrive  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 26-January 10

E-Mail Form Help PHP

Posted 12 May 2010 - 09:33 PM

Hello Everyone,

I am attempting to create a website for a friend/attorney. I know html but have limited experience with php. I am trying to create a form for a person to fill out who desires a bankruptcy consultation. From reading on different places I seen that I need to use php. So here is the code I have

			<p align="left" class="bodytext">To get a FREE online bankruptcy consultation, please fill out and submit the following form. On the next business day, a secure link will be sent to your email address with a password to access our Free Online Bankruptcy Consultation Form.</p>
		
	<div class="tx-thmailformplus-pi1">

		
<form method="post" action="index.php" enctype="multipart/form-data" name="ContactForm" onsubmit="return formCheck();">
<input type="hidden" name="id" value="49">
<input type="hidden" name="submitted" value="1">
<input type="hidden" name="L" value="0">
<input type="hidden" name="type" value="">


<script type="text/javascript">
<!--

function formCheck()
  {
  ErrorMessage="";
  var failure = false;

  if (document.ContactForm.name.value.length==0)
    { ErrorMessage=ErrorMessage+'\"Contact Name\" is a required field.\n'; }
  if (document.ContactForm.phone.value.length==0)
    { ErrorMessage=ErrorMessage+'\"Phone Numbers\" is a required field.\n'; }
  if (document.ContactForm.email.value.length>0)
    {
    if (!addresscheck(document.ContactForm.email.value))
      { ErrorMessage=ErrorMessage+'\"E-mail Address\" must be a valid e-mail address.\n'; }
    }
  else
    { ErrorMessage=ErrorMessage+'\"E-mail Address\" is a required field.\n'; }

  if (ErrorMessage.length > 0) { window.alert(ErrorMessage); return false; }
  }

 //-->
</script>

<P>
<I>Input fields marked with an asterisk (*) are required fields.</I>
</P>
<P>
<TABLE><TR><TD VALIGN="TOP" ALIGN="RIGHT">

* Contact Name:
</TD><TD VALIGN="TOP" ALIGN="LEFT">
<INPUT TYPE="TEXT" NAME="name" VALUE="" SIZE="40">
</TD></TR>
<TR><TD VALIGN="TOP" ALIGN="RIGHT">
Address:
</TD><TD VALIGN="TOP" ALIGN="LEFT">
<TEXTAREA COLS="35" ROWS="5" NAME="address"></TEXTAREA>
</TD></TR>
<TR><TD VALIGN="TOP" ALIGN="RIGHT">
* Phone Numbers:
</TD><TD VALIGN="TOP" ALIGN="LEFT">
<TEXTAREA COLS="35" ROWS="5" NAME="phone"></TEXTAREA>
</TD></TR>
<TR><TD VALIGN="TOP" ALIGN="RIGHT">

* E-mail Address:
</TD><TD VALIGN="TOP" ALIGN="LEFT">
<INPUT TYPE="TEXT" NAME="email" VALUE="" SIZE="40">
</TD></TR>
<TR><TD VALIGN="TOP" ALIGN="RIGHT">
Nature of Your Request:
</TD><TD VALIGN="TOP" ALIGN="LEFT">
<TEXTAREA NAME="request" WRAP="hard" ROWS="5" COLS="35"></TEXTAREA>
</TD></TR>
<TR><TD VALIGN="TOP" ALIGN="RIGHT">
* Terms and Conditions:
</TD><TD VALIGN="TOP" ALIGN="LEFT">

<div style="margin: 0px; padding: 6px; border: 1px inset; width: 285px; max-width: 285px; height: 300px; text-align: left; overflow: auto">
I acknowledge that I am submitting 
the request for bankruptcy consultation 
with an attorney of Nye &amp; Associates, 
P.L.L.C, for the purpose of consultation 
only.  I understand that no attorney-client relationship is established unless 
I sign a separate agreement with the 
attorney.  For the consultation, the 
attorney will analyze my financial 
situation and explain my qualifications 
for relief under Bankruptcy Law.  I understand that, unless I sign an attorney 
retainer agreement, the attorney will 
take no further action on my behalf 
regarding any matter.  I realize the 
purpose of the consultation is only to 
make me familiar with possible rights, 
duties, liabilities, or other issues related 
to the matter I am seeking advice about.  
I realize that without actually retaining an 
attorney to represent me, there might 
be facts or other information which may 
affect any advice he or she may give me.  
I acknowledge that no representation or 
recommendations by the attorney during 
the consultation should be relied upon 
unless the attorney is retained in the 
matter. I understand that any information 
I tell or give the attorney is confidential 
and will not be disclosed without 
permission.  I also understand that if a 
third party is present during any consultation, then that third party may record 
disclosed information which I have disclosed during the consultation.  I 
acknowledge that the attorney has a 
separate legal duty to fully disclose my 
financial condition as required by 
Bankruptcy Law, and I will be truthful and 
candid during the consultation.  I 
acknowledge reviewing the <a href="http://www.nyelaw.org/527a.html">notice 
required by Section 527(a)</a> and <a href="http://www.nyelaw.org/527b.html">notice 
required by Section 527(B)/>.</a>

</div>
<BR>
<INPUT TYPE="checkbox"  NAME="notice" VALUE="agree"> I agree to the terms and conditions specified above.
</TD></TR>
</TABLE>
</P>
<P>
<I>We will use the information you provide us on this form to respond to your request and for no other purpose.</I>
</P>
<P>
<INPUT TYPE="SUBMIT" VALUE="Send">
</P>
</FORM>



Now. I think I may be able to figure out the actual program code from a snippet I found on this site...but I don't know how to reference it here. Is the reference already in there (index.php) or do I have to do something different. Thank You!

EDIT: Removed some code not needed

This post has been edited by stshrive: 12 May 2010 - 09:34 PM


Is This A Good Question/Topic? 0
  • +

Replies To: E-Mail Form Help PHP

#2 atik97  Icon User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Re: E-Mail Form Help PHP

Posted 12 May 2010 - 10:03 PM

The action attribute of <form> tag indicates the script which will process the form, in this case it is index.php. You may replace it with any other php script if you wish. However, that script should have the functionality to process the submitted data of the mail form.You have to use the method specified in the method attribute of <form> tag to retrieve the data submitted by the user. You will have following data available to your processing script-

$name=$_POST["name"];
$email=$_POST["email"];
...



Then you can use mail function to send the data obtained.

mail($to,$subject,$message);


This post has been edited by atik97: 12 May 2010 - 10:14 PM

Was This Post Helpful? 0
  • +
  • -

#3 Guest_shrive*


Reputation:

Re: E-Mail Form Help PHP

Posted 12 May 2010 - 10:20 PM

So would my index.php file just have programming code in it sending out an email? Or would it be another webpage?
Was This Post Helpful? 0

#4 atik97  Icon User is offline

  • ???
  • member icon

Reputation: 144
  • View blog
  • Posts: 715
  • Joined: 16-September 08

Re: E-Mail Form Help PHP

Posted 12 May 2010 - 10:23 PM

Yes, if index.php is set as the value of action attribute in <form> tag, then you need to put the code for sending email in it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1