MichaelAn Posted February 4, 2010 Share Posted February 4, 2010 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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/ Share on other sites More sharing options...
freeloader Posted February 4, 2010 Share Posted February 4, 2010 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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006893 Share on other sites More sharing options...
MichaelAn Posted February 4, 2010 Author Share Posted February 4, 2010 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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006895 Share on other sites More sharing options...
MatthewJ Posted February 4, 2010 Share Posted February 4, 2010 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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006903 Share on other sites More sharing options...
MichaelAn Posted February 4, 2010 Author Share Posted February 4, 2010 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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006905 Share on other sites More sharing options...
Ty44ler Posted February 4, 2010 Share Posted February 4, 2010 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 = "[email protected]" ; </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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006907 Share on other sites More sharing options...
MichaelAn Posted February 4, 2010 Author Share Posted February 4, 2010 Thank you Ty44ler, I really appreciate it!! Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006911 Share on other sites More sharing options...
Ty44ler Posted February 4, 2010 Share Posted February 4, 2010 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 https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006916 Share on other sites More sharing options...
MichaelAn Posted February 4, 2010 Author Share Posted February 4, 2010 Is there anyone you can recommend that I could pay to do this for me? Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006919 Share on other sites More sharing options...
Ty44ler Posted February 4, 2010 Share Posted February 4, 2010 I'm actually in the latter stages of completing a project just like the one you're trying to create, but I'd be willing to take the job on myself if you'd like. PM me if you are interested. Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006944 Share on other sites More sharing options...
freeloader Posted February 4, 2010 Share Posted February 4, 2010 I should be able to complete this even tonight if you'd wanted to probably. PM me if interested. Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006964 Share on other sites More sharing options...
Ty44ler Posted February 4, 2010 Share Posted February 4, 2010 I should be able to complete this even tonight if you'd wanted to probably. PM me if interested. I could have this earlier if you'd wanted to probably. PM me if interested. Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006968 Share on other sites More sharing options...
freeloader Posted February 4, 2010 Share Posted February 4, 2010 Haha, I don't mind mate, if you can do it cheaper he should pick you Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1006981 Share on other sites More sharing options...
MichaelAn Posted February 18, 2010 Author Share Posted February 18, 2010 Tyler44, if you are still available I could really use the assistance. Link to comment https://forums.phpfreaks.com/topic/190945-php-form-not-working/#findComment-1014118 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.