passing data between wordpress pages

admin

Administrator
Staff member
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:

Code:
&lt;form &gt;
    &lt;input type ='text' name='discount'/&gt;
    &lt;a href="http://localhost/wordpress/sericves/" title="Yeah yeah!"&gt;Link     name&lt;/a&gt;;
&lt;/form&gt;

the second page where i want to receive the value:

Code:
&lt;h2&gt;Payment of $ [php function=1]&lt;/h2&gt;

here is the plugin as said by the instruction:

Code:
&lt;?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']) &amp;&amp; ! empty ($_POST['discount'])) 

 {
    header( "Location: http://localhost/wordpress/sericves/page_id=55&amp; discount=" . $_POST['discount'] );
  }
}
add_action('init', 'redirect_on_submit');