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

Accessing GET Variables with include

There is probably an easy solution to this that I've overlooked
somewhere...

I have a main file, call it main.php, and an include file,
myInclude.php. I'm accessing main.php via:
http://www.example.com/main.php?page...est&var2=test2

main.php:
-------------------
<?php
$page = $REQUEST['page'];
if($page=="new") include('myInclude.php');
?>
-------------------

and try to access var1 and var2 from the include:
myInclude.php:
---------------------
$var1 = REQUEST['var1'];
$var2 = REQUEST['var2'];
----------------------
both $var1 and $var2 are empty in myInclude.php. How do I "see" var1
and var2 from myInclude.php?

Thanks!

Jan 1 '07 #1
1 1108
>-------------------
><?php
$page = $REQUEST['page'];
if($page=="new") include('myInclude.php');
?>
-------------------

and try to access var1 and var2 from the include:
myInclude.php:
---------------------
$var1 = REQUEST['var1'];
$var2 = REQUEST['var2'];
It's spelled:
$_REQUEST['var1'];

Jan 1 '07 #2

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

Similar topics

3
by: Leigh Riley | last post by:
Hi, Can someone tell me if the following is possible? I have a file containing some STATIC variables, and some functions e.g. -------------------------------------------------...
3
by: Scott Castillo | last post by:
Is it possible to access an SQL Server database from a Javascript client? I know you can transfer variables from middleware to Javascript client, but was wondering if you can directly access...
8
by: scott | last post by:
hi, sorry if this has been adressed some where elss. if it has plz can you point me to it and ill go read it. any way, i want to declare some variables with in a header file. lets say int i; ...
2
by: Earl Teigrob | last post by:
I am programming ASP.NET using C#. I have been accessing static variables accross my entire application but now need to change some of the static variables that are session specific to instance...
9
by: Bob Day | last post by:
VS 2003, vb.net , sql msde... I have an application with multiple threads running. Its a telephony application where each thread represents a telephone line. For code that would be the same...
8
by: dwok | last post by:
I have been wondering this for a while now. Suppose I have a class that contains some private member variables. How should I access the variables throughout the class? Should I use properties that...
1
by: Greg Scharlemann | last post by:
There is probably an easy solution to this that I've overlooked somewhere... I have a main file, call it main.php, and an include file, myInclude.php. I'm accessing main.php via:...
2
by: Jurek Dabrowski | last post by:
hi all, I have a question in reference to accessing variables in another class maybe someone has dealt with before. I have some public variables declared in my main plug-in class...
1
tolkienarda
by: tolkienarda | last post by:
hi all i have an have a script that i include in my program that validates a form, i was wondering if it would be possible to access variables from that script in my main script. example...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.