473,231 Members | 1,688 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,231 software developers and data experts.

variables

i would like to send a variable to the next paage i am about to load bu
not using post

eg. index2.php?a=0&b=1&c=2
how do i send them and how can i read them?

thanks
--
What's the point in running when the light at the end of the tunnel iz
just another train...
Jul 17 '05 #1
5 1605
*** Sentinel wrote/escribió (Fri, 17 Jun 2005 09:55:59 +0000 (UTC)):
i would like to send a variable to the next paage i am about to load bu
not using post

eg. index2.php?a=0&b=1&c=2
how do i send them and how can i read them?


I suggest that you get a basic PHP tutorial rather than trying to figure
out how things work, it'll be less frustrating.

About your question, you can generate HTML just typing it outside the PHP
tags:

<?php

// This is PHP

?> This is HTML

Or you can use echo or print statements:

<?php

echo 'This is HTML dynamically generated from PHP';

?>

You read URL parameters from the $_GET associative array:

echo 'Param a=' . $_GET['a'];

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #2
You can use POST or GET to "send variables" to the next page.

GET is what you have listed in your question.

eg. index2.php?a=0&b=1&c=2

POST is when you use a form. From the PHP web site:

When a form is submitted to a PHP script, the information from that
form is automatically made available to the script. There are many ways
to access this information, for example:

Example 12-8. A simple HTML form

<form action="foo.php" method="post">
Name: <input type="text" name="username" /><br />
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Submit me!" />
</form>

You may get the POST 'username' variable (from the form above) by using
these
$_POST['username'];
$_REQUEST['username'];

You may retrieve the GET variable 'a' (from index2.php?a=0&b=1&c=2)
by the using these
$_POST['a'];
$_REQUEST['a'];
--
PHP stuff :
http://www.douglassdavis.com

Jul 17 '05 #3
do************@earthlink.net wrote:
You can use POST or GET to "send variables" to the next page. <snip> From the PHP web site: <snip> You may retrieve the GET variable 'a' (from index2.php?a=0&b=1&c=2)
by the using these
$_POST['a'];
$_REQUEST['a'];


Really? The PHP website said that?
It should have said:

You may retrieve the GET variable 'a' (from index2.php?a=0&b=1&c=2)
by the using these
$_GET['a'];
$_REQUEST['a'];
C.
Jul 17 '05 #4
sorry... you are correct. that was a quick copying and pasting mistake!

Jul 17 '05 #5
Colin McKinnon 17.6.2005 15:21:11
<d8*******************@news.demon.co.uk>
co**************@andthis.mms3.com comp.lang.php Colin
do************@earthlink.net wrote:
You can use POST or GET to "send variables" to the next page.

<snip>
From the PHP web site:

<snip>
You may retrieve the GET variable 'a' (from index2.php?a=0&b=1&c=2)
by the using these
$_POST['a'];
$_REQUEST['a'];


Really? The PHP website said that?
It should have said:

You may retrieve the GET variable 'a' (from index2.php?a=0&b=1&c=2)
by the using these
$_GET['a'];
$_REQUEST['a'];
C.


thanks to both

--
What's the point in running when the light at the end of the tunnel iz
just another train...
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hal Vaughan | last post by:
First, I am aware of both SwingUtilities.invokeLater(), and of using Thread to create a new thread.  These are part of the problem. I want to have something running in the background, while the...
4
by: Torsten Bronger | last post by:
Hallöchen! I have a file that looks a little bit like a C header file with a long list of variables (actually constants) definitions, e.g. VI_ATTR_TIMO = 0x54378 .... Actually I need this...
1
by: mark4asp | last post by:
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include that file on every page. This is the best way of...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
7
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
4
by: icarus | last post by:
global_vars.py has the global variables set_var.py changes one of the values on the global variables (don't close it or terminate) get_var.py retrieves the recently value changed (triggered right...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.