Thanks KK,
but unfortunately I can not fix - there is something different between register.php & profile.php. Here's what I did, but the code does not work - all fields are empty and do not extract information from database.
Please tell me where I'm wrong
Thanks
but unfortunately I can not fix - there is something different between register.php & profile.php. Here's what I did, but the code does not work - all fields are empty and do not extract information from database.
Please tell me where I'm wrong

- Code: Select all
<?php require_once( '../xxx/cms.php' ); ?>
<cms:template title='User Profile' hidden='1' />
<!-- this is secured page. login first to access it -->
<cms:if k_logged_out >
<cms:redirect "<cms:login_link />" />
</cms:if>
<!-- someone who manages to reach here is certainly a logged-in user -->
<h2>Edit profile</h2>
<!-- are there any success messages to show from previous save? -->
<cms:set success_msg="<cms:get_flash 'success_msg' />" />
<cms:if success_msg >
<h4>Profile updated.</h4>
</cms:if>
<!-- show the edit form -->
<style>
form{ width:400px; }
</style>
<!-- this ia regular databound-form -->
<cms:form
masterpage=k_user_template
mode='edit'
page_id=k_user_id
enctype="multipart/form-data"
method='post'
anchor='0'
>
<cms:if k_success >
<cms:db_persist_form
_invalidate_cache='0'
k_page_name = "<cms:random_name />"
k_publish_date = '0000-00-00 00:00:00'
k_page_title = frm_title
extended_user_email = frm_email
extended_user_password = frm_password
extended_user_password_repeat = frm_repeat_password
tel = frm_tel
/>
<cms:if k_success >
<cms:set_flash name='success_msg' value='1' />
<cms:redirect k_page_link />
</cms:if>
</cms:if>
<cms:if k_error >
<font color='red'><cms:each k_error ><cms:show item /><br /></cms:each></font>
</cms:if>
DisplayName*:<br />
<cms:input name='title' label='DisplayName' type='text' required='1' validator=' min_len=2 | max_len=20' validator_msg='min_len=... 2! | max_len=...!' placeholder='Alis' />
<br />
E-mail*:<br />
<cms:input name='email' label='E-mail' type='text' required='1' validator='email' validator_msg='email=Need E-mail!' placeholder='email@abc.com' />
<br />
Tel*:<br />
<cms:input name='tel' label='Telephone' type='text' required='1' placeholder='0123456789' />
<br />
<input type="submit" name="submit" value="Save"/>
</cms:form>
<!-- give an option to logout -->
<a href="<cms:logout_link />">logout</a>
<?php COUCH::invoke(); ?>
Thanks