cforms II User Forum

Registration is currently disabled.


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
Non-AJAX form action URI bug?
September 27, 2009
10:04 pm

Please replace the ??? with your data!


Hi All,

I have created a non-AJAX form on a page with a URI of:

When I submit the form, the default action is to redirect to:

I tracked this problem to the get_current_page function in lib_aux.php

### replace standard & custom variables in message/subject text
function get_current_page($clean=false){
    global $Ajaxpid;

    $page = $_SERVER['REQUEST_URI'];
    if ($clean && strpos($page,'?')>0)
            $page = substr( $page, 0, strpos($page,'?'));
    $page = (trim($page)=='' || strpos($page,'lib_ajax.php')!==false )?$_SERVER['HTTP_REFERER']:trim($page); // for ajax
    return htmlspecialchars($page);

Using the REQUEST_URI for the form action URI will only work if the form is on a page with a permalink. It will not work on a page with a page_id asthe REQUEST_URI contains no query string information.

Perhaps I am not understanding the application, but I can think of no situation where you would NOT want to redirect to the HTTP_REFERER URI.

Has anyone else experienced this problem?

Thanks for the help! Smile

September 16, 2013
11:24 pm

I have a very similar problem.

Trying to make two language work with query strings like ?lang=en (for english and ?lang=es for spanish I found that when submiting form with errors (NO AJAX) the return path or url is the one without the query string language.

See it in action:

if you submit it empty the refresh url comes without the language querystring

Any help please?

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
24 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: 3757

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5355

Posts: 18732

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

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

Administrators: Oliver (6400), Nicky (3)