Re: [PHP] Getting The Document Root

2006-02-02 Thread Silvio Porcellana [tradeOver]
Jeremy Privett wrote: I'm looking for a method that would be able to extract the user's true document root (e.g. /home/jeremy/public_html/) so that I can use it for some filesystem scanning functions. I'm trying to avoid hard-coding supported document roots in favor of being able to

Re: [PHP] PHP 5 Backwards Compatability

2006-01-30 Thread Silvio Porcellana [tradeOver]
Tod Thomas wrote: Is their a list of portability problems to be aware of when switching from v4 to v5? Maybe a table that compares the two? Thanks. You can start here: http://www.zend.com/php5/migration.php Silvio -- tradeOver | http://www.tradeover.net ...ready to become the King of the

Re: [PHP] Regular expression

2006-01-30 Thread Silvio Porcellana [tradeOver]
Barry wrote: Simple reg help please i want to match the last , in a,b,c,d and replace it with and Without using a regexp, you could do: code $string = 'a,b,c,d'; $letters = explode(',', $string); $last_letter = array_pop($letters); $final_string = implode(',', $letters) . ' and '

Re: [PHP] PHP hosting with multiple domains?

2006-01-30 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote: snip / hah.. I'll stop now. Think you get the idea. The convenient management of multiple domains with a hosting provider is my ultimate goal. Go with http://www.hub.org I've got a couple of domains with them - and I think they are great. Silvio -- tradeOver |

Re: [PHP] How can I get ENUM values from column info?

2006-01-29 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote: If I have columns type ENUM('live', 'hidden', 'pending'), $flags will show ONLY 'enum'. How can I get all ENUM values? Thanks for any help or direction. -afan This doesn't really seem a PHP question... BUT... give a look here:

Re: [PHP] query problem.

2006-01-24 Thread Silvio Porcellana [tradeOver]
Angelo Zanetti wrote: (...) Why does the cause that not to be displayed? or is it retrieving it correctly but not showing it because of the (which might be conflicting with HTML tags? When showing things in an HTML page it's always a good idea to use 'htmlspecialchars' (or

Re: [PHP] Re: hiding the index.php page.

2006-01-23 Thread Silvio Porcellana [tradeOver]
Barry wrote: Gregory Machin wrote: Hi I would like to know how i would hide my index page so that it is not shown at the end of the url like how gmail does it and many cms do it .. And what is it called when one does this .. Thank you If you use Apache, what you are looking for is

Re: [PHP] date(H, $datevalue) always adds an hour?

2006-01-20 Thread Silvio Porcellana [tradeOver]
David Grant wrote: Murray, I can't think what else it might be. Sorry! David What does date(I, $datevalue) return? (it's a capital 'i') I guess you already checked out this page... http://php.net/date -- tradeOver | http://www.tradeover.net ...ready to become the King of the World? --

Re: [PHP] adding script

2006-01-20 Thread Silvio Porcellana [tradeOver]
Ross wrote: This was a page I did ages ago http://www.ecurry.net/menu2.php The problem with it is when you add or subtact an item is it always button press behind. This must be because of the way the page self submits or something? The script is here

Re: [PHP] getting list of files included

2006-01-20 Thread Silvio Porcellana [tradeOver]
Diana Castillo wrote: does anyone know of a command in php that will give you a list of the files already included . Something that would tell you whether a file is already included before you do the require_once ? Try this: http://php.net/manual/en/function.get-included-files.php Oh,

Re: [PHP] fopen/fwrite and owner/group settings

2006-01-05 Thread Silvio Porcellana [tradeOver]
Mathijs wrote: Hello there, I Have a problem with some file writeing. I Use fopen to create a new file, but that file gets the owner and group the same as the apache owner and group. How can i change it so that the file gets the same owner/group as the files i upload with FTP? Thx

Re: [PHP] Access Client IP address

2006-01-04 Thread Silvio Porcellana [tradeOver]
Nilanjan Dasgupta wrote: Hi, Is there any way to client's IP address inside a php document. I am trying to generate a code that depends on the IP address of the client. thanks a lot, Nilanjan Give a look at $_SERVER, and more specifically $_SERVER[REMOTE_ADDR]

Re: [PHP] forms

