WordPress.org

Ready to get started?Download WordPress

Forums

PHP and database code on Pages (4 posts)

  1. morroida
    Member
    Posted 7 years ago #

    I am in the process of migrating my whole website to WordPress. I was able to succesfully convert all my 7k+ Movable Type posts.

    Now I am struggling with some other pages (not posts). There is a particular page I have that first shows a selects box, the user than selects something in the drop down box and clicks ok, the page is then reloaded, and a PHP script gets what the user selected (method='post'), makes a connection to a database, selects data accordingly and shows to the user.

    How can I migrate that to WordPress?

    edit: I have the php code working already, but I was unable to make it work inside a wordpress page, the database connections get screwed and making the form reload the same page is not working either!

    Thanks

  2. Chris_K
    Member
    Posted 7 years ago #

    Check out the section on creating your own Page Templates at the Pages page in the codex.

    You could create a new Page template, bury all your code into it. Then, in WP, create a new Page, select that template, give it a title and (optionally) just leave the content area blank.

  3. morroida
    Member
    Posted 7 years ago #

    I was able to do what you suggested. It works perfectly the first time it loads, but when I click submit and the page reloads itself passing it parameters, for example

    test.com/test-page/?a=a&b=b

    it won´t work :(

    test.com/test-page with no parameters loads perfectly

  4. morroida
    Member
    Posted 7 years ago #

    can anyone help me please :(

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags