Re: [PHP] Escape %

2001-02-25 Thread Website4S

In a message dated 26/02/2001 07:17:57 GMT Standard Time, [EMAIL PROTECTED] 
writes:

<< there is addslashes();
 http://www.php.net/manual/en/function.addslashes.php
 
 john >>

addslashes() doesn`t work on the % sign though

Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Escape %

2001-02-25 Thread John LYC

there is addslashes();
http://www.php.net/manual/en/function.addslashes.php

john



[EMAIL PROTECTED] wrote:

> Hi,
>
> Anyone know the best method to escape the % sign in PHP?
>
> I`ve checked the manual and devshed and didn`t come across much, is there a
> command like addslashes() or would I have to use something like this...
>
> $Field="A%D%E";
> $Field1=str_replace("%","percent",$Field);
>
> Thanks for any input
>
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Escape %

2001-02-25 Thread Website4S

Hi,

Anyone know the best method to escape the % sign in PHP?

I`ve checked the manual and devshed and didn`t come across much, is there a 
command like addslashes() or would I have to use something like this...

$Field="A%D%E";
$Field1=str_replace("%","percent",$Field);

Thanks for any input

Ade


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / dynlib.m4 run-tests.php /ext/aspell aspell.c php_aspell.h /ext/bcmath bcmath.c php_bcmath.h /ext/bz2 bz2.c php_bz2.h /ext/calendar cal_unix.c calendar.c easter.c /ext/ccvs ccvs.c ccvs.h /ext/com COM.c typedef_VARIANT.c /ext/ctype ctype.c php_ctype.h /ext/curl curl.c php_curl.h /ext/db db.c php_db.h /ext/dbase dbase.c php_dbase.h /ext/domxml php_domxml.c php_domxml.h /ext/dotnet dotnet.cpp /ext/exif exif.c php_exif.h /ext/fdf fdf.c php_fdf.h /ext/filepro filepro.c php_filepro.h /ext/fribidi fribidi.c php_fribidi.h /ext/gd gd.c gdt1.c gdt1.h php_gd.h /ext/gettext gettext.c php_gettext.h /ext/gmp gmp.c php_gmp.h /ext/hyperwave hg_comm.c hg_comm.h hw.c hw_error.h php_hyperwave.h /ext/iconv iconv.c php_iconv.h /ext/iisfunc iisfunc.cpp iisfunc.h setup.c setup.h /ext/imap php_imap.c /ext/informix ifx.ec /ext/ingres_ii ii.c ii.h php_ii.h /ext/interbase interbase.c php_interbase.h /ext/ircg ircg.c ircg_scanner.c ircg_scanner.re php_ircg.h /ext/java java.c reflect.java /ext/ldap ldap.c php_ldap.h /ext/mcal php_mcal.c /ext/mcrypt mcrypt.c /ext/mhash mhash.c /ext/ming ming.c php_ming.h /ext/msql php_msql.c php_msql.h /ext/mssql php_mssql.c php_mssql.h /ext/mysql php_mysql.c php_mysql.h /ext/notes php_notes.c php_notes.h /ext/oci8 oci8.c php_oci8.h /ext/odbc php_odbc.c php_odbc.h php_velocis.h velocis.c /ext/openssl openssl.c php_openssl.h /ext/oracle oracle.c /ext/ovrimos ovrimos.c /ext/pcre php_pcre.c php_pcre.h /ext/pdf pdf.c php_pdf.h /ext/pfpro pfpro.c php_pfpro.h /ext/pgsql pgsql.c php_pgsql.h /ext/printer php_printer.h printer.c /ext/pspell php_pspell.h pspell.c /ext/qtdom qtdom.c qtdom.h /ext/readline php_readline.h readline.c /ext/recode php_recode.h /ext/sablot php_sablot.h sablot.c /ext/satellite Makefile.in class.c class.h common.c common.h corba.c corba.h enum.c enum.h findtype.c findtype.h hashtable.c hashtable.h namedvalue_to_zval.c namedvalue_to_zval.h object.c object.h php_orbit.c php_orbit.h struct.c struct.h typecode.c typecode.h typemanager.c typemanager.h zval_to_namedvalue.c zval_to_namedvalue.h /ext/session mod_files.c mod_mm.c mod_user.c mod_user.h session.c /ext/shmop php_shmop.h shmop.c /ext/snmp php_snmp.h snmp.c /ext/sockets php_sockets.h sockets.c /ext/standard array.c assert.c base64.c base64.h basic_functions.c basic_functions.h browscap.c crc32.c credits.c credits.h crypt.c cyr_convert.c cyr_convert.h datetime.c datetime.h dir.c dl.c dl.h dns.c dns.h exec.c exec.h file.c file.h filestat.c flock_compat.c flock_compat.h formatted_print.c fsock.c fsock.h ftp_fopen_wrapper.c head.c head.h html.c html.h http_fopen_wrapper.c image.c incomplete_class.c info.c info.h iptc.c lcg.c levenshtein.c link.c mail.c math.c md5.c md5.h metaphone.c microtime.c microtime.h output.c pack.c pack.h pageinfo.c pageinfo.h php_array.h php_assert.h php_browscap.h php_crypt.h php_dir.h php_ext_syslog.h php_filestat.h php_fopen_wrapper.c php_fopen_wrappers.h php_image.h php_incomplete_class.h php_iptc.h php_lcg.h php_link.h php_mail.h php_math.h php_metaphone.h php_output.h php_parsedate.h php_rand.h php_smart_str.h php_smart_str_public.h php_standard.h php_string.h php_var.h quot_print.c quot_print.h rand.c reg.c reg.h scanf.c scanf.h soundex.c string.c syslog.c type.c type.h uniqid.c uniqid.h url.c url.h url_scanner.c url_scanner.h url_scanner_ex.c url_scanner_ex.h url_scanner_ex.re var.c /ext/swf php_swf.h swf.c /ext/sybase php_sybase_db.c php_sybase_db.h /ext/sybase_ct php_sybase_ct.c php_sybase_ct.h /ext/sysvsem php_sysvsem.h sysvsem.c /ext/sysvshm php_sysvshm.h sysvshm.c /ext/vpopmail php_vpopmail.h /ext/wddx php_wddx_api.h /ext/xml php_xml.h xml.c /ext/yaz php_yaz.c php_yaz.h /ext/yp php_yp.h yp.c /ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c /ext/zziplib php_zziplib.h zziplib.c /main SAPI.c SAPI.h build-defs.h.in fopen_wrappers.c fopen_wrappers.h internal_functions.c.in internal_functions_registry.h internal_functions_win32.c main.c network.c php.h php_content_types.c php_globals.h php_ini.c php_ini.h php_logos.c php_main.h php_network.h php_open_temporary_file.c php_open_temporary_file.h php_reentrancy.h php_sprintf.c php_ticks.c php_ticks.h php_variables.c php_variables.h reentrancy.c rfc1867.c safe_mode.c snprintf.h /sapi/aolserver aolserver.c /sapi/apache mod_php4.c mod_php4.h php_apache.c sapi_apache.c /sapi/apache2filter apache_config.c php_apache.h php_functions.c sapi_apache2.c /sapi/caudium caudium.c /sapi/cgi cgi_main.c /sapi/fhttpd fhttpd.c /sapi/isapi php4isapi.c /sapi/nsapi nsapi.c /sapi/phttpd php_phttpd.h phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c /sapi/servlet formatter.java servlet.c servlet.java /sapi/thttpd php_thttpd.h thttpd.c /scripts conv_z_macros

2001-02-25 Thread Andi Gutmans

andiSun Feb 25 22:07:42 2001 EDT

  Modified files:  
/php4   dynlib.m4 run-tests.php 
/php4/ext/aspellaspell.c php_aspell.h 
/php4/ext/bcmathbcmath.c php_bcmath.h 
/php4/ext/bz2   bz2.c php_bz2.h 
/php4/ext/calendar  cal_unix.c calendar.c easter.c 
/php4/ext/ccvs  ccvs.c ccvs.h 
/php4/ext/com   COM.c typedef_VARIANT.c 
/php4/ext/ctype ctype.c php_ctype.h 
/php4/ext/curl  curl.c php_curl.h 
/php4/ext/dbdb.c php_db.h 
/php4/ext/dbase dbase.c php_dbase.h 
/php4/ext/domxmlphp_domxml.c php_domxml.h 
/php4/ext/dotnetdotnet.cpp 
/php4/ext/exif  exif.c php_exif.h 
/php4/ext/fdf   fdf.c php_fdf.h 
/php4/ext/filepro   filepro.c php_filepro.h 
/php4/ext/fribidi   fribidi.c php_fribidi.h 
/php4/ext/gdgd.c gdt1.c gdt1.h php_gd.h 
/php4/ext/gettext   gettext.c php_gettext.h 
/php4/ext/gmp   gmp.c php_gmp.h 
/php4/ext/hyperwave hg_comm.c hg_comm.h hw.c hw_error.h 
php_hyperwave.h 
/php4/ext/iconv iconv.c php_iconv.h 
/php4/ext/iisfunc   iisfunc.cpp iisfunc.h setup.c setup.h 
/php4/ext/imap  php_imap.c 
/php4/ext/informix  ifx.ec 
/php4/ext/ingres_ii ii.c ii.h php_ii.h 
/php4/ext/interbase interbase.c php_interbase.h 
/php4/ext/ircg  ircg.c ircg_scanner.c ircg_scanner.re php_ircg.h 
/php4/ext/java  java.c reflect.java 
/php4/ext/ldap  ldap.c php_ldap.h 
/php4/ext/mcal  php_mcal.c 
/php4/ext/mcryptmcrypt.c 
/php4/ext/mhash mhash.c 
/php4/ext/ming  ming.c php_ming.h 
/php4/ext/msql  php_msql.c php_msql.h 
/php4/ext/mssql php_mssql.c php_mssql.h 
/php4/ext/mysql php_mysql.c php_mysql.h 
/php4/ext/notes php_notes.c php_notes.h 
/php4/ext/oci8  oci8.c php_oci8.h 
/php4/ext/odbc  php_odbc.c php_odbc.h php_velocis.h velocis.c 
/php4/ext/openssl   openssl.c php_openssl.h 
/php4/ext/oracleoracle.c 
/php4/ext/ovrimos   ovrimos.c 
/php4/ext/pcre  php_pcre.c php_pcre.h 
/php4/ext/pdf   pdf.c php_pdf.h 
/php4/ext/pfpro pfpro.c php_pfpro.h 
/php4/ext/pgsql pgsql.c php_pgsql.h 
/php4/ext/printer   php_printer.h printer.c 
/php4/ext/pspellphp_pspell.h pspell.c 
/php4/ext/qtdom qtdom.c qtdom.h 
/php4/ext/readline  php_readline.h readline.c 
/php4/ext/recodephp_recode.h 
/php4/ext/sablotphp_sablot.h sablot.c 
/php4/ext/satellite Makefile.in class.c class.h common.c common.h 
corba.c corba.h enum.c enum.h findtype.c 
findtype.h hashtable.c hashtable.h 
namedvalue_to_zval.c namedvalue_to_zval.h 
object.c object.h php_orbit.c php_orbit.h 
struct.c struct.h typecode.c typecode.h 
typemanager.c typemanager.h 
zval_to_namedvalue.c zval_to_namedvalue.h 
/php4/ext/session   mod_files.c mod_mm.c mod_user.c mod_user.h 
session.c 
/php4/ext/shmop php_shmop.h shmop.c 
/php4/ext/snmp  php_snmp.h snmp.c 
/php4/ext/sockets   php_sockets.h sockets.c 
/php4/ext/standard  array.c assert.c base64.c base64.h 
basic_functions.c basic_functions.h browscap.c 
crc32.c credits.c credits.h crypt.c 
cyr_convert.c cyr_convert.h datetime.c 
datetime.h dir.c dl.c dl.h dns.c dns.h exec.c 
exec.h file.c file.h filestat.c flock_compat.c 
flock_compat.h formatted_print.c fsock.c fsock.h 
ftp_fopen_wrapper.c head.c head.h html.c html.h 
http_fopen_wrapper.c image.c incomplete_class.c 
info.c info.h iptc.c lcg.c levenshtein.c link.c 
mail.c math.c md5.c md5.h metaphone.c 
microtime.c microtime.h output.c pack.c pack.h 
pageinfo.c pageinfo.h php_array.h php_assert.h 
php_browscap.h php_crypt.h php_dir.h 
php_ext_syslog.h php_filestat.h 
php_fopen_wrapper.c php_fopen_wrappers.h 
php_image.h php_incomplete_class.h php_iptc.h 
php_lcg.h php_link.h php_mail.h php_math.h 
php_metaphone.h php_output.h php_parsedate.h 
php_rand.h php_smart_str.h 
php_smart_str_public.h php_standard.h 
php_string.h php_var.h quot_print.c quot_print.h 
rand.c reg.c reg.h scanf.c scanf.h soundex.c 
string.c syslog.c type.c type.h uniqid.c 
uniqid.h url.c url.h url_scanner.c url_scanner.h 
   

Re: [PHP-CVS] cvs: php4 /ext/midgard midgard.c

2001-02-25 Thread Andi Gutmans

Are you sure you shouldn't be using zval_ptr_dtor(args[0]) as opposed to 
zval_dtor(). I see you guys doing this a lot and usually you'd want to use 
zval_ptr_dtor(). It reduces reference count and only if the zval really 
needs freeing does it run zval_dtor() and efree(). In any case, you guys 
seem to forget the final free.

Andi

At 11:34 PM 2/25/2001 +, David Guerizec wrote:
>davidg  Sun Feb 25 15:34:48 2001 EDT
>
>   Modified files:
> /php4/ext/midgard   midgard.c
>   Log:
>   force user to pass $xparam by reference (from mgd_walk_xxx_tree() 
> functions)
>
>
>Index: php4/ext/midgard/midgard.c
>diff -u php4/ext/midgard/midgard.c:1.18 php4/ext/midgard/midgard.c:1.19
>--- php4/ext/midgard/midgard.c:1.18 Sun Feb 25 11:31:17 2001
>+++ php4/ext/midgard/midgard.c  Sun Feb 25 15:34:48 2001
>@@ -1,4 +1,4 @@
>-/* $Id: midgard.c,v 1.18 2001/02/25 19:31:17 davidg Exp $
>+/* $Id: midgard.c,v 1.19 2001/02/25 23:34:48 davidg Exp $
>  Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
>  Copyright (C) 2000 The Midgard Project ry
>  Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
>@@ -751,22 +751,28 @@
> zval ** xp = (zval **)xparam;
> zval *return_value;
>
>+   if(!PZVAL_IS_REF(xp[0])) {
>+   /* DG: Do we force the user to pass it by reference ? */
>+   php_error(E_WARNING,"You must pass the fourth parameter by 
>reference.");
>+   return;
>+   }
> ALLOC_ZVAL(return_value);   ZVAL_NULL(return_value);
> ALLOC_ZVAL(args[0]);ZVAL_LONG(args[0], id);
> ALLOC_ZVAL(args[1]);ZVAL_LONG(args[1], level);
>-   args[2] = xp[0];// DG: is this needed ? ->
>-   zval_copy_ctor(args[2]);
>+   args[2] = xp[0];// DG: is this needed ? 
>->zval_copy_ctor(args[2]);
>
> if(call_user_function(CG(function_table), NULL,
>   xp[1], return_value, 3,
>   args) != SUCCESS) {
> php_error(E_WARNING,"Unable to call %s() - function does 
> not exist",
>   (xp[1])->value.str.val);
>+   zval_dtor(return_value);
>+   zval_dtor(args[0]); zval_dtor(args[1]);
> return;
> }
>+
> zval_dtor(return_value);
>-   zval_dtor(args[0]);
>-   zval_dtor(args[1]);
>+   zval_dtor(args[0]); zval_dtor(args[1]);
>  }
>
>  #if YOU_WANT_TO_TEST
>
>
>
>--
>PHP CVS Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php4 as a module AND a cgi

2001-02-25 Thread colin olkowski

hi all,

my question is this, how would one install PHP4 as a module and as a cgi?

somewhere in the install notes for php4 (redhat) the docs clearly say do not
install both, yet my old hosting company was able to do it.

btw, i just moved from the world of virtual hosting on a FreeBSD box to my
own RedHat server.

is this a linux vs. freebsd issue?

colin olkowski - [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP4 directives in httpd.conf not working

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 15:30, Brian White wrote:
> I have php4 running under Apache. Under that apache I have several
> s. I want to set to some of the PHP.INI values under
> one of those hosts. So far I have tried the following values in
> my httpd.conf file:
>
> 1) include_path   "/my/phpinc/path"
> 2) php_include_path   "/my/phpinc/path"
> 3) php3_include_path  "/my/phpinc/path"
> 4) php4_include_path  "/my/phpinc/path"
>
> None of them have worked - I can't even restart Apache with them in
> place. "/my/phpinc/path" definitely exists.
>
> What am I doing wrong?
>
> Regs
>
> Brian White

PHP4 uses different Apache configuration directives (see 
http://au.php.net:81/manual/en/configuration.php ) I think the one you 
want is probably php_value so

php_value include_path "/my/phpinc/path"

might work.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Simple String Replace Question

2001-02-25 Thread Jeff Oien

> 
> 
> 
> 
> 
> 
> 
> 
> 
>  $str = ereg_replace("([^\r\n])\r\n([^\r\n])", "\\1 \\2", $str);
> echo $str;
> ?>
> 
> 
> 
> 

Got it now. I didn't didn't have  tags in mine. With
the  tags it works as prescribed. Thanks! The other 
troubleshooting examples were helpful too to know what's
going on with those characters.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 26 Feb 2001 05:00:42 -0000 Issue 534

2001-02-25 Thread php-general-digest-help


php-general Digest 26 Feb 2001 05:00:42 - Issue 534

Topics (messages 41593 through 41649):

Re: Temporarily turning off magic quotes?
41593 by: Philip Olson
41596 by: Chris Adams

Re: incrementing  a date!
41594 by: Philip Olson

Simple String Replace Question
41595 by: Jeff Oien
41601 by: Chris Adams
41606 by: Jeff Oien
41607 by: Simon Garner
41612 by: Chris Adams
41613 by: Jeff Oien
41615 by: Simon Garner
41644 by: Jeff Oien
41645 by: Simon Garner

Re: Unwanted Characters
41597 by: Chris Adams

Re: isset()
41598 by: Chris Adams
41600 by: Joe Stump

Re: Plugin Detection with PHP?
41599 by: Chris Adams

PhpLib Template Not Parsing
41602 by: Kyndig

PHP CGI-Binary
41603 by: Julia A . Case
41604 by: Frank M. Kromann

sockets...
41605 by: Julia A . Case

Removing HTML codes using regexp
41608 by: Toke Herkild
41609 by: Simon Garner

Re: so what program?
41610 by: CC Zona

Maximum queries from a database?
41611 by: James, Yz

Script not updating
41614 by: Peter Houchin
41616 by: Simon Garner
41618 by: Peter Houchin
41620 by: Miles Thompson
41621 by: Miles Thompson

Re: Can't connect php to mysql on linux
41617 by: David Robley
41619 by: eschmid+sic.s.netic.de
41624 by: Miles Thompson

Using one invocation of PHP executable to generate multiple pages?
41622 by: Jim Lum
41625 by: Miles Thompson

Dynamic Corners GD Image library
41623 by: sam1600.iname.com

Re: php.ini
41626 by: David Robley
41627 by: John Monfort
41629 by: eschmid+sic.s.netic.de

Printing long strings
41628 by: Clayton Dukes
41630 by: Miles Thompson

switch statement
41631 by: Peter Houchin
41632 by: Jon Rosenberg
41633 by: David Robley
41634 by: Peter Houchin
41636 by: David Robley

include file
41635 by: JW
41637 by: David Robley

mysql_info()
41638 by: Gustavo Vieira Goncalves Coelho Rios

Logging out a user
41639 by: Chris Aitken

Regular expression problems
41640 by: Dan Watt
41641 by: Simon Garner
41642 by: Dan Watt
41643 by: Simon Garner

JavaScript
41646 by: Deependra B. Tandukar
41647 by: Robert Gormley
41648 by: Simon Garner

PHP4 directives in httpd.conf not working
41649 by: Brian White

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--




> you can use:
> 
> if($REQUEST_METHOD=='GET' or $REQUEST_METHOD=='POST')
>   ini_set ('magic_quotes_gpc',  'off'); 

This will not work, ini_set cannot mess with magic_quotes setting,
.htaccess is the prime option for temporarily changing this setting, as
per the example provided by Zeev.


Regards,


Philip Olson
http://www.cornado.com/






On 25 Feb 2001 09:15:08 -0800, Philip Olson <[EMAIL PROTECTED]> wrote:
>>  ini_set ('magic_quotes_gpc',  'off'); 
>
>This will not work, ini_set cannot mess with magic_quotes setting,

More precisely, it can change the setting but your PHP code will be executed
after the magic quotes work has already completed.





> ex: 2001-03-28 'll become 2001-04-01

Here's an example (a hack) which may help you get going :


 print getFutureDate('2001-03-28',4); // 2001-04-01

 function getFutureDate($date,$days,$format='Y-m-d')
 {
 list($year,$month,$day) = explode('-', $date);

 $timestamp = mktime(0,0,0, $month, $day, $year); 

 $secs = ($days * 86400);

 return date($format,$timestamp+$secs);
 }


Regards,


Philip Olson
http://www.cornado.com/

On Sun, 25 Feb 2001, kaab kaoutar wrote:

> Hi all!
> s there a way with which we can increment a date (by day) without extracting 
> the month the day and the year then increment some of them depending on the 
> day the month and the year ?
> ex: 2001-03-28 'll become 2001-04-01
> 
> Thanks
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





I would like to get rid of \n characters unless there
are two or more in a row. So for example if there
is a long email formatted like we do here with
line break I want to remove the line breaks so 
text can be wrapped by a browser, but also show
paragraph breaks where necessary. This is what
I have:
$string_new = str_replace("\n", "", $string);
How can I augment 

[PHP] PHP4 directives in httpd.conf not working

2001-02-25 Thread Brian White

I have php4 running under Apache. Under that apache I have several
s. I want to set to some of the PHP.INI values under
one of those hosts. So far I have tried the following values in
my httpd.conf file:

1) include_path   "/my/phpinc/path"
2) php_include_path   "/my/phpinc/path"
3) php3_include_path  "/my/phpinc/path"
4) php4_include_path  "/my/phpinc/path"

None of them have worked - I can't even restart Apache with them in place.
"/my/phpinc/path" definitely exists.

What am I doing wrong?

Regs

Brian White
-
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
Phone: +612-93197901
Web:   http://www.steptwo.com.au/
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] JavaScript

2001-02-25 Thread Simon Garner

From: "Deependra B. Tandukar" <[EMAIL PROTECTED]>

> Greetings!
>
> Is there any equivalent code for (JavaScript)  href=JavaScript:history-back(1)>Back Button in php?
>
> This works as back button on the menu bar.
>
> Looking forward to hearing from you.
>
> regards,
> DT
>
>


Yes, but it works differently. If the user typed in the URL of your page
(instead of clicking a link) then you can't go back from PHP, so you need to
be careful. Here's some sample code:


Back Button";
?>



Cheers

Simon Garner


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] JavaScript

2001-02-25 Thread Robert Gormley

The problem with this (the javascript history) is it bites on frames.

One thing you could do is

print("Go back");

or some such. At least then you could do referer sanity checking to make 
sure you didn't dump the user somewhere nonsensical (if they've bookmarked 
something in the middle of your site.

Robert

At 10:37 AM 26/02/2001 +0545, Deependra B. Tandukar wrote:
>Greetings!
>
>Is there any equivalent code for (JavaScript) href=JavaScript:history-back(1)>Back Button in php?
>
>This works as back button on the menu bar.
>
>Looking forward to hearing from you.
>
>regards,
>DT
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

Robert Gormley
[EMAIL PROTECTED]
http://distortedreality.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] JavaScript

2001-02-25 Thread Deependra B. Tandukar

Greetings!

Is there any equivalent code for (JavaScript) Back Button in php?

This works as back button on the menu bar.

Looking forward to hearing from you.

regards,
DT


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Simple String Replace Question

2001-02-25 Thread Simon Garner

From: "Jeff Oien" <[EMAIL PROTECTED]>

> Ok now I'm really being a pest. Your code works on your
> example but not on mine. I can't figure out why. But I really
> appreciate the help so far from Chris and Simon so thanks.
>
> Here is my example and what happens when I use your
> code. I tried it by pasting text into a textarea part of a
> form and also just having it in a plain text file (Windows system).
> (I just tried creating a file on Unix also, same result.)
> Removes the line breaks but also the multiples for paragraphs.
> This isn't very important, more of a curiosity.


I just tried with your text and it reformats it correctly for me...

Here's what I have got:


















I pasted your text into the textarea and submitted it:


This is a story
of how the West was won.
Not about the Brady bunch
but how those guys with guns
somehow won.

I don't know who won, but
I do know the West was won.
So the West is number one.

Yay.


And it outputted:


This is a story of how the West was won. Not about the Brady bunch but how
those guys with guns somehow won.

I don\'t know who won, but I do know the West was won. So the West is number
one.

Yay.


(Just need to run it through stripslashes() to fix the don\'t.)

Does this not work for you? Some troubleshooting ideas:






Hope this helps

Simon Garner


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Simple String Replace Question

2001-02-25 Thread Jeff Oien

> No, that doesn't make any sense whatsoever :)
>
> A \n *is* a new line. I can only guess you're getting confused because
> there's \r's as well as \n's in the string. Try this:
>
>
>  $str = "abc\r\ndefg\r\n\r\nxyzpqr\r\njklmno";
> $str = ereg_replace("([^\r\n])\r\n([^\r\n])", "\\1 \\2", $str);
> echo $str;
> ?>

Ok now I'm really being a pest. Your code works on your
example but not on mine. I can't figure out why. But I really
appreciate the help so far from Chris and Simon so thanks.

Here is my example and what happens when I use your
code. I tried it by pasting text into a textarea part of a
form and also just having it in a plain text file (Windows system).
(I just tried creating a file on Unix also, same result.)
Removes the line breaks but also the multiples for paragraphs.
This isn't very important, more of a curiosity.
---
original text:

This is a story
of how the West was won.
Not about the Brady bunch
but how those guys with guns
somehow won.

I don't know who won, but
I do know the West was won.
So the West is number one.

Yay.
---
returned from your code:

This is a story of how the West was won. Not about the Brady bunch but how those guys
with guns somehow won. I don't know who won, but I do know the West was won. So the
West is number one. Yay.
---
what I want is:

This is a story of how the West was won. Not about the Brady bunch but how those guys
with guns somehow won.

I don't know who won, but I do know the West was won. So the West is number one.

Yay.

^that may wrap in your e-mail program


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Regular expression problems

2001-02-25 Thread Simon Garner

From: "Dan Watt" <[EMAIL PROTECTED]>

> ok, that was my problem Was using ereg... All the places I read about
> how to do regular expressions (book, online...) did NOT clarify that \w
and
> such would need preg.. Thanks!
>


No prob - yeah, \w is a Perl feature :)

(preg = PCRE = Perl Compatible Regular Expressions)



Cheers

Simon Garner


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Regular expression problems

2001-02-25 Thread Dan Watt

ok, that was my problem Was using ereg... All the places I read about
how to do regular expressions (book, online...) did NOT clarify that \w and
such would need preg.. Thanks!

""Simon Garner"" <[EMAIL PROTECTED]> wrote in message
022d01c09fa6$a2bbd460$[EMAIL PROTECTED]">news:022d01c09fa6$a2bbd460$[EMAIL PROTECTED]...
> From: "Dan Watt" <[EMAIL PROTECTED]>
>
> > Im trying to build a user login system, and when there is a new user, I
> need
> > to validate that they are usign using word characters ([0-9A-Za-z_] or
> > \w)... I have TRIED MANY different regular expressions to test this, but
> > none work. This seems so simple but I am missing something. I need a
> > expression that returs true ONLY if ALL the characters match \w  Any
> > help would be appreciated.
> >
> >
>
>
>  $username = "johnny";
>
> if (!eregi("[^A-Z0-9_-]", $username))
> {
> echo "username OK";
> }
> else
> {
> echo "bad username!";
> }
> ?>
>
> Assuming you only want letters, numbers, underscores or hyphens. If you
> really want \w you would need to use preg instead of ereg, and then you
need
> PCRE support in PHP. Or you could use ereg's character classes, I think
the
> pattern would look like: "[^[:alphanum:]]". However you are probably
better
> off using an explicit set of characters as I have shown, so that it is
> obvious what is and is not allowed.
>
>
> Cheers
>
> Simon Garner
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Regular expression problems

2001-02-25 Thread Simon Garner

From: "Dan Watt" <[EMAIL PROTECTED]>

> Im trying to build a user login system, and when there is a new user, I
need
> to validate that they are usign using word characters ([0-9A-Za-z_] or
> \w)... I have TRIED MANY different regular expressions to test this, but
> none work. This seems so simple but I am missing something. I need a
> expression that returs true ONLY if ALL the characters match \w  Any
> help would be appreciated.
>
>




Assuming you only want letters, numbers, underscores or hyphens. If you
really want \w you would need to use preg instead of ereg, and then you need
PCRE support in PHP. Or you could use ereg's character classes, I think the
pattern would look like: "[^[:alphanum:]]". However you are probably better
off using an explicit set of characters as I have shown, so that it is
obvious what is and is not allowed.


Cheers

Simon Garner



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Regular expression problems

2001-02-25 Thread Dan Watt

Im trying to build a user login system, and when there is a new user, I need
to validate that they are usign using word characters ([0-9A-Za-z_] or
\w)... I have TRIED MANY different regular expressions to test this, but
none work. This seems so simple but I am missing something. I need a
expression that returs true ONLY if ALL the characters match \w  Any
help would be appreciated.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Logging out a user

2001-02-25 Thread Chris Aitken

Okay, I got a bit of a curley one that I havent been able to solve by 
looking at the archives and in the manual. Its kind of a PHP/Apache question.

I have a system where a user logs in through .htaccess, it queries my mysql 
database, sets a cookie which logs their username and access level number.

What I want to be able to do it this.. Give the option to "Log Out" 
which will clear the cookie, and also make htaccess re-request a login. 
Once it logs in again, the current scripts do their thang and log the new 
user in.


Is there any direction anyone can point me to start looking cause I have a 
feeling im off the track on what im searching for in TFM and in TFA.



Chris


--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mysql_info()

2001-02-25 Thread Gustavo Vieira Goncalves Coelho Rios

Am i wrong or php does not support mysql_info() function ?

Is there plans to support it?

thanks in advance!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include file

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:29, JW wrote:
> I have created a config.php3 to store the connection of the database
> and some constant variable. Then, I created the other file
> functions.php3 and inculde config.php3 into this file for
> function.phps3 should use some variables inside the file config.php3.
> However, I don't know why all the variable cannot display in the
> function.php3.
>
> would anyone please to tell me what is the reason and how I can solve
> it?

You may need to declare the variables global within the function, or pass 
them as arguments to the function.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] switch statement

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:20, Peter Houchin wrote:
> I'm playing aruond with the switch statement trying to get one to work
> for $submit
> I have 2 forms on the one page (only one displays at a time) 1 is for
> creating a new record in my data base the other is for
> updating/changing values from the first form should there be any. So i
> want it to switch between the 2 cases

OK. Suppose the possible values for $submit are 'insert' and 'update'. [I 
assume those are values _you_ can assign to a submit button]

Then

switch($submit) {

case 'insert':
  // Your insert stuff here
  break; //So it doesn't fall through to the next case

case 'update:
  // Your update stuff here
  break;

case default:
  // The page has somehow been called without a value (or an
  // inappropriate value) for submit
  // Error handling or whatever here

}

Does that make it clearer? or muddier :-)

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include file

2001-02-25 Thread JW

I have created a config.php3 to store the connection of the database and
some constant variable. Then, I created the other file functions.php3 and
inculde config.php3 into this file for function.phps3 should use some
variables inside the file config.php3. However, I don't know why all the
variable cannot display in the function.php3.

would anyone please to tell me what is the reason and how I can solve it?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] switch statement

2001-02-25 Thread Peter Houchin


I'm playing aruond with the switch statement trying to get one to work for
$submit
I have 2 forms on the one page (only one displays at a time) 1 is for
creating a new record in my data base the other is for updating/changing
values from the first form should there be any. So i want it to switch
between the 2 cases
-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 1:34 PM
To: Peter Houchin; PHP MAIL GROUP
Subject: Re: [PHP] switch statement


On Mon, 26 Feb 2001 12:33, Peter Houchin wrote:

> > Does any one know where there are some tutorials for the switch
> statement?

> Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
>

Have a quick look at
http://www.php.net/manual/en/control-structures.switch.php
which has some user notes which are possibly useful over and above the
actual documentation.

--
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] switch statement

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 12:33, Peter Houchin wrote:

> > Does any one know where there are some tutorials for the switch
> statement?
 
> Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
>
 
Have a quick look at 
http://www.php.net/manual/en/control-structures.switch.php
which has some user notes which are possibly useful over and above the 
actual documentation.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] switch statement

2001-02-25 Thread Jon Rosenberg

Here is a basic example.

switch ($option)
{

case "optiona":
statements;
statements;
break;

case "optionb":
statements;
break;

}




- Original Message -
From: "Peter Houchin" <[EMAIL PROTECTED]>
To: "PHP MAIL GROUP" <[EMAIL PROTECTED]>
Sent: Sunday, February 25, 2001 9:03 PM
Subject: [PHP] switch statement


> Does any one know where there are some tutorials for the switch statement?
>
> Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] switch statement

2001-02-25 Thread Peter Houchin

Does any one know where there are some tutorials for the switch statement?

Peter Houchin
Sun Rentals
[EMAIL PROTECTED]




Re: [PHP] Printing long strings

2001-02-25 Thread Miles Thompson

Clayton,

Have a look at http://www.php.net/manual/en/function.addslashes.php

I've not used them, there are also references to stripslashes, you may need 
to experiment a bit.

Miles

At 07:56 PM 2/25/01 -0500, Clayton Dukes wrote:
>How can I get php to print a long string and ignore any of the characters 
>in the string?
>
>ie:
>$string = "soprint $string;
>
>isn't there some kind of command to use that keeps the string exactly as 
>it is?
>
>
>
>Clayton Dukes
>CCNA, CCDA, CCDP, CCNP
>Internetwork Solutions Engineer
>Internetwork Management Engineer
>Thrupoint, Inc.
>Tampa, FL
>(c) 904.477.7825
>(h) 904.292.1881
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php.ini

2001-02-25 Thread eschmid+sic

On Mon, Feb 26, 2001 at 11:22:20AM +1030, David Robley wrote:
> On Sun, 25 Feb 2001 18:21, Brandon Feldhahn wrote:
> > what do i put in the "Sendmail_from" section of php.ini?
> 
> Did you check the documentation, or the sample ini file? According to the 
> docs,
> 
> sendmail_from string
> 
> Which "From:" mail address should be used in mail sent from PHP under 
> Windows.

It works also under GNU/Linux. I haven't tested it under Unix. The
comments in php.ini may be wrong.

-Egon

-- 
http://www.linuxtag.de/
http://php.net/books.php 
http://www.concert-band.de/
http://www.php-buch.de/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/imap config.m4 php_imap.c php_imap.h

2001-02-25 Thread Sascha Schumann

On Sun, 25 Feb 2001, Dan Kalowsky wrote:

> kalowsky  Sat Feb 24 20:41:19 2001 EDT
>
[..]
>   Changes the config.m4 to support the client.h include
>   # This should include all the approriate headers for c-client (as defined by
>   # c-client maintainers) such as mail.h, and rfc822.h.

Well, the problem with this commit is that it breaks
compatibility with older imap releases as they don't have any
c-client.h.  Dan, can you please add a check for c-client.h
and if it does not exist, fall back to the old set of header
files?

- Sascha


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Printing long strings

2001-02-25 Thread Clayton Dukes



How can I get php to print a long string and ignore 
any of the characters in the string?
 
ie:
$string = "so
print $string;
 
isn't there some kind of command to use that keeps 
the string exactly as it is?
 
 
 
Clayton DukesCCNA, CCDA, CCDP, 
CCNPInternetwork Solutions EngineerInternetwork Management 
EngineerThrupoint, Inc.Tampa, FL(c) 904.477.7825(h) 
904.292.1881

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] php.ini

2001-02-25 Thread John Monfort



__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Mon, 26 Feb 2001, David Robley wrote:

> On Sun, 25 Feb 2001 18:21, Brandon Feldhahn wrote:
> > what do i put in the "Sendmail_from" section of php.ini?
>
> Did you check the documentation, or the sample ini file? According to the
> docs,
>
> sendmail_from string
>
> Which "From:" mail address should be used in mail sent from PHP under
> Windows.
>
> --
> David Robley| WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
> AusEinet| http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php.ini

2001-02-25 Thread David Robley

On Sun, 25 Feb 2001 18:21, Brandon Feldhahn wrote:
> what do i put in the "Sendmail_from" section of php.ini?

Did you check the documentation, or the sample ini file? According to the 
docs,

sendmail_from string

Which "From:" mail address should be used in mail sent from PHP under 
Windows.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Using one invocation of PHP executable to generate multiple pages?

2001-02-25 Thread Miles Thompson

Jim,
PHP works with your server to generate the HTML output, so PHP is "running" 
all the time, it's not like a CGI script. PHP code is embedded in your HTML 
pages, so you can use it to control the generated HTML. You can turn it on 
and off within the page. Carefully look at Chapter 1 Page 1 of the manual 
"What is PHP?"

Then look at a couple of the tutorials at www.thickbook.com, WeberDev, 
Devshed, and so on. The concept will become clearer. From there on, take it 
away; it's powerful, flexible and occasionally frustrating and embarrassing 
(like all languages).

So you can have little pages full of buttons or links which open up other 
pages, or sometimes a lot of PHP script generating relatively few lines of 
code, all depending on various conditions.

Miles Thompson


At 07:21 PM 2/25/01 -0500, Jim Lum wrote:
>Hi,
>
>I have PHP installed on a Win95 machine.  What I'd like to do is to use
>a PHP page that will create multiple HTML pages.
>
>I guess that I can execute PHP.EXE multiple times, but was thinking that
>this means that it's going thru the overhead of starting up PHP.EXE each
>time.  Is there any way to tell PHP.EXE to build multiple HTML pages,
>i.e., kind of like a loop?
>
>Jim
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can't connect php to mysql on linux

2001-02-25 Thread Miles Thompson

George,

1. Is this a brand new project, or were you connecting before, on your web 
pages? If the latter, what changed?
2. **IMPORTANT**  Have you also run phpinfo() and confirmed that you have 
mysql support installed? **IMPORTANT**
3. Did you stop and restart Apache?
4. Have you tried a minimal page - just connecting and echoing the result? 
or with a built-in die message?
5. Is  this a self-hosted server, or someone elses? What name combinations 
of localhost, username and password have you played with? What name is 
mysql running under?

I'll also confess I've given up on .rpms for all of mysql, apache and php. 
It's fairly quick to build them from source, and you have full control over 
where things are placed. Search for something like "LAMP Apache" and that 
will turn up the necessary tutorials.

This probably hasn't been much direct help, but maybe it'll get you going. 
It's not fun, but I've slowly learned to check basics first! (Like the 
wire, when there's a network connectivity problem - sheepish grin.)

Regards - Miles Thompson


At 10:11 AM 2/26/01 +1030, David Robley wrote:
>On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> > Hi,
> >
> > I working on Redhat Linux 6.1 and I've installed
> > MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> > working fine. I've even created a database also using MySqlAdmin.
> > Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> > Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> > php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
> >
> > My problem is I can't connect PHP to Mysql Db using the
> > mysyql_connect("localhost","root","mypassword") command.
> >
> > Please help me asap.
> > Regards,
> > George
>
>Use mysql_error() after your unsuccessful call to mysql_connect to return
>a mysql error string
>
>--
>David Robley| WEBMASTER & Mail List Admin
>RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
>AusEinet| http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Dynamic Corners GD Image library

2001-02-25 Thread sam1600


Hi,

This is probably a no brainer for the math wizards out there.
Can anyone see how the folowing code ( originally posted on
phpbuilder titled "RE: dynamic corners" as a responce to Rasmus's
article on image creation with php & GD :
http://www.phpbuilder.com/annotate/message.php3?id=1003041 )
can be modified to change the "curve" of the arc.

I would like to be able to modify the code so it can display
and arc with a curve inbetween the arc the code produces now:

#
#  ##
#   #
#
#  ##
#
#  ##
# ###
#
#

and a triange like below:

#
#  ##
# ###
#
#   #
#  ##
# ###
#
#   #
#  ##
# ###
#
#   #
#  ##
# ###
#
( pretend this image is the same
 height as the one above ;)

In otherwords I would like to be able to modify
the "height" of the arc ( not to be confused with
the height of the image ) as one is able to modify
the  height of the arc produced using the GD ImageArc()
function.

You may be wondering why I am not using the 
ImageArc() function in the first place.  Well 
check it out and see... this code produces 
a beautifully antialiassed curve, and the 
ImageArc() does not.


Looking forward to your ideas.

Thanks,
Sam


=$r)
  return 0; 

   $d3=pow( ( pow(($x+1),2) + pow(($y+1),2) ), 0.5 ); 
   if ($d3<=$r)
  return 1; 

   $d2=pow( ( pow(($x+1),2) + pow(($y),2) ), 0.5 ); 
   $d4=pow( ( pow(($x),2) + pow(($y+1),2) ), 0.5 ); 

   # p or t 
   if ($d2==$r)
  $p=1; 
   elseif ($d2>$r)
  $p = ( pow( ( pow($r,2) - pow($y,2) ), 0.5 ) - $x ); 
   else  
  $t = ( pow( ( pow($r,2) - pow(($x+1),2) ), 0.5 ) - $y ); 

   # q or s 
   if ($d4==$r)
  $q=1; 
   else if ($d4>$r)
  $q = ( pow( ( pow($r,2) - pow($x,2) ), 0.5 ) - $y ); 
   else
  $s = ( pow( ( pow($r,2) - pow(($y+1),2) ), 0.5 ) - $x ); 

   # area 
   if ($p&&$q) 
  return (0.5*$p*$q); 
   else if ($q&&$t) 
  return (0.5*($q+$t)); 
   else if ($s&&$p) 
  return (0.5*($p+$s)); 
   else if ($t&&$s)
  return ( 0.5*(2+($s-1)*(1-$t)) ); 
   } 


### scan gif 
$r=$side; 

for($x=0;$x<$r;$x++)
   { 
   for($y=0;$y<$r;$y++)
  { 
  $area=getarea($x,$y); 
  ### flip image 
  (strchr($cnr,'b')) ? ($ty=$y) : ($ty=$side-$y-1); 
  (strchr($cnr,'r')) ? ($tx=$x) : ($tx=$side-$x-1); 
  colorise($tx,$ty,$area); 
  } 
 } 

Header("Content-type: image/gif"); 
ImageGif($corner); 

?>




Get your free email from AltaVista at http://altavista.iname.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: CVSROOT / avail cvsusers gen_acl_file.m4

2001-02-25 Thread Sascha Schumann

sas Sun Feb 25 16:25:36 2001 EDT

  Modified files:  
/CVSROOTgen_acl_file.m4 avail cvsusers 
  Log:
  Give wez karma for php_dev and update email address
  
  

Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.106 CVSROOT/gen_acl_file.m4:1.107
--- CVSROOT/gen_acl_file.m4:1.106   Sun Feb 25 08:43:12 2001
+++ CVSROOT/gen_acl_file.m4 Sun Feb 25 16:25:35 2001
@@ -1,7 +1,7 @@
 dnl The PHP Group
 define(`php_group', `andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane')dnl
 dnl PHP Developers (full access to the source trees)
