Jump to content

HTML Form to PHP where it is sent to MYSQL Database, and email.


johntp

Recommended Posts

I have been searching for hours for a resolution for this, but nothing works. They have alot of ASP scripts for it, but I think ASP is worthless most times. Basically what this is, is a request form where people enter all the info on the request they want, then it will store it in a database and shoot the IT department an email. I built the html form, and am very happy with it, and i can even get it to post to a DB, or Email, but not both. Also i cannot get the email to look neat, and was thinking maybe html-email? I am using PHP4 and phpMyAdmin - 2.9.2

 

Has anyone seen some usefull code for this to point me in the right direction? Mainly HTML email that i can stick the results of the form into and arrange it nice and neat, and posting to a database at the same time.

 

This is long and probably somthing no one is interested in besides me, but help would be much appreciated.

 

Thanks in advance.

I would use something like phpmailer

http://phpmailer.codeworxtech.com/

nice easy class to get e-mails sent

 

Also what you ask should be a peice of cake. Post your form and database structure and I can give you some code to get you going.

 

Ray

I've just downloaded phpmailer, and don't think i installed it right. I created an includes folder under c:\PHP\ and then put class.phpmailer.php and languages/phpmailer.lang-en.php when i try to run the test script i'm getting just a blank page.

 

I'm pretty sure the problems is my structure can you please help me.

 

C:\PHP\includes (path where i put the phpmailer files)

C:\Appserv\www\test (the path where i'm running the script http://local-computer/test)

 

Any ideas?

if you are going to run it out of the includes folder in php you have to make sure the parameter in the php.ini file is set correctly

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = "c:\PHP512\includes"

 

Make sure you set it correctly like above.

 

If you want to run it on a script by script basis, you can just put the files in the same folder as the current script and call it within the script

require('class.phpmailer.php');

 

Ray

I did change the php.ini, but just tried it putting the phpmailer in the test folder and called to it. It displayed the test form and i ran the test and everything failed.

 

Test results:

test_wordwrap FAIL

test_low_priority FAIL

test_multiple_plain_fileattachment FAIL

test_plain_stringattachment FAIL

test_quoted_printable FAIL

test_html

 

am i doing something wrong?

Archived

This topic is now archived and is closed to further replies.

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