Title: Basic PHP Script to Pass Post Varables
Last modified: August 20, 2016

---

# Basic PHP Script to Pass Post Varables

 *  Resolved [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/basic-php-script-to-pass-post-varables/)
 * I’ve created a WordPress page with a basic form. It accepts someone’s width, 
   height & weight and then is supposed to pass that data via post to another WordPress
   page on my site. I’m using page templates so that I can add the PHP needed within
   the header, however the data doesn’t get passed.
 * Are there any tricks or tips anyone could give me for passing just numbers via
   post within WordPress?
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [shahar](https://wordpress.org/support/users/shahar/)
 * (@shahar)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/basic-php-script-to-pass-post-varables/#post-2217760)
 * Do you have a URL where the form is?
 *  Thread Starter [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/basic-php-script-to-pass-post-varables/#post-2217819)
 * Here is the first page, the form is entered as html in the page content:
 * Page 1 form: [http://pastebin.com/Lk8kFZUC](http://pastebin.com/Lk8kFZUC)
 * When the form is submitted, the post data is being sent to ‘page-results’, below
   is the PHP that’s above the header in my page reults
 * Page 2 ‘page-results’: [http://pastebin.com/mZmC4uXV](http://pastebin.com/mZmC4uXV)
 * The first problem is that when you submit the first page (which goes to localhost/
   page-results) – it takes you to the correct URL but it says page not found.
 * If you load localhost/page-results without submitting the form it does open.
 * Is there something special I need to setup in functions in order to pass POST
   data from one page to another using basic PHP methods?
 *  [shahar](https://wordpress.org/support/users/shahar/)
 * (@shahar)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/basic-php-script-to-pass-post-varables/#post-2217858)
 * Hi,
 * 1) Try your action as `action="http://localhost/page-results.php"`
    2) What’s
   happening in the `validateForm();` javascript you have on submit?
 * If you’re passing the post data correctly you shouldn’t need to do anything special
   for it to work…
 *  Thread Starter [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/basic-php-script-to-pass-post-varables/#post-2217874)
 * In case anyone comes across this with a similar issue, I found the problem. The
   variables I’m using in my form were interfering with WordPress’ permalinks. I
   changed my variables to have custom names and it resolved the issue.
 * Hope this helps someone out down the line.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Basic PHP Script to Pass Post Varables’ is closed to new replies.

## Tags

 * [form](https://wordpress.org/support/topic-tag/form/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [foochuck](https://wordpress.org/support/users/foochuck/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/basic-php-script-to-pass-post-varables/#post-2217874)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
