Jump to content


Photo

*SOLVED* incrementing session please help thank you.


  • Please log in to reply
2 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 12 April 2006 - 09:44 AM

How do i get the session $domain to increment so if the users ip looked at somthink twice the echo message apears thanks.

My code but needs help cheers.
<?
//start session
session_start();

// Put varable $doamin as an ip
$domain = GetHostByName($REMOTE_ADDR);

// Convert varable $doamin to a session.
$domian=($_session["$domian"]);

// If session $domain = 2 or is 2 echo message.
if($domian>=2){echo "sorry you searched twice please know register!";
}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 12 April 2006 - 10:21 AM

<?
//start session
session_start();

// Put varable $doamin as an ip
$domain = GetHostByName($REMOTE_ADDR);

if (!$_SESSION["$domain"]){
$_SESSION["$domain"]=1;
}
else {
$_SESSION["$domain"]++;
if ($_SESSION["$domain"] > 2) {
echo "sorry you searched twice please know register!";
}
}

?>


That should work as far as i can see but havn't had chance to test it.

www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 12 April 2006 - 10:24 AM

Thank you so much works grate have to learn that know cheers.

[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users