[PHP] Limiting character input in

2004-11-16 Thread Garth Hapgood - Strickland
Unlike the input fields that use maxlength to define the number of character
allowed. Textarea doesnt seem to have that capability. I want to limit the
number of character to 255.

IS there any way of doing this without having to break my neck about it?

Garth

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] "From: " mail() function

2004-11-16 Thread Richard Davey
Hello Garth,

Tuesday, November 16, 2004, 7:56:39 AM, you wrote:

GHS> how can I make the from address look like "Matchmakers Team" instead of
GHS> 'from:[EMAIL PROTECTED]'.

Format it correctly. The PHP manual is your friend:

'From: Matchmakers Team <[EMAIL PROTECTED]>'

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Loading an extension

2004-11-16 Thread Octavian Rasnita
Hi all,

 I want to add an extension (CURL, mysql) to a php program without
specifying it in php.ini (because on some servers I might not have the right
to modify that configuration file).

I have tried using the dl() function, but here is an error I get on the
browser when doing this:

Warning: dl() [
function.dl]:
Not supported in multithreaded Web servers - use extension=ext/php_mysql.dll
in your php.ini in D:\broker\html\cotatii.php on line 6

Fatal error: Call to undefined function mysql_connect() in
D:\broker\html\cotatii.php on line 8

Thank you.

Teddy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: unable to upload a directory using the web brower (HTTP).

2004-11-16 Thread raditha dissanayake
Scott Fletcher wrote:
Um, can't be done.  So, I'll have to use JAVA instead.  Have anyone ever
done this, does anyone know of a good freeware JAVA applet that I can use?
 

Shameless Plug: Rad Upload (http://www.radinks.com/upload) does upload 
folders over HTTP unfortunatley it's not free (but still cheap).


Thanks,
Scott
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 

I found that on most web browsers, I can not upload the folder via HTTP
using hte web browser upload dialog box.  So, I can't use the php's
function, is_uploaded_file and move_uploaded_file.  Because the web
   

browser
 

see the folder as something to open with, like going down one directory.
So, any advice or suggestion??
Thanks,
Scott
   

 


--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Limiting character input in

2004-11-16 Thread Richard Davey
Hello Garth,

Tuesday, November 16, 2004, 7:59:35 AM, you wrote:

GHS> Unlike the input fields that use maxlength to define the number of 
character
GHS> allowed. Textarea doesnt seem to have that capability. I want to limit the
GHS> number of character to 255.

GHS> IS there any way of doing this without having to break my neck about it?

Client-side, only with JavaScript.

Server-side, just count how many characters they have entered:

if (strlen($textarea_content) > 255)
{
   echo "Error message here";
}

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php.ini

2004-11-16 Thread lister
(on windows) can someone tell me where to define which php.ini gets used?

On my dev box, I installed the zend editor. Now when i do a
  localhost/phpinfo()
from a normal browser window (ie not from within the zend IDE) it says php
is using the <..>/zend/php.ini settings file...

within apache's httpd.conf you can set which php DLL to use, but I cannot
see how php then knows which .ini file to work with? It seems to be
picking up the php.ini from a completely different directory somewhere, so
i am wondering if the zend installer sets some secret registry value that
the php.dll is looking for?

I would have thot something like:

httpd.conf >
  extension=php5.dll

then the dll looks for a php.ini in the same directory.
or does it look in the  or something?


On windows, I installed php/apache etc using the webserv project, if this
is relevant. it seems to give a clean setup of apache, mysql, php etc.

Thanks!

/dc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Loading an extension

2004-11-16 Thread Richard Davey
Hello Octavian,

Tuesday, November 16, 2004, 8:08:46 AM, you wrote:

OR> Not supported in multithreaded Web servers - use extension=ext/php_mysql.dll
OR> in your php.ini in D:\broker\html\cotatii.php on line 6

The clue is in the error.

Whatever web server you are using on your Windows box doesn't support
the dl() function (because, as it says, it's multi-threaded), so you
HAVE to set it via an extension command in the php.ini file.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] London - One Day Workshop "How to Build a Professional Database-Driven Website"

2004-11-16 Thread Ryan Carson
This definitely isn't spam. I'm a PHP developer myself who values the PHP 
General Mailing list. I thought everyone would want to
know about the workshop, as it's a great opportunity to improve your skills and 
get ahead of the competition.

Hope to see you there.

> -Original Message-
> From: Ryan A [mailto:[EMAIL PROTECTED] 
> Sent: 15 November 2004 22:37
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] London - One Day Workshop "How to Build a 
> Professional Database-Driven Website"
> 
> SPAM
> 
> 
> > Hey everyone,
> >
> >
> >
> > We're running a one-day practical workshop, in London UK, that will 
> > give
> you everything you need to build a powerful
> > enterprise-level, database-driven website - focusing on PHP, Apache 
> > and
> MySQL. Find out how to plan the project, design the
> > database, structure the code, develop and test the site, deploy it
> effectively, promote it professionally and maintain it
> > efficiently.
> >
> > Read more at www.carsonworkshops.com
> >
> > Hope to see you there,
> > Ryan
> >
> > --
> > Ryan Carson | Carson Systems   | www.carsonsystems.com
> > | Carson Workshops | www.carsonworkshops.com
> > | FlightDeck   | www.flightdeck-online.com
> > | BD4D.com | www.bd4d.com
> > --
> > Telephone   | +44 (0) 1225 859 835
> > Mobile  | +44 (0) 79688 10 253
> > Email   | [EMAIL PROTECTED]
> > Address | Vale View Studios, 9 Vale View, Bath BA1 7RH, UK
> > --
> > This message and any files attached are confidential and intended 
> > solely
> for the use of the individual or entity to whom they are
> > addressed. If you have re
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] London - One Day Workshop "How to Build a Professional Database-Driven Website"

2004-11-16 Thread Lester Caine
Ryan Carson wrote:
This definitely isn't spam. I'm a PHP developer myself who values the PHP 
General Mailing list. I thought everyone would want to
know about the workshop, as it's a great opportunity to improve your skills and 
get ahead of the competition.
Border line given the price
Hope to see you there.
Perhaps when you drop MySQL ;)
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php.ini

2004-11-16 Thread Lester Caine
[EMAIL PROTECTED] wrote:
(on windows) can someone tell me where to define which php.ini gets used?
The default is a copy in the windows directory. (C:\WINDOWS or c:\WINNT)
While details of what goes IN php.ini are nice in the manual - where it 
goes is a bit more vague. Someone add some fine detail into relocating it?

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php.ini

2004-11-16 Thread Burhan Khalid
On Tue, 2004-11-16 at 00:17 -0800, [EMAIL PROTECTED] wrote:
> (on windows) can someone tell me where to define which php.ini gets used?

If there is a php.ini file in the php root directory, then that gets
used. Otherwise, the php.ini file in C:\Windows (iirc).  If the php
interpreter (or dll) cannot find any php.ini file, it uses built-in
defaults.

> 
> On my dev box, I installed the zend editor. Now when i do a
>   localhost/phpinfo()
> from a normal browser window (ie not from within the zend IDE) it says php
> is using the <..>/zend/php.ini settings file...

This is because that's the file that it found first (ie, search order).
Zend installs its own php binaries (unless you do a custom setup).

[ snipped ]

> On windows, I installed php/apache etc using the webserv project, if this
> is relevant. it seems to give a clean setup of apache, mysql, php etc.
> 

I don't mess with those all-in-one-can installers, but you should read
the documentation and/or install log to see what it has installed where.

-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php.ini

2004-11-16 Thread Richard Davey
Hello,

Tuesday, November 16, 2004, 8:17:27 AM, you wrote:

lpc> within apache's httpd.conf you can set which php DLL to use, but I cannot
lpc> see how php then knows which .ini file to work with? It seems to be
lpc> picking up the php.ini from a completely different directory somewhere, so
lpc> i am wondering if the zend installer sets some secret registry value that
lpc> the php.dll is looking for?

It doesn't use a registry setting, I can guarantee you that.

It uses whatever you have defined as your system paths. Open a command
prompt and type in "path" and have a look.

It will search these paths in order and then the local directory too.
I can almost guarantee you have your Windows system32 directory and
standard Windows directory in there already.

If you look in there, I'm very sure you'll find a php.ini file.

I use Zend 3.5 and Apache 1.3 locally too (XP and OSX). I have two
different Apache conf files, one for PHP4 and one for PHP5. Then in my
Windows directory I have two ini files - php4.ini and php5.ini along
with the required php DLLs (there are only 2, one per version, the
extensions remain in the source directory).

When I want to swap from PHP4 to 5 for development I have a small
batch script that copies the respective ini/conf file and restarts
Apache. Works nicely.

You can also set this up (via the path I mentioned above) so it gets
the DLLs from another location, maybe something like c:\php4, but
personally the above works for me, allows switching between the two
versions quickly and it's painless, so there's no reason to change it.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Fwd: Error loading php_mysql.dll

2004-11-16 Thread mindaugas kuksa

Note: forwarded message attached.




__ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 
--- Begin Message ---
Hello,

I write to you because I want to ask you something
about PHP extensions.

The problem is that when I start my web server, PHP
module gives me an error: "PHP Startup: Unable to load
dynamic library '...' - The specified module could not
be found". BUT THEY ARE!!! A part of my php.ini file
is:

;;
; Dynamic Extensions ;
;;

  extension=php_bz2.dll
  extension=php_cpdf.dll
; extension=php_curl.dll
  extension=php_dba.dll
  extension=php_dbase.dll
  extension=php_dbx.dll
;+extension=php_exif.dll
; extension=php_fdf.dll
  extension=php_filepro.dll
  extension=php_gd2.dll
  extension=php_gettext.dll
; extension=php_iconv.dll
; extension=php_ifx.dll
; extension=php_iisfunc.dll
  extension=php_imap.dll
; extension=php_interbase.dll
; extension=php_java.dll
; extension=php_ldap.dll
  extension=php_mbstring.dll
