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
Redirect not working
August 9, 2007
3:34 pm
A Marques
Guest

Hi,

I have a page that creates a form based on post data. The fields variables are inside an if…else condition.

I get my form to send emails, the confirmation message on top of the form also shows but the redirect doesn't work.

Any idea on what the problem might be?

I'm using the latest cforms and tested on Firefox 2 and IE7. 

Thanks for any help and congrats on a fantastic plugin.

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

You're are saying, that you're using the dynamic form feature?

Can you try to get the redirect working with a simple, standard form? 

August 10, 2007
12:42 am
A Marques
Guest

Ok, so maybe I was a little shot on the details.

Let's see if I can do better.

The form is deployed on a blog page where I'm running php (not on index.php but on an actual content page) and is dynamically generated to use variables that are coming from post data on a previous page as the value for some of the $fields.

I've managed to remove the generating function from the if..else cycle, so this is not where the problem is.

Everything works well on the generated form (emails, db tracking) except the redirect.

Answering your second question, If I use the base form outside of the php code (as in <!--cforms#-->), the redirect works fine. 

To run the php on a page I'm using the runPHP plugin. Do you think there might be something conflicting in the evaluation?

Thanks for your fast reply. 

August 10, 2007
7:40 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Thanks for the add'l  info.

There is not reason for the redirect feature to not work then with your dynamic form (provided the form settings are properly configured). The code used to execute the redirect is the same for standard & dynamic forms, so if one works the other should do, too: you may want to try again the standard form test with no Ajax support on the same form (you may have done that already).

Also, since your dynamic form gets already displayed fine and the email part works, too, the redirect in fact must work, here is the code part (which gets executed right after sending the emails & before 'displaying' the success message):

// redirect to a different page on suceess?
if ( get_option('cforms'.$no.'_redirect') ) {
    ?>
    <script type="text/javascript">
        location.href = '<?php echo get_option('cforms'.$no.'_redirect_page') ?>';
    </script>
    <?php
}

Edit: on second thought, it may in fact have to do with the evaluation of code (Javascript output) by runPHP …but I've never used that plugin so I can't say for sure.

 

 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
26 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: 3744

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5345

Posts: 18714

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

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

Administrators: Oliver (6400), Nicky (3)