2006-01-03 Thread Silvio Porcellana [tradeOver]
Mark wrote: Hi can any one show me how make another form appear below another once the 1st form has been submitted. [not really a PHP solution...] You can do like this: the 'SUBMIT' button of the first form only makes visible the (hidden) DIV where the second form is, and only *that*

Re: [PHP] Earlier versions hurt PHP 5

2005-12-29 Thread Silvio Porcellana [tradeOver]
Anas Mughal wrote: Here is a PHP5 hosting company: http://www.a2hosting.com/ Aaargh! I wouldn't suggest that one, I've had a really really bad experience with them (they shut down my site *w/o any notice* because they said I was using too much of their resources - while this was not true). I

Re: [PHP] XML Reader

2005-12-29 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote: Is there any easy php script to run to view an xml file such as new headlines like so: http://news.google.com/?output=rss or can anyone point me in the right direction for good online tutorials or books. You can start here: http://magpierss.sourceforge.net/ Magpie

Re: [PHP] Location ....

2005-12-28 Thread Silvio Porcellana [tradeOver]
Christian Ista wrote: Hello, Could you tell me a efficient solution for change page (new location) in PHP? I tried this code : header(Location: mypage.php); note: HTTP/1.1 requires an absolute URI http://php.net/header But in some case, I have error message heade already send. Then I use

Re: [PHP] gdf fonts

2005-12-21 Thread Silvio Porcellana [tradeOver]
Adrian Bruce wrote: Hi Does anyone know where i can get some decent gdf fonts for using in the imageloadfont() function, i have found some on the net but they are all a bit naf so far. I'm really just looking for something like Arial or verdana. Im creating pie charts on the fly but at

Re: [PHP] mutiple file upload

2005-12-21 Thread Silvio Porcellana [tradeOver]
Ross wrote: Hi, I am trying create a multiple file upload to a mysql server. Google is your friend... http://www.google.com/search?hl=enq=multiple+upload+phpbtnG=Google+Search And, by the way, if you are uploading and storing images in your MySQL DB, you might want to consider that there

Re: [PHP] Problem with fopen and sending POST vars

2005-12-20 Thread Silvio Porcellana [tradeOver]
Barry wrote: Hello everyone! I have a problem sending POST vars via fopen. It was possible for me to send some xml data but that's all. Anyone know how to send POST vars? Big probleme here is also that i have to connect via SSL. cURL can be your friend... http://php.net/curl

Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Silvio Porcellana [tradeOver]
Anders Norrbring wrote: I'm writing a filter/parsing function for texts entered by users, and I've run into a problem... What I'm trying to do is to parse URLs of different sorts, ftp, http, mms, irc etc and format them as links, that part was real easy.. You might want to consider using

Re: [PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Silvio Porcellana [tradeOver]
Jose Borquez wrote: I installed PHP from the ports and did not do any configuration. I set up the phpinfo page and the configuration line did not set disable session. Thanks in advance, Jose Maybe you have this: '--disable-all' (not sure, thou, this should enable sessions anyway,

Re: [PHP] Passing $_POST values to a php script

2005-12-19 Thread Silvio Porcellana [tradeOver]
Jay Blanchard wrote: [snip] I am trying to develop a testing framework for a bunch of php scripts. These files expect various kinds of data from the $_POST array. They work fine when invoked from the browser. But I am wondering if I can programmatically pass these values so that I can

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Jared Williams wrote: Hi, Just unset the ones you've picked ?php #random images example #this is your file $file = images.txt; #open the file $openFile = file($file); #generate a random number srand((double)microtime()*100); #get one of the entries in the file for ($i = 0;

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Silvio Porcellana [tradeOver] wrote: code $file = images.txt; $openFile = file($file); $num_images = 10; # don't need this is PHP 4.2.0 srand((float) microtime() * 1000); $random_keys = array_rand($openFile, $num_images); foreach

Re: [PHP] XSS via curl

2005-11-30 Thread Silvio Porcellana [tradeOver]
Sandy Keathley wrote: Is there a way to detect that a script is being accessed by curl, and not by a browser? ENV ($_SERVER) variables won't work, as those can be forged. Use a CAPTCHA test: http://en.wikipedia.org/wiki/Captcha HTH, cheers! Silvio -- tradeOver |