NickP
-
Posts
2 -
Joined
-
Last visited
Posts posted by NickP
-
-
Here's the code, this is the PHP in my html contacts page (that IS in fact saved with a PHP extension):
<div class = "centercontainer"><form method="post" action="NickParkerPhotoContact.php"><label class = "labelwithmargin">Email: Nick@NickParkerPhoto.com</label><label>Please use the form below:</label><br><label class = "labelwithmargin">Name*</label><input name="name" placeholder="Type Here"><label class = "labelwithmargin">Number</label><input name="number" placeholder="Type Here"><label class = "labelwithmargin">Email*</label><input name="email" type="email" placeholder="Type Here"><label class = "labelwithmargin">Message</label><textarea name="message" placeholder="Type Here"></textarea><input id="submit" name="submit" type="submit" value="Submit"><?phpif ($_POST['submit']) {$name = $_POST['name'];$number = $_POST['number'];$email = $_POST['email'];$message = $_POST['message'];$from = 'From: NickParkerPhoto website';$to = 'NickParkerPhoto@gmail.com';$subject = 'Message from website';$body = "From: $name\n Number: $number\n E-Mail: $email\n Message:\n $message";if (mail ($to, $subject, $body, $from))) {echo '<p>Your message has been sent!</p>';} else {echo '<p>Something went wrong, go back and try again!</p>';}}?></form>And the issue is I keep seeing this in my web page, which means my code is not working with the submit button I created.. :
I'm a complete newby to PHP and have been learning it mostly just for this contact page, but learning that it is a server only-widely accepted language I'm pretty hyped to know anything about it...
Thanks!
Nick P.
Issues with displaying if else echo statement in contact page..
in Third Party Scripts
Posted
Yup. Using xampp..