; extension=php_mcrypt.dll
; extension=php_mhash.dll
  extension=php_mime_magic.dll
  extension=php_ming.dll
; extension=php_mssql.dll
; extension=php_msql.dll
; extension=php_mysql.dll
; extension=php_oci8.dll
; extension=php_openssl.dll
; extension=php_oracle.dll
; extension=php_pdf.dll
  extension=php_pgsql.dll
  extension=php_shmop.dll
  extension=php_snmp.dll
  extension=php_sockets.dll
; extension=php_sybase_ct.dll
  extension=php_tidy.dll
; extension=php_w32api.dll
  extension=php_xmlrpc.dll
  extension=php_xsl.dll
; extension=php_yaz.dll
; extension=php_zip.dll 
  extension=php_exif.dll

These lines starting with semicolon shows modules i
was not able to load. I have heared that if you want
to load some modules, you have to load other modules
first. So i tried to shift modules, which i could not
load, to the end of the list. It worked out only for
the php_exif.dll module. Others still do not work.

The question is...what do i have to do to get them
working?
(well in fact i only want to start php_mysql.dll)

PS.: my system is:
OS: WinXP Pro
WEB: Apache v2.0.50, PHP v5.0.2

HELP PLEASE:)

Mindaugas Kuksa
[EMAIL PROTECTED]
+37067106156

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- End Message ---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] php broken pipe

2004-11-16 Thread Rui Francisco
Hi,
i'm using firebird 1.5.1 on a linux machine with a php script
I'm using a query in loop and go through all records to do some operations
in the middle of the script i fork(); to do other things
When i return to the parent process i try to make one update and i get 
the following error
[nativecode=Unable to complete network request to host "127.0.0.1". 
Error writing data to the connection. Broken pipe]

And continue the loop of the records of the query.
Is this a regular beaviour ?  How can it be solved ?
I'm using Pear DB for database access.
Thank you in advance
Rui Francisco
--
Rui Francisco - [EMAIL PROTECTED]
FCCN - Fundação para a Computação Científica Nacional
Av. Brasil, 101  1700-066 Lisboa - Portugal
Tel: +351 218440100   Fax: +351 218472167
-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Error when I try to display 20 records per page

2004-11-16 Thread Philipp Lutz
Scott McWhite wrote:
$row = mysql_fetch_array($result); //get a row from our result set
a bit farther down...
while($row = mysql_fetch_array($result)){
Dude !
 You're like pulling the same results from the same query/resultset 
twice (..and stuff). You can't do that, man. You have to redo the query.

(Sorry, I just watched Hurley from "Lost" :-) )
Phil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Automatically Escape?

2004-11-16 Thread GH
Is there a function that can automatically escape special characters
before putting them into mySQL?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Automatically Escape?

2004-11-16 Thread Richard Davey
Hello GH,

Tuesday, November 16, 2004, 12:25:20 PM, you wrote:

G> Is there a function that can automatically escape special characters
G> before putting them into mySQL?

See magic_quotes to have it done for you. Although this isn't a
recommend approach if you plan to distribute your application, in
which case mysql_escape_string() is the one.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] my own extension

2004-11-16 Thread Uffe Kousgaard
If I want to write my own extension for PHP/Linux, is there any
specification on how to do that? Some specific functions that the SO
should always include, call convention etc.?

To make things a bit more complex, it will be done with Kylix, so if
anyone has tried that combination before, I would like to hear from
them. But otherwise c++ references are of course OK.

Regards
Uffe

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Converting to integer

2004-11-16 Thread Octavian Rasnita
Hi all,

I get some values from a MySQL table and some of them are in the format
1000.0, 234.0, etc.

I want those values converted as 1000, 234, and so on, but the other string
values need to remain the same.

I have tried using the function is_numeric to test which of the values
returned from MySQL are numbers, but none of them appear to be a number, so
I cannot convert them.

Thank you for any tips.

Teddy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Converting to integer

2004-11-16 Thread Matthew Weier O'Phinney
* Octavian Rasnita <[EMAIL PROTECTED]>:
> I get some values from a MySQL table and some of them are in the format
> 1000.0, 234.0, etc.
>
> I want those values converted as 1000, 234, and so on, but the other string
> values need to remain the same.
>
> I have tried using the function is_numeric to test which of the values
> returned from MySQL are numbers, but none of them appear to be a number, so
> I cannot convert them.

Use intval($value) to get the integer value.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Converting to integer

2004-11-16 Thread Richard Davey
Hello Octavian,

Tuesday, November 16, 2004, 12:53:24 PM, you wrote:

OR> I have tried using the function is_numeric to test which of the values
OR> returned from MySQL are numbers, but none of them appear to be a number, so
OR> I cannot convert them.

Because, unless you cast it otherwise, MySQL always returns strings.

You can use either:

$num = intval($mysql_num);

or just cast it:

$num = (int) $mysql_num;

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Automatically Escape?

2004-11-16 Thread Matthew Weier O'Phinney
* Gh <[EMAIL PROTECTED]>:
> Is there a function that can automatically escape special characters
> before putting them into mySQL?

Use PEAR's DB or MDB2 libraries with prepared statements and
placeholders:

$sql = "INSERT INTO someTable(value1, value2) VALUES(?, ?)";
$ins = $db->query($sql, array($value1, $value2));

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Automatically Escape?

2004-11-16 Thread Jordi Canals
On Tue, 16 Nov 2004 12:33:15 +, Richard Davey <[EMAIL PROTECTED]> wrote:

> G> Is there a function that can automatically escape special characters
> G> before putting them into mySQL?
> 
> See magic_quotes to have it done for you. Although this isn't a
> recommend approach if you plan to distribute your application, in
> which case mysql_escape_string() is the one.

Just a comment :

Note:  This function (mysql_escape_string) has been deprecated since
PHP 4.3.0. Do not use this function. Use mysql_real_escape_string() 
instead.

So, if you're coding new scripts is better to use mysql_real_escape_string().

Best regards,
Jordi.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php.ini

