[PHP] is_executable() ???

2008-01-07 Thread Al
clearstatcache(); if(is_executable(PATH_TO_SOURCE_DIR . $filename) { code } Always returns true for: foo.jpg foo.php foo.sh And even if I feed it a non existing file. I found one ref that said is_executable() doesn't work in safemode, seems dumb if true. If that's so, how can I test whether

[PHP] Re: $_GET and multiple spaces.

2008-01-13 Thread Al
Try "%20" for each space. Better yet, use underscores "_" Churchill, Craig wrote: Hello, One of the values I'm passing in a URL string contains multiple spaces. ... (The multiple spaces are between Argononemertes and australiensis) However when I retrieve the value using $_GET[DarScientificNa

[PHP] Re: Match anything between two " that is not a " except if it is escaped...

2008-01-18 Thread Al
A good habit is to use the hex equivalent character for any character that has a special meaning in pregex expressions. e.g., space = \x20 "/" = \x2f "." = \x2e double quotes = \x3d etc. Then you won't have this type of problem and you won't have to use stuff like this: This is for double quo

[PHP] Re: Best Approach

2008-01-23 Thread Al
PHP's error handler can be set up to automatically send emails. Send them to a dedicated mailbox and then check that mailbox every day. Miguel Guirao wrote: Hello fellow members of this list, There is a couple of rutinary tasks that our servers (different platforms) perform during the night. E

Re: [PHP] Rename

2008-01-24 Thread Al
First get an array of all the files, e.g., $fpDir is the full path to yiour dir. foreach(glob("$fpDir*.*") as $file) { $filesArray[] = $file; } print_r($filesArray); //so you can see what's happening Then do a: foreach($filesArray as $file){ rename($sourceDir.$file,

Re: [PHP] Rename

2008-01-24 Thread Al
You obviously missed my last sentence. "Once you get this working, you can put the rename() in the first foreach() loop. Don't forget to take care of exceptions. " Robert Cummings wrote: On Thu, 2008-01-24 at 16:18 -0500, Al wrote: First get an array of all the files, e.g.,

[PHP] Re: Exception handling with file()

2008-02-11 Thread Al
I've just started using Try/catch and found the doc is a bit weak. Best I can tell most, and likely all, our regular system functions do not "throw " and an exception for the Exception handler. Thus, you can put your code in a personal function, with a throw, or use the old fashion way, e.g.,

[PHP] Re: Making sure an include file works

2008-03-01 Thread Al
Put this at the top of of your include files // *** Debug Only ***/ if(TRUE) // TRUE for debug only { ini_set("display_errors", "on"); //use off if users will see them error_reporting(E_ALL); echo 'Error display and logging on '; //This reminds you to

[PHP] Re: regular expressions question

2008-03-05 Thread Al
ctype_alpha ( string $text ) Adil Drissi wrote: Hi, Is there any way to limit the user to a set of characters for example say i want my user to enter any character between a and z (case insensitive). And if the user enters just one letter not belonging to [a-z], this will not be accepted.

[PHP] Re: SESSION Array problem - possibly different PHP versions?

2008-03-10 Thread Al
Put a print_r($_SESSION) at the top and bottom of your page code so you can see what's happening. Also check your code that updates the session assignment by the GET value. It appears your code maybe unset()ing the session assignments. Are you using Cookies? If so, check this code carefully

[PHP] Re: Why use session_register()?

2008-03-10 Thread Al
Read the current php manual. Lamonte H wrote: Is it necessary to use session_register()? What exactly was the point of this function if you can set sessions using $_SESSION it self? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: php cron to check and remove files

2008-03-13 Thread Al
I handle your object a different and, I believe, a simpler way. Instead of a cronjob, I call a cleanup function whenever a page is opened. Obviously, this approach requires a time overhead and thus is not good for very high volume sites. You can mitigate this drawback by maintaining a simple t

[PHP] Re: Newbie ' If Statement' Question

2008-03-16 Thread Al
Here's how I'd do it. getRecordId();//Or, you can put this inside the heredoc with {} //heredoc $str= << txt; if (!empty($emp_row->getField('testfield')) print $str; else print "Non Print"; ?> [EMAIL PROTECTED] wrote: Hello Folks, I would like to be able to wrap a 'form' inside a php '

Re: [PHP] Convert html to pdf with php

2008-03-20 Thread Al
I think Imagemagick will do it. Philip Thompson wrote: On Mar 20, 2008, at 4:42 PM, Robert Burdo wrote: Does anyone know how to convert an HTML form to a pdf with php? Have you STFW? =D http://www.google.com/search?q=php+html+to+pdf I use dompdf. Unfortunately, the guy who created it isn'

[PHP] Re: fwrite/fclose troubles

2008-03-21 Thread Al
int file_put_contents ( string $filename, mixed $data [, int $flags [, resource $context]] ) This function is identical to calling fopen(), fwrite() and fclose() successively to write data to a file. This native function does it for you Mark Weaver wrote: Hi all, I've been lurking and read

[PHP] Re: fwrite/fclose troubles

2008-03-22 Thread Al
Seems like this does what you are attempting. if(DEBUG_MODE) // TRUE for debug only { ini_set("display_errors", "on"); //use off if users will see them error_reporting(E_ALL); echo 'Error display and logging on '; } Mark Weaver wrote: Hi all, I've been lurking and reading now fo

Re: [PHP] Comparing file creating dates...

2008-03-22 Thread Al
you may need to use filemtime() and not filectime(); Jim Lucas wrote: Ryan S wrote: Hey all, Heres what i am trying to do: When someone sends a message from my site, i take their ip address and make a file with their ip address in a directory called "hash-directory", the file looks like thi

[PHP] Quick email address check

2008-03-26 Thread Al
I'm scripting a simple registry where the user can input their name and email address. I'd like to do a quick validity check on the email address they just inputted. I can check the syntax, etc. but want check if the address exists. I realize that servers can take a long time to bounce etc. I

[PHP] Re: optimilize web page loading

2008-03-26 Thread Al
You are really asking an HTML question, if you think about it. At the PHP level, either use output buffering or assemble all your html string as a variable and then echo it. The goal is to compress the string into the minimum number of packets. Alain Roger wrote: Hi, i would like to know if

[PHP] Re: Quick email address check

2008-03-26 Thread Al
All good suggestions guys. Richard's has the advantage of solving the potential for a delay by the user's email server. I'll have the user submit and tell'm to wait while I check the email address for them. Solves several problems. Al wrote: I'm scripting a simpl

Re: [PHP] Re: optimilize web page loading

2008-03-26 Thread Al
ut, I do recall it was not worth the slight extra trouble to use OB. Now, I simple assemble by html strings with $report .= "foo"; And then echo $report at the end. It also makes the code very easy to read and follow. Andrew Ballard wrote: On Wed, Mar 26, 2008 at 1:18 PM, Al <[E

Re: [PHP] Re: optimilize web page loading

2008-03-27 Thread Al
Good point. I usually do use the single quotes, just happened to key doubles for the email. Actually, it's good idea for all variable assignments. Philip Thompson wrote: On Mar 26, 2008, at 6:28 PM, Al wrote: Depends on the server and it's load. I've strung together some rat

[PHP] File Upload Security

2008-04-11 Thread Al
One of my sites has been hacked and I'm trying to find the hole. The hack code creates dirs with "nobody" ownership, so it's obvious stuff is not via ftp [ownership would be foo] Site is virtual host, Linux/Apache I'm concerned about a file uploader my users use to upload photos. Can anyone s

Re: [PHP] File Upload Security

2008-04-11 Thread Al
c The kapicag/ex3/t.htm appears to be phishing site. mike wrote: How was it "hacked"? That will help determine what kind of exploit might have been used. On 4/11/08, Al <[EMAIL PROTECTED]> wrote: One of my sites has been hacked and I'm trying to find the hole. The

[PHP] Re: File Upload Security

2008-04-12 Thread Al
Thanks guys. I had written a newer version restricted to images which checks MIME and image width and height. I have one application which needs a text file. I think I'll have my users hide a password in it and scan the whole file for Al wrote: One of my sites has been hacked an

[PHP] Need a simple one time search utility

2008-04-12 Thread Al
I need a simple utility that simulates GREP to find a certain string in any php files on my website. Site is on a shared host w/o shell access so I can't run GREP. I can write a PHP scrip to do it; but, this is a one time thing and I was hoping to find something to save me the effort. Thanks

Re: [PHP] Need a simple one time search utility

2008-04-12 Thread Al
host prohibits shell_exec() Casey wrote: On Apr 12, 2008, at 12:13 PM, Al <[EMAIL PROTECTED]> wrote: I need a simple utility that simulates GREP to find a certain string in any php files on my website. Site is on a shared host w/o shell access so I can't run GREP. I can write

Re: [PHP] Need a simple one time search utility

2008-04-12 Thread Al
I know how to script one to do the job; but, I was hoping to save a few hours.. Nathan Nobbe wrote: On Sat, Apr 12, 2008 at 3:42 PM, Al <[EMAIL PROTECTED]> wrote: host prohibits shell_exec() im sure you could put something together w/ php_grep(); http://www.php.net/preg-grep -

[PHP] Re: File Upload Security

2008-04-14 Thread Al
gestion. Thanks. Peter Ford wrote: Al wrote: Thanks guys. I had written a newer version restricted to images which checks MIME and image width and height. I have one application which needs a text file. I think I'll have my users hide a password in it and scan the whole file for and ot

[PHP] Hack question

2008-04-16 Thread Al
I'm still fighting my hack problem on one of my servers. Can anyone help me figure out what's the purpose of this code. The hack places this file in numerous dirs on the site, I assume using a php script because the owner is "nobody". I can sort of figure what is doing; but, I can't figure out

Re: [PHP] Hack question

2008-04-17 Thread Al
Can you explain this in more detail for me. Sounds like this code is providing the entry point for the other hack code. Greg Bowser wrote: I can sort of figure what is doing; but, I can't figure out what the hacker is using it for. It will allow him to upload and execute arbitrary code on

[PHP] Re: Hack question

2008-04-18 Thread Al
I'm continuing to work on this. One thing that seems obvious. The code executes the script code, using eval(), directly from the /tmp dir. So the usual security tests we do prior to using move_uploaded_file() are useless. Al wrote: I'm still fighting my hack problem on one of my se

Re: [PHP] Re: Hack question

2008-04-18 Thread Al
I've not bothered to try and figure out where it came from because hackers spoof their ID anyhow. Eric Butera wrote: On Fri, Apr 18, 2008 at 12:22 PM, Al <[EMAIL PROTECTED]> wrote: I'm continuing to work on this. One thing that seems obvious. The code executes the script

[PHP] Re: Hack question

2008-04-18 Thread Al
Progress. One of our designers uploaded an infected css file for his application. Thus every time the file is called, it's executed. the The code appears to be md5 encoded. I'm going reverse the coding to see what it does. Al wrote: I'm still fighting my hack problem on one of

[PHP] SMS Cellular Text Messaging

2008-04-28 Thread Al
Anyone enlighten me about sending SMS text messages via sendmail or or just php mail()? I've been Googling, etc. and everything I've found so far, comes up with for-fee services. I can send messages to my cellphone with sendmail but the regular email format is dumb at the cellp

Re: [PHP] SMS Cellular Text Messaging

2008-04-28 Thread Al
I didn't word my question well. I know about the following, etc. And, I know they charge their customers. Cingular: [EMAIL PROTECTED] Sprint: [EMAIL PROTECTED] Verizon: [EMAIL PROTECTED] Nextel: [EMAIL PROTECTED] I want to send a pure SMS via these gateways without the regular email headers,

[PHP] Re: XHTML/CSS problem

2008-05-02 Thread Al
Use Firefox and install the HTML Validator. I looked at your page and it instantly showed ALL the errors. jeroen vannevel wrote: hey, this isn't a php problem, but an XHTML/CSS one. have a look at www.speedzor.com/woopsie.php, and please tell me where my problem is. i'm stuck at this for ho

[PHP] How to determine if file is writable and deletable

2008-05-07 Thread Al
the site-name, and I want the scrip to be able to determine if it can delete a file. Thus, the file in question must have its "other" permissions include write. Surely, there must be an easier way. Thanks, Al -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to determine if file is writable and deletable

2008-05-07 Thread Al
You are missing the point of my question. I don't have a problem reading the permissions. They do not solely determine whether a file can be deleted. Aschwin Wesselius wrote: Al wrote: I need to determine if a file is truly deletable by a php script, Deleting permissions seem to be the

[PHP] Re: How to determine if file is writable and deletable

2008-05-11 Thread Al
I ended up using posix_access() which is what is_writeable() should be. is_writeable() is virtually useless. Al wrote: I need to determine if a file is truly deletable by a php script, Deleting permissions seem to be the same as writing, they probably have the same criteria. is_writable

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Al
Make certain your steam is compressed http://www.whatsmyip.org/mod_gzip_test/ Per Jessen wrote: Robin Vickery wrote: 2008/5/14 Per Jessen <[EMAIL PROTECTED]>: The issue is - I'd like this page to appear to be as "real time" as possible, and the occasional delay caused by the conditional g

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Al
Try by not LZW compressing and the use ob_start() and flush() so your files are gzip compressed. I don't know if Firefox knows how to readily handle LZW on the fly. It does know how to handle gzip. Per Jessen wrote: Al wrote: Make certain your steam is compressed http://www.whatsmyi

Re: [PHP] Persistent state applications

2008-05-17 Thread Al
Ive starting using Pear cache_lite(). Works great for maintaining stuff between page refreshes. You can set the retention time to anything reasonable. tedd wrote: At 12:34 PM -0700 5/17/08, James Colannino wrote: Hey everyone! I'm very new to PHP, and had a somewhat general question (forgive

[PHP] PEAR_Exception & PEAR_Error

2008-05-27 Thread Al
I'm using the pear class Mail_RFC822::parseAddressList() which apparently only throws an error_object for PEAR_Error. The manual says that PEAR_Error is deprecated, so I'd like to use PEAR_Exception; but; am having trouble getting it to recognize the error. Can anyone help me with this? -- P

Re: [PHP] PEAR_Exception & PEAR_Error

2008-05-28 Thread Al
filter_var() is an excellent suggestion and works great. Richard Heyes wrote: I'm using the pear class Mail_RFC822::parseAddressList() which apparently only throws an error_object for PEAR_Error. You might want to consider the filter_var() function if you can - it will be much faster. The

[PHP] Re: Regex in PHP

2008-06-04 Thread Al
$user = trim(strstr($email, '@'), '@); VamVan wrote: Hello All, For example I have these email addressess - [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What would be my PHP function[Regular expression[ to that can give me some thing like yahoo.com hotmail.com gmail.com Thanks

Re: [PHP] PDF to images or something similar

2008-06-13 Thread Al
Imagemagick, with some php code, probably will do it. Per Jessen wrote: Ray Mckoy wrote: Hi!. I need to create a pageflip magazine (you know, a flash magazine). My client ask me to do a little php program that convert a full pdf magazine into a pageflip magazine. My doubt is: It's possible wit

[PHP] Re: php seems to be inconsistent in its handling of backslashes ... maybe?

2007-04-22 Thread Al
The proper way to handle special control PCRE characters like "\" is to use the hex [e.g., \x5C] value. Then you won't have a problem. The engine knows you want the the object treated as a character and an a control. [EMAIL PROTECTED] wrote: -- or maybe it's just the PCRE extension -- or quit

[PHP] Re: posting variables to parent frame

2007-04-24 Thread Al
iFrames are obsolete and only IE handles them. I don't even know if IE7 does. Use css tags instead. Hans wrote: Hi there, I'm trying to post variables to a parent frame, I'm working from a page that is in an iFrame. However, I don't know how to accomplish this. I tried target='top' to includ

Re: [PHP] Re: posting variables to parent frame

2007-04-24 Thread Al
Provide an example of an iFrame that will work on all modern browsers and that can't be done with DIVs or OBJECTS Stut wrote: Al wrote: iFrames are obsolete and only IE handles them. I don't even know if IE7 does. Well that's just a complete load of rubbish. The iframe tag i

Re: [PHP] Separating words based on capital letter

2007-04-25 Thread Al
Note: several of the folks used "/" as the delimiter. Actually, it can be almost anything that will not be in the $string. Generally, I use "%" simply because it's easier to spot when I forget the delimiters. Also, note Robin's use of the metachar [[:upper:]]. metacharacters can very useful.

Re: [PHP] Re: posting variables to parent frame

2007-04-25 Thread Al
Sorry about that guys. I just fixed it. Stut wrote: FYI: Every time I reply to you I get a bounce back saying your email address ([EMAIL PROTECTED]) does not exist. It's starting to get annoying. -Stut Stut wrote: Al wrote: Provide an example of an iFrame that will work on all m

[PHP] Re: posting variables to parent frame

2007-04-25 Thread Al
I stand corrected by pros. One should always double check their memory before posting, even when in a hurry. Al wrote: iFrames are obsolete and only IE handles them. I don't even know if IE7 does. Use css tags instead. Hans wrote: Hi there, I'm trying to post variables t

Re: [PHP] Re: posting variables to parent frame

2007-04-25 Thread Al
Very clever use of iFrame. So clever it doesn't show in your html source code. Looks more like you are using DIV tags, with simple POST values, just like I'd have done it. Incidentally, "" is an error for html. tedd wrote: At 11:12 AM -0400 4/24/07, Al wrote: Provide an

Re: [PHP] Re: posting variables to parent frame

2007-04-25 Thread Al
Ted: FF 2.0.0.3 is what I used to examine your html code. It looks the same with IE7. The nifty FF add-on TotalValidator is what I used to validate your html code. tedd wrote: At 2:35 PM -0400 4/25/07, Al wrote: Very clever use of iFrame. So clever it doesn't show in your html source

Re: [PHP] Re: everything printed suddenly has blue text, as if were a link

2007-04-26 Thread Al
is depreciated and shouldn't be used anyhow. Use styles instead. Dave Goodchild wrote: View the source, you have this: which is not closed, therefore everything after it will be blue. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: how to detect type of image

2007-04-28 Thread Al
If it's critical that you can detect the image type accurately, I'd suggest using ImageMagick's "identify" command. It will tell you about everything that you'd ever want to know about an image. http://www.imagemagick.org/script/index.php Post your question on their forum http://www.imagemagick

[PHP] Re: Split string

2007-05-02 Thread Al
Look at split() and explode(). Lester Caine wrote: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a se

[PHP] Re: DBA flatfile mode

2007-05-09 Thread Al
See if there is a optimize, clean. vacuum or refresh command. Most DBs have them by whatever name. Maybe SQLite would be an alternate choice. Ultraband wrote: Hello, I'm using PHP's dba flatfile mode to maintain a flatfile database with a few records. It works good, but I was wondering abo

[PHP] Need a new shared host with php

2007-05-10 Thread Al
I'm looking for a shared host with an up-to-date php5, and one who at least tries to keep it relatively current. Needs are modest. Just need good ftp access, cgi-bin, shell, etc. Any suggestions. I'm looking at Host Monster, anyone have experience with them? Thanks... -- PHP General Mailing

[PHP] php5 include() problem

2007-05-13 Thread Al
perms=0755) [function.include]: failed to open stream: No such file or directory in /home/foo/public_html/EditPage/cgi_file_test.php on line 15 Bottom line: It appears include() is not working right, for whatever reason. Anyone have any ideas? Thanks, Al -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php5 include() problem

2007-05-13 Thread Al
Is there an alternate way to execute a php in cgi-bin so it can do a chmod() on site directories as the "owner"? My approach was the only way I could think of. Given the obvious problem(s), it appears that it may not be a good choice. Richard Davey wrote: Al wrote: I've go

[PHP] Re: using preg_match

2007-05-16 Thread Al
The "container", as you called it, are delimiters. They can be about any character you choose; but, stay away from preg control characters. Personally, I use "%" most of the time. It's a good habit to use delimiter characters that you can be certain will not be included in your strings. Then, y

[PHP] Security Question, re directory permissions

2007-05-18 Thread Al
I'm on a shared Linux host and have been wondering about security and directory "other" ["world"] permissions. The defaults are 755. The 'others' [world] can read them only. Is there a security hole if a dir on the doc root if a directory has permissions 757? If there is a security problem, w

Re: [PHP] Security Question, re directory permissions

2007-05-18 Thread Al
How can they write or edit files there without having ftp access or the site's file manager? Tijnema ! wrote: On 5/18/07, Al <[EMAIL PROTECTED]> wrote: I'm on a shared Linux host and have been wondering about security and directory "other" ["world"] perm

Re: [PHP] Security Question, re directory permissions

2007-05-18 Thread Al
But, SSH and telnet, etc. require authentication login-in and all the executables you mentioned [and others] require someone who has access to upload a harmful file to start with. Right? Once they are in there, they can do anything they please anyhow. Al. Tijnema ! wrote: On 5/18/07

Re: [PHP] Security Question, re directory permissions

2007-05-18 Thread Al
How can anyone, other than the staff, get into my site? Far as I know, other users can't get out of their own domain space and into mine. Tijnema wrote: On 5/19/07, Al <[EMAIL PROTECTED]> wrote: But, SSH and telnet, etc. require authentication login-in and all the executables yo

Re: [PHP] Security Question, re directory permissions

2007-05-18 Thread Al
security, to mkdir and create special files. Guess, I'll go to the trouble to change permissions to create new stuff and then restore them to 755 and 644. Thanks everyone. Robert Cummings wrote: On Fri, 2007-05-18 at 20:16 -0400, Al wrote: How can anyone, other than the staff, get into m

Re: [PHP] Security Question, re directory permissions

2007-05-19 Thread Al
I use Hosting Matters. It is super reliable and solid. itoctopus wrote: I'm genuinely interested to know with whom you're hosting... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Adserver programming with php

2007-05-19 Thread Al
Use php and get the site on the air ASAP, so it generates revenue. You can a quickly and cheaply upgrade the hardware if the need arises. The OS and webserver software will probably make a bigger difference. Seems like I recall someone said Google and Yahoo use PHP. Merlin wrote: Hi there,

[PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-21 Thread Al
Best of both worlds may be SQLite. ZEND has a nice article on the subject. [EMAIL PROTECTED] wrote: I am in the process of adding a part to my website which would include pictures, pdf files, txt files, and excel files. The files sizes could be anywhere on average of 100k to 2mb. Do you think

[PHP] ftp root dir?

2007-05-22 Thread Al
Can I assume that all ftp_connect()s will make the current dir the DOC_ROOT? If not, how can I insure the ftp root dir is the same as DOC_ROOT? You can't use the absolute path with ftp. chdir() doesn't change the ftp current dir. if you ftp_chdir() and it's already on the root, it posts an err

Re: [PHP] ftp root dir?

2007-05-22 Thread Al
I know that; but, I writing a script, that can be used on different servers, which creates a directory and I want to make certain it is created on the DOC ROOT. I don't want the user to have to test the ftp connection with a ftp utility program first. Jim Moseby wrote: r? Can I assume tha

[PHP] Re: ftp root dir?

2007-05-22 Thread Al
. Thanks... Johan Holst Nielsen wrote: Al wrote: Can I assume that all ftp_connect()s will make the current dir the DOC_ROOT? First of all - what do you mean with DOC_ROOT? If it is the document root (of what?!). If not, how can I insure the ftp root dir is the same as DOC_ROOT

[PHP] Re: System wide variable

2007-05-23 Thread Al
Take a look at SQLite Darren Whitlen wrote: Hi, I have a PHP script that reads and updates either a small file or a mysql database. This script is called from several places every .5 seconds. I would like to move this file to a variable for extra speed as the file is causing a few problems

[PHP] ftp_put() problem??

2007-05-23 Thread Al
Can anyone help with this. On a Linux/Apache server. I want to simply copy a file with ftp_put() from one dir to another. To make certain I'm pointing to the correct dirs, I'm using this: print_r(ftp_nlist($conn_id, FTP_EP_DIR)); //It is the correct dir print_r(ftp_nlist($conn_id, $rpdir)); /

[PHP] Re: ftp_put() problem??

2007-05-24 Thread Al
chdir($dist_dir); //$dist_dir is simply relative to $_SERVER[document_root]; i.e., /test ftp_put($conn_id, $dist, $source, flag]; Al wrote: Can anyone help with this. On a Linux/Apache server. I want to simply copy a file with ftp_put() from one dir to another. To make certain I'm poi

[PHP] Question about using ftp_put() for copying files

2007-05-24 Thread Al
Can anyone explain what's going on. If I assign $source= $source_dir . $file; $source_dir is the absolute path i.e., /home/x/public_html/EditPage/ And $dist= $dist_dir . $file; $dist_dir is simply relative to $_SERVER[document_root]; i.e., just plain /test To get ftp_put() to work, I must

Re: [PHP] Question about using ftp_put() for copying files

2007-05-24 Thread Al
wrote: On Thu, May 24, 2007 2:37 pm, Al wrote: Can anyone explain what's going on. If I assign $source= $source_dir . $file; $source_dir is the absolute path i.e., /home/x/public_html/EditPage/ And $dist= $dist_dir . $file; $dist_dir is simply relative to $_SERVER[document_root]; i.e.,

[PHP] Orphan functions?

2007-06-01 Thread Al
certain the are used. Obviously, the parser would need a list of files that possibly could use the functions. Al... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Orphan functions?

2007-06-01 Thread Al
I appreciate the response and looked at the tokenizer doc; but, I'm missing your point. Are you implying I should write a Tokenizer Function to do the job? Al. Robert Cummings wrote: On Fri, 2007-06-01 at 14:15 -0400, Al wrote: Does anyone have a utility or technique to find o

Re: [PHP] Orphan functions?

2007-06-01 Thread Al
I gotcha now. I misspoke about writing a tokenizer function, I understood that it would be a script. That's for the suggestion. Though, I was hoping to avoid reinventing something that already exists. Robert Cummings wrote: On Fri, 2007-06-01 at 14:40 -0400, Al wrote: I appreciat

[PHP] Security for uploaded PDF files

2007-06-04 Thread Al
I have an application, with mild security, that approved users can upload pdf files. Obviously, the security for executables with a simple pdf extension bothers me. I's like some suggestions on how I can protect against errant files with a pdf guise? Thanks. -- PHP General Mailing

[PHP] Re: Removing a row from an Array

2007-06-04 Thread Al
What determines the rows you want to keep? Ken Kixmoeller -- reply to [EMAIL PROTECTED] wrote: Hey - - - - - - -- To do this, I am: - looping through the array - copying the rows that I want to *keep* to a temp array, and - replacing the original array with the "temp' one. Seems convoluted

Re: [PHP] Re: Removing a row from an Array

2007-06-04 Thread Al
h the given pattern. OR, that don't match the pattern. Most require array_values() to resync the keys. Ken Kixmoeller -- reply to [EMAIL PROTECTED] wrote: On Jun 4, 2007, at 3:27 PM, Al wrote: What determines the rows you want to keep? User selection. The array is essentially a "shop

Re: [PHP] Re: Removing a row from an Array

2007-06-05 Thread Al
hich does not exist :) - Tul Al wrote: Can you be more specific? Show us a line of code, or so. There are lots of functions that may fit your needs, array_filter(), array_walk(), preg_grep(), etc. I've found array_grep() to be super in many cases. Returns the array consisting of the elem

[PHP] Re: directories - again

2007-06-07 Thread Al
Here is a function you and others may find helpful. It may need some work, I haven't fully checked it out. DOC_ROOT is $_SERVER['DOCUMENT_ROOT'] ftp_conn() is a simple ftp connection function. /** * dir_perms() * * Checks to see who is dir owner and uses ftp or php to change permission

[PHP] Re: high-bit characters

2007-06-09 Thread Al
Take a look at !preg_match() using the POSIX extended meta character value [:print:] WeberSites LTD wrote: I'm trying to validate an RSS feed and getting errors about "high-bit characters". How can I check if a string contains any high-bit characters? thanks berber -- PHP General Mailing

[PHP] Re: Is it possible to get the name of the top most calling script?

2007-06-10 Thread Al
If the scripts are using a common file, [e.g., config, functions, etc.] you could define two constants. define("ORG_FILE", __FILE__); define("ORG_LINE", __LINE__); barophobia wrote: Hello, I know that __FILE__ and __LINE__ report on the file and line that they occur in. What I want is to be ab

[PHP] Re: create file permission problem

2007-06-13 Thread Al
Doesn't ftp_chmod() work immediately after creating your file, while the resource is still open? Check the permissions for the directory. Check the file and dir permissions with your ftp utility [e.g., WinSCP]. Or, write a simple script that echoes them. It really should work, I do it frequ

[PHP] Re: Undefined index:

2007-06-16 Thread Al
There is obviously something else wrong. That's the purpose of isset(); Comment out your line and see what happens. I'd guess the real problem is later in your code when you are trying to do something with $HTTP_COOKIE_VARS["LoggedIn"] even though your isset() test said it didn't exist. Web

[PHP] Re: Comparing string to array

2007-06-19 Thread Al
preg_grep() or foreach($_POST as $value){ if(empty($value)) continue; $good_stuff[] = $value; } Richard Davey wrote: Hi all, Ok it's 2am, my brain has gone to mush and I am having trouble figuring out an easy way to do this, can anyone shed some light? Take a peek at the fo

[PHP] Re: Setting Different Temp Directory for Different Application Users

2007-06-25 Thread Al
Doesn't this do what you want? tempnam ( string dir, string prefix ) [EMAIL PROTECTED] wrote: Hi All, I want to set different temp directory to every users of my application. Is it possible. TEMP_DIR is only configurable at system level, so I can do it only in PHP.INI or in apache as PHP_VA

Re: [PHP] Create .php file with php

2007-06-26 Thread Al
Would it not be better to create the file with tmpfile() and to put it in the system /tmp dir; which, I believe, is generally not in the webspace? Daniel Brown wrote: On 6/26/07, Marius Toma <[EMAIL PROTECTED]> wrote: I can not believe how stupid I can be sometime. I was trying to create

[PHP] Re: Removing Spaces from Array Values

2007-07-03 Thread Al
foreach() is your friend for this type of operation. foreach($someArray as $value){ $new_array[]= str_replace(' ','', $value); } OR foreach($someArray as $value){ echo str_replace(' ','', $value) . "\n"; } kvigor wrote: Need to remove all spaces from Array Values... And this

[PHP] Re: Anyone recommend a great phpmysql knowledge base?

2007-07-08 Thread Al
Search http://sourceforge.net/softwaremap/index.php There are dozens. Graham Anderson wrote: Does anyone have a positive experience with an 'out of the box' Knowledge Base system (hopefully open-source) that easily allows developers to easily share/post/publish/document their code? I know t

[PHP] Re: Displaying HTML characters in real format

2007-07-12 Thread Al
Best way to learn, and remember, things like this is to make a simple test page and see for yourself. Don Don wrote: Hi all, Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to display data on a page containing e.g. " but will like it to be displayed as

[PHP] Multiple Session Buffers

2007-07-13 Thread Al
Is there a way to instigate 2 separate named session buffers? They will contain different data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Multiple Session Buffers

2007-07-14 Thread Al
up my saving of the security number. Obviously, I don't want it exposed with GET or shown in the HTML source. I'll just make my own simple session-like buffer with a tmpfile() outside the webspace. Al wrote: Is there a way to instigate 2 separate named session buffers? They will co

[PHP] Re: preg_replace() help

2007-07-14 Thread Al
What do you want out? $txt = 'A promise is a debt. -- Irish Proverb'; => [1] $txt = 'A promise is a debt. --Irish Proverb'; OR [2] $txt = 'A promise is a debt. --IrishProverb'; for [1] $txt= preg_replace("%--\x20+%", '--', $txt); //The \x20+ is one or more spaces Rick Pasotto wrote: I hav

<    1   2   3   4   5   6   7   8   >