Title: [Plugin: Shortcode Exec PHP] embedding form handlers &#8211; extra carriage returns
Last modified: August 19, 2016

---

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

 *  [sandbergs](https://wordpress.org/support/users/sandbergs/)
 * (@sandbergs)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/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](https://wordpress.org/support/users/m66b/)
 * (@m66b)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-embedding-form-handlers-extra-carriage-returns/#post-1904535)
 * 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.
 *  Thread Starter [sandbergs](https://wordpress.org/support/users/sandbergs/)
 * (@sandbergs)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-embedding-form-handlers-extra-carriage-returns/#post-1904549)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [sandbergs](https://wordpress.org/support/users/sandbergs/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-embedding-form-handlers-extra-carriage-returns/#post-1904549)
 * Status: not resolved