Jump to content

Can any PHP guru point me in the right direction. Thanks.


Onzeon

Recommended Posts

I've been at this for days, and the more I read the more confusing it gets.

What I want to achieve is: I have a XHTML form with 5 user input fields - These are:

 

name

subject

cust_email

telephone

details

 

I need to create a PHP script that will on user click - submit a email that has this format (secured if possible:

 

From= cust_email

 

Subject= "Customer requested information on" +subject

 

eMail body= name + "requests information on" + subject

/n

+ details

/n

+ "Contact information"

/n

+telephone

+email.

 

So the body would look some how like this:

 

Jane Smith requests information on Botox

 

Hello I'm interested in botox injections please contact me with pricing and availability. Thank you.

 

Contact information.

(888)555-1212

Jsmith@hotmail.com

 

Can you or anyone of the users in this wonderful forum HELP. I'm a print designer and I can assist you guys with anything you may need in print. But web is all to new and I'm struggling.

Thank you, thank you very much.

 

Link to comment
Share on other sites

From just looking at what you're typing. To create those 'carrage returns' and 'line feeds' you use "\n\r" your slashes are backwards.

 

Alternatively you can just Google "free contact form" and find a ton of them for free without having to know a bit of PHP.

Link to comment
Share on other sites

Thank you for your quick reply: Here is the HTML form:

 

<form action="send_contact.php" method="post" enctype="multipart/form-data" id="ContactForm">

  <div class="container">

                                <div class="col-1">

                                    <label>

                                    <strong>Name:</strong><br />

                                    <input type="text" name="name" id="name" class="input" />

                                    </label>

                                                                        <label>

                                    <strong>Subject:</strong><br />

                                    <input type="text" name="subject" id="subject" class="input" />

                                    </label>

                                    <label>

                                    <strong>E-mail:</strong><br />

                                    <input type="text" name="email" id="customer_mail" class="input" />

                                    </label>

                                    <label>

                                    <strong>Telephone:</strong><br />

                                    <input type="text" name="telephone" id="telephone" class="input" />

                                    </label>

                                </div>

                                <div class="col-2">

                              <strong>Write your details here.</strong><br />

                                    <textarea name="detail" cols="10" rows="10" id="detail"></textarea>

                                </div>

                        </div>

                            <div class="container">

                            <div class="right">

                                <a href="#" class="link" onclick="document.getElementById('ContactForm').reset()"><span><span>Limpar</span></span></a>

                                    <a href="#" class="link" onclick="document.getElementById('ContactForm').submit()"><span><span>Enviar</span></span></a>

                                </div>

                            </div>

              </form>

 

AND HERE IS MY 1st LAME ATTEMPT AT A PHP Script.

 

<?php

// Enter your email address

$to ='onzeon@me.com';

 

// Name

$name = $_POST['name'];

// Details

$message = $_POST['message'];

// Mail of sender

$email = $_POST['email'];

 

$body = "$name "sent you a message": $message";

 

$send_contact=mail($to,$subject,$detail,$header);

 

// Check, if message sent to your email

// display message "We've recived your information"

if($send_contact){

echo "We received you email, Thank you";

}

else {

echo "ERROR";

}

?>

 

SO I GAVE UP ON THAT ONE AND MY 2nd LAME ATTEMPT AT A PHP Script.

 

<?php

// Contact subject

$subject ="$assunto";

// Details

$message="$detail";

// Name

$name="$name";

 

// Mail of sender

$mail_from="$customer_mail";

// From

$header="from: $name <$mail_from>";

 

// Enter your email address

$to ='nuamces@nuamces.com.br';

 

$send_contact=mail($to,$subject,$message,$header);

 

// Check, if message sent to your email

// display message "We've recived your information"

if($send_contact){

echo "We received you email, Thank you";

}

else {

echo "ERROR";

}

?>

ANY HELP IS APPRECIATED>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.