Hey guys, I am putting up a test site for another one of my sites that is written completely in php. My problem is, my login fields are coming out blank after I try to login. I only have an IP address for my new host (my testing environment) and the other site is on a domain name. Now this site works fine, but on the new one (where I only have an ip address) it does not. Here is my set cookie code with an ip address instead of a domain. setcookie ("username", $check, time() + 2419200, "/", "64.8.116.246"); Is there another way to use an IP address. The site that is working is like this; setcookie ("username", $check[email], time() + 2419200, "/", ".domainname"); I am really trying to figure this problem out, it is wasting a lot of my time.
You realize, in some cases, two domains can have the same IP? This is not the way to code cookies maybe? http://us3.php.net/manual/en/function.setcookie.php
Thank you all for your help, but I am aware of setting up with a domain and I am aware of shared IP's. I have a dedicated IP and I MUST use the IP. This is my test site. I do not have a domain name pointed to it. So please help me to figure it out using an ip of we can. My IP and not their Ip. Thanks setcookie ("username", $check, time() + 2419200, "/", "64.8.116.246");
Well, I am repeating my question. Why do you necessarily need to specify the domain? Why wouldnt setcookie ('username', $check['email'], time() + 2419200); PHP: work?