Updating user record outside of CMS ?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 3, 2012   (RSS)

By nmsinc - April 3, 2012

I have created a form to update users outside the CMS. I can pull the user in, however, when I submit the changes the page errors out at the 404 error catch which tells me that it is not parsing the user number in the URL!



Here is page top with 404 error catch:



// load viewer library

$libraryPath = 'cmsAdmin/lib/viewer_functions.php';

$dirsToCheck = array('','../','../../','../../../','../../../../');

foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}

if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }



// load records

list($accountsRecords, $accountsMetaData) = getRecords(array(

'tableName' => 'accounts',

'where' => whereRecordNumberInUrl(1),

));

$accountsRecord = @$accountsRecords[0]; // get first record



// show error message if no matching record is found

if (!$accountsRecord) { dieWith404("Record not found!"); }



Here is the form submit code:



<form method="post" action="http://www.claimscaddy.com/user-profile-admin-update.php?<?php echo htmlspecialchars(@$_REQUEST['num']); ?>">

<input type="hidden" name="save" value="1" />



Any ideas anyone? – Thanks nmsinc[/#000000]
nmsinc

Re: [Tom P] Updating user record outside of CMS ?

By nmsinc - April 3, 2012

Hi Tom,

Worked - Thanks!
nmsinc