sandbergs
Member
Posted 2 years ago #
Is it possible to use this to create a custom form handler in wordpress?
For example I have this code in a an Exec-PHP widget (a different plugin) that I would really love to be able to use within the shortcode php plugin (but i get a 501 error when I try)
<?php
if(!empty($_POST['sub_email'])) {
$email=$_POST['sub_email'];
$zip=$_POST['sub_zip'];
$Result=add_email_to_list($email, $zip, 'listname'); }
}
if ($error != 0 || !isset($error)) { ?>
<form method="post" name="frmMailList" id="frmMailList" action="index.php">
<table><tr><td>Email:</td><td colspan="2"><input type="text" name="sub_email" id="sub_email" style="width:140px;" /></td></tr>
<tr><td align="left">Zip:</td><td align="right"><input type="text" name="sub_zip" id="sub_zip" style="width:75px;" /></td><td><input type="submit" value="Sign-Up" /></td></tr></table>
</form>
<?php
}
?>
</div>
http://wordpress.org/extend/plugins/shortcode-exec-php/
Yes, it is possible to handle forms with Shortcode Exec PHP. I have added a basic example here on the support page. Error 501 is a rare and strange error. Maybe there is a problem with the function add_email_to_list?
sandbergs
Member
Posted 2 years ago #
Thanks, I will check it out and try removing that function to debug!
sandbergs
Member
Posted 2 years ago #
I seem to get the 501 error any time I try to add any code to the plugin. I have tried simple statements, your test code, my test code, all come back with 501. Any ideas how to debug?
Error 501 means something like not implemented. A lot of people are using the plugin successful, so maybe there is a server feature missing or disabled preventing the plugin from doing its work. However, the plugin does not have important requirements (not more than WordPress itself), maybe only that the PHP eval function can be executed. If you like, I can take a look. Use the contact form (http://blog.bokhorst.biz/contact/) to sent me your login details (preferably FTP) if you want to. Btw, you get faster response if you use the support page of the plugin (http://wordpress.org/extend/plugins/shortcode-exec-php/).
This problem has been solved in version 1.9