[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Form is not sending me the info i need

Posted on 2009-05-02
11
Medium Priority
?
201 Views
Last Modified: 2013-12-13
Ok, i have no idea what i am doing and i have searched the internet far and wide. I am trying to get emailed the form fields that are filled in with the php below. Here is what i get back in an email.

Name: Judith Richmond

              Company: Plymouth Educational Center\'s Foundation

                    WWW:

                    First Wesite:
But nothing for the WWW and First Site, the weird thing is my input value is not companyname it is company and that is working. Please help i have been at this since 8am est. the link to the form is http://www.jktconsultants.com/PECF_design.html.
<?php
  $email = $_REQUEST['email'] ;
  $fullname = $_REQUEST['fullname']; 
  $text = $_REQUEST['text'];
  $message = "Name: $fullname\n
              Company: $companyname\n
WWW: $text\n 
 First Wesite: $webLike1\n" ;
 
  mail( "richmo58@jktconsultants.com", "Feedback Form Results",
    $message, "From: $email"); 
  header( "Location: http://www.jktconsultants.com/thanks.html" );
?>

Open in new window

0
Comment
Question by:richmo587
  • 6
  • 4
10 Comments
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24288042
The action attribute of the form points to a script "cgi-bin/mail.php", is that the script you posted in the snippet? Because of the mismatched field names I would guess you are editing the wrong script...
0
 

Author Comment

by:richmo587
ID: 24288099
Yes that is the script i am refeerring too. So if I understand you I changes the php script see below: Is that what you mean by "mismatched field names"? When I changed it I am now getting a 500 error
<?php
  $email = $_REQUEST['email'] ;
  $name = $_REQUEST['name']; 
  $message = "Name: $name\n
              Company Name: $company\n
			  First Site: $weblike\n" ;
 
  mail( "richmo58@jktconsultants.com", "Feedback Form Results",
    $message, "From: $email"); 
  header( "Location: http://jktconsultants.com/cgi-bin/thanks.html" );
?>
 

Open in new window

0
 

Author Comment

by:richmo587
ID: 24288103
Do these files have to be in a cgi-bin folder?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24288177
No, php files does not normally have to be in a cgi-bin folder.

The mismatched field names was $company/$companyname and $name/$fullname. In the form, the fields are named 'company' and 'name', in the snippet you posted you read field with names 'companyname' and 'fullname', and it worked. It should not have worked. That is why I was guessing it was the wrong script.

I can't see anything that would result in a 500 Internal server error. Using the wrong field name will not give such an error, it will just give blank values.

Do you have access to the web server error logs?

Try this, it will show which variables are available:
<?php
 
  var_dump($_REQUEST);
 
  $email = $_REQUEST['email'] ;
  $name = $_REQUEST['name']; 
  $message = "Name: $name\n
              Company Name: $company\n
                          First Site: $weblike\n" ;
 
  mail( "richmo58@jktconsultants.com", "Feedback Form Results",
    $message, "From: $email"); 
  #header( "Location: http://jktconsultants.com/cgi-bin/thanks.html" );
?>

Open in new window

0
 

Author Comment

by:richmo587
ID: 24288179
Yeah that really didnt work, i changed it back because there is a thanks.html in the root folder. However there is also one in the cgi-bin folder but when i code in that path it doesnt like it? I
0
 

Author Comment

by:richmo587
ID: 24288207
That brought up the results in a browser and sent me an email. The weblike part is not filled in the email below:

Name: JK Thornburg And Associates

              Company Name: Plymouth Educational Center\'s Foundation

                          First Site:

array(41) { ["name"]=> string(27) "JK Thornburg And Associates" ["company"]=> string(41) "Plymouth Educational Center\'s Foundation" ["email"]=> string(22) "richmo58@studiojkt.com" ["webLike"]=> string(23) "www.thatwasfuckedup.com" ["likeweb4"]=> string(0) "" ["webLike2"]=> string(4) "www." ["webLike3"]=> string(4) "www." ["dweb4"]=> string(4) "www." ["dlikeweb4"]=> string(0) "" ["fonts2"]=> string(0) "" ["fonts3"]=> string(0) "" ["otherexpand2"]=> string(0) "" ["graphics3"]=> string(0) "" ["graphics"]=> string(0) "" ["email2"]=> string(0) "" ["copyrinfo"]=> string(0) "" ["graphics4"]=> string(0) "" ["graphics5"]=> string(0) "" ["aother1t"]=> string(0) "" ["aother2t"]=> string(0) "" ["aother3t"]=> string(0) "" ["aother4t"]=> string(0) "" ["startpages"]=> string(0) "" ["graphics7"]=> string(0) "" ["info"]=> string(0) "" ["sell"]=> string(0) "" ["product"]=> string(0) "" ["impress"]=> string(0) "" ["prospects"]=> string(0) "" ["contact"]=> string(0) "" ["brand"]=> string(0) "" ["otherdetails"]=> string(0) "" ["otherdetails2"]=> string(0) "" ["otherexpand"]=> string(0) "" ["otherservicestext"]=> string(0) "" ["keyword"]=> string(0) "" ["otherkeyword"]=> string(0) "" ["graphics6"]=> string(0) "" ["sixweeks"]=> string(104) "A Website completion date of 6 weeks from the date I provide all needed graphics and copy is acceptable." ["compdate"]=> string(22) "Time required in weeks" ["Submit"]=> string(6) "Submit" } 

Open in new window

0
 

Author Comment

by:richmo587
ID: 24288218
Those mismatched fills came from someone else that was helping me earlier today with this. I dont know why it was working but it was and when i put the corret values in it would not return the form input -
0
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24288258
The name of the "First site" variable is 'webLike', not 'weblike' (capital L). Variable names are case sensitive.

You can remove the line with var_dump(), that was only to see which variables you are sending.

For better formatting of the message in the email, use one of these methods:
$message = "Name: $name\n".
           "Company Name: $company\n".
           "First Site: $webLike\n";
 
# Alternatively:
$message = "Name: $name
Company Name: $company
First Site: $webLike";

Open in new window

0
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 2000 total points
ID: 24288313
The three fields for disliked websites are all called "dweb4". You must have different names for each field, except for radiobuttons that are part of a group, they must have the same name.

Many of your fields have onclick="value=''". This will blank the field when the user clicks into it, which is very anoying when editing the input. Just remove the onclick from these fields.

The field "I would like our website to be designed to a fixed width." have wrong name for the radio buttons, they are called "activesite". This name is used higher up on the page.
0
 

Author Comment

by:richmo587
ID: 24289867
Just got up cxr: let me take a look at this and i will respond - Thanks
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question