Welcome Guest, Not a member yet? Register   Sign In
Root paths for form submit
#1

[eluser]Dandy_andy[/eluser]
I am using a global header for my site which has various options that dynamically change depending on the page being viewed. One of the issues I have is with form submits because of the controller paths. To try and explain this simply, one of the forms in my header template has the following:-

Code:
<form name="logout" id="logout" method="post" action="logout">
<label>input type="submit" class="btn" value="Logout" name="logout" align="middle"/></label>
&lt;/form&gt;

When the header is called up from a controller at say www.site.com/controller, then the "logout" controller is accessed fine.

But now I have added additional tiers to my controllers in order to create various site functions, I cant access the "logout" controller if I am at say www.site.com/user/controller as the post is looking for "logout" at that level.

Is there a simple way to create an absolute path without having to pass variables through the controller? I have tried the following but it doesn't work:-

Code:
&lt;form name="logout" id="logout" method="post" action="&lt;?php echo ($_SERVER['DOCUMENT_ROOT']); ?&gt;/logout"&gt;
          <label>input type="submit" class="btn" value="Logout" name="logout" align="middle"/></label>
                &lt;/form&gt;


Messages In This Thread
Root paths for form submit - by El Forum - 06-08-2012, 02:43 PM
Root paths for form submit - by El Forum - 06-08-2012, 03:13 PM
Root paths for form submit - by El Forum - 06-08-2012, 03:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB