You are here: Re: Passing variables from php script to another using the Post Method « PHP Language « IT news, forums, messages
Re: Passing variables from php script to another using the Post Method

Posted by Hilarion on 12/29/05 19:02

Todd <tmclean@algoma.com> wrote:
> From an HTML form, I am collecting 3 variables, 2 from a radio button
> and one from an text box. I call a php script where I echo out what
> has been selected and ask to confirm. Upon confirm I want to submit
> those variables to be processed. The problem is I'm using another Post
> Method to call another script to do the processing but those variables
> do not get passed. I'm new to php and I'm researching what is the best
> method to accomplish this. Here's a sample of simple confirmation
> script where the 3 variables are passed from the html form. I need to
> confirm the selections, then process the 3 variables. I realize this
> is basic and I will also need to check using the isset function that
> all 3 variables have been selected from the html form before
> displaying. For now, I just want a confirmation of what has been
> selected, then process the variables. Thx to all who can help.
>
> <html>
> <form action="process.php" method=get>
> <?php
>
> echo "You have selected $var1 and $var2 and $var3. Are you sure?";
>
> ?>

<input type="hidden" name="var1" value="<?php echo htmlspecialchars( $var1 ); ?>" />
<input type="hidden" name="var2" value="<?php echo htmlspecialchars( $var2 ); ?>" />
<input type="hidden" name="var3" value="<?php echo htmlspecialchars( $var3 ); ?>" />

> <br>
> <input type=submit value="Confirm">
> <html>


Other method is to store the values in $_SESSION (read about sessions
before using this method because it's more complicated that just
placing values in a special array).


Hilarion

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация