You are here: Re: Passing variables from one script to another using the POST METHOD « PHP Language « IT news, forums, messages
Re: Passing variables from one script to another using the POST METHOD

Posted by Jim Michaels on 10/04/15 11:37

<html>
<form action="process.php" method=post>
<input type=hidden name=var1 value="<?=$var1?>">
<input type=hidden name=var2 value="<?=$var2?>">
<input type=hidden name=var3 value="<?=$var3?>">
<?php

echo "You have selected $var1 and $var2 and $var3. Are you sure?";

?>
<br>
<input type=submit value="Confirm">
<html>
<?php
if (isset($_POST['var1'])) {
process $_POST['var1'] and the rest somehow
}
?>

"Todd" <tmclean@algoma.com> wrote in message
news:1135874283.706545.289520@g14g2000cwa.googlegroups.com...
> >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=post>
> <?php
>
>
> echo "You have selected $var1 and $var2 and $var3. Are you sure?";
>
>
> ?>
> <br>
> <input type=submit value="Confirm">
> <html>
>

 

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

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