Forum : Cookie Example seems to be not working.
Brief description  about Online courses   join in Online courses
View shyam  sunder 's Profile

Cookie Example seems to be not working.

Sir
I tried to run the Cookie Example (username,color) and found its not working.
Asked by shyam sunder | Oct 20, 2009 |  Reply now
Replies (6)
View shyam sunder 's Profile
alka it should work and its working for me as he (sir) said it spaces before names try to read the code and remove the spaces it will work.
Nov 1, 2009
View teacher siliconindia 's Profile
Hi Alka,

Can you send cookie1.php and cookie2.php file on webdeveloper@siliconindia.com
Oct 21, 2009
View teacher siliconindia 's Profile
HI Shyam,

Can you send your php file, which you are using for cookie example on webdeveloper@siliconindia.com
Oct 21, 2009
View alka purwar 's Profile
Dear Sir,

Still it is not working, when i run cookie1.php. It is giving two notices as:

Notice: Undefined index: username in C:\wamp\www\assign8.php on line 5

Notice: Undefined index: colorchoice in C:\wamp\www\assign8.php on line 7

and when i m running cookie2.php it is giving output like this:

Hello:
Notice: Undefined variable: username in C:\wamp\www\cookie2.php on line 43
Your color:
Notice: Undefined variable: colorchoice in C:\wamp\www\cookie2.php on line 45

Oct 21, 2009
View teacher siliconindia 's Profile
Hi Shyam,

Cookie example working fine. Their is one problem, you might be facing while copying source code of example. Usually when you copy the content, and paste in php file, it also get unnecessary space. For example, I copied whole code of cookie1.php, I got one line like <input type = "text" name = " username "> .In cookie1.php file we are getting value of $_POST['username'], but if you see the above code, here the name of element, php will consider as ' username '. So you always get value of $_POST['username'] empty. Try to remove those unnecessary space, then program will give expected result.
Oct 21, 2009
View alka purwar 's Profile
ya!its not working..i did'nt understand anything given in session except theory..and all this making me delay to cmplete the php session..please guide us sir so that i can complete the course as soon as possible...please.....

Regards,
Alka
Oct 20, 2009