2004-11-16 Thread Jordi Canals
On Tue, 16 Nov 2004 00:17:27 -0800 (PST), [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> (on windows) can someone tell me where to define which php.ini gets used?
> 
> On my dev box, I installed the zend editor. Now when i do a
>   localhost/phpinfo()
> from a normal browser window (ie not from within the zend IDE) it says php
> is using the <..>/zend/php.ini settings file...
> 
> within apache's httpd.conf you can set which php DLL to use, but I cannot
> see how php then knows which .ini file to work with? It seems to be
> picking up the php.ini from a completely different directory somewhere, so
> i am wondering if the zend installer sets some secret registry value that
> the php.dll is looking for?
> 

If you're using Apache 2 (does not work with Apache 1.3)... then you
can put a directive in httpd.conf:

PHPIniDir c:/php

Regards,
Jordi.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date handling

2004-11-16 Thread Robert Sossomon


I'm guessing Red Hat Enterprise or at least the kernel I'm using (which is
the latest RH kernel) qualifies under the Linux category above.  Also, with
the application I'm writing, I need to deal with dates after 2038 too.  So
that is why I'm investigating alternatives - just because I'd like something
that would definitely work on any platform and is 'official' as much as
possible - rather than have my date handling be OS-specific.

How are you entering the date into the Table?  Could you not just rewrite the 
page so that the date information is entered differently, then format it in the 
correct way and dump it into the table?  I would think that it would work to 
solve your problem in dealing with dates, but that is just a guess here.

HTH,
Robert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Automatically Escape?

2004-11-16 Thread GH
-- Forwarded message --
From: GH <[EMAIL PROTECTED]>
Date: Tue, 16 Nov 2004 08:45:08 -0500
Subject: Re: [PHP] Automatically Escape?
To: Jordi Canals <[EMAIL PROTECTED]>


What is the Diffrencce between mysql_escape_string and mysql_real_escape_string?




On Tue, 16 Nov 2004 14:34:43 +0100, Jordi Canals <[EMAIL PROTECTED]> wrote:
> On Tue, 16 Nov 2004 12:33:15 +, Richard Davey <[EMAIL PROTECTED]> wrote:
>
> > G> Is there a function that can automatically escape special characters
> > G> before putting them into mySQL?
> >
> > See magic_quotes to have it done for you. Although this isn't a
> > recommend approach if you plan to distribute your application, in
> > which case mysql_escape_string() is the one.
>
> Just a comment :
>
> Note:  This function (mysql_escape_string) has been deprecated since
> PHP 4.3.0. Do not use this function. Use mysql_real_escape_string()
> instead.
>
> So, if you're coding new scripts is better to use mysql_real_escape_string().
>
> Best regards,
> Jordi.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Authentication Class

2004-11-16 Thread Bruno B B Magalhães
Hi guys,
well, I wrote a class for a big project (a framework), and here it is,  
I was wondering if someone have any suggestions regarding flexibility  
and security.

Course it uses specific framework classes but it's quite understable..
==
http://www.bbbm.com.br/
* @copyright 2004 Bruno B B Magalhaes
* @author Bruno B B Magalhaes <[EMAIL PROTECTED]>
* @package BBBM Framework
* @version 0.5dev
*/
class authentication
{
var $domain;

var $database;

var $authenticated = false;

var $access_section = '';
var $access_level = '0';

var $post;
var $session;
var $cookie;
	var $userid;
	var $username;
	var $password;
	var $sessionid;
	var $remember_me;
	
	var $errormsg;
	
	var $tables = array('users','usersgroups');
	
	/**
	* PHP 4 Constructor
	*/
	function authentication(&$database)
	{
		$this->database =& $database;
		$this->database->build_table($this->tables);
		$this->domain = $_SERVER['HTTP_HOST'];
	}
	
	/**
	* Start Authentication Process
	*/
	function authenticate($access_section='',$access_level=0)
	{
		if($access_level > 0)
		{
			$this->access_level	= $access_level;
			$this->access_section	= $access_section;
			
			$this->check_post();
			$this->check_session();
			$this->check_cookie();
			
			if($this->post == true)
			{
$this->auth($this->username,$this->password,$this->access_level);
			}
			elseif($this->cookie == true)
			{
$this->auth_check($this->username,$this->sessionid,$this- 
>access_level);
			}
			elseif($this->session == true)
			{
$this->auth_check($this->username,$this->sessionid,$this- 
>access_level);
			}
			else
			{
$this->authenticated = false;
			}
		}
		else
		{
			$this->authenticated = true;
		}
	}

/**
* Authentication Process
*/
function auth($username='',$password='',$accesslevel=0)
{
$query = 'SELECT
*
FROM
'.$this->database->table['users'].' AS users,
'.$this->database->table['usersgroups'].' AS 
groups
WHERE
users.userGroup=groups.groupId
AND
users.userName=\''.$username.'\'
AND
users.userPassword=\''.$password.'\'
AND
users.userStatus > \'0\'
AND
groups.groupStatus > \'0\'
LIMIT
1';
		$this->database->query($query);
		
		if($this->database->num_rows() > 0)
		{
			$this->database->fetch_array();
			
			if($this->database->row['groupLevel'] >= $accesslevel)
			{
$this->authenticated = true;

$this->userid = $this->database->row['userId'];
$this->session_write('username',$this->database->row['userName']);
$this->session_write('userlevel',$this->database- 
>row['groupLevel']);

if(isset($this->remember_me))
{
	$this->cookie_write('username',$this->database->row['userName']);
	$this->cookie_write('sessionid',session_id());
}

$update_query = 'UPDATE
			'.$this->database->table['users'].'
		 SET
			userSession=\''.session_id().'\',
			userLastvisit = NOW()
		 WHERE
			userId=\''.$this->database->row['userId'].'\'';

$this->database->query($update_query);
}
else
{
$this->logout();
$this->authenticated = false;
$this->errormsg = 'error_noaccessprivileges';
}
}
else
{
$this->logout();
$this->authenticated = false;
$this->errormsg = 'error_unauthorized';
}
}
/**
* Authentication Check Process
*/
function auth_check($username='',$sessionid='',$accesslevel=0)
{
$query = 'SELECT
users.userId,
groups.groupLevel
FROM
'.$this->database->table['users'].' AS users,
'.$this->database->table['usersgroups'].' AS 
groups
WHERE
users.userGroup=groups.groupId
AND
users.userName=\''.$username.'\'
AND
users.userSession=\''.$sessionid.'\'

[PHP] Question on query string

2004-11-16 Thread Stuart Felenstein
I hope this is a reasonable question:


This is the query string my search page is kicking out
to the results page.  It works fine but curious about
these codes or characters. And I know this maybe
unrelated to PHP, so I'll apologize in advance:
Why is each value preceeded by the %5B%5D ?  I think
the % is for wildcards, but for the life of me can't
figure out what 5B and 5D stand for.

Ind%5B%5D=2&Ind%5B%5D=3&Ind%5B%5D=4&Ind%5B%5D=5..

Thank you 
Stuart

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] copy() not working

2004-11-16 Thread Peter Lauri
Best groupmember,

I am implementing a script to upload a file to my webserver. I am using this
form that I copied from a working application:

echo '';
echo '';
echo '';

To handle the form I am using this script...

if($File) {
  if(copy($File, $File_name)) {
   echo 'The image was not uploaded!';
  } else {
   echo 'The file was not uploaded!';
  }
 }

It does not even enter the if($File) part (checked it witch echos).

The php-info() can be seen at www.devdws.com/phpinfo.php

Is there anyone that see any errors in the problem? I have checked severeal
manuals and this is how it should be.

- The Best Of Times
Peter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] AW: AW: Bug #30792 [Opn->Bgs]: LDAP module could not be found

2004-11-16 Thread zengerf
Hello again

Sorry for mailing you directly, I will use the php-general account from now.

Yes I really did copy the modules to system32 (and on the windows folder 
directly too), that does not help. And I reproduced the same error on a second 
server.
And as I said, the oci8 module works without any problems. But when I delete 
the semicolon before the extension entry for ldap and restart IIS, I get this 
error message:

"PHP Warning:  PHP Startup: Unable to load dynamic library 
'C:\PHP\ext\php_ldap.dll' - The specified module could not be found." (and of 
course it is there!)

I use PHP since years and I installed it several times. Today I use PHP4.3 as 
ISAPI module because the ldap module with oci8 does not work as cgi under IIS.
And I thought that you do not use windows ;-) that's why I reported this error.
I just want to help! 
But I can run my apps under PHP4.3 or on an Apache. 

It's up to you to fix it or not.
Thank you anyway.

Greetings
F. Zenger


-Ursprüngliche Nachricht-
Von: Antony Dovgal [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 15. November 2004 11:19
An: Zenger Flavia, IT2
Betreff: Re: AW: Bug #30792 [Opn->Bgs]: LDAP module could not be found


On Mon, 15 Nov 2004 11:13:20 +0100
<[EMAIL PROTECTED]> wrote:

> Hi together 
> 
> Perhaps the error message ist not exact.
> I' really shure that is is not a configuration problem, because the
> oci8 module alone works without an error. 

have you already copied all dlls from dlls/ folder to windows\system32 ?

> So I think it's not possible that an configuration problem can occure
> only by the ldap module an by the oci8 module not. 
> Please reproduce the error yourself.

sorry, I'm unable to reproduce it, as I don't use windows.

-- 
Wbr,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Jay Blanchard
Okie dokieI have to parse an XML file and I continue to RTFM, STFW,
and STFA. So I do this...

/* let's parse! */
if($readXML = fopen(XMLDIR."testRecp.xml", "r")){
while($lineXML = fread($readXML, 4096)){
xml_parse($covadParser, $lineXML, feof($readXML));
$darn =
xml_error_string(xml_get_error_code($covadParser));
echo "XML Error " . $darn . "\n";

}
} else {
echo "COULD NOT READ XML FILE\n";
}

And when the pareser hits the first line of the XML file ...



... it throws an error from xml_get_error_code

"syntax error"

I have done ini_set("short_open_tag", 0);
All of my functions and directives are in place for the xml parser.
I have beaten my forehead against the wall.
I have searched and googled and read and screamed.

Can anyone help me get over this extremely frustrating hump?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Limiting character input in

2004-11-16 Thread Philip Thompson
On Nov 16, 2004, at 1:59 AM, Garth Hapgood - Strickland wrote:
Unlike the input fields that use maxlength to define the number of 
character
allowed. Textarea doesnt seem to have that capability. I want to limit 
the
number of character to 255.

IS there any way of doing this without having to break my neck about 
it?

Garth
Garth,
This has to be done with JavaScript or some client-side scripting 
language. I use this exact thing for a textarea and it works rather 
well. I want to restrict the user to 255 characters, so here's what I 
do:

[code]
-- in javascript --

-- in html --


Characters remaining: 

[/code]
The the input text box does is just keep a counter of how much 
characters they have remaining. It's only function is to indicate to 
the user how much they have left.

Hope that helps.
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date handling

2004-11-16 Thread Ryan
Hi Robert,

Storing the date in my database isn't the issue I'm running into.  The 
problem I'm having is that if I have a date "1950-01-01", how can I display 
it in my PHP script as "Jan 1, 1950".  Or if I have "2040-04-01", how to get 
it to display as "Apr 1, 2040".  I can't see a way to do that right now in 
the core PHP code using the built-in date functions.

Thanks,
Ryan


"Robert Sossomon" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> 
>> > echo strtotime('1950-01-01');
>> ?>
>> I'm guessing Red Hat Enterprise or at least the kernel I'm using (which 
>> is
>> the latest RH kernel) qualifies under the Linux category above.  Also, 
>> with
>> the application I'm writing, I need to deal with dates after 2038 too. 
>> So
>> that is why I'm investigating alternatives - just because I'd like 
>> something
>> that would definitely work on any platform and is 'official' as much as
>> possible - rather than have my date handling be OS-specific.
> 
>
> How are you entering the date into the Table?  Could you not just rewrite 
> the page so that the date information is entered differently, then format 
> it in the correct way and dump it into the table?  I would think that it 
> would work to solve your problem in dealing with dates, but that is just a 
> guess here.
>
> HTH,
> Robert 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on query string

2004-11-16 Thread David Bevan
On November 16, 2004 09:06, Stuart Felenstein wrote:

> Why is each value preceeded by the %5B%5D ?  I think
> the % is for wildcards, but for the life of me can't
> figure out what 5B and 5D stand for.
>
> Ind%5B%5D=2&Ind%5B%5D=3&Ind%5B%5D=4&Ind%5B%5D=5..
Stuart,

The % is an escape character to let the browser know that the character isn't 
allowed in a URL.  The browser then looks at the next 2 characters as a hex 
code for the ASCII character which should be there.

So for %5B, it really is '[', and %5D really is ']'.

You can see what all the ASCII codes are here:
http://www.asciitable.com/

HTH
-- 
Regards,
David Bevan

We could learn a lot from crayons: 
some are sharp, some are pretty, some are dull, some have weird names, 
and all are different colorsbut they all exist very nicely in the same 
box. 

http://www.getanyideas.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on query string

2004-11-16 Thread Richard Davey
Hello Stuart,

Tuesday, November 16, 2004, 2:06:03 PM, you wrote:

SF> Why is each value preceeded by the %5B%5D ? I think the % is for
SF> wildcards, but for the life of me can't figure out what 5B and 5D
SF> stand for.

SF> Ind%5B%5D=2&Ind%5B%5D=3&Ind%5B%5D=4&Ind%5B%5D=5..

They're hex values.

Use urldecode() to get them back to "normal" again.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Burhan Khalid
On Tue, 2004-11-16 at 08:13 -0600, Jay Blanchard wrote:
> Okie dokieI have to parse an XML file and I continue to RTFM, STFW,
> and STFA. So I do this...
> 
> /* let's parse! */
> if($readXML = fopen(XMLDIR."testRecp.xml", "r")){
>   while($lineXML = fread($readXML, 4096)){
>   xml_parse($covadParser, $lineXML, feof($readXML));
>   $darn =
> xml_error_string(xml_get_error_code($covadParser));
>   echo "XML Error " . $darn . "\n";
> 
>   }
> } else {
>   echo "COULD NOT READ XML FILE\n";
> }
> 
> And when the pareser hits the first line of the XML file ...
> 
> 
> 
> ... it throws an error from xml_get_error_code
> 
> "syntax error"
> 
> I have done ini_set("short_open_tag", 0);
> All of my functions and directives are in place for the xml parser.
> I have beaten my forehead against the wall.
> I have searched and googled and read and screamed.

Jay,

  Trim your xml file.  Whitespace can cause this problem.

-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] copy() not working

