cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
What needs declared to use on non-WP page?
August 14, 2007
7:48 pm
Greg
Guest

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 

 

 

August 14, 2007
8:23 pm
Greg
Guest

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.

 Tongue out

August 14, 2007
8:45 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

cforms 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…

August 14, 2007
9:42 pm
Greg
Guest

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:

<html>
    <head>
    <link rel="stylesheet" type="text/css" href="http://www.xxxxxxx.com/wp-content/plugins/contactf…..&quot; />
    <script type="text/javascript" src="http://www.xxxxxxx.com/wp-content/plugins/contactf…..pt&gt;
    <?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

 

 

 

 

 

August 14, 2007
10:47 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

I 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)…

August 15, 2007
2:35 am
greg
Guest

I have tried both of your suggestions..

  1. 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.
  2. 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! 

August 15, 2007
8:00 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Of 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.

August 15, 2007
5:18 pm
greg
Guest

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…..&quot; />
<script type="text/javascript" src="http://www.xxxxxxx.com/wp-content/plugins/contactf…..pt&gt;
    

August 15, 2007
5:35 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Yes, 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? 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
45 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: 3732

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5333

Posts: 18696

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)