0

I have set a url like this in my signup

https://www.example.com/signup?ref_token=5c4d9bc6d3cb2

And my button should be like this :

if(isset($_POST['submit'])){
    // Some code at here
}

Before the isset post I am still able to get the $_GET['ref_token'] data but right after the post, the get data lost.

Eaten Taik
  • 868
  • 2
  • 12
  • 35
  • 1
    Could you add to your question your form please? – Syscall Mar 23 '18 at 07:06
  • 1
    Usually you would use either GET or POST. If you have a form you could include the ref_token as a hidden input. – lloiacono Mar 23 '18 at 07:06
  • Check your action-attribute – Bernhard Mar 23 '18 at 07:06
  • 1
    Possible duplicate [How to keep already set get parameter values on Form Submission](https://stackoverflow.com/questions/7201124/how-to-keep-already-set-get-parameter-values-on-form-submission) – Joseph D. Mar 23 '18 at 07:08
  • Yes I have a form for submission and thank you all that I'm able to get the data now by putting the value as hidden in an input control. – Eaten Taik Mar 23 '18 at 07:16

1 Answers1

0

The easiest solution for you to transmit your form dats via post to the same url.

You can achieve this by using as form action target:

<?php echo $_SERVER["PHP_SELF"].'?'.http_build_query($_GET); ?>

Another possibility would be to transmit your current GET parameters in a hidden field and evaluate them.

Nils
  • 2,665
  • 15
  • 30