2004-11-16 Thread Richard Davey
Hello Peter,

Tuesday, November 16, 2004, 1:58:48 PM, you wrote:

PL> if($File) {
PL>   if(copy($File, $File_name)) {
PL>echo 'The image was not uploaded!';
PL>   } else {
PL>echo 'The file was not uploaded!';
PL>   }
PL>  }

PL> It does not even enter the if($File) part (checked it witch echos).

Do you have Register Globals turned on or off?

If they are off (as they should be), this script will not work.

You should really use move_uploaded_file() to move the file rather
than copy.

And check the $_FILES array for your file name, size, etc.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: unable to upload a directory using the web brower (HTTP).

2004-11-16 Thread Scott Fletcher
Thanks for the info, will check it out.  I also saw one at
http://www.javazoom.net/applets/jclientupload/jclientupload.html and it cost
some money.  But I did the trial download to see if it is flexible enough
for me and I found that it is not.  So, I'm thinking that I might not find
one and might would have to write one from scratch.

Scott

"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Scott Fletcher wrote:
>
> >Um, can't be done.  So, I'll have to use JAVA instead.  Have anyone ever
> >done this, does anyone know of a good freeware JAVA applet that I can
use?
> >
> >
> Shameless Plug: Rad Upload (http://www.radinks.com/upload) does upload
> folders over HTTP unfortunatley it's not free (but still cheap).
>
>
> >Thanks,
> > Scott
> >
> >"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> >
> >
> >>I found that on most web browsers, I can not upload the folder via HTTP
> >>using hte web browser upload dialog box.  So, I can't use the php's
> >>function, is_uploaded_file and move_uploaded_file.  Because the web
> >>
> >>
> >browser
> >
> >
> >>see the folder as something to open with, like going down one directory.
> >>So, any advice or suggestion??
> >>
> >>Thanks,
> >> Scott
> >>
> >>
> >
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> --
> http://www.radinks.com/print/card-designer/ | Card Designer Applet
> http://www.radinks.com/upload/  | Drag and Drop Upload

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Automatically Escape?

2004-11-16 Thread Richard Davey
Hello GH,

Tuesday, November 16, 2004, 1:45:28 PM, you wrote:

G> What is the Diffrencce between mysql_escape_string and 
mysql_real_escape_string?

One of them is depreciated, meaning it could drop from the PHP list of
functions at any point and shouldn't be relied on (my fault, sorry!
use the other version recommended).

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Jason Wong
On Tuesday 16 November 2004 22:13, Jay Blanchard wrote:

> I have done ini_set("short_open_tag", 0);

It's probably not settable at runtime. Check manual.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If Bill Gates had a nickel for every time Windows crashed... Oh wait, he
does!

   -- From a Slashdot.org post
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] unable to upload a directory using the web brower(HTTP).

2004-11-16 Thread Scott Fletcher
I can try that but right now I have a bigger problem.  The web browser can't
upload folder, so I'm stuck there for now.  I'm looking into JAVA as a
workaround to this problem.

Scott

"Angelo Zanetti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> cant you create the folder using php and then copy the contents (files)
> to the newly created folder?
> eg:
>
> $uploaddir = $_SERVER['DOCUMENT_ROOT'] . '/mydir/'';
> if(!is_dir($uploaddir))
> {
> $old = umask(0);
> mkdir($uploaddir, 0777);
> umask($old);
> }
> $uploadfile = $uploaddir .
> $_FILES['userfile']['name'];
> $uploadfileDB = $_FILES['userfile']['name'];
>
> if
> (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
> {
> echo (" Helvetica, sans-serif; font-size: 12px; font-weight: bold> File is
> valid, and was successfully uploaded. ");
> }
>
> not sure if this is what your looking for???
> hope this helps
> ANgelo
>
> >>> "Scott Fletcher" <[EMAIL PROTECTED]> 11/16/2004 12:53:28 AM >>>
> Um, look like I'm going to have to write a JAVA programming and have a
> couple of friends to come to help me out with it.   Suck though!  So,
> applets it is...
>
> Zip it up, that gonna be tought because of lack of good cross-platform
> support.  We have Robo-Help for Windows, since windows zip only work
> for
> windows then I http it over to AIX and have php extract it.  So, does
> the
> GNU zip work for that or not?  Probably not too well.  So, applet is
> the way
> to go.  It will also help me to avoid the need for the su or sudo
> command
> cause it doesn't work through Apache account too well.
>
> Thanks,
>  Scott
>
>
>
> "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Scott Fletcher wrote:
> > > I found that on most web browsers, I can not upload the folder via
> HTTP
> > > using hte web browser upload dialog box.
> >
> > Most? I thought all.
> >
> > > So, I can't use the php's
> > > function, is_uploaded_file and move_uploaded_file.  Because the
> web
> browser
> > > see the folder as something to open with, like going down one
> directory.
> > > So, any advice or suggestion??
> >
> > Zip it up. Or signed applets or activex objects
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> 
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] copy() not working

2004-11-16 Thread Burhan Khalid
On Tue, 2004-11-16 at 14:58 +0100, Peter Lauri wrote:
> Best groupmember,
> 
> I am implementing a script to upload a file to my webserver. I am using this
> form that I copied from a working application:
> 
[ snipped ]
> To handle the form I am using this script...
> 
> if($File) {
>   if(copy($File, $File_name)) {
>echo 'The image was not uploaded!';
>   } else {
>echo 'The file was not uploaded!';
>   }
>  }
> 
> It does not even enter the if($File) part (checked it witch echos).

Use move_uploaded_file() -- and read
http://www.php.net/manual/en/features.file-upload.php
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] copy() not working

2004-11-16 Thread Jason Wong
On Tuesday 16 November 2004 21:58, Peter Lauri wrote:

> Is there anyone that see any errors in the problem? I have checked severeal
> manuals and this is how it should be.

Funny, the example(s) in the manual look quite different. Try the ones in the 
manual, when you get them working then modify to taste.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Advancement in position.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Richard Davey
Hello Jay,

Tuesday, November 16, 2004, 2:13:28 PM, you wrote:

JB> And when the pareser hits the first line of the XML file ...
JB> 
JB> ... it throws an error from xml_get_error_code
JB> "syntax error"

Hard to tell without seeing the XML source, but could it be a case of
whitespace and/or case-folding? (both of which caught me out on my
first XML project) - I had to use the following:

xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] copy function?

2004-11-16 Thread Garth Hapgood - Strickland
I have a button which I want to add a function to, so that when it is
clicked, the data from one  will be copied to another 

Which event handler of the button should I use and hoe should I construct
the function?

Garth

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Jay Blanchard
[snip]
> 
> 
> ... it throws an error from xml_get_error_code

  Trim your xml file.  Whitespace can cause this problem.
[/snip]

I trimmed and chopped to no avail. Argh.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Date handling

2004-11-16 Thread Mike
Ryan,

I had those problems in the past and to simply avoid the matter altogether,
when I store dates I just do so with the time() function.

$cur_date = time();

That way, when I poll the DB, I have a timestamp that I can then use date()
to format in whatever manner I wish.

I haven't run into any problems doing it this way.

About your specific question, if you want to use your preexisting date
format you'll have to do some string manipulation to pull apart the month,
date and year and then format it how you want to. You'll likely have to use
a switch to swap the month from the numeric representation to the text
abbreviation.

But no matter what you do, if you want some flexibility, you'll have to
either change the format in the DB or just do it all on the fly in your
script because the date() function expects you to pass it a timestamp.

You may be able to come up with something clever using strtotime() however.
http://us2.php.net/manual/en/function.strtotime.php

-M

-Original Message-
From: Ryan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 16, 2004 9:23 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Date handling

Hi Robert,

Storing the date in my database isn't the issue I'm running into.  The 
problem I'm having is that if I have a date "1950-01-01", how can I display 
it in my PHP script as "Jan 1, 1950".  Or if I have "2040-04-01", how to get

it to display as "Apr 1, 2040".  I can't see a way to do that right now in 
the core PHP code using the built-in date functions.

Thanks,
Ryan


"Robert Sossomon" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> 
>> > echo strtotime('1950-01-01');
>> ?>
>> I'm guessing Red Hat Enterprise or at least the kernel I'm using (which 
>> is
>> the latest RH kernel) qualifies under the Linux category above.  Also, 
>> with
>> the application I'm writing, I need to deal with dates after 2038 too. 
>> So
>> that is why I'm investigating alternatives - just because I'd like 
>> something
>> that would definitely work on any platform and is 'official' as much as
>> possible - rather than have my date handling be OS-specific.
> 
>
> How are you entering the date into the Table?  Could you not just rewrite 
> the page so that the date information is entered differently, then format 
> it in the correct way and dump it into the table?  I would think that it 
> would work to solve your problem in dealing with dates, but that is just a

> guess here.
>
> HTH,
> Robert 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Automatically Escape?

2004-11-16 Thread Marek Kilimajer
GH wrote:
-- Forwarded message --
From: GH <[EMAIL PROTECTED]>
Date: Tue, 16 Nov 2004 08:45:08 -0500
Subject: Re: [PHP] Automatically Escape?
To: Jordi Canals <[EMAIL PROTECTED]>
What is the Diffrencce between mysql_escape_string and mysql_real_escape_string?
the *_real_* one takes into account charset of the current connection, 
as mentioned in the manual



