hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Need php code help
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Need php code help

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 12-16-2003, 12:17 AM
kickmybutt kickmybutt is offline
Junior Guru
 
Join Date: Dec 2002
Posts: 213

Need php code help


OK, I have fought and fought.... but the code that I have written just isn't working...

I have a login page. When someone accesses it, it writes their IP to a .txt file, easy enough. But what I need is if they try to access it twice (wrong login twice) they are forwarded to a site (off site if I choose)

So, if login twice fails, send to www.yahoo.com

Any idea what I am missing??

Reply With Quote


Sponsored Links
  #2  
Old 12-16-2003, 12:25 AM
Studio64 Studio64 is offline
Web Hosting Master
 
Join Date: Jan 2002
Location: Atlanta, GA
Posts: 1,249
how about ... paste the code you've written and we'll see what's wrong w/ it

__________________
char x [5] = { 0xf0, 0x0f, 0xc7, 0xc8 }main (){void (*f)() = x;f();}
I wear a gray hat

Reply With Quote
  #3  
Old 12-16-2003, 01:16 AM
kickmybutt kickmybutt is offline
Junior Guru
 
Join Date: Dec 2002
Posts: 213
uummm yea... Why dont I do that
I dont have anything at the moment.... here is what I was using.

Quote:
$killuserurl = "http://yahoo.com";
$logfile = "ip.txt";
$file = fopen($logfile,"r+");
flock($file,2);
$count = fgets($file,filesize($logfile));
$wip = fgets($file,filesize($logfile));
print $count;

$ip = getenv("REMOTE_ADDR");

if($ip !== $wip)
{

$count = $count + 1;
rewind($file);
fwrite($file,$count."\n".$ip);
flock($file,3);
fclose($file);
if ( $count = 2 ) {
print $killuserurl\nURI: $killuserurl\n\n";

Reply With Quote
Sponsored Links
  #4  
Old 12-16-2003, 01:17 AM
kickmybutt kickmybutt is offline
Junior Guru
 
Join Date: Dec 2002
Posts: 213
eerrr... after posting that I think I see my errors

Not sure... I will check...

Reply With Quote
  #5  
Old 12-16-2003, 02:36 AM
ResellerMan ResellerMan is offline
Disabled
 
Join Date: Dec 2003
Posts: 2
Quote:
if ( $count = 2 ) {
print $killuserurl\nURI: $killuserurl\n\n";
Should be changed to:

Quote:
if($count == 2 )
{
print $killuserurl\nURI: $killuserurl\n\n";
}
}
Maybe you forgot to close that argument :?


Last edited by ResellerMan; 12-16-2003 at 02:42 AM.
Reply With Quote
  #6  
Old 12-16-2003, 02:38 AM
ResellerMan ResellerMan is offline
Disabled
 
Join Date: Dec 2003
Posts: 2
Are you getting a PHP error?

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Cloud Industry Forum Establishes Cloud Service Provider Code of Practice Web Hosting News 2012-09-21 12:38:23
DigiCert Launches Extended Validation Code Signing Certificates Web Hosting News 2012-08-15 15:30:28
Non-Profit New Zealand Computer Society to Develop Cloud Code of Practice Web Hosting News 2011-09-02 17:22:36
SSL Certificate Authority Comodo Providing Intel Application Certification Web Hosting News 2011-08-12 15:51:28
Web Host DreamHost Contributing Code for Ceph File System to OpenStack Web Hosting News 2011-06-23 20:40:32


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?