Not sure what is wrong with PHP Code

I am trying to figure out what is wrong with my coding. I have my contact form on my site and I am trying to make it work correctly. When I hit submit, it just goes to a blank page. My contact form that is through my HTML is action=mailer.php and my php script is saved as mailer.php. Not sure what I am doing wrong with it all. If anyone can help me and guide me through it, that would be great. I am new to php and I am trying to learn it.

<?php $sendMessage = false; if (isset ($_REQUEST['message']) && isset($_REQUEST['email']) && isset($_REQUEST['name'])) { $email = $_REQUEST['email']; $name = $_REQUEST['name']; $subject = $_REQUEST['subject']; $message = $_REQUEST['message']; if (strlen($message) > 0 && strlen($email) > 0 && strlen($subject) > 0 && strlen($name) > 0) { $sendMessage = true;} } if (isset ($_REQUEST['posted']) && (!$sendMessage)) { echo "Please fill in all the values";} if ($sendMessage) { //[email protected] $to= "[email protected]"; $subject= "Website Feedback."; $headers= "Mime Version: 1.0". "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers .= "From: $email\r\n"; // setup the from field for e-mail $headers .= "Content-type: text/html\r\n"; // setup e-mail format $success = mail($to, $subject, $message, $headers); if ($success) // if successful display the message & success message { echo "You sent the following:
$message

"; echo "

Form submitted successfully.

"; } else // If not successful let the user know { echo "An error occurred when trying to send the e-mail."; } } ?>

[member=72925]Jogden614[/member]

It’s really hard to say what’s wrong, not enough information was provided.

A blank page, means that normally the mailer.php was found, if it wasn’t you’ll get a 404 error.

Now it’s possible that your PHP page is crashing you should add some debugging code to the top and see what happens.

Right after:
[php]<?php[/php]

Add this:

[php]error_reporting(E_ALL);
ini_set(“display_errors”, 1);[/php]

Then test your code again and report back what happens.

I did it right after <?php

It said that Dynamically related files can not be discovered because there is no site definition for this document. I am using dreamweaver for my coding. I don’t receive a 404 error and it is just a blank page. I am going to paste my html doc also. Thank you for your help. I have been trying to work on this because I really want to get my contact form and learn the process with php. That way I can create contact forms for other clients.

<!doctype html>

Contact Us Top Notch Web Creations TN Contact Us

If you would like to contact me or give me feedback please use the form below. I check my emails very often and I will get back to you as soon as I can. I usually reply back to the email no later than 48 hours. If it does happen then it is becuase their is a high volume of emails coming in at the time, but you should recieve an email within 2 days after. If you would like a quicker response, please email me at [email protected].

Name

Email

Website

Subject

Copyright ©2014 TopNotchWebCreations, All Rights Reserved

Stop using Dreamweaver. I recommend webuilder for an IDE

[member=72925]Jogden614[/member] I don’t know anything about Dreamweaver, so I’m not going to be of any help - That error is related to dreamweaver, just from a quick search in google…

I suggest following [member=46186]Kevin Rubio[/member] suggestion and switch IDE, If you’re really trying to learn PHP - get away from Dreamweaver.

Ok. Does IDE cost any money? I am going to look for it on Google. Do I need to redo my whole site in IDE or can I do a mix match and use D.W for html and IDE for PHP?

Should I use Eclipse or Netbeans. I have heard of Eclipse and I am pretty sure that is a good one, but like I said, I am new to this.

[member=72925]Jogden614[/member]

Both of those are good IDE’s and [member=46186]Kevin Rubio[/member] mentioned webuilder

I know [member=71845]JimL[/member] loves Netbeans

The people where I work use Eclipse.

I use notepad on windows when I code in PHP.

But I mainly code using the Visual Studio IDE in .Net.

Ok. Thank you for your help. I am going to download eclipse now. Should help the problem? I am assuming that I should copy and paste the php script that I have now or should I redo the whole script? Again thank you for your help

Is there any way to check the PHP code on notepad++? I am thinking that there is a plugin that I might have to get, but I am not too sure. I am thinking about trying to mess with notepad++ since there is all the different languages built into it. Then eventually get phpstorm for my ide.

I am telling you, webuilder will rock your world. It is a free trial download. You have nothing to lose to check it out. It will do everything you want and more. I have tried probably all the ide’s out there.

Ok. What is the link for that? I typed it in google and some other stuff came up. I’m not too sure which one it is. I put in Web builder IDE. Do you think that it will also fix my problem that I am having? Can I just copy and paste my PHP script that I already have? Sorry for these questions if they sound idiotic. lol. I am not familiar with IDE. Just HTML5 and CSS3. I am getting into web animation now. I am attending college for Web Design. I know I will be learning JavaScript in this course.

It is not Web Builder, it is webuilder, and that is the 1st Google results. Ide is not a programming language. It stands for integrated development environment. It is just a software to do your programming like Dreamweaver but better for programming .

Ok, I am going to download the trial today. I remembered about the ide after I looked it up. Thank you for your help. Do you know why my code isn’t working for my contact form?

Sponsor our Newsletter | Privacy Policy | Terms of Service