On Tue, 16 Nov 2004 14:34:43 +0100, Jordi Canals <[EMAIL PROTECTED]> wrote:
On Tue, 16 Nov 2004 12:33:15 +, Richard Davey <[EMAIL PROTECTED]> wrote:

G> Is there a function that can automatically escape special characters
G> before putting them into mySQL?
See magic_quotes to have it done for you. Although this isn't a
recommend approach if you plan to distribute your application, in
which case mysql_escape_string() is the one.
Just a comment :
Note:  This function (mysql_escape_string) has been deprecated since
PHP 4.3.0. Do not use this function. Use mysql_real_escape_string()
instead.
So, if you're coding new scripts is better to use mysql_real_escape_string().
Best regards,
Jordi.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Jay Blanchard
[snip]
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);
[/snip]

I had those in there as well...here is the first few liners of the XML
source


http://the.api.server/dtd/response.dtd"; >

  

  
covad
covad

  
  
xLink

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php broken pipe

2004-11-16 Thread Greg Donald
On Tue, 16 Nov 2004 09:59:57 +, Rui Francisco <[EMAIL PROTECTED]> wrote:
> I'm using a query in loop and go through all records to do some operations
> in the middle of the script i fork(); to do other things
> When i return to the parent process i try to make one update and i get
> the following error
> [nativecode=Unable to complete network request to host "127.0.0.1".
> Error writing data to the connection. Broken pipe]

You might try pcntl_fork() instead.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] London - One Day Workshop "How to Build a Professional Database-Driven Website"

2004-11-16 Thread Greg Donald
On Tue, 16 Nov 2004 08:24:26 -, Ryan Carson <[EMAIL PROTECTED]> wrote:
> This definitely isn't spam. I'm a PHP developer myself who values the PHP 
> General Mailing
> list. I thought everyone would want to know about the workshop, as it's a 
> great opportunity
> to improve your skills and get ahead of the competition.
> 
> Hope to see you there.

So do you plan to send us all plane fare to London and allow us to
attend your 'great opportunity' for free?


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] copy function?

2004-11-16 Thread Greg Donald
On Tue, 16 Nov 2004 16:42:31 +0200, Garth Hapgood - Strickland
<[EMAIL PROTECTED]> wrote:
> I have a button which I want to add a function to, so that when it is
> clicked, the data from one  will be copied to another 
> 
> Which event handler of the button should I use and hoe should I construct
> the function?

That's Javascript, not PHP.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] copy function?

2004-11-16 Thread Jay Blanchard
[snip]
I have a button which I want to add a function to, so that when it is
clicked, the data from one  will be copied to another


Which event handler of the button should I use and hoe should I
construct
the function?
[/snip]

Both textareas on the same page? Want to do the copy without making a
trip to the server? I think you want JavaScript for this.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] copy function?

2004-11-16 Thread Matt M.
> I have a button which I want to add a function to, so that when it is
> clicked, the data from one  will be copied to another 
> 
> Which event handler of the button should I use and hoe should I construct
> the function?


onclick.  This is not really a php question. do some googleing for javascript.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Array unset

2004-11-16 Thread Bruno B B Magalhães
Hi,
I my system can handle invisible modules, so they can't show in the  
menu but stills works... here is the code:

$c = count($modules)-1;
for($i = 0; $i <= $c; $i++)
{
if($modules[$i]['moduleVisibility'] == 0)
{
unset($modules[$i]);
}
}
	$m = 0;
	$c = count($modules)-1;
	
	for($i = 0; $i <= $c ; $i++)
	{
		if($modules[$i]['modulePath'] ==  
$framework->modules->module['modulePath'])
		{
			$output .= '
			';
		}
		else
		{
			$output .= '
			';
		}
		
		if($framework->output->get_config_vars('modulename'.str_replace('  
','',$modules[$i]['moduleName'])))
		{
			$output .=  
$framework->output- 
>get_config_vars('modulename'.$modules[$i]['moduleName']);
		}
		else
		{
			$output .= $modules[$i]['moduleName'];
		}
		
		$output .= '';
		
		if($i < $c)
		{
			$output .= '|';
		}
		
		$m++;
		$m++;
	}

	$output .= '';
	return $output;
	
The problem is that when I delete an specific array, it outputs  
something like this:

(
[0] => Array
(
[moduleId] => 4
[moduleName] => Contents
[modulePath] => contents
[moduleAliasPath] =>
[moduleController] => administration
[moduleLevel] => 5
[moduleOrder] => 0
[moduleVisibility] => 1
[moduleType] => none
[moduleStatus] => 1
)
[2] => Array
(
[moduleId] => 1
[moduleName] => System
[modulePath] => system
[moduleAliasPath] =>
[moduleController] => administration
[moduleLevel] => 5
[moduleOrder] => 2
[moduleVisibility] => 1
[moduleType] => default
[moduleStatus] => 1
)
[3] => Array
(
[moduleId] => 2
[moduleName] => Logout
[modulePath] => logout
[moduleAliasPath] =>
[moduleController] => administration
[moduleLevel] => 5
[moduleOrder] => 3
[moduleVisibility] => 1
[moduleType] => alias
[moduleStatus] => 1
)
)
So, the question, how resort the numeric values to 1,2,3,4?
Regards,
Bruno
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] copy function?

2004-11-16 Thread Robby Russell
On Tue, 2004-11-16 at 16:42 +0200, Garth Hapgood - Strickland wrote:
> I have a button which I want to add a function to, so that when it is
> clicked, the data from one  will be copied to another 
> 
> Which event handler of the button should I use and hoe should I construct
> the function?
> 
> Garth
> 

Php doesn't do anything like this...unless you post a form. Try
javascript.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] copy function?

2004-11-16 Thread Richard Davey
Hello Garth,

Tuesday, November 16, 2004, 2:42:31 PM, you wrote:

GHS> Which event handler of the button should I use and hoe should I construct
GHS> the function?

This is a JavaScript question. Please post to a JavaScript mailing
list.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] XML + PHP is going to eat my shorts [SOLVED]

2004-11-16 Thread Jay Blanchard
[snip]
>
[/snip]

using fread the above line comae out like this(even though I was not
echoing the line, just processing)



...as soon as I added stripslashes the syntax error disappeared and
VIOLA!...xml file parsing at its finest!

Thanks to all that helped

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Is Perl faster than PHP?

2004-11-16 Thread Merlin
Hi there,
it came to my attention that most of the high traffic portals are using perl in 
the backend. Those sites do also apear to me to be very fast in comparison to 
most php sites. Are there any known performance comperissons between the two 
available? Or can one say that PHP or Perl is faster about x percent in general 
compared to the other one?

thanx for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] my own extension

2004-11-16 Thread Klaus Reimer
Uffe Kousgaard wrote:
If I want to write my own extension for PHP/Linux, is there any
specification on how to do that? Some specific functions that the SO
should always include, call convention etc.?
"Those who know don't talk. Those who talk don't know."
It's all in the docs (not much, but enough):
http://www.php.net/manual/en/zend.php

To make things a bit more complex, it will be done with Kylix, so if
anyone has tried that combination before, I would like to hear from
them. But otherwise c++ references are of course OK.
Kylix? Isn't it a Delphi-like language? How do you want to use all the 
include files of PHP which are written for C? Don't you think it's 
easier to use PHP's extension framework? It's pretty easy to use and 
well documented in the Section "PHP's Automatic Build System".

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] XML + PHP is going to eat my shorts

2004-11-16 Thread Richard Davey
Hello Jay,

Tuesday, November 16, 2004, 3:01:45 PM, you wrote:

JB> I had those in there as well...here is the first few liners of the XML
JB> source

Does the XML file validate? Maybe post a complete file (or if too long
a URL to one) so we could test it? Would at least narrow down if the
error was in the document or your code.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] my own extension

2004-11-16 Thread Uffe Kousgaard
"Klaus Reimer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> It's all in the docs (not much, but enough):
>
> http://www.php.net/manual/en/zend.php

I had looked at the docs, but didn't check out "Zend", since that word
didn't made me think of extensions.

> Kylix? Isn't it a Delphi-like language?

Yes.

> How do you want to use all the
> include files of PHP which are written for C? Don't you think it's
> easier to use PHP's extension framework? It's pretty easy to use and
> well documented in the Section "PHP's Automatic Build System".

It is a large delphi library I want to call from PHP, so I don't think
it is easier.

Regards
Uffe

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] copy() not working

2004-11-16 Thread Peter Lauri
Thank you. Now I am getting somewhere, but I get this error-msg now, I do
not understand the content of it. Have tried to read about the Auth in PHP
but I did not get any information to solve the problem:

Warning:  move_uploaded_file(): SAFE MODE Restriction in effect.  The script
whose uid is 113323 is not allowed to access / owned by uid 0 in
/customers/devdws.com/devdws.com/httpd.www/admin/imageadmin.php on line 36
Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => but_hide.gif
[type] => image/gif
[tmp_name] => /tmp/phpugQpuz
[error] => 0
[size] => 1054
)

)

- BEST OF TIMES

/Peter

"Burhan Khalid" <[EMAIL PROTECTED]> skrev i meddelandet
news:<[EMAIL PROTECTED]>...
> On Tue, 2004-11-16 at 14:58 +0100, Peter Lauri wrote:
> > Best groupmember,
> > 
> > I am implementing a script to upload a file to my webserver. I am using
this
> > form that I copied from a working application:
> > 
> [ snipped ]
> > To handle the form I am using this script...
> > 
> > if($File) {
> >   if(copy($File, $File_name)) {
> >echo 'The image was not uploaded!';
> >   } else {
> >echo 'The file was not uploaded!';
> >   }
> >  }
> > 
> > It does not even enter the if($File) part (checked it witch echos).
> 
> Use move_uploaded_file() -- and read
> http://www.php.net/manual/en/features.file-upload.php
> -- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date handling

