Title: Create Page with PHP scripting
Last modified: August 18, 2016

---

# Create Page with PHP scripting

 *  [raultbc](https://wordpress.org/support/users/raultbc/)
 * (@raultbc)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/)
 * Is it possible to create a page that has the PHP scripting in it to call a database
   and retrieve dynamic data from it? I want to retrieve dynamic data from a static
   page link. Or is it better to create my own php page and link to that?

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

 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262556)
 * Either mechanism works. Placing the PHP inside a [page template](http://codex.wordpress.org/Pages#Page_Templates)
   lets you take advantage of WordPress [Template_Tags](http://codex.wordpress.org/Template_Tags),
   which may save some time in the long run.
 * See <a href=”
    [http://wordpress.org/support/topic/43916#post-245661″>this](http://wordpress.org/support/topic/43916#post-245661″>this)
   post for some sample code.
 *  Thread Starter [raultbc](https://wordpress.org/support/users/raultbc/)
 * (@raultbc)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262559)
 * OK, I’ll have to code the template – should be fun for a non-PHP person.
 * If I have username/password/server values, can I connect to a non-MySQL database
   as well?
 *  [ment0r](https://wordpress.org/support/users/ment0r/)
 * (@ment0r)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262568)
 * i think you mean to execute php over the admin “write page” thingie..
 * there are plugins out who can do that for you, since modifying the template would
   apply the PHP code to ALL pages and i guess you only want it on a single specific
   page, created in admin interface.
 * I am using the plugin **RunPHP** from NoStatusQuo. With it enabled you can use
   BBCode-like markup to run php code in that page/post .. etc.
 * Check it out: [http://www.nosq.com/2004/10/runphp-wordpress-plugin/](http://www.nosq.com/2004/10/runphp-wordpress-plugin/)
 * regards, m3nt0r
 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262711)
 * RaulTBC: yes, you can connect to a different MySQL database manually using the`
   mysql_connect()` function from PHP.
 *  [twhite56](https://wordpress.org/support/users/twhite56/)
 * (@twhite56)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262713)
 * RunPHP doesn’t work for me..and I would rather not use it. How do I add new template
   files and call them from the index page?
    Thanks.
 *  [trevorturk](https://wordpress.org/support/users/trevorturk/)
 * (@trevorturk)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262725)
 * Add the template files to the theme directory, and check out this page for details.
 * [http://codex.wordpress.org/Stepping_Into_Templates#Template_Files_Within_Template_Files](http://codex.wordpress.org/Stepping_Into_Templates#Template_Files_Within_Template_Files)
 *  [twhite56](https://wordpress.org/support/users/twhite56/)
 * (@twhite56)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262731)
 * I checked out that page, but I don’t understand how to add the template so it
   recognizes it when requested. For example, I need to use the existing system 
   and add a function so that when navigate.php is requested it loads it into the
   wordpress system. I’ve tried this about 20 ways with just including wordpress
   files to get it to work, but it doesn’t.
    -Trevor
 *  Thread Starter [raultbc](https://wordpress.org/support/users/raultbc/)
 * (@raultbc)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262736)
 * skippy:
 * Not sure your comment resolves my issue – I want to write a page (I assume whatever
   is written gets saved to my MySQL database) and when I click on the link for 
   that page ([http://www.hostname.com/?page_id=22](http://www.hostname.com/?page_id=22))
   the page still presents itself in the theme that I have selected but the content
   area reads a SQL2K database and displays data from that database.
 * I saw EZ-SQL and have tried to put PHP code in the page data but the PHP code
   is displayed not executed.
 *  [trevorturk](https://wordpress.org/support/users/trevorturk/)
 * (@trevorturk)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262739)
 * twhite56, you would make the navigate.php page, and put it into your current 
   theme folder. Then you would add this PHP code to the part of the other tempate
   where you want that navigate.php code to be included:
 * <?php include (TEMPLATEPATH . ‘/navigate.php’); ?>
 * So, perhaps in your header.php file or sidebar.php file would be where to put
   that line. I hope this helps…?
 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262743)
 * RaulTBC: you cannot embed PHP directly into [Pages](http://codex.wordpress.org/Pages)
   without use a plugin, like RunPHP linked above.
 * Alternately, you can create a [Page Template](http://codex.wordpress.org/Pages#Page_Templates)
   for your navigation page. The template file can contain all the PHP you want,
   including the bit to connect to your other SQL database. Please read [“creating your own page template”](http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates)
   for details.
 * The ezSQL included with WordPress is pretty MySQL-specific. You’re better off
   using the raw [PHP SQL](http://www.php.net/manual-lookup.php?pattern=sql&lang=en)
   functions.
 *  [twhite56](https://wordpress.org/support/users/twhite56/)
 * (@twhite56)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262926)
 * Trevorturk, OK, but here is the issue with my problem – what if I wanted to use
   navigate.php but just have the header/wordpress functions included? In other 
   words, how do I create a blank index.php page that basically includes the wordpress
   functions but uses navigate.php.
    Thanks Again! -Trevor
 *  Thread Starter [raultbc](https://wordpress.org/support/users/raultbc/)
 * (@raultbc)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-262930)
 * skippy:
 * What I had to do was create a template that had the page-specific SQL to run 
   against the MS-SQL database. I then utilized the ezSQL interface to accomplish
   the connection. Kludgy, but it worked.
 * Hopefully someone will treat this issue in the future.
 * Thanks all for your suggestions.
 *  [twhite56](https://wordpress.org/support/users/twhite56/)
 * (@twhite56)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-263091)
 * Anyone have an answer? Thanks.
    -Trevor
 *  [candy2126](https://wordpress.org/support/users/candy2126/)
 * (@candy2126)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-263258)
 * I am having a site that supposrts osCommerce & the whole site is built in PHP,
   is it possible for me to create a static page like: [http://www.example.com/products.com](http://www.example.com/products.com)
   instead of the dynamic page?

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

The topic ‘Create Page with PHP scripting’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 14 replies
 * 6 participants
 * Last reply from: [candy2126](https://wordpress.org/support/users/candy2126/)
 * Last activity: [19 years, 9 months ago](https://wordpress.org/support/topic/create-page-with-php-scripting/#post-263258)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
