Title: WordPress disaster!
Last modified: August 19, 2016

---

# WordPress disaster!

 *  [WebsiteBob](https://wordpress.org/support/users/websitebob/)
 * (@websitebob)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/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(); ?>`

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [kim09](https://wordpress.org/support/users/kim09/)
 * (@kim09)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/wordpress-disaster/#post-1433783)
 * Hi WebsiteBob,
 * There are many plugins where you can create a contact form easily, I use [this contact form](http://wordpress.org/extend/plugins/si-contact-form/)
   and it works well, you can even know senders’data for example their ips, browsers,
   etc.
 * Good luck 🙂
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/wordpress-disaster/#post-1433875)
 * if you are trying to make your php files work, they need to be a template.
 * basically, you need to include a header to let WP know that the php file is a
   page template. Then upload it into your theme…. where your index.php, header.
   php, etc are
 *     ```
       <?php
       /*
       Template Name: contactForm
       */
       ?>
       ```
   
 * goes at the top of the code. Now WP will recognize it as a template. To actually
   use it on your site, make a page through the WP admin interface (you can leave
   it blank, just title it Contact Form or something) and select your newly made
   template from the dropdown template selection menu.
 * And if you go the plugin route, google cforms as well…its my fave
 * Otherwise, if you do not want to make your php files a template, you have to 
   include WP into your php files. Here’s guidance on that:
    [http://codex.wordpress.org/Integrating_WordPress_with_Your_Website](http://codex.wordpress.org/Integrating_WordPress_with_Your_Website)
   [http://www.corvidworks.com/articles/wordpress-content-on-other-pages](http://www.corvidworks.com/articles/wordpress-content-on-other-pages)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress disaster!’ is closed to new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 3 participants
 * Last reply from: [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/wordpress-disaster/#post-1433875)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
