<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1000734" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1000734</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/im-trying-make-simple-script-review-and-help-please#comment-1003182</link>
    <description> &lt;p&gt;well, i think i figured it out. could you check over it and let me know if it&#039;s gonna blow my computer up or if it can be optimized?&lt;/p&gt;
&lt;p&gt;thanks in advance&lt;/p&gt;
&lt;p&gt;#!/usr/local/bin/perl&lt;br /&gt;
#&lt;/p&gt;
&lt;p&gt;$ipfile = &amp;quot;pathtologfile&amp;quot;;&lt;br /&gt;
#path of ip log file&lt;/p&gt;
&lt;p&gt;$same = &amp;quot;sameipurl&amp;quot;;&lt;br /&gt;
# url if same ip&lt;/p&gt;
&lt;p&gt;$differ = &amp;quot;differipurl&amp;quot;;&lt;br /&gt;
# url if differ ip&lt;br /&gt;
#####&lt;/p&gt;
&lt;p&gt;#enter the correct path or variable, opens file&lt;br /&gt;
open (LOG, &amp;quot;$ipfile&amp;quot;);&lt;/p&gt;
&lt;p&gt;$ip = &amp;lt;LOG&amp;gt;;&lt;/p&gt;
&lt;p&gt;if ($ENV{&#039;REMOTE_ADDR&#039;} eq $ip) {&lt;/p&gt;
&lt;p&gt;# closes file so it can&#039;t be read and written at same time&lt;br /&gt;
close (LOG);&lt;/p&gt;
&lt;p&gt;# redirects to same ip page&lt;br /&gt;
print &amp;quot;Location: $same\n\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;} else {&lt;/p&gt;
&lt;p&gt;# closes file so it can&#039;t be read and written at same time&lt;br /&gt;
close (LOG);&lt;/p&gt;
&lt;p&gt;#enter the correct path or variable, writes over&lt;br /&gt;
open (LOG, &amp;quot;&amp;gt;$ipfile&amp;quot;);&lt;/p&gt;
&lt;p&gt;# prints ip on file&lt;br /&gt;
print LOG &amp;quot;$ENV{&#039;REMOTE_ADDR&#039;}&amp;quot;;&lt;/p&gt;
&lt;p&gt;# closes file so it can&#039;t be read and written at same time&lt;br /&gt;
close (LOG);&lt;/p&gt;
&lt;p&gt;# redirects to differ ip page&lt;br /&gt;
print &amp;quot;Location: $differ?$ENV{&#039;QUERY_STRING&#039;}\n\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;#believe this ends script&lt;br /&gt;
exit;&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Aug 1999 23:00:00 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1003182 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/im-trying-make-simple-script-review-and-help-please#comment-1003181</link>
    <description> &lt;p&gt;ok, i&#039;ve added some stuff. what i&#039;m try to do is record the last ip. then if the new ip is the same as the last one they get redirect to page 1 and if the ip&#039;s are differ they get redirected to page 2. all i seem to be able to do no matter if the ip is the same or differ is redirect to $differ. any help would be appreciated.&lt;/p&gt;
&lt;p&gt;#!/usr/local/bin/perl&lt;br /&gt;
#&lt;/p&gt;
&lt;p&gt;$ip = &amp;quot;path&amp;quot;;&lt;br /&gt;
#path of ip log file&lt;/p&gt;
&lt;p&gt;$same = &amp;quot;sameipredirect&amp;quot;;&lt;br /&gt;
# url if same ip&lt;/p&gt;
&lt;p&gt;$differ = &amp;quot;differipredirect&amp;quot;;&lt;br /&gt;
# url if differ ip&lt;/p&gt;
&lt;p&gt;#####&lt;/p&gt;
&lt;p&gt;#enter the correct path or variable, opens file&lt;br /&gt;
open (LOG, &amp;quot;$ip&amp;quot;);&lt;/p&gt;
&lt;p&gt;if ($ENV{&#039;REMOTE_ADDR&#039;} == @ip) {&lt;/p&gt;
&lt;p&gt;# closes file so it can&#039;t be read and written at same time&lt;br /&gt;
close (LOG);&lt;/p&gt;
&lt;p&gt;# redirects to same ip page&lt;br /&gt;
print &amp;quot;Location: $same\n\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;} else {&lt;/p&gt;
&lt;p&gt;# closes file so it can&#039;t be read and written at same time&lt;br /&gt;
close (LOG);&lt;/p&gt;
&lt;p&gt;#enter the correct path or variable, writes over&lt;br /&gt;
open (LOG, &amp;quot;&amp;gt;$ip&amp;quot;);&lt;/p&gt;
&lt;p&gt;# prints ip on file&lt;br /&gt;
print LOG &amp;quot;$ENV{&#039;REMOTE_ADDR&#039;}&amp;quot;;&lt;/p&gt;
&lt;p&gt;# closes file so it can&#039;t be read and written at same time&lt;br /&gt;
close (LOG);&lt;/p&gt;
&lt;p&gt;# redirects to differ ip page&lt;br /&gt;
print &amp;quot;Location: $differ\n\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;#believe this ends script&lt;br /&gt;
exit;&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Aug 1999 16:56:00 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1003181 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
