PlayBuddy
April 18, 2024, 06:31:09 PM

This week's Club Pogo challenges!
Garden Blast : Use 120 rockets or rocket power-up combos this week! [Download Cheat]
World Class Solitaire HD : Place 200 cards into the foundation stacks this week! [Download Cheat]

Main Menu

Re:PHP Formmail script

Started by JeffCoKid,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JeffCoKid

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.

Homer


PogoCheats - It's all about the badges!!!

fatkid

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

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...

JeffCoKid

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.

fatkid

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...

JeffCoKid

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.

fatkid

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?

JeffCoKid


fatkid

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...  :-\

JeffCoKid

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...

fatkid

#10
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...

JeffCoKid

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...

fatkid


JeffCoKid

Thank you fatkid. I will take a look into it tomorrow.

fatkid

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...

JeffCoKid

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

fatkid

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...

JeffCoKid

#17
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

JeffCoKid

#18
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>

JeffCoKid

And then..... I want it to go to 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.

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

 Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:

Shortcuts: ALT+S post or ALT+P preview