View previous topic :: View next topic |
Author |
Message |
Lockley -
Joined: 04 Jul 2003 Posts: 9 Location: Not sure...
|
Posted: Fri Jul 04, 2003 11:32 pm Post subject: two problems - |
|
|
The first is using cookies. they work on my online site but not on my localhost abyss server.
to set it I used
setCookie("cook_name","cook_value",time()+(60*60*24*7));
and the code I used to get a cookie is
$CO = $HTTP_COOKIE_VARS['cook_name'];
I know that these work online so why don't they work on abyss?
The other problem is getting the results from forms to show up when I use method=post. Originally I used just the $variable to get it and that worked... on my online site.
I did try what someone suggested in one of the other posts that was use
$username = $_POST['username']
or
$username = $_REQUEST['username']
but they don't seem to work either
Help would be very appreciated obviously. :) |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jul 05, 2003 12:57 pm Post subject: Re: two problems - |
|
|
First of all, the hoster of your online did all the configuration of PHP for you. Now that you have your own web server, you should do the same to your system.
Lockley wrote: | The first is using cookies. they work on my online site but not on my localhost abyss server.
to set it I used
setCookie("cook_name","cook_value",time()+(60*60*24*7));
and the code I used to get a cookie is
$CO = $HTTP_COOKIE_VARS['cook_name'];
I know that these work online so why don't they work on abyss?
|
As suggested in http://www.aprelium.com/forum/viewtopic.php?t=757 , edit php.ini and set:
if you access your site using http://www.mysite.com .
Quote: |
The other problem is getting the results from forms to show up when I use method=post. Originally I used just the $variable to get it and that worked... on my online site.
I did try what someone suggested in one of the other posts that was use
$username = $_POST['username']
or
$username = $_REQUEST['username']
but they don't seem to work either
|
In order to have the same way of using variable as with your old online host, you can set the register_globals parameter in php.ini to:
Code: |
register_globals=on
|
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Lockley -
Joined: 04 Jul 2003 Posts: 9 Location: Not sure...
|
Posted: Sat Jul 05, 2003 5:55 pm Post subject: |
|
|
thank you, the form posting works now but I'm still having problems with cookies.
I tried this to see if the cookie was being set and it shows that they are not.
Code: | if(!setcookie("newcookie","cookie!!",time()+(0*60*24))); {
print ("didn't work");
} |
I don't have a web address cuz my server is for testing php & mysql stuff while I learn. What should I set the Code: | session.cookie_domain | to for that?
I tried localhost, localhost:81, http://localhost, 127.0.0.1, all the combinations of them. |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Mon Jul 07, 2003 3:24 pm Post subject: |
|
|
If you use http://127.0.0.1 to access your test web server, then you should set that parameter to 127.0.0.1. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Lockley -
Joined: 04 Jul 2003 Posts: 9 Location: Not sure...
|
Posted: Tue Jul 08, 2003 2:00 am Post subject: |
|
|
thanks but it's still not working. I tried setting it to 127.0.0.1 but no luck. I even tried using a dyndns.net account thing to check if that would work (setting it to the domain name from there - lockley.kicks-ass.net) but nothing.
It wouldn't have anything to do witht the port number would it? I had to change it to 81 (well anything other than 80) cuz 80 was in use with something.
thanks |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue Jul 08, 2003 3:06 pm Post subject: |
|
|
We'll check if the port number can be the cause of the problem. If possible, can you tell us what is the script you use to do your tests? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Lockley -
Joined: 04 Jul 2003 Posts: 9 Location: Not sure...
|
Posted: Tue Jul 08, 2003 4:29 pm Post subject: |
|
|
umm what scripts? You mean what php I'm using to set/retrieve cookies right? Well I tried this to see if it was setting the cookie but it just doesn't set them
Code: |
if(!setcookie("newcookie","cookiething",time()+(0*60*24))); {
print ("didn't work<br><br>");
}
|
it prints "didn't work"
I normally use
Code: |
setCookie("newcookie","something",time()+(60*60*24*7));
|
to set the cookie but I jsut get undefined index when I try reading it |
|
Back to top |
|
|
Lockley -
Joined: 04 Jul 2003 Posts: 9 Location: Not sure...
|
Posted: Tue Jul 08, 2003 6:44 pm Post subject: |
|
|
now I'm confused. I'm having problems setting cookies then I see if phpBB2 works and it can set cookies fine. I haven't a clue whats going on... |
|
Back to top |
|
|
|