[PHP] another big, juicy, delicious bug

2003-07-08 Thread Kyle Babich
For a logging system that I've been writing I came up with a way to asign a unique id number to every IP address that visits the site. What I do is append every *new* IP to a new line in a file (ips.txt). Then when I have an IP and need the id I file() the ip log to put it in an array,

RE: [PHP] another big, juicy, delicious bug

2003-07-08 Thread Kyle Babich
This function is what I used: function getId ($ip) { $ipData = file('idData/ips.txt'); $ipData = array_flip($ipData); $id = $ipData[$ip] + 1; return $id; } It is defined in idData.inc.php which is required in the file with the problem (controlPanel.php). I decided to ban a third

[PHP] Authorization script

2003-07-05 Thread Kyle Babich
I am making an authorizatoin script for the control panel of a loggin system I have been writing. Here is what I have right now: ?php require_once('config.inc.php'); $authorized = 0; $getUser = $_SERVER['PHP_AUTH_USER']; $getPass = $_SERVER['PHP_AUTH_PW']; if (($getUser == $user) ($getPass ==

[PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Kyle Babich
Why does this not work? It is just a simple hit counter (hence the snarls, hissing, and growling). It logs the ips address but does not increment $current or log it. I do have counter.txt and ips.txt chmod'd to 777. Ips.txt starts blank and counter.txt starts with just a 0 in it. ?php

Re: [PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Kyle Babich
No, because if i did that the counter would increment no matter what the IP address is. The way I have it the counter will only increment if it is a new ip address to the site. I just fixed it by switching $current++; to $current += 1; Apparently there is some small difference between the two.

Re: [PHP] Snarl, hiss, growl (frustration)

2003-07-04 Thread Kyle Babich
FYI there were no newlines involved in my program. (go back to the message and read the code) On Fri, 4 Jul 2003 12:06:46 -0700 (PDT), Rasmus Lerdorf [EMAIL PROTECTED] said: On Fri, 4 Jul 2003, Robert Cummings wrote: Undoubtedly the above will work as we both know, the output will be 123;

[PHP] file pointer

2003-07-01 Thread Kyle Babich
How would I set the file pointer to the very end of the last line of the file? ex. ahkjhff asdjfhlkajf sdfhaksljdh kasjdhkjlfh asdjfhklajs askjdhjfdjf//here Thanks, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] .inc.php

2003-07-01 Thread Kyle Babich
When .inc.php files are included they are also executed whenever the script is executed right? -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] .inc.php

2003-07-01 Thread Kyle Babich
the real extension is .php On Tue, 2003-07-01 at 17:38, Kyle Babich wrote: When .inc.php files are included they are also executed whenever the script is executed right? -- Kyle -- Yann Larrivee [EMAIL PROTECTED] -- Kyle -- PHP General Mailing List (http://www.php.net

[PHP] have some free time?

2003-07-01 Thread Kyle Babich
Any php programmers out there have a little free time? I've been trying to find the bug in my logging system forever and I've all but given up. If anyone else wants to try their luck then... http://babich.us/log/source/log.php.txt http://babich.us/log/source/config.inc.php.txt

Re: [PHP] have some free time?

2003-07-01 Thread Kyle Babich
bye() to return 'x = 1'? I tried declaring the x = 1 in hello() global and I tried declaring it static. On Tue, 01 Jul 2003 17:27:48 -0500, Kyle Babich [EMAIL PROTECTED] said: Any php programmers out there have a little free time? I've been trying to find the bug in my logging system forever

[PHP] Now what's wrong with this?

2003-06-21 Thread Kyle Babich
The following code obtains lists of files from two different directories and reverse numerically sorts them. Then bellow it takes one file and dumps the contents into an array, which works fine. The problem is where it takes the entire content of the matching file from the second directory

[PHP] Passing Date/Time

2003-06-20 Thread Kyle Babich
I have a input field in a form that is disabled by javascript but is assigned a value in the code that is the RFC 822 formated date. Why is this field not included in the $HTTP_POST_VARS? Here is the page I am talking about: http://babich.us/xlog/post.php When the page is submitted all other

Re: [PHP] Passing Date/Time

2003-06-20 Thread Kyle Babich
Nothing passes when it is disabled via HTML either. just for shits and giggles, why not manually disable the field without using javascript and see what happens. just add the word disabled to the tag. input disabled type='text' name=date value= From: Kyle Babich [EMAIL PROTECTED] Reply

Re: [PHP] Passing Date/Time

2003-06-20 Thread Kyle Babich
That works, thanks. Try setting that date as a type=hidden value instead. Do a print_r($_POST) at the other end to see what comes up! -Michael On Fri, 2003-06-20 at 08:55, Kyle Babich wrote: I have a input field in a form that is disabled by javascript but is assigned a value

[PHP] Not incrementing?

2003-06-20 Thread Kyle Babich
I have a file, current.txt, that at the start has only the digit 1 in it. Here is my code: $current = readfile('setupData/current.txt'); foreach ($HTTP_POST_VARS as $index = $value) { $index = $HTTP_POST_VARS['$index']; } $info = fopen(postInfo/{$current}-{$dateFile}.txt, 'w');

[PHP] Processing Form Data /w $_POST

2003-06-19 Thread Kyle Babich
I have a form (setup.php) that passes values to processSetup.php when they are written into setup.txt. I'm trying to instead of writing every idividual value into setup.txt from setup.php, write a loop that will take as many values as there are in the $_POST array and write them all into a

Re: [PHP] Re: Processing Form Data /w $_POST

2003-06-19 Thread Kyle Babich
What kind of 'logical' order do you need for the Post array? To clarify: Do you need to write to a file the POST variables passed to the script? Yes, setup.php - processSetup.php - setup.txt Kyle Babich [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a form

[PHP] explode, split, or what?

2003-06-19 Thread Kyle Babich
Thank you to those of you who helped me with my last problem earlier today. Now I have a text file (setup.txt) that has a series of values all seperated by \r\n's. Inside of another file I'm trying to read setup.txt into $rawSetupData and explode that with \r\n's into an array called

Re: [PHP] Simple Form Processing

2003-01-12 Thread Kyle Babich
smoothly and understand what's happening, THEN start modifying it to a 3-file form. I'd personally push forms through using POST method rather than get whenever possible -- especially when dealing with files... the manual does it this way too :) Justin on 12/01/03 12:18 PM, Kyle

[PHP] Simple Form Processing

2003-01-11 Thread Kyle Babich
I just broke skin with php and I'm learning forms, which I'm not good with at all. These are snippets from post.html: form method=get action=process.php enctype=multipart/form-data and input type=file name=image1 maxlength=750 allow=images/*br input type=file name=image2 maxlength=750