[PHP] How to new a Object via class name String?

2007-12-16 Thread ked
Hi , I'm a freshman in PHP, can anyone give me any advices? I defied some simple classes, like "User", "Item"... in a general way , $obj = new User(); specially, I need to assign a Object via a class name . Now , my code : switch ($className) { case "User": return new User(); br

[PHP] Securing your Sites

2007-12-16 Thread Wolf
For all of you with an upload/access page to your site that is world-viewable I have made available copies of scripts that kiddies have tried to use to take over my own server. As my upload page has yet to be broken nor my site taken over, I wanted to share them with everyone as a way to learn how

[PHP] how can i use timeout in php's socket?

2007-12-16 Thread 陆星光
how can i use timeout in php's socket? And if php support multicast? thanks

Re: [PHP] Writing text into images, and setting text size

2007-12-16 Thread Casey
Try imagettftext(). On Dec 16, 2007 5:59 PM, Dave M G <[EMAIL PROTECTED]> wrote: > PHP List, > > I've been able to write text into an image using the default fonts > available, with this command: > > ImageString($image, 5, $x - 20,$y-10, $text, $textColour); > > The problem is that the font that i

Re: [PHP] BBcode - Solved

2007-12-16 Thread Ronald Wiplinger
I copied BBCodeParse.ini to the wrong place, Ronald Wiplinger wrote: > I tested BBcode (Pear extension) with that code: > > if (!empty($_POST['bbcode'])) { > require_once 'HTML/BBCodeParser.php'; > $parser = new HTML_BBCodeParser(parse_ini_file('BBCodeParser.ini')); > echo $parse

[PHP] BBcode

2007-12-16 Thread Ronald Wiplinger
I tested BBcode (Pear extension) with that code: if (!empty($_POST['bbcode'])) { require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser(parse_ini_file('BBCodeParser.ini')); echo $parser->qParse($_POST['bbcode']); } ?> it works! I added it t

[PHP] Writing text into images, and setting text size

2007-12-16 Thread Dave M G
PHP List, I've been able to write text into an image using the default fonts available, with this command: ImageString($image, 5, $x - 20,$y-10, $text, $textColour); The problem is that the font that is identified by the index "5" is too small. But it seems that it can't be scaled in any way

Re: [PHP] Fatal error: Class 'DOMDocument' not found

2007-12-16 Thread Jochem Maas
Jeff Schwartz wrote: > I'm attempting to run the sample script on the PHP site: > >$dom = new DOMDocument('1.0', 'iso-8859-1'); > echo $dom->saveXML(); /* */ > ?> > > but get the error: > > Fatal error: Class 'DOMDocument' not found in /var/www/html/ajax/dom.php on > line 2 >

Re: [PHP] how to handle inserting special characters into a mysql field

2007-12-16 Thread Robert Erbaron
> On Saturday 15 December 2007 18:59:12 Richard Lynch wrote: > > On Fri, December 14, 2007 11:03 am, Adam Williams wrote: > > > $query = sprintf("SELECT * FROM users WHERE user='%s' AND > > > password='%s'", > > > mysql_real_escape_string($user), > > > mysql_real_escape_stri

Re: [PHP] PRG pattern - how to implement a "load page using GET"

2007-12-16 Thread Robert Erbaron
> a standard HTTP request is a GET request. I guess I'm just missing some basic definition of terminology. Been writing desktop systems for too long, 'spose. > using firefox and one of a number of extensions (firebug springs to mind) > you can actually view the request headers that are sent. Fir

[PHP] Fatal error: Class 'DOMDocument' not found

2007-12-16 Thread Jeff Schwartz
I'm attempting to run the sample script on the PHP site: saveXML(); /* */ ?> but get the error: Fatal error: Class 'DOMDocument' not found in /var/www/html/ajax/dom.php on line 2 I'm running ver. 5.1.6 and my config appears to be set up for xml: './configure' '--buil

Re: [PHP] PRG pattern - how to implement a "load page using GET"

2007-12-16 Thread Jochem Maas
Robert Erbaron wrote: > I've been reading up on login mechanisms using redirects, and have a > basic mechanism down. > > a1.php: > $site_title='My Site'; > if (isset($_SESSION['errmsg_s'])) > {$errmsg = 'Warning! '.$_SESSION['errmsg_s'].'!';} > else > {$errmsg = ''; } > if (isset($_SESSION['e

[PHP] PRG pattern - how to implement a "load page using GET"

2007-12-16 Thread Robert Erbaron
I've been reading up on login mechanisms using redirects, and have a basic mechanism down. a1.php: Welcome to '.$site_title.''; echo $errmsg; ?> a2.php: a3.php: '; ?> OK, looks like this handles refresh (resubmit) and back button issues. Hitting back when on page 3 empties 'email', so resubmi

Re: [PHP] temp tables mysql OT

2007-12-16 Thread tedd
At 8:34 AM +0100 12/16/07, Jochem Maas wrote: I guess back in day when rocks[tm] were still in vogue you would have had to be much more frugal with the meager cycles at your disposal - we're spoiled for cycles these days :-) I gave up mine when cars came along. To all -- All points well taken

Re: [PHP] php code compiles, produces good html output, but crashes when put through browser

2007-12-16 Thread Per Jessen
Casey wrote: > Maybe I didn't read well enough, but if the PHP produces proper HTML > on the command line, shouldn't it work in the browser too? Not necessarily. Running stand-alone and in the webserver are two completely different environments. > My logic is that if the title displays, then

Re: [PHP] php code compiles, produces good html output, but crashes when put through browser

2007-12-16 Thread Jochem Maas
Casey wrote: > On Dec 15, 2007 11:27 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: >> Casey wrote: >>> Comment out all Javascript. >> Casey - exactly how would javascript being causing a webserver to segfault >> in this context??? >> >> >>> On Dec 15, 2007, at 2:00 PM, "Daniel Brown" <[EMAIL PROTECTED