Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Duplicated tickets if thankyou page is reloaded

Hi all,

I've seen than in all versions of osticket 1.8 and above (including 1.8.1-rc1), when a user submits a ticket, if he reloads the thankyou page (for instance, pressing F5), the ticket is created again, resulting in a duplicate.

Is there any way to solve this? I've seen a popular mod for 1.6 versions, but nothing for 1.8. Somebody with same experience?

Regards.

Comments

  • There is no way to prevent this in the ui at this time.  I'll move your thread to the mods and customization section of the forums.
  • Ok. Thak you so much. I will wait for a future release.

    In any case, if anyone has any kind of "dirty" solution, I'm still open to it :)
  • HI

    I have the below in "thankyou.inc.php"

    <script type="text/javascript">
    <!--
    function delayer(){
        window.location = "index.php"
    }
    //-->
    </script>
    <body onLoad="setTimeout('delayer()', 10000)">


    thanks
    Peter
  • Hi all!!

    Sorry for my late response.
    Thanks for the idea ThunderStorm. Actually I've based on it to include this code in open.php:
    Below of (line 73):

    echo Format::safe_html($ticket->replaceVars(str_replace(
                        array('%{ticket.number}', '%{ticket.extId}', '%{ticket}'), //ticket number vars.
                        array_fill(0, 3, 'XXXXXX'),
                        $page->getBody()
                        )));

    I've put:

        function redirect(){
          echo '<script type="text/javascript" language="JavaScript">setTimeout(function () { location.href =     \'index.php\'; }, 5000);</script>';
        }
        redirect();

    This redirects to index.php past 5 seconds from displaying the thankyou code page.

    It's a dirty solution and I'm sure there's a best way to do this, but after fighting with headers() and more, I think this is the easiest.

    Regards!!
Sign In or Register to comment.