You are here: Re: Change value of session variable by clicking href « PHP Programming Language « IT news, forums, messages
Re: Change value of session variable by clicking href

Posted by Drakazz on 02/27/06 00:35

Hmm, what you are trying to do is to control php directly through
javascript. it doesn't work that way...
Here is an example that would work:

<?php
session_start();
if ( isset($_GET['cat']) ) { $_SESSION['cat'] = $_GET['cat'];
}
else {
$_SESSION['cat']=0;
}
?>
<a href="index.php?cat=1">et cat to 1</a>
<a href="index.php?cat=2">et cat to 2</a>
Cat is : <?php echo $_SESSION['cat']; ?>

 

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

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