WordPress.org

Ready to get started?Download WordPress

Forums

Insert PHP
[resolved] Inserting dynamic text in a form button (2 posts)

  1. drosengarden
    Member
    Posted 7 months ago #

    Hi - can this be done?

    <p span style="padding: 10px 0 50px 40px;"><input type="submit" name="sendbutton" id="myButton" class="myButton" value=[insert_php] if ($_GET['kw'])
    {echo ucwords($_GET['kw']);}
    else
    {echo ucwords('Default Text');}
    [/insert_php]></p>

    I'm getting the button that shows the text [insert_php} so apparently the code is not running.

    I know the code works on my site as I've entered this into a page.

    I might also add that above code is being run in a TEXT widget.

    Thanks

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

  2. WillBontrager
    Member
    Plugin Author

    Posted 7 months ago #

    drosengarden, Insert PHP will work only in posts and pages.

    Sorry, but it won't work in the Text widget.

    Otherwise, yes, your code appears that it would work (although I haven't tested it). Try it in a post or page.

    Will

Reply

You must log in to post.

About this Plugin

About this Topic