473,614 Members | 2,342 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 1217
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
10656
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 = String.Format("SELECT * FROM dbo.documents WHERE ") & query End Sub
9
3128
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 following function:
10
2246
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 multiplyer as integer, ByVal variable as ___?) variable = 5 * multiplyer end function What I would like this function to do is take the name of the incoming variable and assign a calculated value to it. Any help would be greatly appreciated, TIA!!
23
19165
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
6950
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 = document.getElementById('hometab'); Has anyone ever seen anything like this before, or am I dreaming?
25
9514
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
3955
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 name="fileName">../../data/models/<xsl:value-of select="."/>.xml</xsl:variable> I want to use this variable as an argument of the document function: <xsl:apply-templates mode="coordinates" select="document( REFERENCE
13
2011
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 "myvariable" and then maybe assign it something. myvariable = "this is a real variable"
0
2034
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. Ok my problem is the following. I have a class that contains a "MakeByteArray" function. I have many objects of that class. Inside that function, I have a private variable, that is NOT static. It seems that when I put all these objects in...
2
3008
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 elements (children of log) in my XML source have a time-stamp attribute, so I want to use the time-stamp from the page for the page-time-stamp value. I use an xsl:choose/xsl:when/xsl:otherwise combination to setup an if/else statement to select the...
0
8197
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8142
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8287
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2573
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 we have to send another system
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.