WordPress disaster!
-
Okay so I got an issue, I was trying to figure out how to set up custom pages in wordpress (like a contactform.php kinda deal) I still can’t, I don’t even know where I should upload contactform.php. But say I do sitename.com/contactform.php ill get this error: Fatal error: Call to undefined function get_header() in /home/sitename/public_html/contactme.php on line 1 and this is my code `
<?php get_header(); ?>
<?php get_sidebar(); ?><form method=”post” action=”contact.php”>
Name: <input name=”name” type=”text”>
Email: <input name=”email” type=”text”>
Message:
<textarea name=”message” rows=”15″ cols=”40″></textarea>
<input type=”submit”>
</form><?php
$to = “my@email.com”;
$subject = “Contact Us”;
$name = $_REQUEST[‘name’] ;
$email = $_REQUEST[’email’] ;
$message = $_REQUEST[‘message’] ;
$headers = “From: $email”;
$sent = mail($to, $name, $subject, $message, $headers) ;
if($sent)
{print “Your mail was sent successfully!}
else
{print “We encountered an error sending your mail”; }
?>
<?php get_footer(); ?>`
The topic ‘WordPress disaster!’ is closed to new replies.