PHP Contact Form - desparate for help

Joined
Sep 13, 2012
Messages
3
Reaction score
0
Points
1
I'm a novice at web design, but have successfully posted/hosted a few. Now I have a client who wants a contact form on the site. I have the design part done, but it's the PHP part that I can't understand.

I can't get the info that is typed in on the form to go to the email address listed. It shows the fields of information but no "response" information. And she is waiting for my form to be uploaded to her site so her client can put the input information into a database.

HELP!!!!!

Thanks,
Ron
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Google is your friend. See here.
 
OP
A
Joined
Sep 13, 2012
Messages
3
Reaction score
0
Points
1
Thanks

Thanks vansmith and louishen for your quick response. I've been working on this form and studying books/tutorials, etc, etc. to get my one brain cell to understand the process. I will look over your much needed suggestions, and let you know how they work!

Again, THANKS!

Ron
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Many basic tasks can be accomplished by using what's available in tutorials online. This will save you the time of writing things from scratch. For example, the contact form you need. Although you certainly could write it from scratch, contact forms are quite common and many tutorials/freely available scripts will help save you some time.
 
OP
A
Joined
Sep 13, 2012
Messages
3
Reaction score
0
Points
1
Believe me, I've tried ALL the tutorials I could find, but of course, you have to have a good bit of time to devote WITHOUT INTERRUPTIONS to the study. And, that doesn't happen when your boss is breathing down your neck to learn something that is foreign.

I appreciate your knowledge. I wish I had started learning years ago, but I'm easily distracted by design instead of the nuts and bolts of the language. And, at my age, design is much easier. LOL
 
Joined
Jul 23, 2012
Messages
341
Reaction score
1
Points
18
...Now I have a client who wants a contact form on the site...but it's the PHP part that I can't understand.
You really shouldn't have clients.

And she is waiting for my form to be uploaded to her site so her client can put the input information into a database.
If you do the site correctly and professionally, the info from the form will go into the database automatically!! Someone has already typed it in - why should anyone have to type it in again? Screw sending the info via e-mail - insert it directly into the database.

HELP!!!!!

There are MANY examples of how to do this on the web already. Have you looked?

A crude example of code for taking info from a form and putting it into a database. In this example, date_month, date_day and date_year are the names of form elements on the page that called the processing page. Note, this example is crude and incomplete but should get you started.

Code:
<?
{ include 'setup.php' ; } //has database connection/login info

//submitted by form that calls this page - needs more robust untainting
$date_month      = 0 + $_POST["date_month"];
$date_day          = 0 + $_POST["date_day"];
$date_year         = 0 + $_POST["date_year"];

$valueToInsert = $date_month."-".$date_day."-".$date_year ; 

$param_array = array($valueToInsert);
$dbconn = pg_connect($host." ".$port." ".$dbname." ".$user." ".$password); 
$result = pg_query_params($dbconn, $log_ins_stmt, $param_array);  

?>
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top