Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:52:12+00:00 2026-06-17T13:52:12+00:00

I have a document called editprofile.php and I have another one that is called

  • 0

I have a document called editprofile.php and I have another one that is called action.php. when the user submits their info using editprofile.php. the information get POSTed to action.php where I process the information and send it to mysql. After sending it I want to show a message that everything has been successfully changed. I used this :

if $everythingisdone{
$smarty->assign('sucess', 'Your changes have been made');
header('Location: ' . $_SERVER['HTTP_REFERER']);
}

I get redirected to the previous page, but there is no message even though I have this in my editprofile.tpl

{if $sucess}
<div class="sucess">
{$sucess}
</div>
{/if}

how can I assign the message when I redirect back?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:52:13+00:00Added an answer on June 17, 2026 at 1:52 pm

    you could do:

    //custom smarty function to set session flash messages
    function smarty_function_set_flash($params, $smarty) {
        $flash = "";
        if (isset($_SESSION['success'])) {
            $flash = $_SESSION['success'];
            $_SESSION['success'] = ""; //unset the session
        }
        return $flash; //return flash message
    }
    

    your code

    ....
    if($everythingisdone) {
      $_SESSION['success'] =  'Your changes have been made';
      header('Location: ' . $_SERVER['HTTP_REFERER']);
    }
    

    and view:

    {if isset($smarty.session.flash) && $smarty.session.flash != ''}
        <div class="sucess">{set_flash}</div>
    {/if}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object called Document that has a one-to-many relationship with DocumentPersonCc. I
Hi I have an object called document and one called user Document public virtual
Lets assume we have an entity called Document and an other one called User.
So I have two documents that both have allot of properties. One document is
In MongoDB, I have a document with a field called ClockInTime that was imported
This is a bit of a tricky one. I have Document entities that are
I have a page that contains a user control within an update panel. $(document).ready(function()
Suppose I have a document called test1.txt that contains the following numbers: 133213 123123
I have a Perl script that uses Selenium to fetch a HTML document called
I am using mongoengine with flask. I have a db.Document class called profile in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.