This is a discussion on $_REQUEST with variables within the PHP General forums, part of the PHP Programming Forums category; Hi I have 2 windows. in the first i have a form and 2 textfields and one variable. In the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi I have 2 windows.
in the first i have a form and 2 textfields and one variable. In the second Window i want to display the data -> the variable "c" is the most important but I get the error: Undefined index: c (a and b are working fine)! so how can i pass this variable? WINDOW1 ************* <form action="window2.php" method="post"> <?php $c = 'some text'; ?> <input type="Text" name="a"> <input type="Text" name="b"> <input type="submit" name="Submit" value="submit"> </form> WINDOW2 ************* <?php echo $_REQUEST['a']; echo $_REQUEST['b']; echo $_REQUEST['c']; ?> Notice: Undefined index: c in c:\inetpub\wwwroot\fachstelle\window2.php on line 22 |
|
|||
|
On 08/20/2006 05:41 PM, mk wrote:
> Hi I have 2 windows. > in the first i have a form and 2 textfields and one variable. In the > second Window i want to display the data -> the variable "c" is the > most important but I get the error: Undefined index: c (a and b are > working fine)! > [...] Why not just put 'c' in the form as a hidden element? <input type="hidden" name="c" value="some text"> |
|
|||
|
Hi
u can't use the 'c' bc'z it's not a form element, u can't access values of variables which are created on the php page by $_REQUEST globle varible u have to eighter create a hidden varible to render the page or have to pass by querysetring. regards lokesh Jadwani mk wrote: > Hi I have 2 windows. > in the first i have a form and 2 textfields and one variable. In the > second Window i want to display the data -> the variable "c" is the > most important but I get the error: Undefined index: c (a and b are > working fine)! > > so how can i pass this variable? > > WINDOW1 > ************* > <form action="window2.php" method="post"> > <?php > $c = 'some text'; > ?> > <input type="Text" name="a"> > <input type="Text" name="b"> > <input type="submit" name="Submit" value="submit"> > </form> > > WINDOW2 > ************* > > <?php > echo $_REQUEST['a']; > echo $_REQUEST['b']; > echo $_REQUEST['c']; > ?> > > > > > Notice: Undefined index: c in c:\inetpub\wwwroot\fachstelle\window2.php > on line 22 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|