2004-11-16 Thread Ryan
Yes, but time() returns a Unix timestamp which has a limit of 2038.  For 
example, what if I would like to calculate the date of 40 years from today? 
I can't do that with the normal PHP date functions.  I would have to use 
PEAR Date or something similar, which is my original question - of what is 
the 'official' PHP way to handle this as calculations with dates is a common 
thing to do.

Thanks,
Ryan


"Mike" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Ryan,
>
> I had those problems in the past and to simply avoid the matter 
> altogether,
> when I store dates I just do so with the time() function.
>
> $cur_date = time();
>
> That way, when I poll the DB, I have a timestamp that I can then use 
> date()
> to format in whatever manner I wish.
>
> I haven't run into any problems doing it this way.
>
> About your specific question, if you want to use your preexisting date
> format you'll have to do some string manipulation to pull apart the month,
> date and year and then format it how you want to. You'll likely have to 
> use
> a switch to swap the month from the numeric representation to the text
> abbreviation.
>
> But no matter what you do, if you want some flexibility, you'll have to
> either change the format in the DB or just do it all on the fly in your
> script because the date() function expects you to pass it a timestamp.
>
> You may be able to come up with something clever using strtotime() 
> however.
> http://us2.php.net/manual/en/function.strtotime.php
>
> -M
>
> -Original Message-
> From: Ryan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 16, 2004 9:23 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Date handling
>
> Hi Robert,
>
> Storing the date in my database isn't the issue I'm running into.  The
> problem I'm having is that if I have a date "1950-01-01", how can I 
> display
> it in my PHP script as "Jan 1, 1950".  Or if I have "2040-04-01", how to 
> get
>
> it to display as "Apr 1, 2040".  I can't see a way to do that right now in
> the core PHP code using the built-in date functions.
>
> Thanks,
> Ryan
>
>
> "Robert Sossomon" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> 
>>> >> echo strtotime('1950-01-01');
>>> ?>
>>> I'm guessing Red Hat Enterprise or at least the kernel I'm using (which
>>> is
>>> the latest RH kernel) qualifies under the Linux category above.  Also,
>>> with
>>> the application I'm writing, I need to deal with dates after 2038 too.
>>> So
>>> that is why I'm investigating alternatives - just because I'd like
>>> something
>>> that would definitely work on any platform and is 'official' as much as
>>> possible - rather than have my date handling be OS-specific.
>> 
>>
>> How are you entering the date into the Table?  Could you not just rewrite
>> the page so that the date information is entered differently, then format
>> it in the correct way and dump it into the table?  I would think that it
>> would work to solve your problem in dealing with dates, but that is just 
>> a
>
>> guess here.
>>
>> HTH,
>> Robert
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on query string

2004-11-16 Thread Stuart Felenstein
--- Richard Davey <[EMAIL PROTECTED]> wrote:


> Use urldecode() to get them back to "normal" again.

Changed the form action line to this: 

action="searchresults.php?Ind=http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] latest GD dll binary for windows?

2004-11-16 Thread lister
hi -

is there anywhere I can get a pre-compiled GD (graphics library) DLL for
windows, that supports the GIF writing?
The notices on the GD page say in big letters "not intended for use with
PHP!"...

http://www.boutell.com/gd/

For some reason the PHP install I have (Zend IDE has taken over my
machine!) has an old version of GD...

thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is Perl faster than PHP?

2004-11-16 Thread Robby Russell
On Tue, 2004-11-16 at 16:54 +0100, Merlin wrote:
> Hi there,
> 
> it came to my attention that most of the high traffic portals are using perl 
> in 
> the backend. Those sites do also apear to me to be very fast in comparison to 
> most php sites. Are there any known performance comperissons between the two 
> available? Or can one say that PHP or Perl is faster about x percent in 
> general 
> compared to the other one?
> 
> thanx for any hint,
> 
> Merlin
> 

It really depends on how you're running them.. is PHP or Perl running in
mod_* or is it running as a CGI?

Which is quicker to program in?

Yahoo uses php for some of their stuff, I would say that is a pretty
high traffic site. 


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Authentication Class

2004-11-16 Thread raditha dissanayake
Bruno B B Magalhães wrote:
Hi guys,
well, I wrote a class for a big project (a framework), and here it 
is,  I was wondering if someone have any suggestions regarding 
flexibility  and security.
Wow it's the most artistic piece of php i have ever seen.
--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Is Perl faster than PHP?

2004-11-16 Thread raditha dissanayake
Merlin wrote:
Hi there,
it came to my attention that most of the high traffic portals are 
using perl in the backend. Those sites do also apear to me to be very 
fast in comparison to most php sites. Are there any known performance 
comperissons between the two available? Or can one say that PHP or 
Perl is faster about x percent in general compared to the other one?
PHP is faster when running uphill and perl is faster when running 
download. On Sri Lankan roads they are both equally slow.

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] weekly email idea

2004-11-16 Thread Robby Russell
On some of the general lists (like I am on the python list), they have a
weekly email that someone puts together and sends out to the list with
tips and urls to things found throughout the week on the mailing list.
People post valuable links and information and it would be a quick
overview of the past week in URLs/quotes/etc.

I'd be happy to take this on initially (the python passes it around to
the more active people every once in a while), just wondering if you
think it would be worthwhile or not. We could even have, "best
javascript question of the week" section in the email. ;-)

Thoughts? I looked over the past several months and saw nothing like
this happening so I thought I'd put the idea out there and would be
happy to try it out for a few weeks. I don't think one email a week
would flood our inbox so any other concerns, comments or suggestions?

Cheers,

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


[PHP] How to path global object

2004-11-16 Thread Hongwei Li
Hi,

I have a question of how to path global object's values.  Below are some
simplified codes.  It has 4 pieces:

1. tsstart.php: -- this is the start point to be browsed



2. tsdata.php: -- to get data, here I set it as a 2-d array and assign
values to it to simplify the code



3. tsshow.php: -- display the values of $obj:

";
?>

 

 First Row: 
 Second Row: 

Next 
 

4. tsnext.php: -- to display the next 2-d array element's value:

";
include "tsshow.php";
?>

Now, when I browse tsstart.php, it displays:
result-set index: 0
  First Row: 0
  Second Row: 2
and the link "Next"

However, when I click the link "Next", it displays:
new ind: 1
result-set index: 1
  First Row:
  Second Row:

no values are displayed.  Apparently, $obj is not pathed to tsnext.php and
tsshow.php (the second time), but $ind is.  What is wrong in the above
codes?  Can somebody help me?

I greatly appreciate all help!

Hongwei Li

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Auto-load class if it doesn't exists!

2004-11-16 Thread Bruno B B Magalhães
Hi people,
is it possible to have a solution that works like an autoloader... for 
example:

$myclass = new class();
but if this class wasn't loaded yet, it loads by itself... egg:
if(class_exists(class))
{
 $myclass = new class();
}
else
{
 require_once(PATH_DIR.'class.class.php');
$myclass = new class();
}
Regards,
Bruno B B Magalhaes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] my own extension

2004-11-16 Thread Klaus Reimer
Uffe Kousgaard wrote:
It is a large delphi library I want to call from PHP, so I don't think
it is easier.
But you know your library and you have it under control so maybe it's 
easier to write C include files to interface your Kylix library from C 
instead of writing Delphi-Units to interface PHP from Kylix.

So I would try to first implement a C interface (or C++ if it has OO) 
for your Delphi library and then write a simple PHP extension which uses 
this C/C++ interface to use your delphi lib.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Question on query string

2004-11-16 Thread Chris W. Parker
Stuart Felenstein 
on Tuesday, November 16, 2004 8:28 AM said:

> --- Richard Davey <[EMAIL PROTECTED]> wrote:
> 
>> Use urldecode() to get them back to "normal" again.

[snip]

> Or should I do a $_GET['Ind'] = urlencode('Ind') on
> searchresults.php ?




hth,
chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML + PHP is going to eat my shorts [SOLVED]

2004-11-16 Thread Marek Kilimajer
Jay Blanchard wrote:
[snip]

[/snip]
using fread the above line comae out like this(even though I was not
echoing the line, just processing)

...as soon as I added stripslashes the syntax error disappeared and
VIOLA!...xml file parsing at its finest!
magic_quotes_runtime enabled? what about turning it off?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Question on query string

2004-11-16 Thread Jason Wong
On Wednesday 17 November 2004 00:28, Stuart Felenstein wrote:
> --- Richard Davey <[EMAIL PROTECTED]> wrote:
> > Use urldecode() to get them back to "normal" again.
>
> Changed the form action line to this:
>
> action="searchresults.php?Ind= urldecode(((isset($_POST["Ind[]"]))?$_POST["Ind[]"]:""))

When you're building a query string then (in general) there is no need for 
urldecode(). On the contrary you want to use urlencode(), this is done on the 
*value* of the individual parameters.

And about this:  $_POST["Ind[]"], it's obvious you haven't absorbed what I 
said about this particular construct. Please re-read my previous post 
regarding this and try to understand it.

> Or should I do a $_GET['Ind'] = urlencode('Ind') on
> searchresults.php ?

If the URL on the searchpage was constructed properly then on 
searchresults.php the values passed can be read from $_GET directly with no 
further processing (ie no need for urldecode() and other such nonsese) on 
your part. But remember, you still need to validate the data you get from 
$_GET (and in general from $_POST etc) before you use them.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Unix soit qui mal y pense
 [Unix to him who evil thinks?]
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] splitting string

2004-11-16 Thread Afan Pasalic
I  create a string from other strings:
$string = $string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5;
and then store it in DB.
But, I can't figure out how to split them back?
Tried:
$string_back = explode('\n', $string);
$string_back = explode('', $string);
$string_back = explode('', $string);
Anu help?
Also, is there actially better way to do this then adding \n between 
strings?
(e.g. store form fields name, address, city, state, zip, phone, email as 
a one string in db and later pull them from DB and split them back?)

Thanks for any help!
-afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] http header script to stimluate upload with drag and drop??

2004-11-16 Thread Scott Fletcher
Hi!

I wonder is is it possible to have an http header that would stimluate
files/folders upload via dragging over to the browser window?  If so then
what are the sample functions or scripts that make this possible...

