473,498 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

variable value

63 New Member
hello, I need some help!

in this first page I have a variable $v1 which hold some value. without post method, cookie or session, is there any other way to keep the value when we submit a form and move to another page. the problem is that this $value does not belong to the form so I don't know how to keep its value when moving to other pages.
Oct 26 '07 #1
2 1209
Lumpy
69 New Member
I have two different ideas, maybe one of them will work

First, if the data isn't something like a password, can you just pass it through in the link to the page that handles the form.
Expand|Select|Wrap|Line Numbers
  1. echo "<form method=\"post\" action=\"page.php?var=" . $v1 . "\">";
  2.  
Second, use a hidden input in your form and assign that the value you need to pass to the next page with the form.

Expand|Select|Wrap|Line Numbers
  1. echo "<input type=\"hidden\" name=\"var\" value=\"" . $v1 . "\">";
  2.  
With the second way, even though the value doesn't belong to the form, you can still use the form to pass the variable.
Oct 26 '07 #2
nathj
938 Recognized Expert Contributor
hello, I need some help!

in this first page I have a variable $v1 which hold some value. without post method, cookie or session, is there any other way to keep the value when we submit a form and move to another page. the problem is that this $value does not belong to the form so I don't know how to keep its value when moving to other pages.
Hi,

Is there any reason why you can't use sessions? I have done just this, passing data on through multiple forms and Sessions is defeiniltey the easiest way to do it.

Alternatively the suggestions about loading it to a hidden input will enable you then to POST the data across, but if there's lots of data this gets a bit messy in code. Sessions are the obvious solution to this problem

Cheers
nathj
Oct 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

41
10628
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
9
3116
by: Shapper | last post by:
Hello, I am declaring a variable in my aspx.vb code as follows: Public Class catalogue Public productid As String Private Sub Page_Load ... I have an image button where I call the...
10
2225
by: Blaxer | last post by:
There is probably a really easy way to do this, so please forgive me but I would like to set the value of a variable from a variable, an example would be... function Calculate_Something(ByVal...
23
19129
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
20
6926
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
25
9490
by: Sourav | last post by:
Suppose I have a code like this, #include <stdio.h> int *p; void foo(int); int main(void){ foo(3); printf("%p %d\n",p,*p);
3
3943
by: rls03 | last post by:
I have the following which creates a variable containing a relative path where <xsl:value-of select="."/returns a portion of the filename: <xsl:variable...
13
1994
by: Justcallmedrago | last post by:
How would you declare and assign a variable inside a function THAT HAS THE NAME OF A PARAMETER YOU PASSED example: when you call createvariable("myvariable") it will declare the variable...
0
2017
by: zman77 | last post by:
EDIT: -- forgot to mention... I am using Visual Studio 2005, on Win XP, on an intel machine Hi. This is my first post, though I've "lurked" for a while because I find these forums very helpful....
2
2996
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.