However this gives me strange data, the $_SESSION variable seems to
change during page load. in the end of the page it's the earlier value that shows.
I set the $_SESSION[id] with this
Expand|Select|Wrap|Line Numbers
- function setId(id)
- {
- try{
- var obj;
- obj = document.getElementById("sid");
- var serverPage = "setid.php" + "?id="+id;
- xmlhttp.open("GET",serverPage);
- xmlhttp.onreadystatechange = function(){
- if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
- obj.value = xmlhttp.responseText;
- }
- }
- xmlhttp.send(null);
- }catch(eeex)
- {
- alert(eeex);
- }
- }
this code below prints out value x the first time, and when $ss it's the old value
meaning $ss != $_SESSION[''id], and the reason I'm using $ss is because otherwise it's empty.
Expand|Select|Wrap|Line Numbers
- <input id="tId" name="Id" type="hidden" value="<?php $ss = $_SESSION['id'];echo $_SESSION['id'];?>" />
- <input type="submit" name="Submit" value="Save" onclick="submitform(document.getElementById('newproj'),
- 'process_cons_projects.php','cons_proj_message',validatetask);
- updateprojectlist('<?php echo $ss; ?>');return false;"/>
- </label></td>