Form loading the home page and no "thanks" message

Permalink
Hey folks. I have a c5 site with a pretty standard Contact Us page that has a form on it. Upon submitting, the site then loads the home page and there's no "thanks" message. I assume the "thanks" message would show if the Contact Us page was loading. Any ideas? Thanks.

AlbertPotato
 
AlbertPotato replied on at Permalink Reply
AlbertPotato
Just realized that I'm using 5.3.3 and not 5.3.3.1. Upgrading now. Also, this site is hosted with XO (less than ideal). They run php4 by default and seem to run php5 as a CGI and not as an Apache module. Not sure if that makes a difference or not. Also, the rendered action for the form is:

action="/index.php?cID=53&bID=89&arHandle=Main&ccm_token=1259086326:f990a3bb3ad1ddb119071c9ac204d7af&btask=passthru&method=submit_form"
AlbertPotato replied on at Permalink Reply
AlbertPotato
I've updated to 5.3.3.1 but still have the same issue. Any ideas?
AlbertPotato replied on at Permalink Reply
AlbertPotato
I think I've found the culprit. There's this form element:

<input name="pURI" type="hidden" value="" />

and I believe the value should be something like:

/index.php?cID=53 (the cID for that page)

Not sure why it's blank or how to fix?
AlbertPotato replied on at Permalink Reply
AlbertPotato
This is definitely the problem. c5 uses (among other things) $_SERVER['REQUEST_URI'] to tell the form to reload the same page the form is on which can then display the Thanks message. Turns out that the site I'm developing is hosted on IIS (yuk) and Apache on IIS can display null for $_SERVER['REQUEST_URI'] (see this:http://www.dokeos.com/forum/viewtopic.php?t=8335... )

Boo on IIS. Boo on me for not making this client host somewhere decent. I could hack the core and have it use $_SERVER['PHP_SELF'] instead, but that's lame.
AlbertPotato replied on at Permalink Reply
AlbertPotato
AlbertPotato replied on at Permalink Reply
AlbertPotato
I put this at the top of index.php and it seems to have fixed it. Lord knows what else it broke...

if (!isset($_SERVER['REQUEST_URI']))
{
       $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],0 );
       if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; }
}