Free Web Hosting Forum
(#1 (permalink))
Old
blackdogruns's Avatar
Member
blackdogruns is an unknown quantity at this point
 
Posts: 75
Join Date: Dec 2011
Location: Salem, Oregon
Arrow Php send mail form - 05-01-2012, 03:39 PM

Just having some issues with this form that will be used to send contact e-mails.

Here is my form.

HTML Code:
    <div id="popupContact">  
        <a id="popupContactClose">x</a>  
        <h1>Contact an Advisor</h1>  
        <p id="contactArea">  
       <form action="http://www.chspanthers.org/studentlife/popup_files/send_mail.php" method="post" name="form 1">
       <!-------------------------LINE 1 ------------------------->
       Select who you want the e-mail to go to: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Enter your contact e-mail:<br>
       <select name="reciever" class="input">
       <option>"Amanda Laister - Community Service Club"&lt;alaister@central.k12.or.us&gt </option>
       <option>"Jake Herbert - Film Club"&lt;jherbert@central.k12.or.us&gt </option>
       <option>"Adil Abounadi - International Club" &lt;abounadi@central.k12.or.us&gt </option>
       <option>"Amanda Laister - Spanish Club" &lt;alaister@central.k12.or.us&gt </option>
       <option>"Keith Omlid - Ping Pong Club" &lt;komlid@central.k12.or.us&gt </option>
       <option>"Patti Youngren - Ski Club" &lt;pyoungren@central.k12.or.us&gt </option>
       <option>"Kurt Neville - FFA" &lt;kneville@central.k12.or.us&gt </option>
       <option>"Rachel Duncan - GSA" &lt;alaister@central.k12.or.us&gt </option>
       <option>"Rachel Duncan - National Honor Society" &lt;alaister@central.k12.or.us&gt </option>
       <option>codedestroyer504@gmail.com</option>
       </select>
       <input name="sender" type="text" maxlength="50" class="input" value="superexample@domain.com" size="30">
       <!--------------------NEXT LINE----------------------------->
       <center><img src="../studentlife/popup_files/tile.JPG"></center>
       Your Name: <input name="name" type="text" maxlength="20" class="input" value="(/._.)/ flip the table!" size="30"> | Student<input name="type" type="radio" value="student" class="input" />| Parent<input name="type" type="radio" value="parent" class="input">| Teacher<input name="type" type="radio" value="teacher" class="input">| Other<input name="type" type="radio" value="other" class="input">|
        <!--------------------NEXT LINE----------------------------->
       <center><img src="../studentlife/popup_files/tile.JPG"></center>
       Message:<br>
       <textarea name="says" cols="82" rows="7" class="input">This is where you will type your message. Please use this with care, do not spam.</textarea>
       <a href="javascript: submitform()"><input name="submit" type="button" value="Send e-mail" class="button"></a>
       </form>
    </div>  
    <div id="backgroundPopup"></div>
And here's my php.

PHP Code:
<?php
$reciever 
$_REQUEST['reciever'];
$name $_REQUEST['name'];
$email $_REQUEST['sender'];
$type $_REQUEST['type'];
$messagetext $_REQUEST['says'];


$subject $name "clubs" ;
$message "This is an e-mail sent from the clubs and organisations page on the CHS website. The form was created by Ryan Pointer. If you have any questions, please contact him.(me)
From: {$name} 
E-mail: {$email}
Type: {$type}
message: {$messagetext}"
;

if(
mail($reciever$subject$message"From:" $email PHP_EOL)){
    echo 
'Hello $name Thank you for filling out my mail form<br> An e-mail has' ;
    echo 
'been dispatched to the advisor and they will reply shortly to your e-mail, $email ';
    echo 
'Have a nice day <br>';
}else{
    echo 
'There has been an internal server error. Please try again later.';

?>
Not really sure what's wrong. Anything helps.
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
blackdogruns's Avatar
Member
blackdogruns is an unknown quantity at this point
 
Posts: 75
Join Date: Dec 2011
Location: Salem, Oregon
Default 05-01-2012, 03:40 PM

The page I'm working with is:

http://www.chspanthers.org/studentli...r_testing.html


Clicking on the first advisors name will trigger the form.

Last edited by blackdogruns; 05-01-2012 at 03:40 PM. Reason: forgot part of it
Reply With Quote
(#3 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,528
Join Date: Jul 2009
Location: Spain
Default 05-01-2012, 04:46 PM

Can you give the address of the website with the form?
To start, I would try changing the following on the file with PHP code:


PHP Code:
<?php
if (isset($_POST['reciever'])) 
    
$reciever $_POST['reciever'];
else 
$reciever "No data";

if (isset(
$_POST['name'])) 
    
$name $_POST['name'];
else 
$name "No data";

if (isset(
$_POST['sender'])) 
    
$email $_POST['sender'];
else 
$email "No data";

if (isset(
$_POST['type'])) 
    
$type $_POST['type'];
else 
$type "No data";

if (isset(
$_POST['says'])) 
    
$messagetext $_POST['says'];
else 
$messagetext "No data";


$subject $name "clubs" ;
$message "This is an e-mail sent from the clubs and organisations page on the CHS website. The form was created by Ryan Pointer. If you have any questions, please contact him.(me)
From: {$name} 
E-mail: {$email}
Type: {$type}
message: {$messagetext}"
;

if(
mail($reciever$subject$message"From:" $email PHP_EOL)){
    echo 
'Hello $name Thank you for filling out my mail form<br> An e-mail has' ;
    echo 
'been dispatched to the advisor and they will reply shortly to your e-mail, $email ';
    echo 
'Have a nice day <br>';
}else{
    echo 
'There has been an internal server error. Please try again later.';

?>


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma
Reply With Quote
(#4 (permalink))
Old
blackdogruns's Avatar
Member
blackdogruns is an unknown quantity at this point
 
Posts: 75
Join Date: Dec 2011
Location: Salem, Oregon
Cool 05-02-2012, 03:20 PM

Quote:
Originally Posted by d3iti View Post
Can you give the address of the website with the form?
To start, I would try changing the following on the file with PHP code:


PHP Code:
<?php
if (isset($_POST['reciever'])) 
    
$reciever $_POST['reciever'];
else 
$reciever "No data";

if (isset(
$_POST['name'])) 
    
$name $_POST['name'];
else 
$name "No data";

if (isset(
$_POST['sender'])) 
    
$email $_POST['sender'];
else 
$email "No data";

if (isset(
$_POST['type'])) 
    
$type $_POST['type'];
else 
$type "No data";

if (isset(
$_POST['says'])) 
    
$messagetext $_POST['says'];
else 
$messagetext "No data";


$subject $name "clubs" ;
$message "This is an e-mail sent from the clubs and organisations page on the CHS website. The form was created by Ryan Pointer. If you have any questions, please contact him.(me)
From: {$name} 
E-mail: {$email}
Type: {$type}
message: {$messagetext}"
;

if(
mail($reciever$subject$message"From:" $email PHP_EOL)){
    echo 
'Hello $name Thank you for filling out my mail form<br> An e-mail has' ;
    echo 
'been dispatched to the advisor and they will reply shortly to your e-mail, $email ';
    echo 
'Have a nice day <br>';
}else{
    echo 
'There has been an internal server error. Please try again later.';

?>
The site is http://www.chspanthers.org/studentli...r_testing.html

It is in a jquery popup. Click the first advisor to trigger the popup.
Reply With Quote
(#5 (permalink))
Old
blackdogruns's Avatar
Member
blackdogruns is an unknown quantity at this point
 
Posts: 75
Join Date: Dec 2011
Location: Salem, Oregon
Default 05-02-2012, 03:29 PM

For the most part, the form isn't even submitting. I've tried submitting the form using javascript but even that doesn't work.

For instance, usually i would use a general submit button.

[HTML]<input name="submit" type="button" value="Send e-mail" class="button">[HTML]

But then i tried js.

so....

<script type="text/javascript">
function submitform()
{
document.forms["myform"].submit();
}
</script>

And then <a href="javascript: submitform()">Submit</a>


I'm sure the php works, i've used it many times before. Even so, I implemented what you have posted. The form just won't submit.
Reply With Quote
(#6 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,528
Join Date: Jul 2009
Location: Spain
Default 05-02-2012, 04:57 PM

The form is sent by pressing the button because we got to the "send_mail.php".

Would have to see what data is coming from the form.
Try adding the following lines at the beginning of the file "send_mail.php" (just for testing):

PHP Code:
echo "<p>Content POST:</p> ";
print_r($_POST);
echo 
"<p>Content REQUEST:</p> ";
print_r($_REQUEST); 


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma
Reply With Quote
Reply

Tags
java, mail form, php, send

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com