473,387 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to pass variables from one page to another.

I have one link in the second script that leads to the first one.How can I pass variables from the second script to the first one?
I cannot use $_GET $_POST variables because I don't use those requests.
Nov 1 '07 #1
3 2549
I dont really understand why you couldn't use GET or POST but one way would be to use cookies.
Nov 1 '07 #2
Atli
5,058 Expert 4TB
Hi.

You can use the GET protocol with links. Simple make the link look like this:
Expand|Select|Wrap|Line Numbers
  1. <a href="mypage.php?var1=val1&var2=val2">Linkage</a>
  2.  
And call it from your PHP code like so:
Expand|Select|Wrap|Line Numbers
  1. echo $_GET['var1'] ." and ". $_GET['var2'];
  2.  
Which would print "val1 and val2".

You could also consider using Sessions.
Nov 2 '07 #3
realin
254 100+
if its a form and u dont have any sensitive data to pass, then you can always use hidden fields and get the value using $_POST or watever the method u want ;)

cheers !!
Nov 2 '07 #4

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

Similar topics

5
by: eagletender | last post by:
I am simply trying to pass a variable to another page. I know my second page can do Request("str") to retrieve that variable, but how do I pass it in the first place? I tried...
2
by: blurz | last post by:
Hi, would like to know whether I can use ViewState to pass variables from one web page to another. I've been trying do this but all I managed to do is to pass the variable to the target page but...
7
by: Andy Fish | last post by:
Hi, I have a javascript solution where page A launches page B in a second window and then they can pass data between them. That's all well and good. Now say page B wants to navigate to page C...
8
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable,...
2
by: macyp | last post by:
I have to pass values from one aspx page to another. The controls I have in the first page are: a textbox, 3 drop down lists, and 2 check boxes, and a submit button. It is a search page, and the...
2
by: KFactor | last post by:
Is it possible to pass form variables to a page on another server using response.redirect? Or is there a secure way of passing sensitive information from one site to another such as a userID? ...
3
by: drec | last post by:
I am creating a search box that the user types a value in, and then this gets passed to another page called search.php I would like to be able to pass these values through the URL, but I cant...
3
by: mike | last post by:
Hello, I've got a .aspx page that passes login information to an .asp page using a querystring. The problem is its not secure, the user can see the login information right there and type in...
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.