close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Reflect changes to profile photo immediately after user updates their profile.

Thread began 4/26/2013 9:47 am by Mysite07430650 | Last modified 4/29/2013 6:41 pm by Mysite07430650 | 2847 views | 12 replies

Jason ByrnesWebAssist

The problem is code order.

the image is using the SecurityAssistpcms2users recordsset:
<img src="../_images/userprofilethumb/<?php echo $row_SecurityAssistpcms2users['UserImage']; ?>" alt="Client Thumbnail Photo" name="cppmf100" width="50" height="50" id="cppmf100">Profile Photo

On the page, you have the recordset before the update behavior. move the code for the update behavior at lines 143 - 224:

php:
<?php 

// WA DataAssist Update
if ((isset($_POST["UserUpdate_submit"]) && $_POST["UserUpdate_submit"] != "")) // Trigger
{
  
$WA_connection $mfaccessConn;
  
$WA_table "pcms2_users";
  
$WA_redirectURL "userupdate.php?success=1";
  if (
function_exists("rel2abs")) $WA_redirectURL $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
  
$WA_keepQueryString true;
  
$WA_indexField "UserID";
  
$WA_fieldNamesStr "UserEmail|UserPassword|UserFirstName|UserLastName|UserCity|UserState|UserZip|UserPhone|UserFax|UserCountry|UserAddress|UserAddress2|UserImage|UserThumbnail|emailVerified";
  
$WA_fieldValuesStr "".((isset($_POST["User_Update_group_Email"]))?$_POST["User_Update_group_Email"]:"")  ."" $WA_AB_Split "".((($_POST["User_Update_group_Password"] != ""))?WA_SHA1Encryption($_POST["User_Update_group_Password"]):$row_SecurityAssistpcms2users["UserPassword"])  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_First_Name"]))?$_POST["User_Update_group_First_Name"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_Last_Name"]))?$_POST["User_Update_group_Last_Name"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_City"]))?$_POST["User_Update_group_City"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_County"]))?$_POST["User_Update_group_County"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_10_Post_Code"]))?$_POST["User_Update_group_10_Post_Code"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_1_Telephone"]))?$_POST["User_Update_group_1_Telephone"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_1_Mobile"]))?$_POST["User_Update_group_1_Mobile"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_11_Country"]))?$_POST["User_Update_group_11_Country"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_Address_1"]))?$_POST["User_Update_group_Address_1"]:"")  ."" $WA_AB_Split "".((isset($_POST["User_Update_group_Address"]))?$_POST["User_Update_group_Address"]:"")  ."" $WA_AB_Split "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."" $WA_AB_Split "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."" $WA_AB_Split "".(($row_SecurityAssistpcms2users['UserEmail'] != $_POST["User_Update_group_Email"])? '0'$row_SecurityAssistpcms2users['emailVerified'])  ."";
  
$WA_columnTypesStr "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL";
  
$WA_comparisonStr "=|=|=|=|=|=|=|=|=|=|=|=|=|=|=";
  
$WA_fieldNames explode("|"$WA_fieldNamesStr);
  
$WA_fieldValues explode($WA_AB_Split$WA_fieldValuesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  
  
$WA_where_fieldValuesStr "".((isset($_SESSION["SecurityAssist_UserID"]))?$_SESSION["SecurityAssist_UserID"]:"")  ."";
  
$WA_where_columnTypesStr "none,none,NULL";
  
$WA_where_comparisonStr "=";
  
$WA_where_fieldNames explode("|"$WA_indexField);
  
$WA_where_fieldValues explode($WA_AB_Split$WA_where_fieldValuesStr);
  
$WA_where_columns explode("|"$WA_where_columnTypesStr);
  
$WA_where_comparisons explode("|"$WA_where_comparisonStr);
  
  
$WA_connectionDB $database_mfaccessConn;
  
mysql_select_db($WA_connectionDB$WA_connection);
  @
session_start();
  
$updateParamsObj WA_AB_generateInsertParams($WA_fieldNames$WA_columns$WA_fieldValues, -1);
  
$WhereObj WA_AB_generateWhereClause($WA_where_fieldNames$WA_where_columns$WA_where_fieldValues,  $WA_where_comparisons );
  
$WA_Sql "UPDATE `" $WA_table "` SET " $updateParamsObj->WA_setValues " WHERE " $WhereObj->sqlWhereClause "";
  
$MM_editCmd mysql_query($WA_Sql$WA_connection) or die(mysql_error());
  if (
$WA_redirectURL != "")  {
    if (
$WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
      
$WA_redirectURL .= ((strpos($WA_redirectURL'?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
    }
    
header("Location: ".$WA_redirectURL);
  }
}
?>
<?php 
// WA DataAssist Update
if ((isset($_GET['send']) && $_GET['send'] != "")) // Trigger
{
  
$WA_connection $mfaccessConn;
  
$WA_table "pcms2_users";
  
$WA_redirectURL "";
  if (
function_exists("rel2abs")) $WA_redirectURL $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
  
$WA_keepQueryString false;
  
$WA_indexField "UserID";
  
$WA_fieldNamesStr "UserImage|UserThumbnail|randomString";
  
$WA_fieldValuesStr "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."" $WA_AB_Split "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."" $WA_AB_Split "".$_SESSION['rpw']  ."";
  
$WA_columnTypesStr "',none,''|',none,''|',none,''";
  
$WA_comparisonStr "=|=|=";
  
$WA_fieldNames explode("|"$WA_fieldNamesStr);
  
$WA_fieldValues explode($WA_AB_Split$WA_fieldValuesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  
  
$WA_where_fieldValuesStr "".$_SESSION['SecurityAssist_UserID']  ."";
  
$WA_where_columnTypesStr "none,none,NULL";
  
$WA_where_comparisonStr "=";
  
$WA_where_fieldNames explode("|"$WA_indexField);
  
$WA_where_fieldValues explode($WA_AB_Split$WA_where_fieldValuesStr);
  
$WA_where_columns explode("|"$WA_where_columnTypesStr);
  
$WA_where_comparisons explode("|"$WA_where_comparisonStr);
  
  
$WA_connectionDB $database_mfaccessConn;
  
mysql_select_db($WA_connectionDB$WA_connection);
  @
session_start();
  
$updateParamsObj WA_AB_generateInsertParams($WA_fieldNames$WA_columns$WA_fieldValues, -1);
  
$WhereObj WA_AB_generateWhereClause($WA_where_fieldNames$WA_where_columns$WA_where_fieldValues,  $WA_where_comparisons );
  
$WA_Sql "UPDATE `" $WA_table "` SET " $updateParamsObj->WA_setValues " WHERE " $WhereObj->sqlWhereClause "";
  
$MM_editCmd mysql_query($WA_Sql$WA_connection) or die(mysql_error());
  if (
$WA_redirectURL != "")  {
    if (
$WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
      
$WA_redirectURL .= ((strpos($WA_redirectURL'?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
    }
    
header("Location: ".$WA_redirectURL);
  }
}
?>



to line 131 so the update is before the recordset.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...