Thanks,
 Scott

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Question on query string

2004-11-16 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 16 November 2004 16:28, Stuart Felenstein wrote:

> --- Richard Davey <[EMAIL PROTECTED]> wrote:
> 
> 
> > Use urldecode() to get them back to "normal" again.
> 
> Changed the form action line to this:
> 
> action="searchresults.php?Ind= urldecode(((isset($_POST["Ind[]"]))?$_POST["Ind[]"]:""))
> 
> 
> Still getting this:
> 
> ?Ind%5B%5D=1&Ind%5B%5D=2&Ind%5B%5D=3
> 
> I'm under the assumption the values get passed from
> search.php using urldecode() to searchresults.php.
> Maybe that is not the case.

URL encoding and decoding is done completely outwith PHP in this case -- the
encoding to %xx is done by the browser, and automatically decoded by the Web
server on the way through to PHP.  You should never see the %xx versions in
your script, and will have no need of urldecode().

The main problem with the above snippet that I can see is that there's very
unlikely to be such a thing as $_POST["Ind[]"] -- form fields with
name="Ind[]" will turn up as an array in $_POST["Ind"] ($_POST["Ind"][0],
$_POST["Ind"][1], etc.).  But the whole snippet looks very odd -- why are
you trying to pass POSTed values as GET variables on (I presume) a form
action??  Can you post a little context to the list to give us some idea
what you're really trying to do.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] link in ModalDialog

2004-11-16 Thread vlad georgescu
first of all thanks for response.

and second, some clarification. i have a main window (with a txtarea -
html-editor), from this page I want to open a little page
(upload_img.php) to handle the uploadimg2-onserver and return
path2img-onserver (where was uploaded) on close.

showModalDialog in js open a page in modal mode (on top). this type of
window can return a value (the parent is waiting until child is
closed), but, as I telling you, any link/redirect in modal window
opens a new one instead of opening in the same window. due to this I
can't use POST in upload_img.php.

the solution was in using a non-modal window for upload_img.php, and
returning result with js opener reference
(opener.document.forms[0].htmled.value+= "";)

regards,


On Mon, 15 Nov 2004 13:38:27 -0500, Gryffyn, Trevor
<[EMAIL PROTECTED]> wrote:
> I didn't see an answer to this, so thought I'd drop you a note.
> 
> I've never used the "showModalDialog" function in JS..  Is it something
> built into JS or is it some other function that does a window.open or
> something like that?
> 
> Anyway, a "modal" dialog box in regular programming terms is a window
> that'll open in addition to the regular application window and not allow
> you to interact with the parent window until the modal dialog is closed.
> 
> Try opening a "File.." dialog box in any Windows application and you get
> an idea of what I'm talking about.  You can't do anything with that app
> until you close that "File..." dialog box.
> 
> Now, I'm not quite sure what you're asking here but it sounds like your
> process is happening like this:
> 
> 1. You have a main window with whatever HTML or PHP script or whatever
> in it.  In this window, you have an "upload" button or something.
> 
> 2. You click on the "upload" button or link (or maybe this happens
> onLoad or something) and a new window opens with upload_img.php in it.
> This handles the file selection and/or the whole upload itself, pasting
> some kind of data either in this window or in the parent window (not
> quite clear on that).
> 
> 3. You're trying to go to another link fro mthe upload_img.php modal
> window and it's opening yet another (third) window.
> 
> Couple of things to think about:
> 
> 1. Do you want the upload_img.php in the main window or in a little side
> popup window?
> 
> 2. Do you want the popup window to close and return to the main window
> when it's done the upload?
> 
> 3. Do you want the popup window to stay while you do other stuff?
> 
> 4. Do you want links clicked on in the popup window to display within
> the popup or in the main window?
> 
> In Javascript as well as in normal HTML, there's the concept of the
> "parent" window.   In HTML, you can do:
> 
> Some link
> 
> Then from the new page that's opened, do:
> 
> Link to open in parent
> window
> 
> Something like that (my syntax may be a little off.. I don't use parent
> a lot).
> 
> There are similar functions in Javascript.   You can also name windows
> and use them as the target:
> 
> Some link to show in
> popup
> 
> Some link to show in main
> window
> 
> The first one, target "popup-window" will open a new window if one named
> "popup-window" doesn't exist.  The second one will also open a new
> window if you havn't used Javascript to name the current window or used
> a target = "main-window" already.  But then as long as that window stays
> open, any targets pointing to "main-window" will go there.
> 
> In the past, when I've used popups with javascript, it's happened like
> this:
> 
> 1. Main window has a link that creates popup using JS and window.open or
> whatever it is... Usually without scroll bars, with a specific window
> size, etc.
> 
> 2. The popup window does some kind of thing and once it's done, has a
> "close window" option.  The close window option runs another JS that
> refreshes the "parent" window to reflect the changes made in the popup
> window.  This is usually done by sending it parameters in the URL (and
> retrieved via a $_GET variable) or with a general refresh with no
> parameters and it gets the query parameters from session variables.
> 
> The variables are usually something like what page in a long listing
> you're on Or whate query you did to get the information displayed.
> Like I did an online catalog for a very large country store.  You might
> do a query for "show me all jellies, jams and preserves", then with 20
> listed per page, on the 5th page, you edit the price of one of them.  Or
> the inventory quantity or the description or something.  Once you're
> done doing that in the popup, it says "Done!  Click to close window",
> then either via the URL or via session variables, tells the parent
> window to display Jellies/Jams/Preserves, 20 items per page, 5th page.
> If you do a delete and there might not be 5 pages anymore, you might
> want to do "If requesting page 5.. And only 4 pages are found.. Make it
> page 4 instead" or just go back to page 1.  Otherwise, you might get a
> blank 

Re: [PHP] Is Perl faster than PHP?

2004-11-16 Thread Brent Baisley
Since both Perl and PHP are scripting languages, I don't think you 
could definitively say one is faster than the other. First and foremost 
it's the talent of the coder that makes a program fast or slow. Perl 
has been around a lot longer and so the libraries (i.e. CPAN) are more 
refined and optimized. For instance, I would say Perl DBI is faster at 
accessing databases than PHP's PEAR.  You don't have to use PEAR if you 
find the overhead too much. And you don't have to use DBI, but DBI is 
so mature I don't know why you wouldn't want to. You could also get 
"compilers" for both languages to speed up your site.

I've seen some really slow Perl sites and some really slow PHP sites. 
The learning curve for PHP is far easier than that for Perl, so you 
probably have many more people using PHP for their sites that aren't 
really that good at scripting. And how many of those slow PHP sites 
were generated from Dreamweaver? If you did extensive tests, I would 
say Perl would probably come out ahead. But that doesn't mean you can't 
create a PHP site that is really fast.

Sorry, I know I didn't answer your question.
On Nov 16, 2004, at 10:54 AM, Merlin wrote:
Hi there,
it came to my attention that most of the high traffic portals are 
using perl in the backend. Those sites do also apear to me to be very 
fast in comparison to most php sites. Are there any known performance 
comperissons between the two available? Or can one say that PHP or 
Perl is faster about x percent in general compared to the other one?

thanx for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Authentication Class

2004-11-16 Thread Bruno B B Magalhães
Is this good or bad? heheh!
Regards,
Bruno B B Magalhaes
On Nov 16, 2004, at 3:31 PM, raditha dissanayake wrote:
Bruno B B Magalhães wrote:
Hi guys,
well, I wrote a class for a big project (a framework), and here it 
is,  I was wondering if someone have any suggestions regarding 
flexibility  and security.
Wow it's the most artistic piece of php i have ever seen.
--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Question on query string

2004-11-16 Thread Stuart Felenstein

--- "Ford, Mike" <[EMAIL PROTECTED]> wrote:
 
> The main problem with the above snippet that I can
> see is that there's very
> unlikely to be such a thing as $_POST["Ind[]"] --
> form fields with
> name="Ind[]" will turn up as an array in
> $_POST["Ind"] ($_POST["Ind"][0],
> $_POST["Ind"][1], etc.).  But the whole snippet
> looks very odd -- why are
> you trying to pass POSTed values as GET variables on
> (I presume) a form
> action??  Can you post a little context to the list
> to give us some idea
> what you're really trying to do.

Mike - 
Not sure what context would be useful.  The form
action is set to $_GET method.  I should have noticed
POST in there but set those urldecodes via Dreamweaver
bindings.  If you know what those are. Originally the
form was $_POST.  Now -  method="get"  
The search.php form really does nothing with the
arrays.  In searchresults.php I am grabbing the
variables like this:

$HTTP_GET_VARS['Ind']
if (count($Ind) > 0 AND is_array($Ind)) {
$s_Ind = "'".implode("','", $Ind)."'";

Stuart

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Auto-load class if it doesn't exists!

2004-11-16 Thread Jonel Rienton
Hi,
you would need something like a singleton class if my memory serves me.
cheers,
jonel
--
I not know English well, but I know 7 computer languages.
anonymous
On Nov 16, 2004, at 11:36 AM, Bruno B B Magalhães wrote:
Hi people,
is it possible to have a solution that works like an autoloader... for 
example:

$myclass = new class();
but if this class wasn't loaded yet, it loads by itself... egg:
if(class_exists(class))
{
 $myclass = new class();
}
else
{
 require_once(PATH_DIR.'class.class.php');
$myclass = new class();
}
Regards,
Bruno B B Magalhaes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: http header script to stimluate upload with drag and drop??

2004-11-16 Thread M. Sokolewicz
Scott Fletcher wrote:
Hi!
I wonder is is it possible to have an http header that would stimluate
headers don't "stimulate". They are simple "messages", a bit of text 
with no real meaning until the browser/server/whatever gives it meaning 
locally to itself.

files/folders upload via dragging over to the browser window?
No.
  If so then
what are the sample functions or scripts that make this possible...
headers, functions and script don't have much to do with eachother. I 
would suggest reading some documentation about headers to actually 
understand what you're talking about.

Please don't take that wrong, I'm not trying to offend you, but I really 
think you should at least educate yourself about such things a bit 
before asking.
Thanks,
 Scott
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: splitting string

2004-11-16 Thread M. Sokolewicz
Afan Pasalic wrote:
I  create a string from other strings:
$string = $string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5;
and then store it in DB.
But, I can't figure out how to split them back?
Tried:
$string_back = explode('\n', $string);
$string_back = explode('', $string);
$string_back = explode('', $string);
Anu help?
Also, is there actially better way to do this then adding \n between 
strings?
(e.g. store form fields name, address, city, state, zip, phone, email as 
a one string in db and later pull them from DB and split them back?)

Thanks for any help!
-afan
use "\n" instead of '\n'. Special characters and variables between 
single quotes aren't replaced with their ACTUAL meanings, while they are 
when the text is between DOUBLE quotes. So, using "\n" you get a NewLine 
character; using '\n' you will get the raw text '\n' (no quotes)

- Tul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] splitting string

