<p>The answer is now included in the question. Don't be a dingbat and make sure MAMP or Apache (or whatever webserver you're using) is configured properly.</p>

CC BY-SA 3.0
2016-02-16T18:10:57.243Z
2016-02-16T18:10:57.243Z
Elliot Lewis
<p>I've been having trouble getting a front-end profile template to save any data.
It was quite complex so I've gone back to a base install of Craft with no custom fields for a User.</p>

<p>Using the example code from the docs it still doesn't save any data.
<a href="http://buildwithcraft.com/docs/templating/user-profile-form" rel="nofollow">http://buildwithcraft.com/docs/templating/user-profile-form</a></p>

<p>This is running the full version of Craft on localhost.</p>

<p>I have a custom route of /profile set to a template called 'profile'.</p>

<p>Loading the page loads all currently stored data exactly the same as the CP.</p>

<p>Submitting the form reloads the page but none of the input data is saved and redisplayed. Going to the CP also shows nothing was saved.</p>

<p>After a few hours of trouble-shooting I discovered, on submit from the front-end template, the <code>saveUser</code> method was not running. It was from the CP.</p>

<p>Adding <code>action="{{ siteUrl }}"</code> to the form gets it working. But oddly then introduces the front controller in to the URL after submit, eg. <a href="http://localhost/index.php/profile" rel="nofollow">http://localhost/index.php/profile</a>.</p>

<p>There's no mention in the example code of a form requiring an <code>action</code> value. I can't work out why the example code doesn't work or why I need <code>action</code>. I'd rather not have the pretty URLs messed up.</p>

<p>Help?</p>

<pre><code>&lt;h1&gt;Profile&lt;/h1&gt;

&lt;form action="{{ siteUrl }}" method="post" accept-charset="UTF-8" enctype="multipart/form-data"&gt;

    {{ getCsrfInput() }}

    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="redirect" value="profile"&gt;
    &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;

    &lt;fieldset&gt; 
        &lt;legend class="visually-hidden"&gt;Personal details&lt;/legend&gt;

        &lt;label for="firstName"&gt;First name &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
        &lt;input id="firstName" type="text" name="firstName" value="{{ currentUser.firstName }}" placeholder="Jane" required="required" aria-required="true" autofocus="autofocus"&gt;

   &lt;/fieldset&gt;

    &lt;input type="submit" value="Save Profile"&gt;
&lt;/form&gt;
</code></pre>

<h3>Update 10-08-2015</h3>

<p>The profile form submitting seems to be a red-herring. When installing Craft I couldn't get it to work with clean URLs so I edited Apache's config to set 404s to redirect to crafts index.php. I'd since forgot. Local config:</p>

<ul>
<li>Mac OS X 10.10.4</li>
<li>MAMP (not pro)</li>
</ul>

<p>By default MAMP has <code>AllowOverride None</code>. That was stopping the .htaccess file from working. I'm using vhosts so I've manually set this in the vhost config. Another gotcha is Crafts config of <code>omitScriptNameInUrls</code> and <code>usePathInfo</code>. Craft caches test results for 24 hours, so I had to clear the cache before my updated vhost config worked.</p>

<pre><code>&lt;Directory "/path/to/craft/public"&gt;
    Options FollowSymLinks
    AllowOverride All
    Order Allow,Deny
    Allow From All
&lt;/Directory&gt;
</code></pre>

<p>The title of this SE question is all wrong now but it's valuable info. OK to change? I'd also say this is a common enough set-up to be in the official docs?</p>

CC BY-SA 3.0
2015-08-07T19:02:45.273Z
That's... weird.  Are all other URLs working on your site (submitting from the CP, etc.)?
Brad Bell
CC BY-SA 3.0
2015-08-09T20:27:20.757Z
Yep, everything works fine in the CP.
Elliot Lewis
<user-profile><htaccess><404><mamp><apache>
Front end profile does not save data - form action
# Front end profile does not save data - form action

(Asked by: username_0 on 2015-08-07)

I've been having trouble getting a front-end profile template to save any data.
It was quite complex so I've gone back to a base install of Craft with no custom fields for a User.
Using the example code from the docs it still doesn't save any data.
http://buildwithcraft.com/docs/templating/user-profile-form
This is running the full version of Craft on localhost.
I have a custom route of /profile set to a template called 'profile'.
Loading the page loads all currently stored data exactly the same as the CP.
Submitting the form reloads the page but none of the input data is saved and redisplayed. Going to the CP also shows nothing was saved.
After a few hours of trouble-shooting I discovered, on submit from the front-end template, the saveUser method was not running. It was from the CP.
Adding action="{{ siteUrl }}" to the form gets it working. But oddly then introduces the front controller in to the URL after submit, eg. http://localhost/index.php/profile.
There's no mention in the example code of a form requiring an action value. I can't work out why the example code doesn't work or why I need action. I'd rather not have the pretty URLs messed up.
Help?
Profile



    {{ getCsrfInput() }}

    
    
    

     
        Personal details

        First name *
        

   

    


Update 10-08-2015
The profile form submitting seems to be a red-herring. When installing Craft I couldn't get it to work with clean URLs so I edited Apache's config to set 404s to redirect to crafts index.php. I'd since forgot. Local config:

Mac OS X 10.10.4
MAMP (not pro)

By default MAMP has AllowOverride None. That was stopping the .htaccess file from working. I'm using vhosts so I've manually set this in the vhost config. Another gotcha is Crafts config of omitScriptNameInUrls and usePathInfo. Craft caches test results for 24 hours, so I had to clear the cache before my updated vhost config worked.

    Options FollowSymLinks
    AllowOverride All
    Order Allow,Deny
    Allow From All


The title of this SE question is all wrong now but it's valuable info. OK to change? I'd also say this is a common enough set-up to be in the official docs?

**Tags:** user-profile, htaccess, 404, mamp, apache

> **Comments:**
> **username_1**: That's... weird.  Are all other URLs working on your site (submitting from the CP, etc.)?  
> **username_0**: Yep, everything works fine in the CP.  

---

## 1 answers

### Answer by username_0 on 2016-02-16. Score: 1 | Accepted answer

The answer is now included in the question. Don't be a dingbat and make sure MAMP or Apache (or whatever webserver you're using) is configured properly.


---

