imartin123 Posted October 9, 2006 Share Posted October 9, 2006 I am new to PHP. Need Help.I have set cookie and I can use the in all my scripts except 1.When I try to use it in this one script it is blank but I can still see itin all other scripts.Can anyone help me with this.Also I will be happy to make a donation the cause in the next few days.ThanksIke Quote Link to comment Share on other sites More sharing options...
tomfmason Posted October 9, 2006 Share Posted October 9, 2006 Please post the code for the page in question.. use the bbcode tags like this..[nobbc][code]<?php//yourcode here?>[/code][/nobbc]Tom Quote Link to comment Share on other sites More sharing options...
imartin123 Posted October 9, 2006 Author Share Posted October 9, 2006 In testing when I try to move my cookie to another varit comes up blank.Also when I change this test to echo other varsI get the same info. It don't show a new echos.Thanks for any help.Ikw<?phpecho $Var;$Mycookie = $_Cookie['Testvar'];echo $Mycookie;echo "Here Test";echo "IKE";echo $Var;?> Quote Link to comment Share on other sites More sharing options...
amalosoul Posted October 9, 2006 Share Posted October 9, 2006 You first have to start a session in order to pass variables without $_GET,$_POSTso this is your first file:1.<?phpsession_start();$_SESSION[var]='string';?>this is the second file that will use it2.<?phpsession_start();$var=$_SESSION[var];echo $var;?>the second file will echo your string. You can also use session_destroy when you don't need to use your cookies anymore (they will still be available for that page, to deal with this problem check unset) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.