Getting URL Variables in One Page, and using in another

0

I have a link in which I get the parameters in the url completely, in case it points to an HTML where I have my inputs, and I get the URL with the parameters, what I need and get the variables from that URL and use it on another page when giving a submit in a form ...

LINK

link

I need to save the variables and save them in the variables and use them normally in the other pages ... but I can not ...

I can use php or jquery but I have no idea why and more than 1 variable that I will need to load ...

Just to clarify:

MY INDEX and Html PURE WHERE IT HAS AN INPUT, in this input when I fill in the data I can choose what type of payment I make, and there is a php for each of the payment types, so the accuracy of picking the above variables for to be able to use in the filling of values and other data that will be in the bd and the time of the payment ...

    
asked by anonymous 24.06.2017 / 02:08

2 answers

1

You can use a session to store these values.

In the session you can store values that "persist" between one page and another because they are kept in the HTML requests for your server.

As in the code below:

Page that receives the variables:

session_start();
$_SESSION['nome_var'] = $_GET['var'];

Page that uses the session_start(); variables to access the values by $_SESSION['nome_var'] set.

    
24.06.2017 / 04:10
1

It would be ideal to make a single PHP script.

You can pass an input with the id of the selected payment method to the PHP script, and then use a switch statement.

Example.

switch ($_POST['tipo_pagamento']) {
case 0:
    echo "sua logica de programação";
    break;
case 1:
    echo "sua logica de programação";
    break;
case 2:
    echo "sua logica de programação";
    break;
}
    
24.06.2017 / 04:50