WordPress.org

Support

Support » Plugins and Hacks » Shortcode Exec PHP » [Plugin: Shortcode Exec PHP] embedding form handlers – extra carriage returns

[Plugin: Shortcode Exec PHP] embedding form handlers – extra carriage returns

  • I am using a form handler in my php code and embedding the shortcode in a wordpress page. I am getting carriage returns entered into the page above the form – the number of carriage returns seems to correspond with the number of lines I have in the form handler. Any way to correct this?

    My code:
    if (isset($_POST[‘wc_firstname’]))
    $wc_firstname = $_POST[‘wc_firstname’];
    if (isset($_POST[‘wc_lastname’]))
    $wc_lastname = $_POST[‘wc_lastname’];
    if (isset($_POST[‘wc_address1’]))
    $wc_address1 = $_POST[‘wc_address1’];
    if (isset($_POST[‘wc_address2’]))
    $wc_address2 = $_POST[‘wc_address2’];
    if (isset($_POST[‘wc_city’]))
    $wc_city = $_POST[‘wc_city’];
    if (isset($_POST[‘wc_state’]))
    $wc_state = $_POST[‘wc_state’];
    if (isset($_POST[‘wc_zip’]))
    $wc_zip = $_POST[‘wc_zip’];
    if (isset($_POST[‘wc_email’]))
    $wc_email = $_POST[‘wc_email’];
    if (isset($_POST[‘wc_attendees’]))
    $wc_attendees = $_POST[‘wc_attendees’];
    if (isset($_POST[‘wc_email’]))
    {
    save_wcinfo($wc_firstname, $wc_lastname, $wc_address1, $wc_address2, $wc_city, $wc_state, $wc_zip, $wc_email, $wc_attendees);
    }
    ?>
    <form method=”post” action=””><table><tr>
    <td><label>First Name</label></td>
    <td colspan=”2″><input type=”text” name=”wc_firstname” style=”width:200px;”></td></tr>
    <td><label>Last Name</label></td>
    <td colspan=”2″><input type=”text” name=”wc_lastname” style=”width:200px;”></td></tr>
    <td><label>Address 1</label></td>
    <td colspan=”2″><input type=”text” name=”wc_address1″ style=”width:200px;”></td></tr>
    <td><label>Address 2</label></td>
    <td colspan=”2″><input type=”text” name=”wc_address2″ style=”width:200px;”></td></tr>
    <td><label>City</label></td>
    <td colspan=”2″><input type=”text” name=”wc_city” style=”width:200px;”></td></tr>
    <td><label>State</label></td>
    <td colspan=”2″><input type=”text” name=”wc_state” style=”width:200px;”></td></tr>
    <td><label>Zip</label></td>
    <td colspan=”2″><input type=”text” name=”wc_zip” style=”width:200px;”></td></tr>
    <td><label>E-mail</label></td>
    <td colspan=”2″><input type=”text” name=”wc_email” style=”width:200px;”></td></tr>
    <td><label># Attendees</label></td>
    <td colspan=”2″><input type=”text” name=”wc_attendees” style=”width:200px;”></td></tr>
    </table>
    <input type=”submit” value=”Submit”>
    </form>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor M66B

    @m66b

    I am not seeing this behavior. I assumed all the above code was in the PHP code field of the Shortcode Exec PHP plugin. I added <? at the end to make it working, maybe that is your problem.

    hmm, well i have solved the problem for now by removing all carriage returns in my php code.. as follows.

    if (isset($_POST[‘wc_firstname’])) { $wc_firstname = $_POST[‘wc_firstname’]; } if (isset($_POST[‘wc_lastname’])) { $wc_lastname = $_POST[‘wc_lastname’]; } if (isset($_POST[‘wc_address1’])) { $wc_address1 = $_POST[‘wc_address1’]; } if (isset($_POST[‘wc_address2’])) { $wc_address2 = $_POST[‘wc_address2’]; } if (isset($_POST[‘wc_city’])) { $wc_city = $_POST[‘wc_city’]; } if (isset($_POST[‘wc_state’])) { $wc_state = $_POST[‘wc_state’]; } if (isset($_POST[‘wc_zip’])) { $wc_zip = $_POST[‘wc_zip’]; } if (isset($_POST[‘wc_email’])) { $wc_email = $_POST[‘wc_email’]; } if (isset($_POST[‘wc_attendees’])) { $wc_attendees = $_POST[‘wc_attendees’]; } if (isset($_POST[‘wc_email’])) { save_info($wc_firstname, $wc_lastname, $wc_address1, $wc_address2, $wc_city, $wc_state, $wc_zip, $wc_email, $wc_attendees); } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Shortcode Exec PHP] embedding form handlers – extra carriage returns’ is closed to new replies.
Skip to toolbar