• Hello could any help me how to get parametrs var and id from URL

    …/objednavka-provedena/?var=Emailem+do+3+dní%3A+49+K?&id=1191

    to page

    <p>
    VAR: <br/>
    ID:<br/>
    </p>

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • In a Page Template for your Page always done properly in a Child Theme, you can use:

    
    $myvar = $_GET["var"];
    $myid = $_GET["id"];
    echo '<p>' . 'VAR: ' . htmlspecialchars_decode($myvar) . '<br/>' . 'ID: ' . htmlspecialchars_decode($myid) . '<br/>' . '</p>';
    

    This will echo on screen:

    
    VAR: Emailem do 3 dní: 49 K?
    ID: 1191
    

    You can lookup $_GET and htmlspecialchars_decode at the PHP Manual. Note the + are not echoed. This has to do with how these are handled within htmlspecialchars_decode. Your URL has a mixture of special characters, so do some testing starting with above example.

    Thread Starter janbrokes

    (@janbrokes)

    thank you very much!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get parametr from URL to page’ is closed to new replies.