Title: Using PHP in WordPress
Last modified: August 19, 2016

---

# Using PHP in WordPress

 *  [keenanwl](https://wordpress.org/support/users/keenanwl/)
 * (@keenanwl)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/)
 * I would like to build a few .php pages in order to process a form and then present
   API errors and thank-yous. Is that possible on the WP CMS? What would I need 
   to do in order to make that happen?
 * As an alternative solution, I would like to process a form wholly within a WordPress
   page. Is it possible to have wordpress php functions and other php notation on
   the same page? For example, may I start a session before the header is called?

Viewing 6 replies - 16 through 21 (of 21 total)

[←](https://wordpress.org/support/topic/using-php-in-wordpress/?output_format=md)
[1](https://wordpress.org/support/topic/using-php-in-wordpress/?output_format=md)
2

 *  [illuminatus7](https://wordpress.org/support/users/illuminatus7/)
 * (@illuminatus7)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885861)
 * [@wp-fresher](https://wordpress.org/support/users/wp-fresher/), you can use get_permalink()
   function to get the URL of the page that you want by the following manner: –
   
   1) First get the page id from its title/ slug 2) Store the page id in a variable.
   3) Pass this variable as an argument into the get_permalink() function.
 * You can check out the code here [http://pastebin.com/MPjaZpSK](http://pastebin.com/MPjaZpSK)
 *  [Nyl Stanton](https://wordpress.org/support/users/nyl-stanton/)
 * (@nyl-stanton)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885869)
 * Can sombody please help…
    I accidently deleted my entire .htaccess file after
   editing a 301 redirect. I clicked the wrong button. now i have a new .htaccess
   file and I dont know how to edit it, I dont know exactly what should be there
   or how to format it. I dont anything about it. Meanwhile my website is now just
   a white page. Im using the twenty eleven theme if that helps at all. Please Help…
 *  [th77409](https://wordpress.org/support/users/th77409/)
 * (@th77409)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885870)
 * Is there any way to pass variables from the post into the template? I’m using
   the PHP Exec plugin, and I’d like to use the post field to pass a bunch of variables
   into my content-single.php until I get my SQL database running. Any clues?
 *  [Kulkarni](https://wordpress.org/support/users/abhijeet1/)
 * (@abhijeet1)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885872)
 * Use the wordpress extension. Save it through wordperss php extension it will 
   work.
 *  [Passagens Aereas](https://wordpress.org/support/users/passagens-aereas/)
 * (@passagens-aereas)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885873)
 * Im looking for the same solution… same problem in [http://depoimentosdeamor.org](http://depoimentosdeamor.org)
   but it is working now… In my new blog [http://passagensaereaspara.com.br](http://passagensaereaspara.com.br)
   i think my theme is broken…
 *  [j.calosor](https://wordpress.org/support/users/jcalosor/)
 * (@jcalosor)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885874)
 * seems like i need to post replies on posts before i can post my own topic?

Viewing 6 replies - 16 through 21 (of 21 total)

[←](https://wordpress.org/support/topic/using-php-in-wordpress/?output_format=md)
[1](https://wordpress.org/support/topic/using-php-in-wordpress/?output_format=md)
2

The topic ‘Using PHP in WordPress’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [webforms](https://wordpress.org/support/topic-tag/webforms/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 21 replies
 * 17 participants
 * Last reply from: [j.calosor](https://wordpress.org/support/users/jcalosor/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/using-php-in-wordpress/page/2/#post-1885874)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
