You are here: Accessing GET variables with include file « PHP Programming Language « IT news, forums, messages
Accessing GET variables with include file

Posted by Greg Scharlemann on 01/01/07 18:57

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=new&var1=test&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!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация