Topic RSS
7:48 pm
Hi there!
I have a site that I'm working on that is essentially a Wordpress blog. As such there is an additional page that needs to be part of the site that doesn't have any theme features of the blog. Essentially a static Blank PHP/HTML page without any WP formatting.
Now that I have cForms running properly on the blog I would really like to have one of the forms appear on this static page as well. I've tried to get this to show up by just including:
<?PHP insert_cform(); ?>
However I get:
Fatal error: Call to undefined function: insert_cform() in /home/senio4/public_html/test.php on line 9
Is there anyway I could make this work?
Thank you!
Greg
8:23 pm
ok, I've ditched that insert code and just hard copied the displayed form and the header call and I now have the form displaying on a non-wordpress page. However when I fill out the form and click submit I get the "One Moment Please…" message and that's it. The submit button stays pressed and nothing happens. Additionally the data doesn't get pushed into the DB.

8:45 pm
March 6, 2005
Offlinecforms is not designed to work in non WP environments. So it does require some basic WP features/settings. Why not build your stripped page with a bare minimum of WP includes (no Theme stuff needed) add wp_head(); and you should be good to go…
9:42 pm
Hmmm. Thank you for your help. I've never tried anything quite like this so any help is appreciated..
On this non-WP page I have:
<head>
<link rel="stylesheet" type="text/css" href="http://www.xxxxxxx.com/wp-content/plugins/contactf….." />
<script type="text/javascript" src="http://www.xxxxxxx.com/wp-content/plugins/contactf…..pt>
<?php require('./wp-blog-header.php'); ?>
</head>
<body>
<?PHP insert_cform(); ?>
</body>
</html>
This gives me the error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/senio4/public_html/test2.php:5) in /home/senio4/public_html/wp-content/plugins/contactforms/cforms.php on line 57
RIGHT ABOVE A WORKING FORM!! WOO HA!
Now if I can just get rid of this message! LOL. I checked on /cforms.php line57 and it's the Session Start for Captcha. I'm not using Captcha though. Any thoughts?
Thanks again!!
Greg
10:47 pm
March 6, 2005
OfflineI see you're making progress. Great!
You could comment out the SESSION part if you don't intend to use captcha. You may addiitonally need to add a wp_head(); statement that will put the proper Javascript statements into your HTML HEAD(er)…
2:35 am
I have tried both of your suggestions..
- Commenting out the //session tag – this makes the error disappear and allows for the form to pass data to the DB and email. However the form still hangs on the Waiting… message and leaves the Submit button permanently pressed. Although passing the info, to the end user, the system appears to be hung.
- wp_head(); — each time I try to call this <?php wp_head(); ?> before the wp-blog-header.php I get an error: Fatal error: Call to undefined function: wp_head() in /home/senio4/public_html/test3.php on line 7
If I call it after the wp-blog-header.php, it never makes it past my first error.
Any suggestions? I'm hitting my head against a wall here.
Thanks!
8:00 am
March 6, 2005
OfflineOf course you could hard code the Javascript part that cforms puts in the header of a standard Theme, just copy and paste it from one of your regular theme pages.
That should fix the "hanging", or alternatively try to disable the Ajax support in cforms to see if it works then.
5:18 pm
disabled AJAX, no visible change.
and is this what you mean by hard coding the JS in the <head></head>?
<link rel="stylesheet" type="text/css" href="http://www.xxxxxxx.com/wp-content/plugins/contactf….." />
<script type="text/javascript" src="http://www.xxxxxxx.com/wp-content/plugins/contactf…..pt>
5:35 pm
March 6, 2005
OfflineYes, that would be required for Ajax support. Also, you may want to you use Firefox/Firebug to better trouble shoot, it will tell you why the browser stalls (look at Console-> return values from post)
When you disable Ajax, the page should reload completey, hence the button can stay pressed. Is this really not working?
Most Users Ever Online: 959
Currently Online:
57 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3553
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5160
Posts: 18393
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote











