I have two simple page. I need to send value of a text box, filled by the user, to another simple page. I have fallowed <a href="https://stackoverflow.com/questions...-wordpress-pages/50227476#50227476instruction">How to pass data between wordpress pages</a>. I got the follwoing error:
Warning: sizeof(): Parameter must be an array or an object that implements Countable in D:\xamp\htdocs\wordpress\wp-content\plugins\allow-php-in-posts-and-pages\allowphp.php on line 175
Warning: sizeof(): Parameter must be an array or an object that implements Countable in D:\xamp\htdocs\wordpress\wp-content\plugins\allow-php-in-posts-and-pages\allowphp.php on line 364
Here are my code:
the page from which I wanto to send the value:
the second page where i want to receive the value:
here is the plugin as said by the instruction:
Warning: sizeof(): Parameter must be an array or an object that implements Countable in D:\xamp\htdocs\wordpress\wp-content\plugins\allow-php-in-posts-and-pages\allowphp.php on line 175
Warning: sizeof(): Parameter must be an array or an object that implements Countable in D:\xamp\htdocs\wordpress\wp-content\plugins\allow-php-in-posts-and-pages\allowphp.php on line 364
Here are my code:
the page from which I wanto to send the value:
Code:
<form >
<input type ='text' name='discount'/>
<a href="http://localhost/wordpress/sericves/" title="Yeah yeah!">Link name</a>;
</form>
the second page where i want to receive the value:
Code:
<h2>Payment of $ [php function=1]</h2>
here is the plugin as said by the instruction:
Code:
<?php
/*
Plugin name: redirect on post
Desciption:
http://stackoverflow.com/questions/13686245/how-to-create-a-custom-url- based-on-dropdown-in-wordpress-form-submission
I-changed-dropdown-to-field-input
*/
function redirect_on_submit() {
// check if the post is set
if (isset($_POST['discount']) && ! empty ($_POST['discount']))
{
header( "Location: http://localhost/wordpress/sericves/page_id=55& discount=" . $_POST['discount'] );
}
}
add_action('init', 'redirect_on_submit');