# PHP Passing Variables

**URL:** <https://forum.kirupa.com/t/php-passing-variables/23504>\
**Category:** programming\
**Created:** [June 18, 2003, 6:50pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504 "2003-06-18T18:50:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sorcerer](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sorcerer](https://forum.kirupa.com/u/Sorcerer)\
**Post date:** [June 18, 2003, 6:50pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504/1 "2003-06-18T18:50:56Z")

</div>

Using php is there a way to POST variables from one page to another without a form? Or maybe there is another way to do what I am wanting.

I have a form and the first thing it does on submit is validate 4 fields in the form, if one of these fields doesn’t validate I want to return the user to the form with all of the information they put in. Along with a message saying they didn’t fill in all required fields.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 7:01pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504/2 "2003-06-18T19:01:51Z")

</div>

I think the only way to do it with PHP is to redirect them back to the page but add the varaibles to the URL string…

[www.something.com/something.php?name=Jubba&place=Kirupaform.com](http://www.something.com/something.php?name=Jubba&place=Kirupaform.com)

The better way would be to use Javascript to validate the form. Works faster client side rather than having the server process the information…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 7:03pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504/3 "2003-06-18T19:03:43Z")

</div>

Haven’t worked a whole lot with javascript, know any good sites where I could find the information on how to validate the form with it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 7:06pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504/4 "2003-06-18T19:06:00Z")

</div>

[http://www.google.com/search?hl=en&ie=utf-8&oe=utf-8&q=javascript+form+validation](http://www.google.com/search?hl=en&ie=utf-8&oe=utf-8&q=javascript+form+validation)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 7:06pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504/5 "2003-06-18T19:06:47Z")

</div>

google is good, thanks for the quick reply.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2003, 7:10pm UTC](https://forum.kirupa.com/t/php-passing-variables/23504/6 "2003-06-18T19:10:12Z")

</div>

🙂
