Re: [PHP] string concatenation with fgets

2009-11-30 Thread aurfalien
Hi Ash, Actually I need the if because the code will print out an empty line and add "sometext" to it. So without the if check for an empty line, at the end of the loop I'll get sometext. For example, if the file I am processing called somename.txt has a b c in it. I'll have; asomet

Re: [PHP] string concatenation with fgets

2009-11-30 Thread aurfalien
Hi Shawn, Your code looks cleaner then mine so i tried it and got the last entry in the txt file printed twice. On Nov 30, 2009, at 7:07 AM, Shawn McKenzie wrote: aurfal...@gmail.com wrote: So here is my final test code, notice the check for ' ' in the if. Since I'm on Linux, this has to

Re: [PHP] how to prevent a mild DOSS attack?

2009-11-28 Thread aurfalien
On Nov 28, 2009, at 9:24 AM, LAMP wrote: LinuxManMikeC wrote: On Wed, Nov 25, 2009 at 3:57 PM, Ashley Sheridan wrote: On Wed, 2009-11-25 at 16:38 -0600, LAMP wrote: hi guys, this morning I got complains from website owner and tons of visitors - nobody was able to access the website. it

Re: [PHP] string concatenation with fgets

2009-11-26 Thread aurfalien
So here is my final test code, notice the check for ' ' in the if. Since I'm on Linux, this has to do with whats between the last LF and EOF which is nothing but this nothing will get printed out. $file = fopen("somefile.txt", "r"); while (! feof($file)) { $names = trim(fgets(

Re: [PHP] Wiki recommendation?

2009-11-25 Thread aurfalien
On Nov 25, 2009, at 2:42 PM, Skip Evans wrote: Hey all, I'm looking for a good Wiki to maintain documentation on a large commercial web site that is always growing. DokuWiki is the only one I've installed and used at any length, so before I just use that one again I'd like to hear from th

Re: [PHP] string concatenation with fgets

2009-11-24 Thread aurfalien
On Nov 24, 2009, at 5:52 PM, ryan wrote: Is this what you want $file = fopen("test.txt", "r"); while (!feof($file)) { $line = trim(fgets($file)); print $line."sometext\n"; } fclose($file); outputs asometext bsometext csometext Ref to http://us3.php.net/manual/en/function.fgets.php. "Rea

Re: [PHP] string concatenation with fgets

2009-11-24 Thread aurfalien
On Nov 24, 2009, at 5:55 PM, Nirmalya Lahiri wrote: --- On Wed, 11/25/09, aurfal...@gmail.com wrote: From: aurfal...@gmail.com Subject: [PHP] string concatenation with fgets To: php-general@lists.php.net Date: Wednesday, November 25, 2009, 7:00 AM Hi all, I'm trying to append some text to w

[PHP] string concatenation with fgets

2009-11-24 Thread aurfalien
Hi all, I'm trying to append some text to what I read from a file. My code; $file = fopen("foo.txt", "r"); while (!feof($file)) { $line = fgets($file); print $line."sometext"; } fclose($file); foo,txt; a b c d e f g And when I run the script, it looks like; a sometextb

Re: [PHP] syntax woes

2009-04-02 Thread aurfalien
Hi all, For any one following this thread, here is how I worked around the apache/php/chown limitation. script snippet (and if any one has a more elegant style, please share as I am an amateur script kiddie). $path = "/homes".$username; $chowncmd = "/usr/bin/sudo /bin/chown "; mkdir($path

Re: [PHP] syntax woes

2009-04-02 Thread aurfalien
On Thu, 2009-04-02 at 15:58 -0700, aurfal...@gmail.com wrote: On Thu, 2009-04-02 at 15:47 -0700, aurfal...@gmail.com wrote: aurfal...@gmail.com wrote: Hi all, I'm unsure how to describe this but I'll try. The following code works fine in its own PHP script; $mkdircmd = '/bin/mkdir /homes/'.$uid

Re: [PHP] syntax woes

2009-04-02 Thread aurfalien
On Thu, 2009-04-02 at 15:47 -0700, aurfal...@gmail.com wrote: aurfal...@gmail.com wrote: Hi all, I'm unsure how to describe this but I'll try. The following code works fine in its own PHP script; $mkdircmd = '/bin/mkdir /homes/'.$uid; exec($mkdircmd); But when placed in a larger PHP script being

Re: [PHP] syntax woes

2009-04-02 Thread aurfalien
aurfal...@gmail.com wrote: Hi all, I'm unsure how to describe this but I'll try. The following code works fine in its own PHP script; $mkdircmd = '/bin/mkdir /homes/'.$uid; exec($mkdircmd); But when placed in a larger PHP script being part of the ldap_provisioning module in Drupal, the Drupal G

[PHP] syntax woes

2009-04-02 Thread aurfalien
Hi all, I'm unsure how to describe this but I'll try. The following code works fine in its own PHP script; $mkdircmd = '/bin/mkdir /homes/'.$uid; exec($mkdircmd); But when placed in a larger PHP script being part of the ldap_provisioning module in Drupal, the Drupal GUI is blank until I do;

Re: [PHP] php exe from cli, but no web

2009-03-31 Thread aurfalien
wow, that was ez! thanks a lot. i also enabled php logging and checked my apache logs and it was as you said. very cool. my httpd process runs as apache, but I also did a whoami php script to very this. thanks again stu, you helped out hugely! - aurf On Mar 31, 2009, at 3:38 PM, Stuart

[PHP] php exe from cli, but no web

2009-03-31 Thread aurfalien
and type the file name; http://mywebroot/file.php but it doesn't exe. I'm not expecting to see a screen full, but I check to see if the perl script runs on the remote host, and it doesn't. All is well from a CLI. Any suggestions are greatly appreciated, - aurfalien