2004-11-16 Thread Greg Donald
On Tue, 16 Nov 2004 12:01:04 -0600, Afan Pasalic <[EMAIL PROTECTED]> wrote:
> I  create a string from other strings:
> $string = $string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5;
> and then store it in DB.
> 
> But, I can't figure out how to split them back?
> 
> Tried:
> $string_back = explode('\n', $string);

Double quotes will cause the value to be evaluated as a newline
character.  The single quotes will not.  Use "\n" instead like you did
when you made the string.

> Also, is there actially better way to do this then adding \n between
> strings?

You can use whatever works.  I use the pipe | character, it's pretty
standard and I've never seen it used as anything except a delimiter.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php.ini

2004-11-16 Thread lister
thanks for the replies, but...

> If there is a php.ini file in the php root directory, then that gets
used. Otherwise, the php.ini file in C:\Windows (iirc).  If the

Actually it seems like the Zend IDE installed another apache server. But
the situation is more confusing.

When I start my standard apache server (dbl-click the binary itself to
make sure no windows services are redirecting), it is not looking for a
php.ini in the same folder as the binary. It reads in
C:/dev/Zend/etc/php.ini

I think I tracked down the issue to setting which httpd.conf apache looks
for. the directory setup is:

apache/
   /conf/httpd.conf

but this file seems to not be getting used, rather it is using the other
apache install...

1 apache binary
  2 looks for an httpd.conf (search order?)
3 which has a line where to load a php.dll
  4 php.ini is looked for next to the php.dll
 5 php.ini says where to find other php extensions etc.

so somewhere tween 1 and 2 there is a redirect i cannot track down.

i guess its not really a PHP issue, more an apache/zend IDE installer
thing but appreciate any tips...

/dc


>
>> On my dev box, I installed the zend editor. Now when i do a
>>   localhost/phpinfo()
>> from a normal browser window (ie not from within the zend IDE) it says php
>> is using the <..>/zend/php.ini settings file...
>
> This is because that's the file that it found first (ie, search order).
Zend installs its own php binaries (unless you do a custom setup).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] splitting string

2004-11-16 Thread Jason Wong
On Wednesday 17 November 2004 02:01, Afan Pasalic wrote:

> I  create a string from other strings:
> $string = $string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5;
> and then store it in DB.
>
> But, I can't figure out how to split them back?
>
> Tried:
> $string_back = explode('\n', $string);

Notice that you used "\n" when creating $string? Do the same here.

> Also, is there actially better way to do this then adding \n between
> strings?
> (e.g. store form fields name, address, city, state, zip, phone, email as
> a one string in db and later pull them from DB and split them back?)

You're not using your database like it should be used. Each invidually 
identifiable item should be stored in a separate column. Lumping everything 
into one column makes it harder to extract and process data. Google for 
"normalise table tutorial", or "normalize table tutorial" if you want things 
from a mainly American point of view.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You carve wounds upon my flesh and write there in salt!

  -- Fremen Lament
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] splitting string

2004-11-16 Thread Dennis Lahay
I usually put a bar "|" between each string, if I need to.
$string = $string1."|".$string2."|".$string3."|".$string4."|".$string5;
D
On Nov 16, 2004, at 12:01 PM, Afan Pasalic wrote:
I  create a string from other strings:
$string = 
$string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5;
and then store it in DB.

But, I can't figure out how to split them back?
Tried:
$string_back = explode('\n', $string);
$string_back = explode('', $string);
$string_back = explode('', $string);
Anu help?
Also, is there actially better way to do this then adding \n between 
strings?
(e.g. store form fields name, address, city, state, zip, phone, email 
as a one string in db and later pull them from DB and split them 
back?)

Thanks for any help!
-afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http header script to stimluate upload with drag and drop??

2004-11-16 Thread Robby Russell
On Tue, 2004-11-16 at 13:10 -0500, Scott Fletcher wrote:
> Hi!
> 
> I wonder is is it possible to have an http header that would stimluate
> files/folders upload via dragging over to the browser window?  If so then
> what are the sample functions or scripts that make this possible...
> 
> Thanks,
>  Scott
> 

I have a script that will stimulate you.

;-)

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] splitting string

2004-11-16 Thread M. Sokolewicz
Afan Pasalic wrote:

Chris W. Parker wrote:
Yes.
$string = "$string1|$string2|$string3|$string4|$string5";
$string_back = explode("|", $string);
Ok, I'm going to change the code and use pipes
:)
Thanks to all of you.!
-afan
please explain...  WHY is that better?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php.ini

2004-11-16 Thread Jason Wong
On Wednesday 17 November 2004 01:33, [EMAIL PROTECTED] wrote:
> thanks for the replies, but...
>
> > If there is a php.ini file in the php root directory, then that gets
>
> used. Otherwise, the php.ini file in C:\Windows (iirc).  If the
>
> Actually it seems like the Zend IDE installed another apache server. But
> the situation is more confusing.

phpinfo() will tell you exactly where that particular installation of PHP 
expects its php.ini file to be found.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
BOFH Excuse #287:

Telecommunications is downshifting.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] splitting string

2004-11-16 Thread Klaus Reimer
Afan Pasalic wrote:
But, I can't figure out how to split them back?
$string_back = explode('\n', $string);
That one is the right one. But you must use double quotes, not single 
quotes. Escaped characters (except \') in single quoted strings are not 
processed.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] splitting string

2004-11-16 Thread Afan Pasalic
That was the trick?
At least - I was close :)
Thanks!
-afan
Klaus Reimer wrote:
Afan Pasalic wrote:
But, I can't figure out how to split them back?
$string_back = explode('\n', $string);

That one is the right one. But you must use double quotes, not single 
quotes. Escaped characters (except \') in single quoted strings are 
not processed.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] odbc question

2004-11-16 Thread Adil
>$sql = "SELECT * FROM users WHERE username='$username' AND
password='$password'";
>$result = odbc_exec($dbConnection, $sql);
>
>while ($rows = odbc_fetch_array($result)) {
> //This doesn't work with odbc_fetch_object either
> print $rows->COLUMNNAME;
>}

It's returning an array, not an object (I can't speak as to how the
odbc_fetch_object function behaves - it seems poorly documented, but it
looks like you get back something more fancy than a simple object with
named variables).

In short, use odbc_fetch_array and refer to the items as
$rows["COLUMNNAME"] (or use single quotes).


- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] http header script to stimluate upload with drag anddrop??

2004-11-16 Thread Scott Fletcher
:-)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: http header script to stimluate upload with drag and drop??

2004-11-16 Thread Scott Fletcher
I have written lot of http header scripts myself, so I'm familiar with what
they are used for.

Scott

"M. Sokolewicz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Scott Fletcher wrote:
> > Hi!
> >
> > I wonder is is it possible to have an http header that would
stimluate
> headers don't "stimulate". They are simple "messages", a bit of text
> with no real meaning until the browser/server/whatever gives it meaning
> locally to itself.
>
> > files/folders upload via dragging over to the browser window?
> No.
>If so then
> > what are the sample functions or scripts that make this possible...
> headers, functions and script don't have much to do with eachother. I
> would suggest reading some documentation about headers to actually
> understand what you're talking about.
>
> Please don't take that wrong, I'm not trying to offend you, but I really
> think you should at least educate yourself about such things a bit
> before asking.
> >
> > Thanks,
> >  Scott

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem typing in PHP forms on Mac OS

2004-11-16 Thread Jonel Rienton
do you have the actual link of this page, i can test it for you.
--
I not know English well, but I know 7 computer languages.
anonymous
On Nov 16, 2004, at 2:24 PM, Jeff - Webmaster wrote:
Hello all. I have created a few PHP pages on our website where users 
can go a fill out a simple form and submit it to our support 
department using the post method. For users on PC's, this works 
flawlessly. I am getting complaints from people who use Macintosh who 
say that they are not able to type in certain fields. The fields in 
question are text boxes. There is not anything special about the code 
(snippet at the end of this email). They are hitting the issue using 
Safari, Netscape, or IE and with varying versions of each. Has anyone 
out there run into this before?

Thanks
Jeff


#condensed#

Billing Address


#condensed#
I agree to the 
conditions above
I do not agree with 
the conditions above




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] splitting string

2004-11-16 Thread Brent Baisley
The problem is that you are using single quotes, so php is looking for 
a literal \n rather than escaping it to a new line character. Try 
double quotes and then PHP will parse the contents of the quotes, 
looking for escape characters and  variables.
explode("\n")

Use nl2br() to convert new lines to .
On Nov 16, 2004, at 1:01 PM, Afan Pasalic wrote:
I  create a string from other strings:
$string = 
$string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5;
and then store it in DB.

But, I can't figure out how to split them back?
Tried:
$string_back = explode('\n', $string);
$string_back = explode('', $string);
$string_back = explode('', $string);
Anu help?
Also, is there actially better way to do this then adding \n between 
strings?
(e.g. store form fields name, address, city, state, zip, phone, email 
as a one string in db and later pull them from DB and split them 
back?)

Thanks for any help!
-afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   >