Jump to content

PHP Form NOT Working!!!


MichaelAn

Recommended Posts

Hi,

 

I'm hoping someone can help me. I hired a couple of guys to create a php form for one of my clients but ended up having to let them go. The form they created was put onto my client's website but is not working. The form is supposed to have the ability to send this form to my client's email address once the "submit" button is clicked but my client has informed me that several people are telling him that they filled out this particular form online but he has not received the form through his email.

 

I have attached the php file so that someone can possibly take a look at it and tell me what is wrong and how I can fix it. This is one of my major clients and I need this situation fixed as soon as possible so any help is GREATLY appreciated.

 

[attachment deleted by admin]

Link to comment
Share on other sites

There are several flaws in this program.

 

First of all, you are mixing javascript with php code. When starting php code, you need to indicate this by using <?php or <? (make sure short tags are accepted then).

 

Secondly, you are using outdated php code. We use $_POST these days instead of $HTTP_POST_VARS.

 

Thirdly, you are declaring all e-mail headers, but you are not actually sending the e-mail.

Link to comment
Share on other sites

Ok, so how do I fix this problem?  Remember I said that someone else did this for me but they are no longer with me and I have a very limited knowledge of PHP but I need to get this file fixed as soon as possible.  I'm new to PHP so if someone could walk me through this I would greatly appreciate it.

Link to comment
Share on other sites

This entire form is jacked up... If you really paid someone for it, you need to get your money back.

 

That being said, there is a lot of work here to get this working and I thihnk it is going to be hard for you to find someone that will just do it for free.

 

Aside from the things that freeloader said, the field names are duplicated in the form which means they will overwrite themselves, there is nothing in there at all with regards to building the body of the email, etc.

 

I would give this form a 15% complete status... it appears your "coders" did not know php at all.

 

 

Link to comment
Share on other sites

Ok, I understand that I made a HUGE mistake hiring those two people to do this work for me, but, that having been said, again, how do I fix this problem?  Are there codes that need to be changed?  If so, what codes and where?  I'm willing to put forth an effort to do the work myself I just need someone to point me in the right direction PLEASE

Link to comment
Share on other sites

It seems as though they took a different approach to making that form.

 

This is the line that combines php and javascript:

//if no error is found the form is emailed to a which ever email account you want it to be emailed to 
  if(($_SERVER['addSuper'] == 'Submit'))// && $error_count == 0
{	
       //below are just headers for the mail to function 
       $yourmail = $name . " <" . $email . ">" ;
       $headers = "From:  $yourmail \r\n"; 
       $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; 
       $headers .= "MIME-Version: 1.0 ";
       $receiver = "jhall@anjoinsure.ag" ;
</script>

The above is strictly php, but it is placed within the <script></script> tags. It should be moved outside and placed between <? ?> tags.

 

They named all of the inputs strangely as well. They aren't descriptive at all. If all you're doing is sending email, this could be done pretty easily, but it seems like this coder made it much more complex than need be.

 

Also, HTTP_SERVER_VARS is deprecated and should be $_SERVER[]

 

I'll see what I can do for this and get back with you.

Link to comment
Share on other sites

Now that I'm looking at this, really the only thing that is complete is the actual HTML form. There isn't even an email being generated, nor is it even grabbing any info from the form. This form is not near done whatsoever and has a ways to go.

 

I'd say save your time and get someone to do it for you. If you have little to no knowledge about php or html, it's going to take you quite some time just to get the basics down. It's not too hard of a project for someone with some experience in php, but it would still take at least an hour or so...

Link to comment
Share on other sites

  • 2 weeks later...
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.