Jump to content

Archived

This topic is now archived and is closed to further replies.

aleminio

several questions.

Recommended Posts

First of all, i have for example a registration form.
what are the differents between POST and GET methods?? wont it do the same thing?

how can i get user's ip? i add
IF... submit... {
$ip = getenv('REMOTE_ADDR');
}
and inserting the $ip into the database. but when i do that i think it inserts the server's ip and not the user's who submit.

and how can i run a code at a certain time?
if i want for example to clear a field at 12am without running a code manually.


thank you.


Share this post


Link to post
Share on other sites
Try $_SESSION['ip_address'] = $ip;

For getting the IP

Share this post


Link to post
Share on other sites
[list]
[*][url=http://www.cs.tut.fi/~jkorpela/forms/methods.html]GET/POST.[/url]
[*][url=http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server]$_SERVER variables.[/url]
[*]See "crontab" in my signature.
[/list]

Share this post


Link to post
Share on other sites
i have tried using
$_SESSION
but it does the same thing. when i run it with hamachi it shows.
127.0.0.1

when i upload it, and people submit the form, it shows the same ip.
only the last digit changes sometimes.
i guess it's the server's ip.

and how can i open the crontab command line in the server i uploaded the files to?

Share this post


Link to post
Share on other sites
[quote author=aleminio link=topic=101740.msg403096#msg403096 date=1153827565]
i have tried using
$_SESSION
but it does the same thing. when i run it with hamachi it shows.
127.0.0.1

when i upload it, and people submit the form, it shows the same ip.
only the last digit changes sometimes.
i guess it's the server's ip.

and how can i open the crontab command line in the server i uploaded the files to?
[/quote]
make sure you've got session_start(); at the very top of the page (within php ofcourse).

Share this post


Link to post
Share on other sites
[quote author=JA link=topic=101740.msg403144#msg403144 date=1153833467]
[quote author=aleminio link=topic=101740.msg403096#msg403096 date=1153827565]
i have tried using
$_SESSION
but it does the same thing. when i run it with hamachi it shows.
127.0.0.1

when i upload it, and people submit the form, it shows the same ip.
only the last digit changes sometimes.
i guess it's the server's ip.

and how can i open the crontab command line in the server i uploaded the files to?
[/quote]
make sure you've got session_start(); at the very top of the page (within php ofcourse).
[/quote]

indeed.
even when i open a simple page and all i write is this code, still i don't get the correct ip.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.