• Resolved sdwood

    (@sdwood)


    Hi,

    I might be barking up the wrong tree here…I currently have a standard PHP application that i am trying to migrate to WP. Chiefly this is so I can manage copy etc via the WP admin console. So i have some pages that currently take HTTP query params which the PHP code uses to lookup a MySQL database, pretty standard fare. So lets say that i have some users and currently a page that looks like /users?userId=143523 is used to fetch the users details from the database and combine this with some static HTML output. What I think i would like to do is have a wordpress template page that will allow me to edit the copy for this page without having to FTP a new copy of the file onto the server.

    So if i had a custom template that renders the copy i want and the links etc i want in a profile page – along with the dymanic database driven content which i will get by looking up the database – is this possible ? For example maybe i could create a new page called users, based on a template called profile-page.

    I guess my question is basically can i do this in wordpress and how would I go about it ? It seems that trying to create a “page” manually for each user using the user-template custom template with a custom field would work, but this wont work when a new user signs up obviously, although i would also like the URL structure that WP would give me for this. Maybe there is something i am not understanding ?

    thanks,
    Steve.

Viewing 5 replies - 1 through 5 (of 5 total)
  • It is certainly possible to pass parameters in the URL with WP. I am doing that with categories. I use the code below to add the ‘stayincat’ parameter to the permalink for a page. The user clicks on the page title and the URL passes the stayincat parameter to the page template:

    <h2><a href="<?php echo htmlentities(add_query_arg('stayincat',get_query_var('cat'),get_permalink())) ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    Thread Starter sdwood

    (@sdwood)

    Hi,

    Many thanks for your reply. I think the problem was that when i had a slug e.g.

    mydomain.org/member/?memberId=1234

    I was making URLs like member?foo=bar and it should be member/foo=bar.

    Thanks,
    Steve.

    I was making URLs like member?foo=bar and it should be member/foo=bar.

    Did you have a typo in the line above? It should be member/?foo=bar

    If your problem is solved, please use the dropdown at top right to mark this topic ‘Resolved’.

    Thread Starter sdwood

    (@sdwood)

    Yes – a typo – thans very much for your help.

    You are welcome. Now, please use the dropdown at top right to mark this topic ‘Resolved’.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Passing HTTP Get parameters….’ is closed to new replies.