RE: [PHP] Changed variabele

From: Date: Mon, 30 Oct 2000 10:12:51 +0000
Subject: RE: [PHP] Changed variabele
Groups: php.general 
Request: Send a blank email to php-general+get-22645@lists.php.net to get a copy of this message
It is Global. The included pages are becoming the part of the script, so you can use everything available in every text you include. Ithink the expample you gave would work, but I am not sure I understood you.. if I want to check whether someone is asking for home link or contact in a URL like http://site.com/page=contact: then: if($page=='home') $link='/index.html'; elseif($page=='contact') $link='/contact.html'; else $link='Unknown link, sorry'; would do the simple trick. Cheers! -----Original Message----- From: Jan van Schaijk [mailto:beethoven@hetnet.nl] Sent: Monday, October 30, 2000 5:39 PM To: Php-list Subject: [PHP] Changed variabele Hi, I have two questions: - is a variable like http://.../bla.php3?variabele=1 global? So, if I use '#include bla2.php3' can I use is in the file bla2.php3 ? - How can I check if a variable has changed? I made links in my document like : index.php3?link=home and index.php3?link=contact In index.php3 I want to check if a variable has changed, so if a link is clicked. Can I do it by this: if ($link) { switch ($link) { case "home": { echo "<HTML>" } case "contact": { echo "contact" } } $link=""; } ? Jan van Schaijk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#22645) next »