[PHP] preg_replace and eval

2002-10-28 Thread Daniel Pupius
Hey there, We have a class that sets up a tree structure that represents an e-learning object made up of nested "components". We have a function getPropertyValue($name) which returns the property $name for the current component. Now, we want to allow the user to use something like {parent.proper

[PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Daniel Pupius
Hi there. I'm working with RDF/XML that is strict on what characters are allowed within the elements and attributes. I was wondering if anyone had a script that processed a string and replaced all illegal-characters with their HTML code, for example "&" is converted to & and " to ". It should also

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Daniel Pupius
cessor. However, I'd like IE to be able to view the XML file just for completeness. Da "Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Thu, Jun 06, 2002 at 12:47:57PM +0100, Daniel Pupius wrote: > &g

Re: [PHP] How can i resize images after upload?

2002-06-07 Thread Daniel Pupius
Why not use PHP's built in image library: http://www.php.net/manual/en/ref.image.php -- it's pretty cool. The resample function doesn't exist in some old install but it's quite easy to write your own -- just doesn't run as fast as a compiled version. Dan -- PHP General Mailing List (http:/

[PHP] What do you say to someone who says...

2003-12-04 Thread Daniel Pupius
What do you say to someone who says: "PHP is just a kiddie language"? (Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373) PHP is currently my strongest development language and it annoys me that it is a much less bankable skillset than .NET and Java. How long do you think it'

[PHP] Re: Starting OOP

2003-12-16 Thread Daniel Pupius
It would be a good idea to create a database abstaction class. This means that should you move your application to a different database you only have to replace your database class, instead of recoding everything with the new set of functions. It can also be neater than using the mysql functions

[PHP] Re: RewriteRule REGEX ?

2004-01-26 Thread Daniel Pupius
I don't think you need to escape the full-stop (period) that could cause problems. I've used the following rule with no problem: RewriteRule ^learning/(.*).htm$ _rewriteHandler.php?query=$1/ "Monty" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My server runs Apache 2.0. I am t

[PHP] Re: send a POST to a URL from within PHP code

2004-01-26 Thread Daniel Pupius
You need to open a socket: http://uk.php.net/manual/en/function.fsockopen.php Think there's a demo in the comments lower down the page. Yup, here it is: function httpPost($host, $path, $referer, $data) { $fp = fsockopen($host, 80); fputs($fp, "POST ".$path." HTTP/1.0\r\n"); fputs($fp

[PHP] Re: Create a zip archive from a folder

2004-01-29 Thread Daniel Pupius
I have achieved this using the shell_exec() function: $cmd = "cd ".escapeshellarg($curdir).";zip -r9b . ".escapeshellarg($name)." *"; $result = shell_exec($cmd); This moved the shell into the current directory ($curdir), then creates a new zip file ($name) for the entire directory. I hav