Home  >  Q&A  >  body text

Use isset function to get multiple URL parameters

I want to know how to get two parameters from URL. I have a url like this: www.example.com/simplepay-cancel/?r=eyJyIjo1MDE3LCJ0Ijo1MDIyOTI5NTIsImUiOiJDQU5DRUwiLCJtIjoiT01TNTMxNDU1MDEiLCJvIjoiMTE2Njk4ODAyOTk1NjMwIn0=&s=h/kKbYJWL3EYZiW/fG xaUh Ekx3d7E0EGBCieMGUjWlT+9tUhKBDJU4JglMVpYloj

It contains two parameters: r and s. Both are encrypted.

I want to get the following:

if (  (isset($_GET['r']) && isset($_GET['s']))) {
echo 'Hello';  }

It only works if I set the r parameter to a URL. This is a Wp site and I set the id as s parameter and it fails and goes to 404 page.

How to get these two parameters?

Thanks!

P粉019353247P粉019353247424 days ago576

reply all(1)I'll reply

  • P粉451614834

    P粉4516148342023-09-15 00:58:55

    The following example will help you "Get multiple parameters with the same name from URL in PHP".

    reply
    0
  • Cancelreply