WordPress.org

Ready to get started?Download WordPress

Forums

Insert PHP
PHP With Forms (2 posts)

  1. casdrubo
    Member
    Posted 1 year ago #

    Good Morning,

    I just installed your plugin and having it working fine with some sample code you provided.

    I have very little/zero PHP experience so forgive me if I'm asking some pretty obvious questions.

    I have some php code that will allow me to send my html form to a mysql database. In the html form I am referencing "gamesheet.php" and the php script is called "gamesheet.php".

    How can I make the html form execute using php code written with the "insert php" plug-in?

    SAMPLE HTML Header:
    <h2>Home Team</h2>
    <form action="gamesheet.php" method="POST">Team Name:

    http://wordpress.org/extend/plugins/insert-php/

  2. WillBontrager
    Member
    Plugin Author

    Posted 1 year ago #

    If I understand your question correctly, this is what you have:

    ~ A form.

    ~ A separate PHP script to process the form when it is submitted. The PHP script updates a MySQL database that is not the same database as WordPress uses.

    My recommendation is to install the PHP script separately. Then put the form on a WordPress post or page.

    The form can then submit to the PHP script directly (the form tag's action attribute value being the absolute URL to gamesheet.php, like http://example.com/gamesheet.php ).

    Then you won't need to embed the script into a WordPress post or page. Less hassle :)

    Let me know if I didn't understand your question.

    Will

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.