-define(`php_dev', 
`php_group,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile')
+define(`php_dev', 
+`php_group,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez')
 dnl PHP Documentation Group
 define(`php_doc', 
`chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly')dnl
 dnl Quality Assurance Team
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.102 CVSROOT/avail:1.103
--- CVSROOT/avail:1.102 Sun Feb 25 08:43:12 2001
+++ CVSROOT/avail   Sun Feb 25 16:25:35 2001
@@ -2,12 +2,12 @@
 unavail
 avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane|CVSROOT
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto|phpweb
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern|php4/pear,pearweb,pear
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile|php4,php3,php31,phpfi
-avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,hholzgra|functable
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern|php4/pear,pearweb,pear
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez|php4,php3,php31,phpfi
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag

[PHP] Using one invocation of PHP executable to generate multiple pages?

2001-02-25 Thread Jim Lum

Hi,

I have PHP installed on a Win95 machine.  What I'd like to do is to use
a PHP page that will create multiple HTML pages.

I guess that I can execute PHP.EXE multiple times, but was thinking that
this means that it's going thru the overhead of starting up PHP.EXE each
time.  Is there any way to tell PHP.EXE to build multiple HTML pages,
i.e., kind of like a loop?

Jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Script not updating

2001-02-25 Thread Miles Thompson

Peter,

In case "AAA" When $submit is set, you will always get an an insert; you 
have a mysql_query executing.

In case "BBB" you are only assigning the SQL statement to $result, I didn't 
look further to see where it executes. It really doesn't matter because 
case "AAA" will always fire first.

Can you structure your flow so that, depending on your conditions you 
assign the SQL statement to a variable, such as $sql_string, and then at 
the end of your conditions execute $result = mysql_query( $sql_string ); ?

This also looks like a scenario where having a good hard look at using 
switch ... case .. break. I've really liked it for control structures 
involving buttons.

You may also want to consider redisplaying your input page with a flag 
identifying the missing or incorrect values. Julie Meloni has a very nice 
example of this at http://www.thickbook.com

Hope you are having lovely weather. Our forecast tonight is snow, followed 
by ice pellets, freezing rain, rain and then back to snow. All that's 
missing is the sunshine!

Regards - Miles Thompson

At 10:30 AM 2/26/01 +1100, Peter Houchin wrote:
>Could some one please have a look thru my code and tell me why it creates 
>a new record instead of updating the record?
>
>What this script is suposed to do is show a HTML form .. then once the 
>user fills it out it then shows another form which echo's the values 
>inputted in the first so the user can update if they made a mistake .. it 
>does everything right .. up until the user clicks on update ... where 
>instead of updating the record it creates a new one ..
>
>Any sussestions/Help would be greatful
>
>
>Peter Houchin
>Sun Rentals
>[EMAIL PROTECTED]
>
>$db = mysql_connect("localhost","root","password");
>  mysql_select_db("rentdb",$db);
>
>if ($submit){

"AAA"

>
>  $result = mysql_query("INSERT INTO app 
> (name,company,address,suburb,state,post,areacode,phone,faxareacode,fax,email,secret) 
> VALUES 
> 
>('$name','$company','$address','$suburb','$state','$post','$areacode','$phone','$faxareacode','$fax','$email','$secret')");
>
>  if($name){
>  $result="SELECT * FROM app WHERE name=$name";
>  if ($submit){
>
>  $result ="UPDATE app SET 
> 
>name='$name',company='$company',address='$address',suburb='$suburb',state='$state',post='$post',areacode='$areacode',phone='$phone',faxareacode='$faxareacode',fax='$fax',email='$email',secret='$secret'
> 
> WHERE name=$name";
>echo mysql_error();
>
>}



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Script not updating

2001-02-25 Thread Miles Thompson



The query flagged by if ($submit) will always fire first, and it appears 
you will always have a $name value as well. I believe it's actually firing 
twice in some scenarios - runs the insert and then immediately updates.

Will $submit contain different values? Then

switch ( $submit )
{
case "update":
 $sql = "update blah blah ";
   break;
case "new":
  $sql = "insert into blah blah ...";
   break;
 default:
  echo "No value to process for submit";
   unset( $sql );
}

if isset( $submit )
{
$result = mysql_query( $sql );
 and so forth ..
}

With this structure you can use an array to hold the value of your buttons, 
such as $action[ ], in which case the switch statement is "switch( 
$action[0] )"

Cheers - Miles


Miles

At 10:43 AM 2/26/01 +1100, Peter Houchin wrote:

>but that's why i've got the
>if($name){ 
>if($submit) ...
>
>
>clause in it .. thinking that if there was a name then update the record..
>otherwise create a new one
>-Original Message-
>From: Simon Garner [mailto:[EMAIL PROTECTED]]
>Sent: Monday, February 26, 2001 10:36 AM
>To: Peter Houchin; PHP MAIL GROUP
>Subject: Re: [PHP] Script not updating
>
>
>From: "Peter Houchin" <[EMAIL PROTECTED]>
>
>
> > Could some one please have a look thru my code and tell me why it creates
>a new record instead of updating the record?
> >
>
>[snip]
>
> >
> > if ($submit){
> >
> >  $result = mysql_query("INSERT INTO app
>(name,company,address,suburb,state,post,areacode,phone,faxareacode,fax,email
>,secret) VALUES
>('$name','$company','$address','$suburb','$state','$post','$areacode','$phon
>e','$faxareacode','$fax','$email','$secret')");
> >
>
>
>^^ Here's your culprit. Check your logic. Whenever they push submit it
>INSERTs a new record (I think...).
>
>
>Regards
>
>Simon Garner
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can't connect php to mysql on linux

2001-02-25 Thread eschmid+sic

On Mon, Feb 26, 2001 at 10:11:02AM +1030, David Robley wrote:
> On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> > Hi,
> >
> > I working on Redhat Linux 6.1 and I've installed
> > MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> > working fine. I've even created a database also using MySqlAdmin.
> > Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> > Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> > php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
> >
> > My problem is I can't connect PHP to Mysql Db using the
> > mysyql_connect("localhost","root","mypassword") command.
> >
> > Please help me asap.
> > Regards,
> > George
> 
> Use mysql_error() after your unsuccessful call to mysql_connect to return 
> a mysql error string

Hehe, this wouldn't work if the connect was unsuccessful. You can always
get an mysql error string after a successful call to mysql_connect. Look
into Paul DuBois book and it should be very clear.

-Egon

-- 
http://www.linuxtag.de/
http://php.net/books.php 
http://www.concert-band.de/
http://www.php-buch.de/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Script not updating

2001-02-25 Thread Peter Houchin


but that's why i've got the
if($name){ 
if($submit) ...


clause in it .. thinking that if there was a name then update the record..
otherwise create a new one
-Original Message-
From: Simon Garner [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 10:36 AM
To: Peter Houchin; PHP MAIL GROUP
Subject: Re: [PHP] Script not updating


From: "Peter Houchin" <[EMAIL PROTECTED]>


> Could some one please have a look thru my code and tell me why it creates
a new record instead of updating the record?
>

[snip]

>
> if ($submit){
>
>  $result = mysql_query("INSERT INTO app
(name,company,address,suburb,state,post,areacode,phone,faxareacode,fax,email
,secret) VALUES
('$name','$company','$address','$suburb','$state','$post','$areacode','$phon
e','$faxareacode','$fax','$email','$secret')");
>


^^ Here's your culprit. Check your logic. Whenever they push submit it
INSERTs a new record (I think...).


Regards

Simon Garner



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can't connect php to mysql on linux

2001-02-25 Thread David Robley

On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> Hi,
>
> I working on Redhat Linux 6.1 and I've installed
> MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> working fine. I've even created a database also using MySqlAdmin.
> Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
>
> My problem is I can't connect PHP to Mysql Db using the
> mysyql_connect("localhost","root","mypassword") command.
>
> Please help me asap.
> Regards,
> George

Use mysql_error() after your unsuccessful call to mysql_connect to return 
a mysql error string

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/midgard midgard.c

2001-02-25 Thread David Guerizec

davidg  Sun Feb 25 15:34:48 2001 EDT

  Modified files:  
/php4/ext/midgard   midgard.c 
  Log:
  force user to pass $xparam by reference (from mgd_walk_xxx_tree() functions)
  
  
Index: php4/ext/midgard/midgard.c
diff -u php4/ext/midgard/midgard.c:1.18 php4/ext/midgard/midgard.c:1.19
--- php4/ext/midgard/midgard.c:1.18 Sun Feb 25 11:31:17 2001
+++ php4/ext/midgard/midgard.c  Sun Feb 25 15:34:48 2001
@@ -1,4 +1,4 @@
-/* $Id: midgard.c,v 1.18 2001/02/25 19:31:17 davidg Exp $
+/* $Id: midgard.c,v 1.19 2001/02/25 23:34:48 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -751,22 +751,28 @@
zval ** xp = (zval **)xparam;
zval *return_value;
 
+   if(!PZVAL_IS_REF(xp[0])) {
+   /* DG: Do we force the user to pass it by reference ? */
+   php_error(E_WARNING,"You must pass the fourth parameter by 
+reference.");
+   return;
+   }
ALLOC_ZVAL(return_value);   ZVAL_NULL(return_value);
ALLOC_ZVAL(args[0]);ZVAL_LONG(args[0], id);
ALLOC_ZVAL(args[1]);ZVAL_LONG(args[1], level);
-   args[2] = xp[0];// DG: is this needed ? ->
-   zval_copy_ctor(args[2]);
+   args[2] = xp[0];// DG: is this needed ? 
+->zval_copy_ctor(args[2]);
 
if(call_user_function(CG(function_table), NULL,
  xp[1], return_value, 3,
  args) != SUCCESS) {
php_error(E_WARNING,"Unable to call %s() - function does not exist",
  (xp[1])->value.str.val);
+   zval_dtor(return_value);
+   zval_dtor(args[0]); zval_dtor(args[1]);
return;
}
+
zval_dtor(return_value);
-   zval_dtor(args[0]);
-   zval_dtor(args[1]);
+   zval_dtor(args[0]); zval_dtor(args[1]);
 }
 
 #if YOU_WANT_TO_TEST



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Script not updating

2001-02-25 Thread Simon Garner

From: "Peter Houchin" <[EMAIL PROTECTED]>


> Could some one please have a look thru my code and tell me why it creates
a new record instead of updating the record?
>

[snip]

>
> if ($submit){
>
>  $result = mysql_query("INSERT INTO app
(name,company,address,suburb,state,post,areacode,phone,faxareacode,fax,email
,secret) VALUES
('$name','$company','$address','$suburb','$state','$post','$areacode','$phon
e','$faxareacode','$fax','$email','$secret')");
>


^^ Here's your culprit. Check your logic. Whenever they push submit it
INSERTs a new record (I think...).


Regards

Simon Garner


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Simple String Replace Question

2001-02-25 Thread Simon Garner

From: "Jeff Oien" <[EMAIL PROTECTED]>

> That almost works. The two \n in a row are on new lines.
> So it's
> \n
> \n
> intead of \n\n. If that makes any sense.
> Jeff Oien


No, that doesn't make any sense whatsoever :)

A \n *is* a new line. I can only guess you're getting confused because
there's \r's as well as \n's in the string. Try this:




Or alternatively:




A CR is a carriage return, a LF is a line feed or newline. \r = CR, \n = LF.
Unix files use only LF (\n) for new lines, whereas MS DOS/Windows uses CRLF
(\r\n) and Mac uses just CR (\r).


Cheers

Simon Garner



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Script not updating

2001-02-25 Thread Peter Houchin

Could some one please have a look thru my code and tell me why it creates a new record 
instead of updating the record?

What this script is suposed to do is show a HTML form .. then once the user fills it 
out it then shows another form which echo's the values inputted in the first so the 
user can update if they made a mistake .. it does everything right .. up until the 
user clicks on update ... where instead of updating the record it creates a new one ..

Any sussestions/Help would be greatful


Peter Houchin
Sun Rentals
[EMAIL PROTECTED]

";
echo "";
echo "";
 
?> 
Please Check your information, and change any details that are not correct, then 
click update. if this information is correct click here";?>. 
   
  The 
information you entered is:
 Your 
Name: 
  Company: 
  Address: 
  Suburb: 
  State: 
  Post 
Code: 
  Phone:*>02>03>07>08 
  Fax:*>02>03>07>08 
  Email 
Address: 
Secret 
Word:**









\n";
}
} 
else {
 
 
 
?> 
   Name: 
   Company: 
   Address: 
  
Suburb:   
 
State:   ACT 
NSW NT 
QLD SA 
TAS VIC WA 
  Post 
Code: 
  Phone:* 
 02 03 

07 08   
  Fax:* 
 02 03 
07 08   
Email: 
 Secret 
word:** 
    
 
  * 
Please Include your area code with your phone & fax number. **Please 
include a secret word (maximum of 15 characters) for verification should you lose 
your password. 



RE: [PHP] Simple String Replace Question

2001-02-25 Thread Jeff Oien

That almost works. The two \n in a row are on new lines.
So it's
\n
\n
intead of \n\n. If that makes any sense.
Jeff Oien

> Or you could just do this:
> 
>  $str = "abc\ndefg\n\nxyzpqr\njklmno";
> $str = ereg_replace("([^\n])\n([^\n])", "\\1 \\2", $str);
> echo $str;
> ?>
> 
> That should give you:
> 
> abc defg\n\nxyzpqr jklmno
> 
> Works by replacing any \n with a space, as long as that \n is not next to
> another \n.
> 
> 
> Cheers
> 
> Simon Garner
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Simple String Replace Question

2001-02-25 Thread Chris Adams

On 25 Feb 2001 14:37:02 -0800, Jeff Oien <[EMAIL PROTECTED]> wrote:
>> On 25 Feb 2001 10:34:27 -0800, Jeff Oien <[EMAIL PROTECTED]> wrote:
>> >I would like to get rid of \n characters unless there
>> >are two or more in a row. So for example if there
>> 
>> The Perl-compatible regular expressions support lookahead and look behind:
>> 
>> $str = preg_replace("/(?
>Man, that went right over my head. Is there a description of
>how this works anywhere? Thanks for help in any case.

The Regular Expression part of the online PHP manual has a lot of information
(http://www.php.net/manual/en/ref.pcre.php) but it does tend to assume you
already know what you need to do.

Basically, the regular expression in there matches any "a" where the character
before isn't an "a" (?http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Maximum queries from a database?

2001-02-25 Thread James, Yz

Hi all,

I'm a little concerned as to how many times some of the scripts I've been
working on are querying a database:  Some are making up to 4 or 5 queries
each.  Should this give me any cause for concern?

I've only ever been unable to connect to the database once (other than
through script error), and that's when I was using a persistent connection.
So, I guess my question is, is there a recommended maximum number of queries
I should be working around? (MySQL).

Thanks,
James.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] so what program?

2001-02-25 Thread CC Zona

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Knasen) wrote:

> What I found out in my first mail to the list was..quit working with
> filmaker =). Sure, I can do that. But the question remains..what program
> WILL a macuser use to forfill the needs in MySQL/PHP?

Don't quit working with filemaker entirely.  It has many advantages, such 
being great for quick prototyping.  Just don't waste time trying to use FM 
as a web backend, 'cuz that gets ugly quick.  A Mac user can fulfill that 
need with MySQL/PHP  (or PostgresSQL/PHP) just fine.  I know of at least 
two options for doing this:

1) OS X
2) using one of the Linux distros for Mac (ex. LinuxPPC, YellowDogLinux, 
SuSe)

Both options are very cheap to try, and offer slightly different 
advantages, so no harm in trying out both.  Plan on setting aside 1GB or so 
for a Linux partition, for which you get a dual-boot Mac--giving you all 
the advantages of Mac PLUS all the advantages of Linux in one box.  Not 
bad, eh?

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Removing HTML codes using regexp

2001-02-25 Thread Simon Garner

From: "Toke Herkild" <[EMAIL PROTECTED]>

> What if I want to replace all html codes from a string ?
> I've tried using :
> 
> $myString = preg_replace('/<*>/, '', $myString);
> but that deletes all string... ( or everything from first '<' ) ...
> 
> Toke Herkild...
> 
> 



Try striptags()

http://php.net/striptags


Cheers

Simon Garner


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Removing HTML codes using regexp

2001-02-25 Thread Toke Herkild

What if I want to replace all html codes from a string ?
I've tried using :

$myString = preg_replace('/<*>/, '', $myString);
but that deletes all string... ( or everything from first '<' ) ...

Toke Herkild...






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Simple String Replace Question

2001-02-25 Thread Simon Garner

From: "Jeff Oien" <[EMAIL PROTECTED]>

> > On 25 Feb 2001 10:34:27 -0800, Jeff Oien <[EMAIL PROTECTED]> wrote:
> > >I would like to get rid of \n characters unless there
> > >are two or more in a row. So for example if there
> >
> > The Perl-compatible regular expressions support lookahead and look
behind:
> >
> > $str = 'abcdefabcaadd';
> > echo "$str\n";
> > $str = preg_replace("/(? > echo "$str\n";
> >
> > will display this:
> > abcdefabcaadd
> > -bcdef-bcaadd
>
> Man, that went right over my head. Is there a description of
> how this works anywhere? Thanks for help in any case.
> Jeff Oien
>


Or you could just do this:



That should give you:

abc defg\n\nxyzpqr jklmno

Works by replacing any \n with a space, as long as that \n is not next to
another \n.


Cheers

Simon Garner



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Simple String Replace Question

2001-02-25 Thread Jeff Oien

> On 25 Feb 2001 10:34:27 -0800, Jeff Oien <[EMAIL PROTECTED]> wrote:
> >I would like to get rid of \n characters unless there
> >are two or more in a row. So for example if there
> 
> The Perl-compatible regular expressions support lookahead and look behind:
> 
> $str = 'abcdefabcaadd';
> echo "$str\n";
> $str = preg_replace("/(? echo "$str\n";
> 
> will display this:
> abcdefabcaadd
> -bcdef-bcaadd

Man, that went right over my head. Is there a description of
how this works anywhere? Thanks for help in any case.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sockets...

2001-02-25 Thread Julia A . Case

Ok, I'm trying to open a socket connection to port 23 (telnet)...  the 
script just seems to hang on connect...  though I can connect and talk 
with ports 25 (smtp), port 80 (http), port 110 (pop3) and port 443 (https) 
so the code isn't too bad...  Is there something special about the telnet 
port?

Julia

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/ircg ircg.c

2001-02-25 Thread Sascha Schumann

sas Sun Feb 25 13:53:20 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c 
  Log:
  Provide improved means for mass joins
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.37 php4/ext/ircg/ircg.c:1.38
--- php4/ext/ircg/ircg.c:1.37   Sun Feb 25 10:16:42 2001
+++ php4/ext/ircg/ircg.cSun Feb 25 13:53:19 2001
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.37 2001/02/25 18:16:42 sas Exp $ */
+/* $Id: ircg.c,v 1.38 2001/02/25 21:53:19 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -52,6 +52,9 @@
FMT_MSG_SELF_PART,
FMT_MSG_NICK,
FMT_MSG_QUIT,
+   FMT_MSG_MASS_JOIN_BEGIN,
+   FMT_MSG_MASS_JOIN_ELEMENT,
+   FMT_MSG_MASS_JOIN_END,
NO_FMTS
 };
 
@@ -106,7 +109,10 @@
"",
"",
"%f changes nick to %t",
-   "%f quits (%m)"
+   "%f quits (%m)",
+   "Welcome",
+   " %f",
+   " in this very fine channel"
 };
 
 #define MSG(conn, type) \
@@ -180,7 +186,6 @@
int mode = 0;
smart_str encoded_msg = {0};
 
-   result->len = 0;
if (fmt[0] == '\0') {
return;
}
@@ -367,16 +372,25 @@
int i;
static smart_str m;
 
-   for (i = 0; i < nr; i++) {
+   if (nr > 1) {
m.len = 0;
-   format_msg(MSG(conn, FMT_MSG_JOIN), channel, NULL, users[i].c,
+   
+   format_msg(MSG(conn, FMT_MSG_MASS_JOIN_BEGIN), channel, NULL, NULL,
"", &m);
-   msg_send(conn, &m);
-   }
-
-   m.len = 0;
-   format_msg(MSG(conn, FMT_MSG_JOIN_LIST_END), channel, NULL, NULL,
+   for (i = 0; i < nr; i++) {
+   format_msg(MSG(conn, FMT_MSG_MASS_JOIN_ELEMENT), channel, NULL,
+   users[i].c, "", &m);
+   }
+   
+   format_msg(MSG(conn, FMT_MSG_MASS_JOIN_END), channel, NULL, NULL,
+   "", &m);
+   } else {
+   m.len = 0;
+   format_msg(MSG(conn, FMT_MSG_JOIN), channel, NULL, users[0].c,
+   "", &m);
+   format_msg(MSG(conn, FMT_MSG_JOIN_LIST_END), channel, NULL, NULL,
"", &m);
+   }
msg_send(conn, &m);
 }
 
@@ -395,6 +409,7 @@
php_irconn_t *conn = dummy;
static smart_str m;
 
+   m.len = 0;
format_msg(MSG(conn, FMT_MSG_SELF_PART), channel, NULL, conn->conn.username, 
"", &m);
msg_send(conn, &m);
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP CGI-Binary

2001-02-25 Thread Frank M. Kromann

IF you dont specify --with-apache or --with-apxs configure options you will build the 
CGI !

- Frank

>Ok, I give up...  how do I build PHP as a CGI-Binary?  I've spent two days 
>searching the configure file for this.
>
>Julia
>
>-- 
>[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
>[Programmer at large] [  but is that what ships are really for.]  
>[   Admining Linux  ] [   To thine own self be true.   ]
>[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
>  
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP CGI-Binary

2001-02-25 Thread Julia A . Case

Ok, I give up...  how do I build PHP as a CGI-Binary?  I've spent two days 
searching the configure file for this.

Julia

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PhpLib Template Not Parsing

2001-02-25 Thread Kyndig

Afternoon All,

  Been running through archives and posts throughout the net.
Hopin ta find an answer. Looks like the questions been asked,
but no public answer has been made.

  I'm using PhpLib's Template code. ( just pulled the file and
modified it a minor bit ) The problem I'm having is when I create
a dynamic page with the Template class, any php within that
page is not being parsed by the webserver. If you visit:
http://www.kyndig.com/listings  and look at the page source,
you'll see the php code to call the banner code in. Any pointers
in how to go about fixing this is much appreciated.

-- 
Kind Regards,
---
Kyndig
Online Text Game Resource Site:  http://www.kyndig.com
ICQ#10451240


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/midgard article.c midgard.c page.c topic.c

2001-02-25 Thread David Guerizec

davidg  Sun Feb 25 11:31:17 2001 EDT

  Modified files:  
/php4/ext/midgard   article.c midgard.c page.c topic.c 
  Log:
  optimized the mgd_is_in_xxx_tree() functions
  
  
Index: php4/ext/midgard/article.c
diff -u php4/ext/midgard/article.c:1.8 php4/ext/midgard/article.c:1.9
--- php4/ext/midgard/article.c:1.8  Sat Feb 24 05:39:30 2001
+++ php4/ext/midgard/article.c  Sun Feb 25 11:31:17 2001
@@ -1,4 +1,4 @@
-/* $Id: article.c,v 1.8 2001/02/24 13:39:30 davidg Exp $
+/* $Id: article.c,v 1.9 2001/02/25 19:31:17 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -32,7 +32,6 @@
 MGD_FUNCTION(is_article_in_topic_tree)
 {
zval **root, **article;
-   int *ids, id, i;
 
RETVAL_FALSE;
CHECK_MGD;
@@ -57,17 +56,10 @@
return;
 #endif
 
-   ids = mgd_tree(mgd_handle(), "topic", "up", (*root)->value.lval, 0, NULL);
-   if (ids) {
-   id = mgd_idfield(mgd_handle(), "topic", "article",
-  (*article)->value.lval);
-   for (i = 0; ids[i]; i++)
-   if (ids[i] == id) {
-   free(ids);
-   RETURN_TRUE;
-   }
-   free(ids);
-   }
+   if(mgd_is_in_tree(mgd_handle(), "topic", "up", (*root)->value.lval,
+   mgd_idfield(mgd_handle(), "topic", "article",
+   (*article)->value.lval)))
+   RETURN_TRUE;
 }
 
 const char *article_sort(const char *order)
Index: php4/ext/midgard/midgard.c
diff -u php4/ext/midgard/midgard.c:1.17 php4/ext/midgard/midgard.c:1.18
--- php4/ext/midgard/midgard.c:1.17 Sat Feb 24 13:12:11 2001
+++ php4/ext/midgard/midgard.c  Sun Feb 25 11:31:17 2001
@@ -1,4 +1,4 @@
-/* $Id: midgard.c,v 1.17 2001/02/24 21:12:11 davidg Exp $
+/* $Id: midgard.c,v 1.18 2001/02/25 19:31:17 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -374,7 +374,7 @@
MGDLS_FETCH();

/* set apache log facilities available to the library */
-   // mgd_set_log_debug_func(mgd_log_debug);
+   mgd_set_log_debug_func(mgd_log_debug);
 
midgard_module = ap_find_linked_module("mod_midgard.c");
if (!midgard_module) {
@@ -754,7 +754,8 @@
ALLOC_ZVAL(return_value);   ZVAL_NULL(return_value);
ALLOC_ZVAL(args[0]);ZVAL_LONG(args[0], id);
ALLOC_ZVAL(args[1]);ZVAL_LONG(args[1], level);
-   args[2] = xp[0];// DG: is this needed ? -> 
zval_copy_ctor(args[2]);
+   args[2] = xp[0];// DG: is this needed ? ->
+   zval_copy_ctor(args[2]);
 
if(call_user_function(CG(function_table), NULL,
  xp[1], return_value, 3,
Index: php4/ext/midgard/page.c
diff -u php4/ext/midgard/page.c:1.8 php4/ext/midgard/page.c:1.9
--- php4/ext/midgard/page.c:1.8 Sat Feb 24 05:42:00 2001
+++ php4/ext/midgard/page.c Sun Feb 25 11:31:17 2001
@@ -1,4 +1,4 @@
-/* $Id: page.c,v 1.8 2001/02/24 13:42:00 davidg Exp $
+/* $Id: page.c,v 1.9 2001/02/25 19:31:17 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -70,7 +70,6 @@
 MGD_FUNCTION(is_in_page_tree)
 {
 zval **root, **page;
-int *ids, i;
 
 RETVAL_FALSE;
CHECK_MGD;
@@ -90,15 +89,9 @@
if(!mgd_exists_id(mgd_handle(), "page", "id=$d", (*root)->value.lval))
RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
 
-ids = mgd_tree(mgd_handle(), "page", "up", (*root)->value.lval, 0, NULL);
-   if (ids) {
-   for (i = 0; ids[i]; i++)
-   if (ids[i] == (*page)->value.lval) {
-   free(ids);
-   RETURN_TRUE;
-   }
-   free(ids);
-   }
+if(mgd_is_in_tree(mgd_handle(), "page", "up",
+   (*root)->value.lval, 
+(*page)->value.lval))
+   RETURN_TRUE;
 }
 
 MGD_FUNCTION(get_page)
Index: php4/ext/midgard/topic.c
diff -u php4/ext/midgard/topic.c:1.8 php4/ext/midgard/topic.c:1.9
--- php4/ext/midgard/topic.c:1.8Sat Feb 24 05:39:30 2001
+++ php4/ext/midgard/topic.cSun Feb 25 11:31:17 2001
@@ -1,4 +1,4 @@
-/* $Id: topic.c,v 1.8 2001/02/24 13:39:30 davidg Exp $
+/* $Id: topic.c,v 1.9 2001/02/25 19:31:17 davidg Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -103,7 +103,7 @@
 MGD_FUNCTION(is_in_topic_tree)
 {
zval **root, **topi

Re: [PHP] Simple String Replace Question

2001-02-25 Thread Chris Adams

On 25 Feb 2001 10:34:27 -0800, Jeff Oien <[EMAIL PROTECTED]> wrote:
>I would like to get rid of \n characters unless there
>are two or more in a row. So for example if there

The Perl-compatible regular expressions support lookahead and look behind:

$str = 'abcdefabcaadd';
echo "$str\n";
$str = preg_replace("/(?http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] isset()

2001-02-25 Thread Joe Stump

empty() fails when $var == 0

--Joe

On Sun, Feb 25, 2001 at 10:50:15AM -0800, Chris Adams wrote:
> On 25 Feb 2001 00:01:30 -0800, Mark Maggelet <[EMAIL PROTECTED]> wrote:
> >On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger 
> >([EMAIL PROTECTED]) wrote:
> >>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
> >>> in my preceding email I've written:
> >>>
> >>> if($var!='')
> >>>
> >>> will fix your all your worries without an intervention of a 
> >strings
> >>> function.
> >>
> >>Except that it will throw a warning in PHP4 if $var is not set.
> >>=> isset () should be used.
> >
> >man, this is like the thread that will not die. isset() will return 
> >true for an empty string, which is not what he wants. the right thing 
> >to do is use
> >
> >if((isset($var))&&($var!=""))
> 
> Isn't this a bit more legible:
> 
> if (!empty($var))
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Plugin Detection with PHP?

2001-02-25 Thread Chris Adams

On 25 Feb 2001 04:37:21 -0800, Andy Clarke <[EMAIL PROTECTED]> wrote:
>Is there a way to use PHP to tell whether a user's browser has a particular
>plugin?
...
>I know that this can be done using Javascript, but as this can be turned
>off by the user etc, it seemed as though it would be more reliable to do it
>server side (if it is possible).

No, it's not possible. The safest approach is to assume the user doesn't have a
plugin and then use JavaScript to enable a plugin. In certain cases, there are
plugin specific tricks you could play in a detection script (e.g. QuickTime
allows a QTSRC attribute which overrides the SRC value - SRC="somefile"
QTSRC="plugin_check.php?HasQT=1&filename=somefile"). For the rest, you'll need
to use JavaScript.

This is complicated by the way Microsoft broke Netscape's plugins object - on
netscape, you can iterate over that list very easily. IE has the object, but
it's always empty. (You can use VBScript to attempt to create an object of that
class and then trap the error if it fails, but that's not particularly elegant)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] isset()

2001-02-25 Thread Chris Adams

On 25 Feb 2001 00:01:30 -0800, Mark Maggelet <[EMAIL PROTECTED]> wrote:
>On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger 
>([EMAIL PROTECTED]) wrote:
>>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
>>> in my preceding email I've written:
>>>
>>> if($var!='')
>>>
>>> will fix your all your worries without an intervention of a 
>strings
>>> function.
>>
>>Except that it will throw a warning in PHP4 if $var is not set.
>>=> isset () should be used.
>
>man, this is like the thread that will not die. isset() will return 
>true for an empty string, which is not what he wants. the right thing 
>to do is use
>
>if((isset($var))&&($var!=""))

Isn't this a bit more legible:

if (!empty($var))

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Unwanted Characters

2001-02-25 Thread Chris Adams

On 24 Feb 2001 21:31:33 -0800, Clayton Dukes <[EMAIL PROTECTED]> wrote:
>How do I remove unwanted/unprintable characters from a variable?
>
>$sometext =3D "Th=C0e c=D8ar r=F6=F8an over m=D6y dog"
>needs to be filtered and reprinted as:
>"The car ran over my dog"

Strip everything which isn't in the list of allowed characters:
eregi_replace("[^[:alpha:]]", "", $sometext)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Temporarily turning off magic quotes?

2001-02-25 Thread Chris Adams

On 25 Feb 2001 09:15:08 -0800, Philip Olson <[EMAIL PROTECTED]> wrote:
>>  ini_set ('magic_quotes_gpc',  'off'); 
>
>This will not work, ini_set cannot mess with magic_quotes setting,

More precisely, it can change the setting but your PHP code will be executed
after the magic quotes work has already completed.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Simple String Replace Question

2001-02-25 Thread Jeff Oien

I would like to get rid of \n characters unless there
are two or more in a row. So for example if there
is a long email formatted like we do here with
line break I want to remove the line breaks so 
text can be wrapped by a browser, but also show
paragraph breaks where necessary. This is what
I have:
$string_new = str_replace("\n", "", $string);
How can I augment this to not replace:
\n
\n
Thanks.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/ircg ircg.c php_ircg.h

2001-02-25 Thread Sascha Schumann

sas Sun Feb 25 10:16:42 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c php_ircg.h 
  Log:
  Add function for kick and topic
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.36 php4/ext/ircg/ircg.c:1.37
--- php4/ext/ircg/ircg.c:1.36   Sat Feb 24 12:37:19 2001
+++ php4/ext/ircg/ircg.cSun Feb 25 10:16:42 2001
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.36 2001/02/24 20:37:19 sas Exp $ */
+/* $Id: ircg.c,v 1.37 2001/02/25 18:16:42 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -64,6 +64,8 @@
PHP_FE(ircg_part, NULL)
PHP_FE(ircg_msg, NULL)
PHP_FE(ircg_nick, NULL)
+   PHP_FE(ircg_topic, NULL)
+   PHP_FE(ircg_kick, NULL)
PHP_FE(ircg_disconnect, NULL)
PHP_FE(ircg_is_conn_alive, NULL)
PHP_FE(ircg_lookup_format_messages, NULL)
@@ -496,6 +498,51 @@

irc_join(&conn->conn, Z_STRVAL_PP(p2), NULL,  conn);
RETVAL_TRUE;
+}
+
+PHP_FUNCTION(ircg_topic)
+{
+#if defined(IRCG_API_VERSION) && IRCG_API_VERSION >= 20010226
+   zval **p1, **p2, **p3;
+   php_irconn_t *conn;
+
+   if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &p1, &p2, &p3) == 
+FAILURE)
+   WRONG_PARAM_COUNT;
+
+   convert_to_long_ex(p1);
+   convert_to_string_ex(p2);
+   convert_to_string_ex(p3);
+
+   conn = lookup_irconn(Z_LVAL_PP(p1));
+
+   if (!conn) RETURN_FALSE;
+   
+   irc_handle_command(&conn->conn, "TOPIC", 2, Z_STRVAL_PP(p2), Z_STRVAL_PP(p3));
+   RETVAL_TRUE;
+#endif
+}
+
+PHP_FUNCTION(ircg_kick)
+{
+#if defined(IRCG_API_VERSION) && IRCG_API_VERSION >= 20010226
+   zval **p1, **p2, **p3, **p4;
+   php_irconn_t *conn;
+
+   if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &p1, &p2, &p3, &p4) == 
+FAILURE)
+   WRONG_PARAM_COUNT;
+
+   convert_to_long_ex(p1);
+   convert_to_string_ex(p2);
+   convert_to_string_ex(p3);
+   convert_to_string_ex(p4);
+
+   conn = lookup_irconn(Z_LVAL_PP(p1));
+
+   if (!conn) RETURN_FALSE;
+   
+   irc_handle_command(&conn->conn, "KICK", 3, Z_STRVAL_PP(p2), Z_STRVAL_PP(p3), 
+Z_STRVAL_PP(p4));
+   RETVAL_TRUE;
+#endif
 }
 
 PHP_FUNCTION(ircg_part)
Index: php4/ext/ircg/php_ircg.h
diff -u php4/ext/ircg/php_ircg.h:1.4 php4/ext/ircg/php_ircg.h:1.5
--- php4/ext/ircg/php_ircg.h:1.4Sat Feb 17 00:30:10 2001
+++ php4/ext/ircg/php_ircg.hSun Feb 25 10:16:42 2001
@@ -36,6 +36,8 @@
 PHP_FUNCTION(ircg_register_current_conn);
 PHP_FUNCTION(ircg_msg);
 PHP_FUNCTION(ircg_nick);
+PHP_FUNCTION(ircg_kick);
+PHP_FUNCTION(ircg_topic);
 PHP_FUNCTION(ircg_disconnect);
 PHP_FUNCTION(ircg_is_conn_alive);
 PHP_FUNCTION(ircg_lookup_format_messages);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] incrementing a date!

2001-02-25 Thread Philip Olson


> ex: 2001-03-28 'll become 2001-04-01

Here's an example (a hack) which may help you get going :


 print getFutureDate('2001-03-28',4); // 2001-04-01

 function getFutureDate($date,$days,$format='Y-m-d')
 {
 list($year,$month,$day) = explode('-', $date);

 $timestamp = mktime(0,0,0, $month, $day, $year); 

 $secs = ($days * 86400);

 return date($format,$timestamp+$secs);
 }


Regards,


Philip Olson
http://www.cornado.com/

On Sun, 25 Feb 2001, kaab kaoutar wrote:

> Hi all!
> s there a way with which we can increment a date (by day) without extracting 
> the month the day and the year then increment some of them depending on the 
> day the month and the year ?
> ex: 2001-03-28 'll become 2001-04-01
> 
> Thanks
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Temporarily turning off magic quotes?

2001-02-25 Thread Philip Olson


> you can use:
> 
> if($REQUEST_METHOD=='GET' or $REQUEST_METHOD=='POST')
>   ini_set ('magic_quotes_gpc',  'off'); 

This will not work, ini_set cannot mess with magic_quotes setting,
.htaccess is the prime option for temporarily changing this setting, as
per the example provided by Zeev.


Regards,


Philip Olson
http://www.cornado.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 25 Feb 2001 16:56:03 -0000 Issue 533

2001-02-25 Thread php-general-digest-help


php-general Digest 25 Feb 2001 16:56:03 - Issue 533

Topics (messages 41542 through 41592):

Re: Detecting JavaScript
41542 by: Mitchell Hagerty
41544 by: Mitchell Hagerty
41588 by: Trevor DeVore

Re: Temporarily turning off magic quotes?
41543 by: Zeev Suraski
41560 by: mwaples.waples.net
41574 by: PHPBeginner.com

Unwanted Characters
41545 by: Clayton Dukes
41546 by: Joe Stump
41555 by: CC Zona
41558 by: mwaples.waples.net
41575 by: PHPBeginner.com
41589 by: Clayton Dukes

php and apache 2.0
41547 by: jeremy.netwyred.com

Escaping double quotes?
41548 by: Ben Cheng
41549 by: Joe Stump

MYSQL HELP!!!
41550 by: Felipe Lopes

extract() help
41551 by: Jaxon
41553 by: CC Zona

Re: session_register in function
41552 by: Jeff Lacy
41569 by: PHPBeginner.com

really weird html - was "extract() help"
41554 by: Jaxon
41556 by: Jaxon

Re: Cookie References?
41557 by: mwaples.waples.net
41571 by: PHPBeginner.com

Re: isset()
41559 by: Mark Maggelet
41561 by: Joe Stump
41576 by: PHPBeginner.com
41577 by: Christian Reiniger

Join causing Error?
41562 by: Keith Spiller
41566 by: CC Zona
41568 by: Chris Adams

Implode?
41563 by: Kenneth R Zink II

How do I submit a POST form?
41564 by: Alexis Michel Golzman

php.ini
41565 by: Brandon Feldhahn

Re: PHP4 install question
41567 by: Michael Hall

Re: DIsplaying page before script finnished
41570 by: PHPBeginner.com

Re: php_self
41572 by: PHPBeginner.com

Re: comparing numbers
41573 by: PHPBeginner.com

incrementing  a date!
41578 by: kaab kaoutar
41583 by: Web Admin

session_start
41579 by: kaab kaoutar

Plugin Detection with PHP?
41580 by: Andy Clarke

No same username
41581 by: Brandon Feldhahn
41584 by: Web Admin
41585 by: Kath
41587 by: Web Admin

Re: [PHP-DEV] No same username
41582 by: André Langhorst

Re: crontab help
41586 by: Joe Stump

so what program?
41590 by: Knasen

Re: [PHP-DB] Join causing Error?
41591 by: Bob Hall

Re: [PHP-DB] Re: [PHP] No same username
41592 by: Scott Bernard

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--



I think phpclient sniffer can do that...

found here: http://www.php.net/manual/en/ref.imap.php

mitch

- Original Message -
From: Jochen K?chelin <[EMAIL PROTECTED]>
Date: Saturday, February 24, 2001 10:37 pm
Subject: [PHP] Detecting JavaScript

> Who can give me a PHP-Script to
> detect if JavaScript is enabled?
> 
> It should work with both, IE and NN!
> 
> thanks
> 
> --
> Ihr WEBberater
> Stuttgarter Str.3, D-73033 Göppingen
> Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> http://www.wa-p.de ** mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>






wps didn't check to see what was in my paste buffer

sorry: http://www.asphyxia.com/

mitch

- Original Message -
From: Ed Lazor <[EMAIL PROTECTED]>
Date: Saturday, February 24, 2001 11:12 pm
Subject: Re: [PHP] Detecting JavaScript

> I couldn't find anything about phpclient sniffer on that page.  Is 
> that the 
> right page?
> 
> -Ed
> 
> At 10:54 PM 2/24/2001 -0600, you wrote:
> >I think phpclient sniffer can do that...
> >
> >found here: http://www.php.net/manual/en/ref.imap.php
> >
> >mitch
> >
> >- Original Message -
> >From: Jochen K?chelin <[EMAIL PROTECTED]>
> >Date: Saturday, February 24, 2001 10:37 pm
> >Subject: [PHP] Detecting JavaScript
> >
> > > Who can give me a PHP-Script to
> > > detect if JavaScript is enabled?
> > >
> > > It should work with both, IE and NN!
> > >
> > > thanks
> > >
> > > --
> > > Ihr WEBberater
> > > Stuttgarter Str.3, D-73033 Göppingen
> > > Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> > > http://www.wa-p.de ** mailto:[EMAIL PROTECTED]
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: php-list-
> > > [EMAIL PROTECTED]
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>





PHP won't be able to tell you if 

[PHP] RE: [PHP-DB] Re: [PHP] No same username

2001-02-25 Thread Scott Bernard

There is something called constraints in the database (generally).
You have to set that field in the database, to unique, or make a "unique"
index on that field.

regards.

idsarts.

-Mensaje original-
De: Web Admin [mailto:[EMAIL PROTECTED]]
Enviado el: Domingo, 25 de Febrero de 2001 10:26 a.m.
Para: Brandon Feldhahn; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Asunto: [PHP-DB] Re: [PHP] No same username


define a UNIQUE field :)

  - Original Message -
  From: Brandon Feldhahn
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ;
[EMAIL PROTECTED]
  Sent: Sunday, February 25, 2001 4:03 PM
  Subject: [PHP] No same username


  how do i make somthing with my database that knows it the username
  entered is already a name in use?


  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: CVSROOT / avail gen_acl_file.m4

2001-02-25 Thread Rasmus Lerdorf

rasmus  Sun Feb 25 08:43:12 2001 EDT

  Modified files:  
/CVSROOTavail gen_acl_file.m4 
  Log:
  gtk karma for jan
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.101 CVSROOT/avail:1.102
--- CVSROOT/avail:1.101 Sat Feb 24 11:53:41 2001
+++ CVSROOT/avail   Sun Feb 25 08:43:12 2001
@@ -8,7 +8,7 @@
 avail|rasmus,sterling,jimw|pres
 
avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly|phpdoc
-avail|andrei,fmk,zimt|php-gtk
+avail|andrei,fmk,zimt,jan|php-gtk
 avail|emile,davidg,alan_k,ab|php4/ext/midgard
 avail|rasmus|php4/ext/aspell
 avail|andi|php4/ext/bcmath
Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.105 CVSROOT/gen_acl_file.m4:1.106
--- CVSROOT/gen_acl_file.m4:1.105   Sat Feb 24 11:53:41 2001
+++ CVSROOT/gen_acl_file.m4 Sun Feb 25 08:43:12 2001
@@ -24,7 +24,7 @@
 avail|php_pres|pres
 avail|php_qa|qaweb
 avail|php_dev,php_ext,php_doc|phpdoc
-avail|andrei,fmk,zimt|php-gtk
+avail|andrei,fmk,zimt,jan|php-gtk
 avail|php_midgard|php4/ext/midgard
 dnl Access to individual dirs in the code tree
 avail|rasmus|php4/ext/aspell



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] Join causing Error?

2001-02-25 Thread Bob Hall

Sir, I don't see anything wrong with the syntax in your query. If I 
haven't over looked something, and if you haven't misspelled 
anything, then you have a data problem. Since your first query 
returns a Cartesian product, you should get something if the WHERE 
clause returns >= 1 row for each table. So either there are no rows 
in q that meet the conditions
q.active = '1' AND q.global = '1'
or there are no rows in c that meet the condition
c.active = '1'
Run the first query with only the first WHERE condition. If you get 
rows, add the second condition. If that works, add the third. The 
point at which the query stops returning rows is the point at which a 
subset of your WHERE conditions  aren't met by the any of the rows in 
one of the tables.

BTW, why are you putting quotes around numbers? I'm assuming that's 
not the problem, since you say you did it in the query that worked, 
but I don't see the point.

Bob Hall

>Can anyone tell me why this:
>   Line 282mysql_select_db("centraldb",$db);
>   Line 283$qorder++;
>   Line 284$result = mysql_query("SELECT q.questid, q.question, 
>q.answer, q.qorder, q.depart, q.catid,
>   q.active, q.global, q.adate, q.author, 
>q.authoremail, q.askemail, c.catid, c.category, c.under,
>   c.corder, c.active FROM central_groupfaqq q, 
>central_groupfaqcat c WHERE q.active = '1' AND
>   q.global = '1' AND c.active = '1' ORDER BY 
>c.under, c.order, q.qorder",$db);
>   Line 285while ($myrow = mysql_fetch_row($result))
>
>Would cause this error:
>   Warning: Supplied argument is not a valid MySQL result resource in 
>faqbody.php3 on line 285
>
>When changing the same SELECT statement to:
>   Line 284$result = mysql_query("SELECT * FROM central_groupfaqq 
>WHERE active = '1' ORDER BY
>qorder",$db);
>
>Works perfectly?
>
>
>Keith Spiller
>a.k.a. Larentium

Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] so what program?

2001-02-25 Thread Knasen

Ok..

What I found out in my first mail to the list was..quit working with
filmaker =). Sure, I can do that. But the question remains..what program
WILL a macuser use to forfill the needs in MySQL/PHP?

_
knasen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Unwanted Characters

2001-02-25 Thread Clayton Dukes


This doesn't seem to work, have I done something wrong?



$sometext = "ThÀe cØar röøan over mÖy dog\n";
   $thread =  ereg_replace("[^[:alnum:][:space:]]", "", $sometext);
   echo $thread;

still prints:
ThÀe cØar röøan over mÖy dog


Thanks,
Clayton


- Original Message -
From: <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>
Sent: Sunday, February 25, 2001 2:28 AM
Subject: Re: [PHP] Unwanted Characters


> Clayton Dukes wrote:
> >
> > How do I remove unwanted/unprintable characters from a variable?
> >
> > $sometext = "ThÀe cØar röøan over mÖy dog"
> > needs to be filtered and reprinted as:
> > "The car ran over my dog"
> >
> > Thanks :-)
> > Clayton Dukes
>
>  $sometext = "ThÀe cØar röøan over mÖy dog";
> $thread =  ereg_replace("[^[:alnum:][:space:]]", "", $sometext);
> echo $thread
> ?>
>
> will print what you asked - of course you may not want numbers but you
> get the idea.
> I do this check on all my user inputs to php scripts- I choose what is
> allowed not what to deny which makes it easier.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Detecting JavaScript

2001-02-25 Thread Trevor DeVore

PHP won't be able to tell you if JavaScript is enabled or not.  PHP can 
only determine what version of JavaScript is supported based on the browser 
information provided in HTTP_USER_AGENT.


Trevor DeVore
Blue Mango Multimedia



> > >
> > > > Who can give me a PHP-Script to
> > > > detect if JavaScript is enabled?
> > > >
> > > > It should work with both, IE and NN!
> > > >
> > > > thanks
> > > >
> > > > --
> > > > Ihr WEBberater
> > > > Stuttgarter Str.3, D-73033 Göppingen
> > > > Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598
> > > > http://www.wa-p.de ** mailto:[EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] No same username

2001-02-25 Thread Web Admin

Or better using:

create table test1 (t1 char(5), t2 char(5), primary key (t1), unique (t2)); 

when creating table. No duplicate records with the same t2 because it's unique.

Ahmad Anvari
  - Original Message - 
  From: Kath 
  To: Brandon Feldhahn ; [EMAIL PROTECTED] 
  Sent: Sunday, February 25, 2001 6:19 PM
  Subject: Re: [PHP] No same username


  
   $sql = "SELECT username FROM main_users WHERE username = '$username'";

   $result = mysql_query($sql);

   $num = mysql_numrows($result);

   if ($num > "0") { die ("That username already exists, please chose
  another"); }
  -
  That could do it :)

  - Kath

  - Original Message -
  From: "Brandon Feldhahn" <[EMAIL PROTECTED]>
  To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
  <[EMAIL PROTECTED]>
  Sent: Sunday, February 25, 2001 7:33 AM
  Subject: [PHP] No same username


  > how do i make somthing with my database that knows it the username
  > entered is already a name in use?
  >
  >
  > --
  > PHP General Mailing List (http://www.php.net/)
  > To unsubscribe, e-mail: [EMAIL PROTECTED]
  > For additional commands, e-mail: [EMAIL PROTECTED]
  > To contact the list administrators, e-mail: [EMAIL PROTECTED]
  >


  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]





Re: [PHP] crontab help

2001-02-25 Thread Joe Stump

Didn't you just ask this a few days ago?

In your while loop put a sleep(300) which will sleep for 300 seconds after
processing X amount of emails.

--Joe

On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote:
> hi there.
> 
> is there a way to tell crontab to do:
> 
> "run script every 5 mins for 1 hour"..
> 
> i have this mass email script that is so huge that i need it to chunk into
> records and make sure that it will run every 5 mins for 1 hour.
> 
> Thanks for any help.
> 

-- 

---
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
---


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] No same username

2001-02-25 Thread Kath


 $sql = "SELECT username FROM main_users WHERE username = '$username'";

 $result = mysql_query($sql);

 $num = mysql_numrows($result);

 if ($num > "0") { die ("That username already exists, please chose
another"); }
-
That could do it :)

- Kath

- Original Message -
From: "Brandon Feldhahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, February 25, 2001 7:33 AM
Subject: [PHP] No same username


> how do i make somthing with my database that knows it the username
> entered is already a name in use?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] No same username

2001-02-25 Thread Web Admin

define a UNIQUE field :)

  - Original Message - 
  From: Brandon Feldhahn 
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Sunday, February 25, 2001 4:03 PM
  Subject: [PHP] No same username


  how do i make somthing with my database that knows it the username
  entered is already a name in use?


  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]





Re: [PHP] incrementing a date!

2001-02-25 Thread Web Admin

hi,
try $tomorrow  = mktime(0,0,0,date("m")  ,date("d")+1,date("Y"));
or maybe better than this, if you convert the date to the standard
unix timestamp and use DATE function.
Best of luck,
Ahmad Anvari
  - Original Message - 
  From: kaab kaoutar 
  To: [EMAIL PROTECTED] 
  Sent: Sunday, February 25, 2001 2:36 PM
  Subject: [PHP] incrementing a date!


  Hi all!
  s there a way with which we can increment a date (by day) without extracting 
  the month the day and the year then increment some of them depending on the 
  day the month and the year ?
  ex: 2001-03-28 'll become 2001-04-01

  Thanks
  _
  Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]





[PHP] Re: [PHP-DEV] No same username

2001-02-25 Thread André Langhorst

Brandon Feldhahn wrote:

> how do i make somthing with my database that knows it the username
> entered is already a name in use?

please do not cross-post!!!
it is sufficient to post it to _one_ mailing list (php-general)

thanks


-- 
· André Langhorstt: +49 331 5811560 ·
· [EMAIL PROTECTED]  m: +49 173 9558736 ·
* PHP Quality Assurance  http://qa.php.net  *


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] No same username

2001-02-25 Thread Brandon Feldhahn

how do i make somthing with my database that knows it the username
entered is already a name in use?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Plugin Detection with PHP?

2001-02-25 Thread Andy Clarke

Is there a way to use PHP to tell whether a user's browser has a particular
plugin?

I thought that the $HTTP_ACCEPT variable might have this type of
information, but in a little test that I have done, it just returns "*/*".

I know that this can be done using Javascript, but as this can be turned
off by the user etc, it seemed as though it would be more reliable to do it
server side (if it is possible).


Thanks

Andy Clarke




 
   Andy Clarke
  78 West Kensington Court, Edith Villas,
 London, England  W14 9AB

phone:  44 (0)20 7602 3382
  mobile:  07947 418177

  Freelance Lingo/PHP Programmer

 [EMAIL PROTECTED]
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] session_start

2001-02-25 Thread kaab kaoutar

hi!
do we have to use in each page using the data of a session the 
session-start()?
cause in the manual it says that session_start -- Initialize session data 
and session_start() creates a session ?!
thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] incrementing a date!

2001-02-25 Thread kaab kaoutar

Hi all!
s there a way with which we can increment a date (by day) without extracting 
the month the day and the year then increment some of them depending on the 
day the month and the year ?
ex: 2001-03-28 'll become 2001-04-01

Thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] isset()

2001-02-25 Thread Christian Reiniger

On Sunday 25 February 2001 09:01, Mark Maggelet wrote:

> >> if($var!='')
> >>
> >> will fix your all your worries without an intervention of a

> >Except that it will throw a warning in PHP4 if $var is not set.
> >=> isset () should be used.
>
> man, this is like the thread that will not die. isset() will return
> true for an empty string, which is not what he wants. the right thing
> to do is use
>
> if((isset($var))&&($var!=""))

I never said *only* isset() should be used :)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] isset()

2001-02-25 Thread PHPBeginner.com

100% agreed!

this makes much more sense then any of us was saying before.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Mark Maggelet [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 5:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger 
([EMAIL PROTECTED]) wrote:
>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
>> in my preceding email I've written:
>>
>> if($var!='')
>>
>> will fix your all your worries without an intervention of a 
strings
>> function.
>
>Except that it will throw a warning in PHP4 if $var is not set.
>=> isset () should be used.

man, this is like the thread that will not die. isset() will return 
true for an empty string, which is not what he wants. the right thing 
to do is use

if((isset($var))&&($var!=""))

the isset on the left gets evaluated first so a warning is never 
thrown. to be even safer, you can go:

if((isset($var))&&(trim($var)!=""))

you do not want to use strlen() for the following reasons:
1) makes code unreadable -> very sloppy
2) overhead
3) it will give a warning when $var is not set (error_reporting 15 
only).



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Unwanted Characters

2001-02-25 Thread PHPBeginner.com

use eregi_replace("[asutk]+", '', $string)

in this way there will be no such letters as a,s,u,t,k in $string




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 2:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Unwanted Characters



How do I remove unwanted/unprintable characters from a variable?

$sometext = "ThÀe cØar röøan over mÖy dog"
needs to be filtered and reprinted as:
"The car ran over my dog"




Thanks :-)
Clayton Dukes



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Temporarily turning off magic quotes?

2001-02-25 Thread PHPBeginner.com

you can use:

if($REQUEST_METHOD=='GET' or $REQUEST_METHOD=='POST')
ini_set ('magic_quotes_gpc',  'off'); 




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Ben Cheng [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Temporarily turning off magic quotes?


If I have magic quotes turned on for post/get/etc. in my php.ini, is 
there any way to temporarily turn it off for one page?  For example, 
I have a preview page inbetween my data entry page and the page that 
actually saves to db.  I don't want magic quotes turned on when going 
from the data entry to the preview page since all quotes keep getting 
backslashed.  Is there a way to do this?

-Ben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] comparing numbers

2001-02-25 Thread PHPBeginner.com

$id = ($id<=59) ? $id=81 : false;

or the traditional way:

if($id<=59) {
   $id=81;
}


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] comparing numbers



How can I do something like the following shell script, in PHP? (I know this
won't work normally, but you get the idea).

if [ $id <= 59 ]; then
$id=81

TIA!
Clayton Dukes



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php_self

2001-02-25 Thread PHPBeginner.com

Here's what to do:

in Apache:
Add (this is all one line)
LoadModule php4_module C:/Webserver/php/sapi/php4apache.dll

then (five lines)
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
to your httpd.conf.

Remove(comment) Action application ... line



Copy php.ini to C:\Winnt\System32.

Copy msvcrt.dll (from C:\Webserver\PHP\dlls\msvcrt.dll) to C:\Winnt\system32
 - you're almost guranteed to have it, as I did, but just check.

Copy phpts.dll to C:\Winnt\system32.

Startup the Apache service.

At this point, if it worked, you are runniong as a module.

Hopefully this will work :-)


And if it doesn't download a new version of PHP and reinstall it as INSTALL
file says.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 9:27 AM
To: PHPBeginner.com
Subject: Re: [PHP] php_self


well i have windows so how do i recompile it?

"PHPBeginner.com" wrote:

> You have compiled it as CGI, didn't ya?
>
> recompile it as apache's module if you can so apache can give PHP_SELF the
> right value,
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
> -Original Message-
> From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 4:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php_self
>
> Why does php self always show php4/php.exe? how do i take  it off?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Cookie References?

2001-02-25 Thread PHPBeginner.com

Yes it can :

here's what I once was doing to assign a user with a cookie containing a
Session ID:


$uniqid = md5 (uniqid (rand()));

if(!isset($sid)) {
$time = time();
setcookie ("sid", $uniqid, $time*3);
}

time()+time() makes it really, really LONG ...  (62 years?), of course it
has not expired from anyone yet :-))



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 7:42 AM
To: PHP
Subject: [PHP] Cookie References?


Could you give me some URLs for tutorials related
to cookies and good reference material?

One question I have is can a cookie never expire?
Jeff Oien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] DIsplaying page before script finnished

2001-02-25 Thread PHPBeginner.com

use flush()

it will push the output out of apache.
But note, if you have a table, on Netscape not much will be shown (even if
it receives the data) until the  arrives.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: David Tandberg-Johansen [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] DIsplaying page before script finnished


Hello!

I wonder if there are any way to display the page before the script is
finished?

I have a loop in my script,and I want to display the resoult for each loop.

Thanks

David :-)



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] session_register in function

2001-02-25 Thread PHPBeginner.com

you have to have the variable you register (in both ways) global.

so no matter how you call the function the variable must be defined global.

mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:16 AM
To: PHP List
Subject: [PHP] session_register in function


The variable I register before the function becomes available in the session
to other pages...the variable I register inside the function are not
accessible in the session to ohter pages.  Is this normal?  How can I work
around this?  Thanks!  PHP4.0.4pl1 on Linux.

sample code:




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Join causing Error?

2001-02-25 Thread Chris Adams

On 25 Feb 2001 00:20:37 -0800, Keith Spiller <[EMAIL PROTECTED]> wrote:
>  Line 284$result =3D mysql_query("SELECT q.questid, q.question, =

Try changing this to something like 
$result = mysql_query("SELECT ...") or die(mysql_error());
and seeing what error is being returned by MySQL.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP4 install question

2001-02-25 Thread Michael Hall

There may be other/easier solutions, but what always works for me is
compiling Apache from source after removing the rpm, then compiling PHP
from source.
The instructions at the end of the README.config file in the Apache source
distro work like a charm.
This seems long-winded but at least I know it's gonna work at the end. 

Mick

On Sat, 24 Feb 2001, Ed Lazor wrote:

> I've had PHP installed through the RedHat RPMS listed below.
> 
> php-imap-4.0.4pl1-3
> php-manual-4.0.4pl1-3
> php-4.0.4pl1-3
> php-ldap-4.0.4pl1-3
> php-mysql-4.0.4pl1-3
> 
> Unfortunately, I discovered there's a bug in this version, so I need to 
> remove the rpms and install PHP by compiling the source.  I've been playing 
> with it for a few hours, but haven't had any luck, so I figured I'd ask 
> here.  What's the easiest way to compile PHP and load it into Apache?
> 
> If I understand correctly, because of the rpm, PHP resides as the file
> /usr/lib/apache/libphp4.so
> 
> Apache loads PHP with the following command in httpd.conf
> LoadModule php4_modulemodules/libphp4.so
> 
> I'm not sure (can someone confirm please?), but I assume Apache is loading 
> all of the modules as DSO.  Is the goal is to remove the rpms and create a 
> new /usr/lib/apache/libphp4.so file by compiling the PHP4 source code?
> 
> If so, how do I go about it?  The directions for PHP make it sound really 
> easy.  I tried them tho and the php files just show up as plain text.  Here 
> are the instructions I tried (that didn't work).
> 
> -Ed
> 
> 
> 
> 
> $ ./configure --with-mysql --with-apxs
> $ make
> $ make install
> 
> If you get an error telling you that the apxs script could not be found,
> look for it on your system and if you find it, provide the full path to it
> as: --with-apxs=/path/to/apxs
> 
> Next you must copy php.ini-dist to the appropriate place (normally
> /usr/local/lib/php.ini) and edit it as necessary to set PHP options.
> 
> The only thing left to do is to edit your httpd.conf file and make sure the
> PHP 4 mime type is there and uncommented.  You need a line that looks like
> this:
> 
> AddType application/x-httpd-php .php
> 
> Then restart your server (apachectl restart) and you should be able to
> serve up PHP files now.  Make a test file called test.php and put some
> PHP tags in it.  Like , for example.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >