$_REQUEST with variables

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-20-2006
mk
 
Posts: n/a
Default $_REQUEST with variables

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

Reply With Quote
  #2 (permalink)  
Old 08-21-2006
Mumia W.
 
Posts: n/a
Default Re: $_REQUEST with variables

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">

Reply With Quote
  #3 (permalink)  
Old 08-21-2006
babal
 
Posts: n/a
Default Re: $_REQUEST with variables

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


Reply With Quote
  #4 (permalink)  
Old 09-17-2006
mk
 
Posts: n/a
Default Re: $_REQUEST with variables

Hi Iokesh

Good Idea with this hidden variable, I do it that way next time.

Thanks Markus

Reply With Quote
  #5 (permalink)  
Old 09-17-2006
mk
 
Posts: n/a
Default Re: $_REQUEST with variables

Hi Mumia

Good Idea with this hidden variable, I do it that way next time.

Thanks Markus

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:01 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0