Wordpress Version: 2.3.3
TDO Mini Forms Version: 0.10
Operating System (if known): N/A
Webserver Software: N/A
Link to Website: http://www.spotifylinks.com
Error Message:
Copy and paste any error messages here
Is it possible to use a form on an external page outside of wordpress?
I am trying to build a subsite that will load a form from tdo mini forms and submit to wordpress.
I saw some code on how to load the form using php a while ago and can not find it. With this code will the form work on an external page?
This worked for me on my test site. I created a new php file. I had to load up Wordpress before excuting the form, but it works and all the form behaviour works.
<?php
// Load up Wordpress:
// Make sure the path to wp-load.php is correct.
//
$wp_load = realpath("../wordpress/wp-load.php");
if(!file_exists($wp_load)) {
$wp_config = realpath("../wordpress/wp-config.php");
if (!file_exists($wp_config)) {
exit("Can't find wp-config.php or wp-load.php");
} else {
require_once($wp_config);
}
} else {
require_once($wp_load);
}
// Display Form
//
if(function_exists('tdomf_the_form')) {
// Change 1 to the form id of the form you wish to display
tdomf_the_form(1);
// You can also supply a post id, if you want to edit a post
#tdomf_the_form(1,365);
} else {
exit("TDO Mini Forms plugin is not enabled");
}
?>
There are a few limitations though. The style sheet used by the from is not automatically included, you’ll have to hack that in yourself. However AJAX and normal post method work.
Mark Cunningham
Guest
May 12th, 2009 at 3:54 pm
If you can show me the code I’ll tell you.
It depends on what you mean by “external page”? Do you mean a Wordpress Page (i.e. not a post) or do you mean completely outside of the Wordpress site?
Permalink | Quote