WordPress.org

Support

Support » Plugins and Hacks » Insert PHP » PHP With Forms

PHP With Forms

  • 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/

Viewing 1 replies (of 1 total)
  • Plugin Author WillBontrager

    @willbontrager

    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

Viewing 1 replies (of 1 total)
  • The topic ‘PHP With Forms’ is closed to new replies.
Skip to toolbar