• Have a program written, working well, using $_GET parameters, submitted from a form, to load a query a file in SQL, displaying the results.

    Currently migrating the program into the WordPress framework and am running into some strange behaviour.

    Although the page loads well with no parameters, attempting to invoke the php parameters in the standard way, the page has no idea what is going on, and returns a 404 error.

    URL’s sent to broswer look like

    “home/program/?parameter1=1 & paraemeter2 =2…etc for up to 28 parameters”
    -> 404 error.

    Strangely, the browser can be made to at least recognize the page by adding a ‘$’ before parameter1; however, parameter1 no longer behaves properly.

    “home/program/?$parameter1=1 & paraemeter2 =2…etc”
    -> parameters after the first work as expected

    What could explain WordPress’s reluctance to interpret the code in the standard way? What effect is the “$” having?

    when trying home/page?param=1 OR home/page?$param=1 a 404 is also served

    • This topic was modified 2 years, 7 months ago by diamaudix.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • What are the parameters you’re using? Certain parameters are reserved by WordPress and if you add them WordPress is going to try and use them itself to find posts and it will return a 404 if it can’t find any. If you’re using a reserved term the reason adding $ would work is because it’s changing the name of the parameter, eliminating this conflict. A list of reserved terms is available here.

    EDIT: In poking around your link I can see that you have registered a post type called “Artist”: https://diamaudix.com/artist/ Since artist has been registered as a post type using it as a parameter will cause WordPress to attempt to find an artist that matches the parameter value. Setting query_var to false or some other value when registering the post type will address the issue.

    Thread Starter diamaudix

    (@diamaudix)

    You are right. It was the name of the parameter “artist”… changed it to producer and it worked ?? Thanks for the help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with passing $_GET parameters’ is closed to new replies.