If you need to look at the PHP Script itself, PM me and I will send it. It tells me it is too long to post.
Sorry I don't speak this language. ;)
You obviously want the form to mail you all the info in the code (I'm assuming from the form action)
As for your PHP code... To do a form mail can easily be done in 5 lines of code or less...
http://us3.php.net/manual/en/ref.mail.php (http://us3.php.net/manual/en/ref.mail.php)
It's a rundown of the mail() command...
The HTML in here looks just fine... I don't see any sintax errors or anything off the top of my head... The problem most likely lies in the PHP code itself...
Any more info the error you got would help to send this in the right direction...
Well that site didnt help me any fatkid...
I just dont know what to do. The PHP document came straight from hummingbirdhosting and they said that code has worked for others, but I am me, and shit doesnt work for me half the time.
I'll get it figured out eventually.
Do you understand the html code that you have written there? Or did you just use a site builder to create that form? Because there could easily be descrepancies between the name of things in the html code and the things in the PHP... If you understand PHP and HTML just use the mail() command and have it concatonate all of the names together into 1 name... Then just have it mail that one variable name to whatever specified email adress... If you don't know how to write PHP or HTML then this won't help you at all... But you also didn't answer the other question I had.. What was the error? I can only tell you so much without knowing what the error is...
Yes I know HTML by the back of my hand and hard code all of my pages.
PHP and all that crap is beyond me... I will look into the discrepancies.
Thanks.
If you want when I get to work I can email you a PHP script that will email you whatever is on your form... You just have to go in and change the name values to whatever they are named in your HTML... And its only like 5 lines long... That's what I'm assuming you want your PHP script to do... Correct?
Yes and that would be hella great lol... Thanks
I don't seem to have it on my computer anymore but I am emailing another guy that works on the other side of campus that should have it... As soon as he lets me know I can post it here for you... Elsewise I will just sit down and write it again and post it on here (but if I do that it probably won't be up till much later on today or tomorow)...
Sorry this is taking longer than expected... :-\
Thats ok... I am home for the day anyhow. I was just going to work on a re design of my site. I get tired of it being so boring lol.
My Personal site that is... EagleOutlet is going to remain the way it is as there are 400 pages or so...
Do you remember what the error you were receiving was?
Aslo what all did the PHP code that you got have in it?
Looking @ scripts I've found on the 'net for PHP mailers, the largest I've found was 35 lines long... And I've typed responces on here that were over 3 pages long on MS Word... So the script you have must be HUGE... lol
And as I'm sure you're aware... The larger it is, the more likely it is that you will wind up with a few pretty big bugs every now and then...
I was receiving "You have put in an incorrect email address" and "You have left a required field blank"
Like I say, if you want the PHP script I can email it to you...
http://www.phpdeveloper.org/section/tutorial/40 (http://www.phpdeveloper.org/section/tutorial/40)
Try that tut, and see if it helps you get the hang of the mail() function
Thank you fatkid. I will take a look into it tomorrow.
The mail() function is pretty simple in it's sytnax... You just put in the field name values in the correct place and it will send the form to whatever email you specify.... No fancy coding or anything like that at all... Still haven't been able to find my script... I'll check on my work computer later today...
I just got a script of the mail function from my web page authoring teacher. It is basically the same as you have given me, but she has it all working with a form so she gave me to code. Now all I have to is edit the code. I will let you know if I come across any problems... dont ya just love that... I run to you guys when I have problems lmao.
Have a good day fatkid and thank you so much for your help.
Take care,
- Jeff
Yeah editing should be too tough... Just substitute value names in one for another... ;D Good luck with it... Let me know if you come across any more problems... I'd love to help out...
Well, being the difficult self I seem to be... here is the script.
<?PHP
$from_name = "Quill Signatures";
$from_email = " ";
$to_name = "JeffCoKid";
$to_email = "JeffCoKid@bresnan.net";
$subject = "Quill Sginature Order";
$headers = "From: $from_name<$from_email>\n";
$headers .= "Reply-To: <$from_email>\n";
mail("$to_name<$to_email>", $subject, $message, $headers);
}
}
?>
And it doesnt seem to want to work. I tried editing what I thought needed to be edited so... I just do not know php and it may be a good idea for me to learn it.
And I am beginning to think maybe my teacher was nuts this morning and didnt understand what I was saying... she happens to do that quite frequently.
Thanks for your assistance fatkid... hope you, or someone php inclined can help me on this one.
- Jeff
Here is the PHP code I am working with:
<?
$from_name = "Quill Signature Order Form";
$from_email = " ";
$to_name = "JeffCoKid";
$to_email = "JeffCoKid@bresnan.net";
$subject = "Quill Signature Order";
$headers = "From: $from_name<$from_email>\n";
$headers .= "Reply-To: <$from_email>\n";
$message .= "replyemail\n";
$message .= "SigName\n";
$message .= "Color1\n";
$message .= "Color2\n";
$message .= "Color3\n";
$message .= "Color4\n";
$message .= "Color5\n";
$message .= "Gradient\n";
$message .= "bgcolor\n";
$message .= "Font Size\n";
$message .= "Font Face\n";
$message .= "\n";
mail("$to_name<$to_email>", $subject, $message, $headers);
?>
I have been successful in receiving the email, except my problem now is, the email is blank. It displays this:
replyemail
SigName
Color1
Color2
Color3
Color4
Color5
Gradient
bgcolor
Font Size
Font Face
but that's it. I want it to read the form and get the information people put in.
So, we are progressing but still having some trouble.
My code for my form is:
<table width="275" align="center" border="0" cellpadding="5" cellspacing="0" rules="none">
<form action="http://www.jeffcokid.com/form.php" method="post">
<tr>
<td width="150" nowrap>Font Face</td>
<td width="150">
<select name="Font Face">
<option value="Art Brush">Art Brush</option>
<option value="Comic Sans MS">Comic Sans MS</option>
<option value="One Stroke Script LET">One Stroke Script LET</option>
<option value="Surfer">Surfer</option>
</select>
</tr>
<tr>
<td width="150" nowrap>Select Your Font Size</td>
<td width="150">
<select name="Font Size">
<option value="20">20</option>
<option value="22">22</option>
<option value="24">24</option>
<option value="26">26</option>
<option value="28">28</option>
<option value="36">36</option>
<option value="48">48</option>
<option value="72">72</option>
</select>
</tr>
<tr>
<td width="150" nowrap>Background Color</td>
<td width="150">
<input type="text" name="bgcolor" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap>Single Font Color</td>
<td width="150">
<input type="text" name="Color" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap> </td>
<td width="150">
</tr>
<tr>
<td width="150" nowrap>Multiple Font Colors</td>
<td width="150">
<select name="Gradient">
<option value="vertical">Vertical</option>
<option value="horizontal">Horizontal</option>
</select>
</tr>
<tr>
<td width="150" nowrap>Font Color One</td>
<td width="150">
<input type="text" name="Color1" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap>Font Color Two</td>
<td width="150">
<input type="text" name="Color2" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap>Font Color Three</td>
<td width="150">
<input type="text" name="Color3" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap>Font Color Four</td>
<td width="150">
<input type="text" name="Color4" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap>Font Color Five</td>
<td width="150">
<input type="text" name="Color5" size="5" maxlength="6">
</tr>
<tr>
<td width="150" nowrap> </td>
<td width="150">
</tr>
<tr>
<td width="150" nowrap>Quill Signature Name</td>
<td width="150">
<input type="text" name="SigName" rows="1" size="35">
</TEXTAREA>
</tr>
<tr>
<td width="150" nowrap>Your E-mail Address</td>
<td width="150">
<input type="text" name="replyemail" size="35">
</tr>
</td>
</table>
<br><br>
<center><input type="submit" name="Send" value="Submit Your Order">
</form>
And then..... I want it to go to http://www.jeffcokid.com/quillpay.htm (http://www.jeffcokid.com/quillpay.htm) when you hit submit... so if we could get all this working that would be great as well hehe...
What a pain... but it will be worth it in the end I know it.
OK I finally found my PHP script for mail... ;D
Here it is...
<?
$message= "";
//steps through each field past through the post headers and compile them into a message string.
for(reset($HTTP_POST_VARS); list($name, $value) = each($HTTP_POST_VARS);)
{
$message .= $name.": ".$value."\r\n"; // the "." concatanates strings together.
}
//send out the email. PARAM1=Send email to. PARAM2=Subject. PARAM3=Email body message. PARAM4=email headers (In this case specifying what it should do if someone attempts to reply to the email-it just sends it right back to apply@nfmprovo.com)
mail("anymail@anymail.com", "Subject goes here", $message, "From: applicant \r\nReply-To: anymail@anymail.com\r\n");
//This is where you want to redirect to after the form has been submitted...
header("Location: /index.html");
?>
I know the comments are a bit messy but I just wrote them out really quick for a buddy of mine...
Here's a breakdown of the code...
First line it clears out the $message value
Next it goes through your form and finds each header under name and value... Looking at your code you don't seem to have any inputed values, just names... So you can either delete out the part of the php code for value or you may want to add value headers into your form...
What will happen is the code will grab the name header and call it what you have titled it... Color1, Color2, etc etc... Then if you have a value header, that is what the user inputs... Green, Blue, Red, etc etc...
Ok so back to the code... It goes through every place in the form that it finds a name or value header and records what they point to... It then concatanates them into a string and enters to a new line saving the string to $message... So in your email it will look something like this...
Color1 Green
Color2 Blue
Color3 Red
Next it moves onto the mail() code... As it says in the comments it goes:
mail("param1","param2",param3 (which is $message), param4 (who its from \r\n and who to reply to..
Then finally you have
header("Location: anyurl.com");
This is where the page goes after the submit button is hit...
Yawwwnn... I would have gotten back to you sooner on this but I was napping.
Thanks a lot fatkid! I will take a look into this this evening. I will be away for a few hours... gotta go back to school tonight as its a work night for FBLA... and we reallllllly need to get our site going as it is due on the 28th lol and we have the basic design. (the design on jeffcokid.com is what we are using just for saving time... but when we go to nationals it will probably change.)
How would I insert input values into my form?
<tr>
<td width="150" nowrap>Font Color One</td>
<td width="150">
<input type="text" name="Color1" value="" size="5" maxlength="6">
</tr>
Easy as pie.. Then whatever the use inputs into the text field will be record as the value of Color1
I figured it would be the value tag
Thanks again. I will hopefully get this working this evening.
Have a good one fatkid. I really appreciate all this. ;D
sry lol im not a real genius with computers but i did go to collage for csomthing lol... i forgot what it was tho lol
you mean you went to college?
col·lage (k-läzh, k-)
n.
An artistic composition of materials and objects pasted over a surface, often with unifying lines and color.
http://dictionary.reference.com/search?q=collage (http://dictionary.reference.com/search?q=collage)
College is an institute for higher learning... ;-) Guess you just partied those years right through... lol ;D
lmao Fatkid found another victim
;D
Those were the days but im confused how did i pull of a 3.6 all the way through lmao ;D ;D
ok, home for the evening.... no, havent been to college yet as I am a Junior in HS.
Partying is the fun part in collage fyi lmao
Okay so I am a complete dumbass... I cannot get this script to work for the life of me. I just ran through my form and put in values (value="") and left it blank like that. Go ahead and laugh lol... I am just not any good at this crap.
- Jeff
Wait wait.... I am receiving the email with the correct information. I figured that one out. GENUIS!!!
lmao...
But now... the redirection... that's the problem.
Here is the code I am currently using....
_______________________________________
<?
$message= "";
//steps through each field past through the post headers and compile them into a message string.
for(reset($HTTP_POST_VARS); list($name, $value) = each($HTTP_POST_VARS);)
{
$message .= $name.": ".$value."\r\n"; // the "." concatanates strings together.
}
//send out the email. PARAM1=Send email to. PARAM2=Subject. PARAM3=Email body message. PARAM4=email headers (In this case specifying what it should do if someone attempts to reply to the email-it just sends it right back to jeffcokid@bresnan.net)
mail("jeffcokid@bresnan.net", "Quill Signature Order", $message, "From: applicant \r\nReply-To: jeffcokid@bresnan.net\r\n");
//This is where you want to redirect to after the form has been submitted...
header("Location: http://www.jeffcokid.com/quillpay.htm");
?>
<?php
header("Location: http://www.example.com/");
?>
Try adding the php tag to the <? ... From what I've looked at online it seems that, that is the only thing that is different from that script to the PHP manual...
Or you can just comment out the header call and instead after the PHP ?> Start writing your HTML that you want displayed... It will also work that way...