Jump to content

PHP form not transferring data from a field


mktimpact

Recommended Posts

I would appreciate some assistance. I am very green when it comes to programming so please excuse my lack of understanding / number of questions :)

I have two sites for a client, both of which use a similar form structure, both of which are built in PHP. The form is a quotation request form with 3 pages on it, the last of which has an area for the customer to enter their contact details and also has a 'comments' section for them to submit specific comments regarding their enquiry.

When a customer submits the quote, and email is sent to the company and it specifies the contact details, what the enquiry was in relation to, and the location. Here however is the issue. On one of the sites, anloffshorecontainers.com.au there is no issue. Comments submitted are transferred in the emai.

The other site however, anlcontainers.com.au sends the details to the client capturing everything except whatever is included in the 'comments' box on the form.

I compared the code between the two sites for this form, and as I said I am not a programmer, but found the only difference was that on the form that was working (on the attached coding titled 'OFFSHORE') there is the code: id="comment" inserted within the relevant section of code, however this is missing off the coding for the site that has the issue (called 'MAIN' on the attached).

I thought perhaps this was the issue so added this id="comment" into the code on the php template in WordPress and it has made no difference.

My questions:

1. How do I fix this so that the comments are sent in the email to the client for the site having issues?

2. For my own learning, what does id="comment" mean? I assumed this picked up text in the comments section and transferred with the email, however I may be completely off track.

I have attached the relevant code pieces I refer to, along with the full code for the page on which we are having issues where this id="comments" is missing on line 223.

Thanks

Will

Issues with Comments on form for sites.txt

Link to comment
Share on other sites

answers -

 

1. by determining where your code and data are doing what you expect and where they are not, to narrow down the point where the problem is at.

 

2. the id="..." attribute is only used in the client-side code and unless that form element is being referenced in the client/browser by its id, the lack of an id won't have any affect. the name="..." attribute determines what data is submitted.

 

there's nothing obviously wrong with the form. in fact, most of the form fields don't have id's. on the page where that form submits to, add the following line of debugging code to display what post data is being submitted (i'm betting that the comment data is submitted, but the form processing logic isn't doing anything with it or is overwriting it) -

echo '<pre>',print_r($_POST,true),'</pre>';
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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