[PHP] Change dir mode to writable for uploading..

2001-02-24 Thread Dhaval Desai

Hi!

I have problem uploading the file to a  directory...
It says permission denied. THe problem is taht ther
directory is on the web.
I connect using WS_ftp.
THe directory is set to:

drwxr-xr-x

How do I make it writable..?


I am using form to upload the files there..


Is there any way I can make the directory writable..?

Thank You!

Dhaval Desai

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.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] Change dir mode to writable for uploading..

2001-02-24 Thread PHPBeginner.com

use chmod 775 dir (or 777 - but not recommended)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 5:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Change dir mode to writable for uploading..


Hi!

I have problem uploading the file to a  directory...
It says permission denied. THe problem is taht ther
directory is on the web.
I connect using WS_ftp.
THe directory is set to:

drwxr-xr-x

How do I make it writable..?


I am using form to upload the files there..


Is there any way I can make the directory writable..?

Thank You!

Dhaval Desai

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.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]




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

2001-02-24 Thread Rasmus Lerdorf

rasmus  Sat Feb 24 02:20:38 2001 EDT

  Modified files:  
/CVSROOTavail cvsusers gen_acl_file.m4 
  Log:
  Midgard cvs account for Alexander Bokovoy
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.99 CVSROOT/avail:1.100
--- CVSROOT/avail:1.99  Fri Feb 23 18:50:13 2001
+++ CVSROOT/avail   Sat Feb 24 02:20:38 2001
@@ -9,7 +9,7 @@
 
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|php-gtk
-avail|emile,davidg,alan_k|php4/ext/midgard
+avail|emile,davidg,alan_k,ab|php4/ext/midgard
 avail|rasmus|php4/ext/aspell
 avail|andi|php4/ext/bcmath
 avail|NOBODY|php4/ext/calendar
Index: CVSROOT/cvsusers
diff -u CVSROOT/cvsusers:1.226 CVSROOT/cvsusers:1.227
--- CVSROOT/cvsusers:1.226  Thu Feb 22 11:18:10 2001
+++ CVSROOT/cvsusersSat Feb 24 02:20:38 2001
@@ -270,3 +270,4 @@
 cevm  Carlos Eduardo Vargas Miranda [EMAIL PROTECTED]
Brazilian Portuguese translation
 noribsd   Jaemin Byon [EMAIL PROTECTED]Korean 
translation
 eskalyBenjamin Schulz [EMAIL PROTECTED] 
Documentation
+abAlexander Bokovoy   [EMAIL PROTECTED]  Midgard
Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.103 CVSROOT/gen_acl_file.m4:1.104
--- CVSROOT/gen_acl_file.m4:1.103   Fri Feb 23 18:50:13 2001
+++ CVSROOT/gen_acl_file.m4 Sat Feb 24 02:20:38 2001
@@ -13,7 +13,7 @@
 dnl
 define(`php_pres', `rasmus,sterling,jimw')dnl
 dnl
-define(`php_midgard', `emile,davidg,alan_k')dnl
+define(`php_midgard', `emile,davidg,alan_k,ab')dnl
 dnl
 unavail
 avail|php_group|CVSROOT



-- 
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] $result = $$function

2001-02-24 Thread Peter Van Dijck

Hi,
I'd like to do:
$function = "build_result()";
$result = $$function;
but it doesn't seem to work.
The reason why I think I need it is that I have a generic function, but 
within it I have to call another function depending on who called it. I 
could build a switch within the generic function deciding which function to 
call, but tht seems less elegant, as I'd have to adjust the generic 
function every time a new function calls it.
The build_result() function only gets called in certain cases by the 
generic function (if it's not cached), so I can't just put it outside fo 
the generic function.
Any hints?
Thanks!
Peter
~
http://liga1.com  ,a weblog on:
- Localisation
- Internationalisation
- Globalisation
- Accessibility


-- 
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-24 Thread Sascha Schumann

sas Sat Feb 24 04:37:19 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c 
  Log:
  Add the ability to set a connection password
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.34 php4/ext/ircg/ircg.c:1.35
--- php4/ext/ircg/ircg.c:1.34   Wed Feb 21 11:58:32 2001
+++ php4/ext/ircg/ircg.cSat Feb 24 04:37:18 2001
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.34 2001/02/21 19:58:32 sas Exp $ */
+/* $Id: ircg.c,v 1.35 2001/02/24 12:37:18 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -87,6 +87,7 @@
irc_write_buf wb;
HashTable ctcp_msgs;
char *ident; /* NOT available outside of ircg_pconnect or register_hooks */
+   char *password; /* NOT available outside of ircg_pconnect or register_hooks */
 } php_irconn_t;
 
 static char *fmt_msgs_default[] = {
@@ -589,6 +590,13 @@
smart_str_sets(&m, irconn->ident);
irc_set_ident(conn, &m);
}
+
+   if (irconn->password) {
+   smart_str m;
+
+   smart_str_sets(&m, irconn->password);
+   irc_set_password(conn, &m);
+   }

irc_register_hook(conn, IRCG_MSG, msg_handler);
irc_register_hook(conn, IRCG_QUIT, quit_handler);
@@ -627,19 +635,24 @@
 
 PHP_FUNCTION(ircg_pconnect)
 {
-   zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL, **p6;
+   /* This should become an array very soon */
+   zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL, **p6, **p7;
const char *username;
const char *server = "0";
const char *ident = NULL;
+   const char *password = NULL;
int port = 6667;
php_fmt_msgs_t *fmt_msgs = NULL;
php_irconn_t *conn;

-   if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 6 
-   || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, 
&p5, &p6) == FAILURE)
+   if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 7
+   || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, 
+&p5, &p6, &p7) == FAILURE)
WRONG_PARAM_COUNT;
 
switch (ZEND_NUM_ARGS()) {
+   case 7:
+   convert_to_string_ex(p7);
+   password = Z_STRVAL_PP(p7);
case 6:
convert_to_string_ex(p6);
ident = Z_STRVAL_PP(p6);
@@ -665,6 +678,7 @@
conn = malloc(sizeof(*conn));
conn->fd = -1;
conn->ident = ident;
+   conn->password = password;
 
zend_hash_init(&conn->ctcp_msgs, 10, NULL, NULL, 1);
if (irc_connect(username, register_hooks, 
@@ -675,7 +689,7 @@
if (p5 && Z_TYPE_PP(p5) == IS_ARRAY) {
ircg_copy_ctcp_msgs(p5, conn);
}
-   conn->ident = NULL;
+   conn->password = conn->ident = NULL;
conn->fmt_msgs = fmt_msgs;  
irconn_id++;
conn->irconn_id = irconn_id;



-- 
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] cvs: php4 /sapi/aolserver README

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 05:14:27 2001 EDT

  Modified files:  
/php4/sapi/aolserverREADME 
  Log:
  Change the default to assumption that people don't use AOLserver 3.0 anymore.
  
  
Index: php4/sapi/aolserver/README
diff -u php4/sapi/aolserver/README:1.4 php4/sapi/aolserver/README:1.5
--- php4/sapi/aolserver/README:1.4  Tue Aug 22 00:33:27 2000
+++ php4/sapi/aolserver/README  Sat Feb 24 05:14:27 2001
@@ -1,11 +1,10 @@
-AOLserver README ($Id: README,v 1.4 2000/08/22 07:33:27 sas Exp $)
+AOLserver README ($Id: README,v 1.5 2001/02/24 13:14:27 sas Exp $)
 
 To compile PHP 4.0 as a module for AOLserver, you need:
 
-- AOLserver 3.0 source distribution (not required for AOLserver >= 3.1)
-- installed AOLserver 3.0 or later
+- installed AOLserver 3.1 or later
+  (see the note below for AOLserver 3.0)
 
-
 NOTE: You should not use this module in production. PHP is not 100% stable
   yet in threaded mode. To increase reliability enable the Global Lock
   by removing #define NO_GLOBAL_LOCK in main/main.c. Also don't use
@@ -24,13 +23,12 @@
 
 $ ./configure \
--with-aolserver=/path/to/installed/aolserver \
-   --with-aolserver-src=/path/to/source/distribution \

+
+NOTE: If you are still using AOLserver 3.0, you need to retain the
+  AOLserver source code and pass another option to PHP:
 
-NOTE: While AOLserver 3.0 did not install its include directory, later
-  releases will do so. This effectively means that you do not need
-  to retain the source directory of AOLserver, if there is an
-  include directory in the installation directory.
+  --with-aolserver-src=/path/to/source/distribution
 
 3.) Compiling and Installing PHP
 



-- 
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] splitting email on MIME format

2001-02-24 Thread n e t b r a i n

Hi all,

anyone could show me how to split an multi-part email in mime format using
imap funct? I need to take an email in html format with embedded images and
store its html,text and etc. in a mysql db 

simple script, class, tutorial or specified howto are very welcomed

many thanks in advance
max


-- 
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] redirect to another page not using headers

2001-02-24 Thread kaab kaoutar

Hi!
i'm working on Windows NT workstation with PWS§
Therefore header does not work ! but i want to redirect to another page!
any server isde idea  ?
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-CVS] cvs: php4 /ext/midgard article.c calendar.c event.c person.c topic.c

2001-02-24 Thread David Guerizec

davidg  Sat Feb 24 05:39:30 2001 EDT

  Modified files:  
/php4/ext/midgard   article.c calendar.c event.c person.c topic.c 
  Log:
  fixed some possible memory leaks.
  
  

Index: php4/ext/midgard/article.c
diff -u php4/ext/midgard/article.c:1.7 php4/ext/midgard/article.c:1.8
--- php4/ext/midgard/article.c:1.7  Thu Feb 22 09:39:37 2001
+++ php4/ext/midgard/article.c  Sat Feb 24 05:39:30 2001
@@ -1,4 +1,4 @@
-/* $Id: article.c,v 1.7 2001/02/22 17:39:37 davidg Exp $
+/* $Id: article.c,v 1.8 2001/02/24 13:39:30 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]>
@@ -59,12 +59,14 @@
 
ids = mgd_tree(mgd_handle(), "topic", "up", (*root)->value.lval, 0, NULL);
if (ids) {
-   id =
-  mgd_idfield(mgd_handle(), "topic", "article",
+   id = mgd_idfield(mgd_handle(), "topic", "article",
   (*article)->value.lval);
for (i = 0; ids[i]; i++)
-   if (ids[i] == id)
+   if (ids[i] == id) {
+   free(ids);
RETURN_TRUE;
+   }
+   free(ids);
}
 }
 
@@ -254,21 +256,24 @@
 
topics = mgd_tree(mgd_handle(), "topic", "up", (*id)->value.lval, 0, NULL);
 
-   if (typev == -1)
-   php_midgard_select(&MidgardArticle, return_value,
-   ARTICLE_SELECT,
-  ARTICLE_FROM,
-  "article.topic IN $D AND author=person.id"
-  " AND (article.up=$d OR 1=$d)",
-  sortv, topics, up, up_wild);
-   else
-   php_midgard_select(&MidgardArticle, return_value,
-   ARTICLE_SELECT,
-  ARTICLE_FROM,
-  "article.type=$d AND article.topic IN $D"
-  " AND (article.up=$d OR 1=$d)"
-  " AND author=person.id",
-  sortv, typev, topics, up, up_wild);
+   if(topics) {
+   if (typev == -1)
+   php_midgard_select(&MidgardArticle, return_value,
+  ARTICLE_SELECT,
+  ARTICLE_FROM,
+  "article.topic IN $D AND author=person.id"
+  " AND (article.up=$d OR 1=$d)",
+  sortv, topics, up, up_wild);
+   else
+   php_midgard_select(&MidgardArticle, return_value,
+  ARTICLE_SELECT,
+  ARTICLE_FROM,
+  "article.type=$d AND article.topic IN $D"
+  " AND (article.up=$d OR 1=$d)"
+  " AND author=person.id",
+  sortv, typev, topics, up, up_wild);
+   free(topics);
+   }
 }
 
 MGD_FUNCTION(list_topic_articles_all_fast)
@@ -331,20 +336,23 @@
 
topics = mgd_tree(mgd_handle(), "topic", "up", (*id)->value.lval, 0, NULL);
 
-   if (typev == -1)
-   php_midgard_select(&MidgardArticle, return_value,
-  ARTICLE_SELECT_FAST,
-  ARTICLE_FROM_FAST,
-  "article.topic IN $D"
-  " AND (article.up=$d OR 1=$d)",
-  sortv, topics, up, up_wild);
-   else
-   php_midgard_select(&MidgardArticle, return_value,
-  ARTICLE_SELECT_FAST,
-  ARTICLE_FROM_FAST,
-  "article.type=$d AND article.topic IN $D"
-  " AND (article.up=$d OR 1=$d)",
-  sortv, typev, topics, up, up_wild);
+   if(topics) {
+   if (typev == -1)
+   php_midgard_select(&MidgardArticle, return_value,
+  ARTICLE_SELECT_FAST,
+  ARTICLE_FROM_FAST,
+  "article.topic IN $D"
+  " AND (article.up=$d OR 1=$d)",
+  sortv, topics, up, up_wild);
+   else
+   php_midgard_select(&MidgardArticle, return_value,
+  ARTICLE_SELECT_FAST,
+  ARTICLE_FROM_FAST,
+  "article.type=$d AND article.topic IN $D"
+ 

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

2001-02-24 Thread David Guerizec

davidg  Sat Feb 24 05:42:00 2001 EDT

  Modified files:  
/php4/ext/midgard   page.c 
  Log:
  fixed a possible memory leak
  
  
  
Index: php4/ext/midgard/page.c
diff -u php4/ext/midgard/page.c:1.7 php4/ext/midgard/page.c:1.8
--- php4/ext/midgard/page.c:1.7 Thu Feb 22 09:39:37 2001
+++ php4/ext/midgard/page.c Sat Feb 24 05:42:00 2001
@@ -1,4 +1,4 @@
-/* $Id: page.c,v 1.7 2001/02/22 17:39:37 davidg Exp $
+/* $Id: page.c,v 1.8 2001/02/24 13:42:00 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]>
@@ -91,9 +91,14 @@
RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
 
 ids = mgd_tree(mgd_handle(), "page", "up", (*root)->value.lval, 0, NULL);
-   if (ids)
+   if (ids) {
for (i = 0; ids[i]; i++)
-   if (ids[i] == (*page)->value.lval) RETURN_TRUE;
+   if (ids[i] == (*page)->value.lval) {
+   free(ids);
+   RETURN_TRUE;
+   }
+   free(ids);
+   }
 }
 
 MGD_FUNCTION(get_page)



-- 
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] Change dir mode to writable for uploading..

2001-02-24 Thread Web Admin

Hi Dhaval,
You said in your previous e-mail 'C:\'. Are you using a NT based
server or Unix based? If your server is a unix based one, consider
trying this command:
chmod 777 /path/to/directory
Warning, this is a bit dangerous and might be vulnerable, are you
running your webserver with nobody? Anyone else has access to
write cgi scripts on your servers? If everything's set up carefully,
you can chown your directory to nobody. It will work with the current
permission.
Ahmad Anvari

  - Original Message - 
  From: Dhaval Desai 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, February 24, 2001 11:55 AM
  Subject: [PHP] Change dir mode to writable for uploading..


  Hi!

  I have problem uploading the file to a  directory...
  It says permission denied. THe problem is taht ther
  directory is on the web.
  I connect using WS_ftp.
  THe directory is set to:

  drwxr-xr-x

  How do I make it writable..?


  I am using form to upload the files there..


  Is there any way I can make the directory writable..?

  Thank You!

  Dhaval Desai

  __
  Do You Yahoo!?
  Get email at your own domain with Yahoo! Mail. 
  http://personal.mail.yahoo.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] checking $more still does not work !

2001-02-24 Thread kaab kaoutar

Hi!
i have a submit button called "more" in a page that calles itself
i try to check whether the page was just loaded or called by clicking on 
that button using :
if ($more) {echo "hi";}
it never echo hi
any idea ?
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] $result = $$function

2001-02-24 Thread Web Admin

Hi,
I didn't get why you haven't used this:
switch $var
  case something: $result=$build_result(); break;
  case somethingelse: $result=$build2(); break;
  blah blah blah... 

Ahmad
  - Original Message - 
  From: Peter Van Dijck 
  To: php gen list 
  Sent: Saturday, February 24, 2001 4:00 PM
  Subject: [PHP] $result = $$function


  Hi,
  I'd like to do:
  $function = "build_result()";
  $result = $$function;
  but it doesn't seem to work.
  The reason why I think I need it is that I have a generic function, but 
  within it I have to call another function depending on who called it. I 
  could build a switch within the generic function deciding which function to 
  call, but tht seems less elegant, as I'd have to adjust the generic 
  function every time a new function calls it.
  The build_result() function only gets called in certain cases by the 
  generic function (if it's not cached), so I can't just put it outside fo 
  the generic function.
  Any hints?
  Thanks!
  Peter
  ~
  http://liga1.com  ,a weblog on:
  - Localisation
  - Internationalisation
  - Globalisation
  - Accessibility


  -- 
  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] checking $more still does not work !

2001-02-24 Thread Web Admin

Hi Kaab,
There must be another problem, it should work. Maybe it helps if
you send your code here. To see how a simple script works, try
this tiny script named test.php:




Submit is pressed"; };
?>

If you first load the php page, you don't see anything rather than a 
submit button. If you press submit, you will see a message.

Ahmad Anvari
  - Original Message - 
  From: kaab kaoutar 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, February 24, 2001 5:35 PM
  Subject: [PHP] checking $more still does not work !


  Hi!
  i have a submit button called "more" in a page that calles itself
  i try to check whether the page was just loaded or called by clicking on 
  that button using :
  if ($more) {echo "hi";}
  it never echo hi
  any idea ?
  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: RE: [PHP] special characters with perl,mysql,php

2001-02-24 Thread Christian Reiniger

On Saturday 24 February 2001 07:49, Mitchell Hagerty wrote:
> The special character I'm concerned with at the moment is the back tick
> ` which mysql doesn't like on an insert. I was looking for a way not to
> parse the entire file evertime I inserted or extracted them from the
> database. Its simple enough todo in perl and php just seems like it
> would burn alot of cpu time.
>
> I was actually hoping mysql would have a way to encode it on the way in
> and decode on the way out. That way php or perl would be irrelevant.
> Guess not :\

Well, as someone else already said, addslashes () is the tool of choice 
for the way in, and for he way out you don't need to do anything.

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

"The number of Unix installations has grown to 10, with more expected."
 -- The Unix Programmer's Manual, 2nd Edition, June 1972

--
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] redirect to another page not using headers

2001-02-24 Thread Joe Njeru

HI,
why don't you implement some client side script in your page
for example:

echo ("function
Relod1(){window.location='your.php?url=default.php';}")


Joe Njeru,
Nairobi Kenya

""kaab kaoutar"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
> i'm working on Windows NT workstation with PWS§
> Therefore header does not work ! but i want to redirect to another page!
> any server isde idea  ?
> 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]




[PHP] status page between submit and results

2001-02-24 Thread Mitchell Hagerty


Blizzard here, hows the weather there? :)

The website I am working on has several forms, a search, and a login that can take 
close to a minute depending 
on much traffic it is recieving. I've noticed on other sites ("paypal" for instance) 
that when you submit it throws up 
a "loading..." page that goes onto the results page when it is returned.

any ideas on how to do this? 

tks
mitch



-- 
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] status page between submit and results

2001-02-24 Thread Web Admin

Here?! Sunny today! ;-)
I highly suggest you use client side scripting in this case.
onLoad 
Event handler. A load event occurs when Navigator finishes loading a window or all 
frames within a  tag. The onLoad event handler executes JavaScript code when 
a load event occurs. 

Here's a sample code for your result page:


.. Some Coding Here ...

.. The rest of coding..


That's the snippiest piece of code. [I didn't test it, however, I'm sure that it work 
out]
Create a loading.gif animation gif which shows a [Loading...] animation.
It will be replaced by a blank gif file named blank.gif which shows a blank screen.
Take care,
Ahmad Anvari
  - Original Message - 
  From: Mitchell Hagerty 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, February 24, 2001 7:02 PM
  Subject: [PHP] status page between submit and results



  Blizzard here, hows the weather there? :)

  The website I am working on has several forms, a search, and a login that can take 
close to a minute depending 
  on much traffic it is recieving. I've noticed on other sites ("paypal" for instance) 
that when you submit it throws up 
  a "loading..." page that goes onto the results page when it is returned.

  any ideas on how to do this? 

  tks
  mitch



  -- 
  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-24 Thread Joe Stump

For the last time - put an input box on a page and submit with NOTHING in the
box. Now I want SOMETHING in that box (like a name) - isset() will return true
even though it's empty.

--Joe

On Sat, Feb 24, 2001 at 04:32:11PM +0900, PHPBeginner.com wrote:
> Whatever they input is not the objects, right?
> 
> then (I've just double-checked it, to be sure I am not saying some 'BULL')
> 
> 
> $var = 0;
> 
> if($var)
>   echo 'var matched';
> 
> if(isset($var))
>   echo 'var is set';
> 
> 
> when the $var is 0 the second condition will return true, the first will be
> false instead...
> Obviously if they enter anything else then 0 and NULL (I mean nothing) it
> will return true in both cases, if($var.., if(isset($var... if(strle($var
> ...
> 
> What's wrong with isset() in here?
> I am on PHP4.0.4!
> 
> explain me again, why on user input strlen() would do better then isset() ?
> 
> 
> Sincerely,
> 
>  Maxim Maletsky
>  Founder, Chief Developer
> 
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
> 
> 
> 
> 
> 
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:25 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
> 
> 
> You're wrong in saying that you "usually know what the variable will be" -
> you
> never know what it's going to be. You aren't entering it you need to
> remember that mostly idiots are inputting the data :O)
> 
> --Joe
> 
> On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> > have I said it won't work, Joe?
> >
> > I said that using strlen() might not be necessary. (re-read my post)
> > On my own opinion the same things could be done without using the string
> > functions.
> > Am I wrong in something there? then thanks for correcting me - will know
> it
> > for the feature.
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, February 24, 2001 4:17 PM
> > To: PHPBeginner.com
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > You are COMPLETELY wrong here. isset() is designed to check if a variable
> is
> > SET - NOT if it has something in it. empty() is designed for strings NOT
> for
> > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> > problems
> > when you do checks and variables aren't set.
> >
> > I do this, like I said before, because the extra 1 billionth of a second
> is
> > worth the overhead. I've programmed for sites ranging from a few hundered
> > hits
> > a day to a few million hits a day and this works ALL the time.
> >
> > --Joe
> >
> > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > > I don't agree with you in here,
> > >
> > > you usually know what kind of variable you're checking, so strlen() will
> > > work just as well as
> > >
> > > $var ? 'OK' : 'Empty'
> > >
> > > will work or the isset() - common, it was made for checking the
> > variables -
> > > use it.
> > >
> > > strlen() is in fact an overhead, why would you allow your design to be
> > some
> > > sort of untraditional? I don't think there's any necessity for it
> > >
> > > a "good design" often would be something like this:
> > >
> > > $var = 'whatever';
> > >
> > > if($var)
> > >   ...do this
> > > else
> > >   ERROR('no var') // some your func to output the error mess or to
> continue
> > > with debugging
> > >
> > > in most cases it will work better and simpler for you without spending
> > these
> > > bazillions of important for every developer seconds.
> > >
> > >
> > >
> > > Sincerely,
> > >
> > >  Maxim Maletsky
> > >  Founder, Chief Developer
> > >
> > >  PHPBeginner.com (Where PHP Begins)
> > >  [EMAIL PROTECTED]
> > >  www.phpbeginner.com
> > >
> > >
> > >
> > >
> > >
> > > -Original Message-
> > > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 23, 2001 3:07 AM
> > > To: Steve Edberg
> > > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > > Subject: Re: [PHP] isset()
> > >
> > >
> > > I stand firm on strlen() for the following reasons ...
> > >
> > > if(!$var) will sometimes act strangely (has for me in the past) when
> > > variables
> > > are set to something other than what you are expecting.
> > >
> > > if(isset($var)) will return true if your text field is declared but not
> > > filled
> > > in.
> > >
> > > if(empty($var)) will return true if $var is set to 0 (for obvious
> reason)
> > so
> > > is
> > > only good for certain instances.
> > >
> > > strlen() on the other hand converts the variable to a string and returns
> a
> > > count
> > > of characters. It's never failed or acted funky. For this reason I use
> it
> > > religiously.
> > >
> > > Others might say "well it's extra overhead" to which I reply "I'll take
> an
> > > extra
> > > bazilliont

[PHP] getting result set of a stored procedure

2001-02-24 Thread Kevin Beckford

I have been working with mysql for a while, and now I am working with Sybase
ASE. I have some stored procedures that I can run, but I would like to know
how to access the result set of such a call. In mysql, the result set is
just another table, and I can fetch it as a hash or object to get what I
need. Using stored procedures, how would I do the same thing?



-- 
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] Class methods in PHP

2001-02-24 Thread Kevin Beckford

Is there class methods in php? 



-- 
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-24 Thread PHPBeginner.com

in my preceding email I've written:

if($var!='')

will fix your all your worries without an intervention of a strings
function.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:09 AM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


For the last time - put an input box on a page and submit with NOTHING in
the
box. Now I want SOMETHING in that box (like a name) - isset() will return
true
even though it's empty.

--Joe

On Sat, Feb 24, 2001 at 04:32:11PM +0900, PHPBeginner.com wrote:
> Whatever they input is not the objects, right?
>
> then (I've just double-checked it, to be sure I am not saying some 'BULL')
>
>
> $var = 0;
>
> if($var)
>   echo 'var matched';
>
> if(isset($var))
>   echo 'var is set';
>
>
> when the $var is 0 the second condition will return true, the first will
be
> false instead...
> Obviously if they enter anything else then 0 and NULL (I mean nothing) it
> will return true in both cases, if($var.., if(isset($var... if(strle($var
> ...
>
> What's wrong with isset() in here?
> I am on PHP4.0.4!
>
> explain me again, why on user input strlen() would do better then isset()
?
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:25 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> You're wrong in saying that you "usually know what the variable will be" -
> you
> never know what it's going to be. You aren't entering it you need to
> remember that mostly idiots are inputting the data :O)
>
> --Joe
>
> On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> > have I said it won't work, Joe?
> >
> > I said that using strlen() might not be necessary. (re-read my post)
> > On my own opinion the same things could be done without using the string
> > functions.
> > Am I wrong in something there? then thanks for correcting me - will know
> it
> > for the feature.
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, February 24, 2001 4:17 PM
> > To: PHPBeginner.com
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > You are COMPLETELY wrong here. isset() is designed to check if a
variable
> is
> > SET - NOT if it has something in it. empty() is designed for strings NOT
> for
> > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> > problems
> > when you do checks and variables aren't set.
> >
> > I do this, like I said before, because the extra 1 billionth of a second
> is
> > worth the overhead. I've programmed for sites ranging from a few
hundered
> > hits
> > a day to a few million hits a day and this works ALL the time.
> >
> > --Joe
> >
> > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > > I don't agree with you in here,
> > >
> > > you usually know what kind of variable you're checking, so strlen()
will
> > > work just as well as
> > >
> > > $var ? 'OK' : 'Empty'
> > >
> > > will work or the isset() - common, it was made for checking the
> > variables -
> > > use it.
> > >
> > > strlen() is in fact an overhead, why would you allow your design to be
> > some
> > > sort of untraditional? I don't think there's any necessity for it
> > >
> > > a "good design" often would be something like this:
> > >
> > > $var = 'whatever';
> > >
> > > if($var)
> > >   ...do this
> > > else
> > >   ERROR('no var') // some your func to output the error mess or to
> continue
> > > with debugging
> > >
> > > in most cases it will work better and simpler for you without spending
> > these
> > > bazillions of important for every developer seconds.
> > >
> > >
> > >
> > > Sincerely,
> > >
> > >  Maxim Maletsky
> > >  Founder, Chief Developer
> > >
> > >  PHPBeginner.com (Where PHP Begins)
> > >  [EMAIL PROTECTED]
> > >  www.phpbeginner.com
> > >
> > >
> > >
> > >
> > >
> > > -Original Message-
> > > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 23, 2001 3:07 AM
> > > To: Steve Edberg
> > > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > > Subject: Re: [PHP] isset()
> > >
> > >
> > > I stand firm on strlen() for the following reasons ...
> > >
> > > if(!$var) will sometimes act strangely (has for me in the past) when
> > > variables
> > > are set to something other than what you are expecting.
> > >
> > > if(isset($var)) will return true if your text field is declared but
not
> > > filled
> > > in.
> > >
> > > if(empty($var)) will re

[PHP] session_register in function

2001-02-24 Thread Jon Rosenberg

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]




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

2001-02-24 Thread php3

Addressed to: "George  Alexander" <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from "George  Alexander" <[EMAIL PROTECTED]> 24 Feb 2001 
05:40:59 -
>
> 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.


mypassword is the same password you used for mysqladmin, and the command
line interpreter for the root user, right?


Try this command and see what it returns.  If the error message doesn't
give you a good idea what is wrong, please post again, including the
error message you receive.


mysql_connect( "localhost", "root", "mypassword" ) or
   die( "Unable to connect" . mysql_error());


I suggest you always use this code, along with:

mysql_select_db( "database" ) or
   die( "Unable to select" . mysql_error());

 in every program you write.  It is almost impossible to troubleshoot
problems if you don't know what went wrong.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.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] session_register in function - addendum

2001-02-24 Thread Jon Rosenberg

The code snippet below is from a file that is the post action of a login
form
the login form also has session_start();

- Original Message -
From: "Jon Rosenberg" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, February 24, 2001 11:16 AM
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:
>
>  session_Start();
>
> $foo = "bar";
> session_register("foo");
>
> function bob($user){
> $username = $user . "one";
> $username2 = $user . "two";
> session_register("username");
> session_register("username2");
> return true;
> }
> ?>
>
>
> --
> 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] DIsplaying page before script finnished

2001-02-24 Thread David Tandberg-Johansen

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]




Re: [PHP] DIsplaying page before script finnished

2001-02-24 Thread Kyndig

On Sat, 24 Feb 2001, David Tandberg-Johansen wrote:
> 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.
Try the REFRESH meta tag


> 
> 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]
-- 
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]




Re: [PHP] DIsplaying page before script finnished

2001-02-24 Thread Kevin Beckford

try using flush()
- Original Message -
From: "David Tandberg-Johansen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 24, 2001 11:34 AM
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]




php-general Digest 24 Feb 2001 16:44:33 -0000 Issue 531

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


php-general Digest 24 Feb 2001 16:44:33 - Issue 531

Topics (messages 41431 through 41496):

Re: Download PHP from Linux machine?
41431 by: Simons
41437 by: ..s.c.o.t.t..

Re: Using while as for...
41432 by: ..s.c.o.t.t..
41436 by: Andrew Hill
41438 by: Andrew Hill
41462 by: PHPBeginner.com

Re: special characters with perl,mysql,php
41433 by: ..s.c.o.t.t..
41464 by: Mitchell Hagerty
41483 by: Christian Reiniger

Re: Help INSERTing to MySQL
41434 by: ..s.c.o.t.t..
41435 by: ..s.c.o.t.t..

Can't connect php to mysql on linux
41439 by: George  Alexander
41492 by: php3.developersdesk.com

Re: Location
41440 by: Steve Werby
41452 by: PHPBeginner.com

Re: isset()
41441 by: PHPBeginner.com
41465 by: Joe Stump
41466 by: PHPBeginner.com
41467 by: Joe Stump
41469 by: PHPBeginner.com
41472 by: PHPBeginner.com
41487 by: Joe Stump
41490 by: PHPBeginner.com

Re: International support
41442 by: PHPBeginner.com

Re: variable sent using pots is cat!
41443 by: PHPBeginner.com

Re: How do I request a new feature?
41444 by: PHPBeginner.com

Re: Sessions and naming a file with SID
41445 by: PHPBeginner.com

Re: Templates & PHP
41446 by: PHPBeginner.com

Re: Passing values containing a ? and a &
41447 by: PHPBeginner.com

Re: books
41448 by: PHPBeginner.com

Re: concatenate vars?
41449 by: PHPBeginner.com

Re: Problems sending mail to aol with the mail() function
41450 by: PHPBeginner.com

Re: Counter Help
41451 by: PHPBeginner.com
41454 by: PHPBeginner.com
41468 by: Navid Yar
41470 by: PHPBeginner.com

Re: 


try to "double quotes" the url


""Jorge Alvarez"" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó
976k7t$2t2$[EMAIL PROTECTED]">news:976k7t$2t2$[EMAIL PROTECTED]...
> Hi there,
>
> I want to download PHP from my Linux server, but I can't just type "lynx
>
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
> site=www.php.net"
>
> This is the link in the PHP downloads page, but the shell gets confused by
> the & character.
>
> What should I do?
>
> Best Regards,
>
> Jorge.
>
>
>
> --
> 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]
>






well, you could load lynx, then type "G" (go) and
type in "www.php.net" on the address bar, then
navigate your way to the download page from there.
(it's only one page deep into the site)

that's how i did it at work on our linux machine.


> -Original Message-
> From: Simons [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 21:00
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Download PHP from Linux machine?
>
>
> try to "double quotes" the url
>
>
> ""Jorge Alvarez"" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó
> 976k7t$2t2$[EMAIL PROTECTED]">news:976k7t$2t2$[EMAIL PROTECTED]...
> > Hi there,
> >
> > I want to download PHP from my Linux server, but I can't just type "lynx
> >
> http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
> > site=www.php.net"
> >
> > This is the link in the PHP downloads page, but the shell gets confused by
> > the & character.
> >
> > What should I do?
> >
> > Best Regards,
> >
> > Jorge.
> >
> >
> >
> > --
> > 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]
>





this is how you'd do it, in any of three ways,
depending on the values you want to start/stop with.

//counts from 0 to 10
$count=0;
while ($count <= 10) {
echo "$count, ";
$count++;
}
print "";

//counts from 1 to 10
$count=0;
while (++$count <= 10) {
echo "$count, ";
}
print "";

//counts from 1 to 11
$count=0;
while ($count++ <= 10) {
echo "$count, ";
}



> -Original Message-
> From: Felipe Lopes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 24, 2001 02:46
> To: [EMAIL PROTECTED]
> Subject: [PHP] Using while as for...
>
>
> I was trying to code the following script using while instead of for,
> but I'm havig a lot of problems...Is it possible to do what I want?
>
> for ($count = 0; $count <= 10; $count++){
> echo "Number is $count \n";
> }
>
> Could anyone tell me how is it with while instead of for??
> Thank you!!
>
> Felipe Lopes
> MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
> Faça já o seu. É gratuito!!!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To un

Re: [PHP] Class methods in PHP

2001-02-24 Thread Christian Reiniger

On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
> Is there class methods in php?

Well, there are classes, classes can have methods, there are methods to 
handle classes, methods to inspect methods, methods to inspect classes 
and propably more.

I have no idea what you mean with your question, but I hope that some 
part of the above answers it...

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

"The number of Unix installations has grown to 10, with more expected."
 -- The Unix Programmer's Manual, 2nd Edition, June 1972

--
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-24 Thread Christian Reiniger

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.

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

"The number of Unix installations has grown to 10, with more expected."
 -- The Unix Programmer's Manual, 2nd Edition, June 1972

--
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-24 Thread James Moore



> -Original Message-
> From: David Tandberg-Johansen [mailto:[EMAIL PROTECTED]]
> Sent: 24 February 2001 16:34
> 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.

If you have output buffering on then you need to flish the buffer (see the
manual) otherwise it should happen automatically.

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] DIsplaying page before script finnished

2001-02-24 Thread Fredrik Wahlberg

I think if you use flush() you can send it continually. Rembember to end
every line or the browser will not understand that it shall show it.
Tables can also give you problems, they do not show until they are closed.

/Fredrik

On Sat, 24 Feb 2001, David Tandberg-Johansen wrote:

> 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.
>

- [EMAIL PROTECTED] -
Fredrik Wahlberg
Kristinehovsgatan 12  Home: +46-8-642 35 23
S-117 29 StockholmWork: +46-8-54 54 56 12
SwedenMobile: +46-70-576 16 51


-- 
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] Class methods in PHP

2001-02-24 Thread Kevin Beckford

Well I meant class functions that do not need an object to be declared...
but don't worry about it - I found out. There are none in php.

- Original Message - From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>out
Sent: Saturday, February 24, 2001 11:49 AM
Subject: Re: [PHP] Class methods in PHP


: On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
: > Is there class methods in php?
:
: Well, there are classes, classes can have methods, there are methods to
: handle classes, methods to inspect methods, methods to inspect classes
: and propably more.
:
: I have no idea what you mean with your question, but I hope that some
: part of the above answers it...
:
: --
: Christian Reiniger
: LGDC Webmaster (http://sunsite.dk/lgdc/)
:
: "The number of Unix installations has grown to 10, with more expected."
:  -- The Unix Programmer's Manual, 2nd Edition, June 1972
:
: --
: 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] Fwd: Binding A Socket

2001-02-24 Thread Kyndig


I posted this message, but it never went through:


Not sunny on this end, abit drab today,


I'm workin up a socket bind for a MUD game. Heh, why not, nothin
ta do wright now. I've taken the main socket() call off of php.net
page as an example to bind a port. The script functions, but
when I telnet to the binded port...I get nothing. Any help?

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

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

-- 
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] Help with mass import to MySQL using PHP

2001-02-24 Thread Clayton Dukes



Hi everyone,
 
I'm working on converting my site to 
PHP/MySql.
 
 
I need to figure out a way to import several 
thousand text files into the database while applying certain PHP functions to 
them.
 
 
From now on, when a user submits a new document, it 
gets a random docid assigned to it using the following method:
 
  $time = 
time();  $rand = 
Random_Password(5);  
$docid = $time . $rand;
 
Random_Password is defined as:
 
function Random_Password($length) 
{    
mt_srand((double)microtime()*1000);    
$possible_characters = 
"abcdefghijklmnopqrstuvwxyz";    
$string = "";    
while(strlen($string)<$length) 
{    
$string 
.=    
substr($possible_characters,(mt_rand()%(strlen($possible_characters))),1);    
}    return($string);
 
 
 
After they fill in a form and paste thier document, the following fields 
are submitted to the database:
 
$query = "INSERT INTO documents VALUES ('$docid', '$category', 
'$subcategory', '$date', '$subject', '$title', '$author', '$email', '$language', 
'$grade', '$level', '$city', '$state', '$county', '$school', '$zip', 
'$authors_comments', '$teachers_comments', 'N', '$docdata')";
 
 
 
Now, the million dollar question is:
how do I import the several thousand text documents 
I already have while applying this formulae, aside from manually submitting each 
one ;-)?
 
Here's an example of one of the text 
documents:

Currently, all text documents have exactly the same 
format:
--
$docid
$subject
$title
$author
$email$language$grade$school$country$author_comments$teacher_comments$date--
The only thing that changes are the fields after the colon and the body 
itself.
I realize that the current text files do not have all of the information 
for the new database such as $subcategory, I'm going to have to grandfather the 
old text files in somehow.
Also, there are certain fields that are enums in the database, so 
I need to make sure that each field conforms to that, eg; one of the subject 
fields in the database only allows for "Computers and Internet" not Computer, so 
I need to rewrite that string before placing it in the database. I also need to 
change $grade from any alpha strings to a percentile grade, eg: [b-B]=92 (see 
database format below).
 
--Document 
ID    : 
100Subject    
: 
ComputerTitle  
: internet beyond human 
controlAuthor 
:Email Address  
:Language   : 
englishGrade  
: bSchool System  : ohio state 
universityCountry    
: USAAuthor's Comments  : tom doddTeacher's Comments : well 
doneDate   
: 
5/96--
 
 
 
The Internet Beyond Human ControlThe 
Internet has started to change the way of the world during this decade.  
More homes,companies, and schools are getting hooked online with the 
Internet during the past few years.This  change has started to become 
the new way of life present and future. The Internet system is
 
 
 
And here's the database format:
CREATE TABLE dox (  id bigint(20) DEFAULT 
'0' NOT NULL auto_increment,  docid varchar(20),  category 
enum('Language Arts','Sciences','Humanities','Arts','Special 
Subjects','Other'),  subcategory 
enum('Physics','Biology','Chemistry','Math','Computers and 
Internet','History','Economics','Geography','Law','Religion','Philosophy','Black 
Awareness','Countries','Drugs','Education','Environmental 
Awareness','Politics','Health','Sex and Sexuality','Female 
Awareness','Art','Movies or TV','Music','Sports','Charles 
Dickens','Shakespeare','Biography','Fictional 
Stories','Astronomy','Mythology'),  date varchar(10),  subject 
varchar(200),  title varchar(200),  author 
varchar(200),  email varchar(50),  language 
enum('English','Danish','Dutch','Finnish','German','Spanish'),  grade 
int(3),  level enum('High School','College','Other'),  city 
varchar(15),  state varchar(15),  county 
varchar(15),  school varchar(45),  zip smallint(5),  
authorcomments varchar(200),  teachercomments varchar(200),  
approve enum('Y','N'),  docdata text,  PRIMARY KEY 
(id),  UNIQUE id (id));
 
 
I realize that this is a lot, but from what I have 
read since being subscribed to this e-mail list, you guys have talents that are 
far above and beyond the scope of this. Thank you so much for your help (and 
wisdom!).
 
 
Regards,
Clayton DukesCCNA, CCDA, CCDP, 
CCNPInternetwork Solutions EngineerInternetwork Management 
Engineer

-- 
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] Help with mass import to MySQL using PHP

2001-02-24 Thread richard merit

No answer, but a question.  I noticed you're using, in
effect, two id's for each entry, a id number and a doc
id number.  The first is accomplished thru
auto-increment.  Wouldn't it be easier to us just one
id number, a=LAST_INSERT_ID(id+b) and reserve the
first 10k numbers (b), whatever is needed for your old
files then run a php code to format your old entries
and increment those 1 - 10and forget about
random numbers.  If I'm not mistaken, if you generate
random numbers you'll have to check, to be on the safe
side, to make sure the random number wasn't used for
someother doc. 

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.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] Class methods in PHP

2001-02-24 Thread Aaron Tuller

that's not true.

you can call a static method with the "::" notation.

like ClassName::method();

there's doesn't need to be an instance to do that.

not sure if that's true for all of PHP4 or just 4.04 or whatnot.

-aaron

At 11:56 AM -0500 2/24/01, Kevin Beckford wrote:
>Well I meant class functions that do not need an object to be declared...
>but don't worry about it - I found out. There are none in php.
>
>- Original Message - From: "Christian Reiniger" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>out
>Sent: Saturday, February 24, 2001 11:49 AM
>Subject: Re: [PHP] Class methods in PHP
>
>
>: On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
>: > Is there class methods in php?
>:
>: Well, there are classes, classes can have methods, there are methods to
>: handle classes, methods to inspect methods, methods to inspect classes
>: and propably more.
>:
>: I have no idea what you mean with your question, but I hope that some
>: part of the above answers it...
>:
>: --
>: Christian Reiniger
>: LGDC Webmaster (http://sunsite.dk/lgdc/)
>:
>: "The number of Unix installations has grown to 10, with more expected."
>:  -- The Unix Programmer's Manual, 2nd Edition, June 1972
>:
>: --
>: 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 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] parsing multiple xml documents

2001-02-24 Thread Daniel Convissor

Hi Folks:

I just wrote a basic XML parser using the parse_xml() function set.  Does
what I want on the first document.  But, if I try to run a second document
through, it chokes saying "junk after document element."

All of the files are valid and parse okay if I just send one file through. 
Also, the program runs fine if I redeclare the parser before parsing each
file.  While this works, having to redeclare the parser each time seems far
from efficient.

So, is there a better way to handle this, please?

Sample code is below if you're interested.

Thanks,

--Dan


Yipee!";
  } else {
 echo "\nUGH! ";
 echo xml_error_string(xml_get_error_code($Parser));
  }
   }
}

?>



Yipee!";
  } else {
 echo "\nUGH! ";
 echo xml_error_string(xml_get_error_code($Parser));
  }
   }
}

?>



-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

-- 
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-24 Thread Sascha Schumann

sas Sat Feb 24 11:53:41 2001 EDT

  Modified files:  
/CVSROOTgen_acl_file.m4 avail 
  Log:
  php-gtk karma for zimt
  
  
Index: CVSROOT/gen_acl_file.m4
diff -u CVSROOT/gen_acl_file.m4:1.104 CVSROOT/gen_acl_file.m4:1.105
--- CVSROOT/gen_acl_file.m4:1.104   Sat Feb 24 02:20:38 2001
+++ CVSROOT/gen_acl_file.m4 Sat Feb 24 11:53:41 2001
@@ -24,7 +24,7 @@
 avail|php_pres|pres
 avail|php_qa|qaweb
 avail|php_dev,php_ext,php_doc|phpdoc
-avail|andrei,fmk|php-gtk
+avail|andrei,fmk,zimt|php-gtk
 avail|php_midgard|php4/ext/midgard
 dnl Access to individual dirs in the code tree
 avail|rasmus|php4/ext/aspell
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.100 CVSROOT/avail:1.101
--- CVSROOT/avail:1.100 Sat Feb 24 02:20:38 2001
+++ CVSROOT/avail   Sat Feb 24 11:53:41 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|php-gtk
+avail|andrei,fmk,zimt|php-gtk
 avail|emile,davidg,alan_k,ab|php4/ext/midgard
 avail|rasmus|php4/ext/aspell
 avail|andi|php4/ext/bcmath



-- 
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] Help with mass import to MySQL using PHP

2001-02-24 Thread Clayton Dukes

1. Local Server
2. Either one, I'm trying to learn PHP
3. Yes, this is just a project for which I am not making any money, but I can pay 
someone in respect and admiration ;-)

  - Original Message - 
  From: Todd Pillars 
  To: Clayton Dukes 
  Sent: Saturday, February 24, 2001 2:25 PM
  Subject: RE: [PHP] Help with mass import to MySQL using PHP


  Hi,
   couple of questions:
 1.are you doing this on a local server or a server on the internet?
 2.are you looking for a direction to do this yourself or for someone to write the 
code?
 3.are you looking for free advice?...I am all for free source, but this is going 
to take some time and energy.

  Todd
-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 1:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help with mass import to MySQL using PHP


Hi everyone,

I'm working on converting my site to PHP/MySql.


I need to figure out a way to import several thousand text files into the database 
while applying certain PHP functions to them.


From now on, when a user submits a new document, it gets a random docid assigned 
to it using the following method:


  $time = time();
  $rand = Random_Password(5);
  $docid = $time . $rand;

Random_Password is defined as:

function Random_Password($length) {
mt_srand((double)microtime()*1000);
$possible_characters = "abcdefghijklmnopqrstuvwxyz";
$string = "";
while(strlen($string)<$length) {
$string .=

substr($possible_characters,(mt_rand()%(strlen($possible_characters))),1);
}
return($string);



After they fill in a form and paste thier document, the following fields are 
submitted to the database:

$query = "INSERT INTO documents VALUES ('$docid', '$category', '$subcategory', 
'$date', '$subject', '$title', '$author', '$email', '$language', '$grade', '$level', 
'$city', '$state', '$county', '$school', '$zip', '$authors_comments', 
'$teachers_comments', 'N', '$docdata')";



Now, the million dollar question is:
how do I import the several thousand text documents I already have while applying 
this formulae, aside from manually submitting each one ;-)?

Here's an example of one of the text documents:
Currently, all text documents have exactly the same format:
--
$docid
$subject
$title
$author
$email
$language
$grade
$school
$country
$author_comments
$teacher_comments
$date
--
The only thing that changes are the fields after the colon and the body itself.
I realize that the current text files do not have all of the information for the 
new database such as $subcategory, I'm going to have to grandfather the old text files 
in somehow.
Also, there are certain fields that are enums in the database, so I need to make 
sure that each field conforms to that, eg; one of the subject fields in the database 
only allows for "Computers and Internet" not Computer, so I need to rewrite that 
string before placing it in the database. I also need to change $grade from any alpha 
strings to a percentile grade, eg: [b-B]=92 (see database format below).

--
Document ID: 100
Subject: Computer
Title  : internet beyond human control
Author :
Email Address  :
Language   : english
Grade  : b
School System  : ohio state university
Country: USA
Author's Comments  : tom dodd
Teacher's Comments : well done
Date   : 5/96
--




The Internet Beyond Human Control
The Internet has started to change the way of the world during this decade.  More 
homes,
companies, and schools are getting hooked online with the Internet during the past 
few years.
This  change has started to become the new way of life present and future. The 
Internet system is



And here's the database format:
CREATE TABLE dox (
  id bigint(20) DEFAULT '0' NOT NULL auto_increment,
  docid varchar(20),
  category enum('Language Arts','Sciences','Humanities','Arts','Special 
Subjects','Other'),
  subcategory enum('Physics','Biology','Chemistry','Math','Computers and 
Internet','History','Economics','Geography','Law','Religion','Philosophy','Black 
Awareness','Countries','Drugs','Education','Environmental 
Awareness','Politics','Health','Sex and Sexuality','Female Awareness','Art','Movies or 
TV','Music','Sports','Charles Dickens','Shakespeare','Biography','Fictional 
Stories','Astronomy','Mythology'),
   

Re: [PHP] Help with mass import to MySQL using PHP

2001-02-24 Thread Clayton Dukes

the first field, ID, is just for keeping a standard sequence and isn't
called from any web pages. The second ($docid) is a random field which is
called from a web page, which makes it harder (if not impossible) to
guess/hack. This makes it a bit more secure.

A note about the old docid #'s, my intention is to replace the old $docid
with one in the new format. And, since the random docid is based (partly) on
the time at which it was generated, there's not much chance of it being
duplicated.

- Original Message -
From: "richard merit" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 24, 2001 2:30 PM
Subject: Re: [PHP] Help with mass import to MySQL using PHP


> No answer, but a question.  I noticed you're using, in
> effect, two id's for each entry, a id number and a doc
> id number.  The first is accomplished thru
> auto-increment.  Wouldn't it be easier to us just one
> id number, a=LAST_INSERT_ID(id+b) and reserve the
> first 10k numbers (b), whatever is needed for your old
> files then run a php code to format your old entries
> and increment those 1 - 10and forget about
> random numbers.  If I'm not mistaken, if you generate
> random numbers you'll have to check, to be on the safe
> side, to make sure the random number wasn't used for
> someother doc.
>
> __
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.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]




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

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 12:37:20 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c 
  Log:
  Replace the sixth and seventh parameter of ircg_pconnect()
  with a connection-detail array.  Currently, you can set
  realname, password, ident.  Those information are used
  during the connection setup process.
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.35 php4/ext/ircg/ircg.c:1.36
--- php4/ext/ircg/ircg.c:1.35   Sat Feb 24 04:37:18 2001
+++ php4/ext/ircg/ircg.cSat Feb 24 12:37:19 2001
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.35 2001/02/24 12:37:18 sas Exp $ */
+/* $Id: ircg.c,v 1.36 2001/02/24 20:37:19 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -87,7 +87,8 @@
irc_write_buf wb;
HashTable ctcp_msgs;
char *ident; /* NOT available outside of ircg_pconnect or register_hooks */
-   char *password; /* NOT available outside of ircg_pconnect or register_hooks */
+   char *password; /* dito */
+   char *realname; /* dito */
 } php_irconn_t;
 
 static char *fmt_msgs_default[] = {
@@ -597,6 +598,14 @@
smart_str_sets(&m, irconn->password);
irc_set_password(conn, &m);
}
+
+#if defined(IRCG_API_VERSION) && IRCG_API_VERSION >= 20010225
+   if (irconn->realname) {
+   smart_str m;
+   smart_str_sets(&m, irconn->realname);
+   irc_set_realname(conn, &m);
+   }
+#endif

irc_register_hook(conn, IRCG_MSG, msg_handler);
irc_register_hook(conn, IRCG_QUIT, quit_handler);
@@ -636,26 +645,19 @@
 PHP_FUNCTION(ircg_pconnect)
 {
/* This should become an array very soon */
-   zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL, **p6, **p7;
+   zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL, **p6;
const char *username;
const char *server = "0";
-   const char *ident = NULL;
-   const char *password = NULL;
int port = 6667;
php_fmt_msgs_t *fmt_msgs = NULL;
php_irconn_t *conn;

-   if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 7
-   || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, 
&p5, &p6, &p7) == FAILURE)
+   if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 6
+   || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, 
+&p5, &p6) == FAILURE)
WRONG_PARAM_COUNT;
 
switch (ZEND_NUM_ARGS()) {
-   case 7:
-   convert_to_string_ex(p7);
-   password = Z_STRVAL_PP(p7);
case 6:
-   convert_to_string_ex(p6);
-   ident = Z_STRVAL_PP(p6);
case 5:
case 4:
convert_to_string_ex(p4);
@@ -677,8 +679,28 @@
 */
conn = malloc(sizeof(*conn));
conn->fd = -1;
-   conn->ident = ident;
-   conn->password = password;
+   conn->ident = conn->password = conn->realname = NULL;
+   if (ZEND_NUM_ARGS() > 5 && Z_TYPE_PP(p6) == IS_ARRAY) {
+   zval **val;
+
+   if (zend_hash_find(Z_ARRVAL_PP(p6), "ident", sizeof("ident"),
+   (void **) &val) == SUCCESS) {
+   convert_to_string_ex(val);
+   conn->ident = Z_STRVAL_PP(val);
+   }
+
+   if (zend_hash_find(Z_ARRVAL_PP(p6), "password", sizeof("password"),
+   (void **) &val) == SUCCESS) {
+   convert_to_string_ex(val);
+   conn->password = Z_STRVAL_PP(val);
+   }
+
+   if (zend_hash_find(Z_ARRVAL_PP(p6), "realname", sizeof("realname"),
+   (void **) &val) == SUCCESS) {
+   convert_to_string_ex(val);
+   conn->realname = Z_STRVAL_PP(val);
+   }
+   }
 
zend_hash_init(&conn->ctcp_msgs, 10, NULL, NULL, 1);
if (irc_connect(username, register_hooks, 



-- 
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] function mail

2001-02-24 Thread Augusto Cesar Castoldi



$sent=mail("[EMAIL PROTECTED]", $subject, $msg, $from);

if $sent==1 --> the e-mail was sent

if $sent==0 --> problem when sending e-mail??

how this works? When the function mail will have a problem?

if the "to" mail are wrong?

regards,

Augusto Cesar Castoldi


-- 
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 /sapi/cgi cgi_main.c /sapi/servlet servlet.c

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 13:05:01 2001 EDT

  Modified files:  
/php4/sapi/cgi  cgi_main.c 
/php4/sapi/servlet  servlet.c 
  Log:
  Neither the CGI nor the Servlet SAPI module call syslog, so remove
  references to the syslog include files.
  
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.91 php4/sapi/cgi/cgi_main.c:1.92
--- php4/sapi/cgi/cgi_main.c:1.91   Fri Feb 23 14:07:15 2001
+++ php4/sapi/cgi/cgi_main.cSat Feb 24 13:05:01 2001
@@ -57,10 +57,7 @@
 #ifdef PHP_WIN32
 #include 
 #include 
-#include "win32/syslog.h"
 #include "win32/php_registry.h"
-#else
-#include 
 #endif
 
 #if HAVE_SIGNAL_H
Index: php4/sapi/servlet/servlet.c
diff -u php4/sapi/servlet/servlet.c:1.44 php4/sapi/servlet/servlet.c:1.45
--- php4/sapi/servlet/servlet.c:1.44Fri Feb 23 14:07:15 2001
+++ php4/sapi/servlet/servlet.c Sat Feb 24 13:05:01 2001
@@ -54,10 +54,7 @@
 #ifdef PHP_WIN32
 #include 
 #include 
-#include "win32/syslog.h"
 #include "win32/php_registry.h"
-#else
-#include 
 #endif
 
 #include "zend_compile.h"



-- 
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] cvs: php4 /sapi/cgi cgi_main.c

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 13:07:07 2001 EDT

  Modified files:  
/php4/sapi/cgi  cgi_main.c 
  Log:
  php_register_command_line_global_vars only needs file scope.
  
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.92 php4/sapi/cgi/cgi_main.c:1.93
--- php4/sapi/cgi/cgi_main.c:1.92   Sat Feb 24 13:05:01 2001
+++ php4/sapi/cgi/cgi_main.cSat Feb 24 13:07:07 2001
@@ -340,7 +340,7 @@
 }
 
 
-void php_register_command_line_global_vars(char **arg)
+static void php_register_command_line_global_vars(char **arg)
 {
char *var, *val;
ELS_FETCH();



-- 
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] file handle error? or something else?

2001-02-24 Thread rick - SomersNet, Inc.

Hello All...

I wanted to write a program that would search google for specific
keywords from my database, and report to me if it found my domain, and
if so what page it was on.

Well it works, and it's very cool I might add, but then it fails...  
:(   But it doesn't fail right away.. I have had it fail as fast as 5
mins into exec, and as long as 1 1/2 hours into exec... and when it does
fail, it spits out 1 error over, and over, and over, just as fast as it
can (i think it gets stuck in the "for").. and the error says something
about "invalid file handle resource"...

I am testing it with 4 domains, and 90 keywords, and only having it
search the first 50 pages.. It takes a domain from mysql and then gets
the list of keywords to check. It then calls google and checks each
keyword page for the key domain.

Below is a copy of my code as it stands right now. I don't expect anyone
to have a quick answer to this problem, but I am hopeful that someone
might see something in the code that could be done better..
hopefuly   :)

BTW.. I am running FreeBSD/3.4 and PHP/4.0.2


 500) {
break;
}

 $agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)';
 $mydata=("q=$keyword&hl=en&lr=&safe=off&start=$i&sa=N");
 $host="www.google.com";
 $filename = "/search?$mydata";
 $sp=fsockopen($host,80) or brake;
 socket_set_timeout($sp, 600) or brake;
 fputs($sp,"GET $filename HTTP/1.1\n") or brake;
 fputs($sp,"Host: $host\n");
 fputs($sp,"User-Agent: $agent\n");
 fputs($sp,"Connection: close\n\n");
  while(!feof($sp)) {
 $output .= fgets($sp,128);
 }
 fclose($sp);
 $sp="";

 if(ereg("$domain","$output")){
 $found=1;
 $output="";
   break;
 } else{
 $found=0;
 $output="";}

}

if($found == "1"){
$page = $i / 10;
print "$domain / $keyword - page $page \n";
} else{
$page = "50";
print "$domain / $keyword - page $page+ \n";}

flush();

# add to database
mysql_query("INSERT INTO Stats
VALUES('$domain','$keyword','$month','$day','$year','$page')");

# end keywords
}
print "\n\n";
# end domains
}

mysql_close($connect);

?>





Thanks for your time and help, I really appreciate it... I am hope it's
just something simple...  :) 

Thanks Allot,

..rick

-- 
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/standard basic_functions.c php_ext_syslog.h syslog.c /main php_syslog.h

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 13:08:15 2001 EDT

  Modified files:  
/php4/ext/standard  basic_functions.c php_ext_syslog.h syslog.c 
/php4/main  php_syslog.h 
  Log:
  Actually compile on systems without syslog.
  
  PR: #9412
  
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.307 
php4/ext/standard/basic_functions.c:1.308
--- php4/ext/standard/basic_functions.c:1.307   Tue Feb 20 06:23:03 2001
+++ php4/ext/standard/basic_functions.c Sat Feb 24 13:08:15 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.307 2001/02/20 14:23:03 andrei Exp $ */
+/* $Id: basic_functions.c,v 1.308 2001/02/24 21:08:15 sas Exp $ */
 
 #include "php.h"
 #include "php_main.h"
@@ -507,10 +507,12 @@
PHP_FE(ezmlm_hash,  NULL)
 
/* functions from syslog.c */
+#ifdef HAVE_SYSLOG_H
PHP_FE(openlog, NULL)
PHP_FE(syslog,  NULL)
PHP_FE(closelog,NULL)
PHP_FE(define_syslog_variables, NULL)
+#endif
 
/* functions from lcg.c */
PHP_FE(lcg_value, NULL)
Index: php4/ext/standard/php_ext_syslog.h
diff -u php4/ext/standard/php_ext_syslog.h:1.3 php4/ext/standard/php_ext_syslog.h:1.4
--- php4/ext/standard/php_ext_syslog.h:1.3  Sun Jul 23 18:39:49 2000
+++ php4/ext/standard/php_ext_syslog.h  Sat Feb 24 13:08:15 2001
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_ext_syslog.h,v 1.3 2000/07/24 01:39:49 david Exp $ */
+/* $Id: php_ext_syslog.h,v 1.4 2001/02/24 21:08:15 sas Exp $ */
 
 #ifndef PHP_EXT_SYSLOG_H
 #define PHP_EXT_SYSLOG_H
@@ -25,9 +25,9 @@
 
 #include "php_syslog.h"
 
-extern PHP_MINIT_FUNCTION(syslog);
-extern PHP_RINIT_FUNCTION(syslog);
-extern PHP_RSHUTDOWN_FUNCTION(syslog);
+PHP_MINIT_FUNCTION(syslog);
+PHP_RINIT_FUNCTION(syslog);
+PHP_RSHUTDOWN_FUNCTION(syslog);
 
 PHP_FUNCTION(openlog);
 PHP_FUNCTION(syslog);
Index: php4/ext/standard/syslog.c
diff -u php4/ext/standard/syslog.c:1.24 php4/ext/standard/syslog.c:1.25
--- php4/ext/standard/syslog.c:1.24 Sun Jan 21 09:26:43 2001
+++ php4/ext/standard/syslog.c  Sat Feb 24 13:08:15 2001
@@ -16,9 +16,11 @@
+--+
  */
 
-/* $Id: syslog.c,v 1.24 2001/01/21 17:26:43 rasmus Exp $ */
+/* $Id: syslog.c,v 1.25 2001/02/24 21:08:15 sas Exp $ */
 
 #include "php.h"
+
+#ifdef HAVE_SYSLOG_H
 #include "php_ini.h"
 #include "zend_globals.h"
 
@@ -261,6 +263,8 @@
RETURN_TRUE;
 }
 /* }}} */
+
+#endif
 
 /*
  * Local variables:
Index: php4/main/php_syslog.h
diff -u php4/main/php_syslog.h:1.4 php4/main/php_syslog.h:1.5
--- php4/main/php_syslog.h:1.4  Fri Jun  9 10:21:40 2000
+++ php4/main/php_syslog.h  Sat Feb 24 13:08:15 2001
@@ -4,7 +4,10 @@
 #ifdef PHP_WIN32
 #include "win32/syslog.h"
 #else
+#include "php_config.h"
+#ifdef HAVE_SYSLOG_H
 #include 
+#endif
 #endif
 
 /* 



-- 
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] cvs: php4 /ext/midgard mgd_internal.h midgard.c oop.c php_midgard.h

2001-02-24 Thread David Guerizec

davidg  Sat Feb 24 13:12:11 2001 EDT

  Modified files:  
/php4/ext/midgard   mgd_internal.h midgard.c oop.c php_midgard.h 
  Log:
  fixed the error reporting.
  added custom log to the lib
  
  
Index: php4/ext/midgard/mgd_internal.h
diff -u php4/ext/midgard/mgd_internal.h:1.6 php4/ext/midgard/mgd_internal.h:1.7
--- php4/ext/midgard/mgd_internal.h:1.6 Thu Feb 22 09:39:37 2001
+++ php4/ext/midgard/mgd_internal.h Sat Feb 24 13:12:11 2001
@@ -1,4 +1,4 @@
-/* $Id: mgd_internal.h,v 1.6 2001/02/22 17:39:37 davidg Exp $
+/* $Id: mgd_internal.h,v 1.7 2001/02/24 21:12:11 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]>
@@ -42,7 +42,7 @@
   if (!mgd_rcfg()) { \
  RETURN_FALSE_BECAUSE(MGD_ERR_NOT_CONNECTED); \
   } \
-  mgd_set_errno(MGD_ERR_OK); \
+  mgd_reset_errno(); \
} while (0);
 
 #define MGD_FUNCTION(name) \
Index: php4/ext/midgard/midgard.c
diff -u php4/ext/midgard/midgard.c:1.16 php4/ext/midgard/midgard.c:1.17
--- php4/ext/midgard/midgard.c:1.16 Fri Feb 23 01:53:49 2001
+++ php4/ext/midgard/midgard.c  Sat Feb 24 13:12:11 2001
@@ -1,4 +1,4 @@
-/* $Id: midgard.c,v 1.16 2001/02/23 09:53:49 davidg Exp $
+/* $Id: midgard.c,v 1.17 2001/02/24 21:12:11 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]>
@@ -373,6 +373,9 @@
SLS_FETCH();
MGDLS_FETCH();

+   /* set apache log facilities available to the library */
+   // mgd_set_log_debug_func(mgd_log_debug);
+
midgard_module = ap_find_linked_module("mod_midgard.c");
if (!midgard_module) {
MGDG(rcfg) = NULL;
@@ -552,10 +555,30 @@
   MGDG(mgd_errno) = mgd_errno;
 }
 
+void mgd_reset_errno(void)
+{
+   MGDLS_FETCH();
+   MGDG(mgd_errno) = MGD_ERR_OK;
+}
+
 int mgd_get_errno()
 {
MGDLS_FETCH();
return MGDG(mgd_errno);
+}
+
+void mgd_log_debug(int flags, const char *fmt, ...)
+{
+   midgard_pool *pool;
+   char *str;
+   va_list args;
+
+   pool = mgd_alloc_pool();
+   va_start(args, fmt);
+   str = mgd_vformat(mgd_handle(), pool, fmt, args);
+   va_end(args);
+   MGD_LOG_START("\nDEBUG: %s") MGD_LOG_ARG(str) MGD_LOG_END()
+   mgd_free_pool(pool);
 }
 
 MGD_FUNCTION(get_midgard)
Index: php4/ext/midgard/oop.c
diff -u php4/ext/midgard/oop.c:1.7 php4/ext/midgard/oop.c:1.8
--- php4/ext/midgard/oop.c:1.7  Fri Feb 23 02:04:48 2001
+++ php4/ext/midgard/oop.c  Sat Feb 24 13:12:11 2001
@@ -1,4 +1,4 @@
-/* $Id: oop.c,v 1.7 2001/02/23 10:04:48 davidg Exp $
+/* $Id: oop.c,v 1.8 2001/02/24 21:12:11 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]>
@@ -121,11 +121,7 @@
 
 void php_midgard_delete(zval * return_value, const char *table, int id)
 {
-   if (!mgd_rcfg()) {
-   RETURN_FALSE_BECAUSE(MGD_ERR_NOT_CONNECTED);
-   }
-
-   RETVAL_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
+   CHECK_MGD;
 
if (mgd_delete(mgd_handle(), table, id)) {
   RETURN_TRUE;
@@ -151,17 +147,14 @@
const char *fields, int id, ...)
 {
va_list args;
-   RETVAL_FALSE_BECAUSE(MGD_ERR_INTERNAL);
-
-   if (!mgd_rcfg()) {
-   RETURN_FALSE_BECAUSE(MGD_ERR_NOT_CONNECTED);
-   }
+   CHECK_MGD;
 
va_start(args, id);
if (mgd_vupdate(mgd_handle(), table, id, fields, args)) {
   RETVAL_TRUE;
}
else {
+ RETVAL_FALSE_BECAUSE(MGD_ERR_INTERNAL);
   /* EEH: TODO: log_error(
  "Midgard: update of %s %d failed",
 table ? table : "", id);
@@ -178,8 +171,6 @@
int id;
CHECK_MGD;
 
-   RETVAL_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
-
va_start(args, values);
id = mgd_vcreate(mgd_handle(), table, fields, values, args);
va_end(args);
@@ -202,11 +193,7 @@
va_list args;
midgard_res *res;
 
-   if (!mgd_rcfg()) {
-   RETURN_FALSE_BECAUSE(MGD_ERR_NOT_CONNECTED);
-   }
-
-   RETVAL_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
+   CHECK_MGD;
 
va_start(args, order);
res =
@@ -242,11 +229,7 @@
midgard_pool *pool = NULL;
char *propname, *value=NULL;
 
-   if (!mgd_rcfg()) {
-   RETURN_FALSE_BECAUSE(MGD_ERR_NOT_CONNECTED);
-   }
-
-   RETVAL_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
+   CHECK_MGD;
 
 #if HAVE_MIDGARD_SITEGROUPS
if (grouped)
@@ -284,7 +267,7 @@
(char*)mgd_colname(res, i),
value, 1);
}
-   }
+   } else RETVAL_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
 
if (res)
mgd_release(res);
@@ -314,7 +297,6 @@
int i;

[PHP-CVS] cvs: php4 /main network.c

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 13:14:18 2001 EDT

  Modified files:  
/php4/main  network.c 
  Log:
  Declare inet_aton properly, if the system lacks support for it.
  
  PR: #9382
  
  
Index: php4/main/network.c
diff -u php4/main/network.c:1.14 php4/main/network.c:1.15
--- php4/main/network.c:1.14Sun Jan 21 09:26:44 2001
+++ php4/main/network.c Sat Feb 24 13:14:18 2001
@@ -15,7 +15,7 @@
| Authors: Stig Venaas <[EMAIL PROTECTED]> |
+--+
  */
-/* $Id: network.c,v 1.14 2001/01/21 17:26:44 rasmus Exp $ */
+/* $Id: network.c,v 1.15 2001/02/24 21:14:18 sas Exp $ */
 
 #include "php.h"
 
@@ -39,7 +39,9 @@
 #if HAVE_ARPA_INET_H
 #include 
 #endif
-#else
+#endif
+
+#ifndef HAVE_INET_ATON
 int inet_aton(const char *, struct in_addr *);
 #endif
 



-- 
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] cvs: php4 /ext/standard datetime.c

2001-02-24 Thread Sascha Schumann

sas Sat Feb 24 13:18:29 2001 EDT

  Modified files:  
/php4/ext/standard  datetime.c 
  Log:
  Don't assume that tzname exists, if tm_zone does not exist.
  
  PR: #9380
  
  
Index: php4/ext/standard/datetime.c
diff -u php4/ext/standard/datetime.c:1.66 php4/ext/standard/datetime.c:1.67
--- php4/ext/standard/datetime.c:1.66   Fri Feb  9 07:28:23 2001
+++ php4/ext/standard/datetime.cSat Feb 24 13:18:28 2001
@@ -19,7 +19,7 @@
  */
 
 
-/* $Id: datetime.c,v 1.66 2001/02/09 15:28:23 rasmus Exp $ */
+/* $Id: datetime.c,v 1.67 2001/02/24 21:18:28 sas Exp $ */
 
 
 #include "php.h"
@@ -260,7 +260,7 @@
case 'T':   /* timezone name */
 #if HAVE_TM_ZONE
size += strlen(ta->tm_zone);
-#else
+#elif HAVE_TZNAME
size += strlen(tzname[0]);
 #endif
break;
@@ -452,7 +452,7 @@
case 'T':   /* timezone name */
 #if HAVE_TM_ZONE
strcat(return_value->value.str.val, ta->tm_zone);
-#else
+#elif HAVE_TZNAME
strcat(return_value->value.str.val, tzname[0]);
 #endif
break;



-- 
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] file handle error? or something else?

2001-02-24 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("rick - SomersNet, Inc.") wrote:

>  $sp=fsockopen($host,80) or brake;
>  socket_set_timeout($sp, 600) or brake;
>  fputs($sp,"GET $filename HTTP/1.1\n") or brake;

Hmm.  What's that 'or brake' stuff?  'brake' is used as a constant, but you 
don't show what it's defined as.  I assume what you're going for is an 'or 
die()' function call...?

-- 
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]




[PHP] Please help - File Uploads, 2nd try

2001-02-24 Thread Ed Lazor

I upgraded my web server and now file uploads don't work.  A test script is 
listed below.  It puts the file on the server, but the file has

Content-Type: image/pjpeg^M
^M

pre-pended to it, thus breaking the file.  Do you know why it's doing this 
and how to fix it?

-Ed



File Upload Test








Upload:  















 here for display purposes only
$Location = "/htdocs/attachments/test/" . $Filename;
#copy($uploadedfile, $Location);

move_uploaded_file($uploadedfile, $Location);

print "File upload processed.";
print "Link to file";
}
?>


-- 
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] C vs PHP

2001-02-24 Thread Gustavo Vieira Goncalves Coelho Rios

Hi folks!

I am a used C programmer and now my company decide to switch every non
performance critical web stuf to php. Since i am just a php beginner i
have some questions i could not find anywhere!

As you may know, C does not provide any kind of support for garbage
collection, every thing you want to be done you have to tell (in C) by
yourself. But in PHP i have no ideia about how it manages memory. for
instance:


In C:

str = (char *) malloc(10u);

if i decide to alloc new memory for str (just for explanation purposes),
and i do:

str = (char *) malloc(33u);

i would be in trouble, cause the reference for the previous allocated
pool of memory would be lost.
The approach could be to save the previous references or use realloc.

Now, my doubt: How PHP deals with this:

$query = "select * from apm where id=3";

/* do my processing */

/* and set query to a new string */

$query = "Query done without errors";


What will happen with the previous allocated memory for $query?
I don't like my application eating memory without releasing it after
they are no need any more.

May some one explain how to prevent such scenarios ?

Thanks a lot for your time and cooperation.

best regrads.

Gustavo Rios

-- 
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] CLOB update difficulties

2001-02-24 Thread Chris Murtland

Hello,

I am trying to update an Oracle 8i CLOB field. I have looked at previous
messages on the list and am trying the following:

$sql="update murtland.articles set
title='$title',release_date=TO_DATE('$release_date','-MM-DD'),body=:body
text,sections='$sections',mod_date=TO_DATE('$mod_date','-mm-dd
hh24:mi:ss'),mod_userid=$userid where articleid=$articleid";
//echo $sql;
$stmt=OCIParse($conn,$sql);
$bodytext = OCINewDescriptor($conn, OCI_D_LOB);
OCIBindByName($stmt,":bodytext",&$bodytext,-1,OCI_B_CLOB);
OCIExecute($stmt, OCI_DEFAULT);
$bodytext->save($body);
OCICommit($stmt);
$bodytext->free();
OCIFreeStatement($stmt);
OCILogoff($conn);

However, this gives me the error: invalid LOB locator specified.

Any suggestions would be greatly appreciated.

Thanks,
Chris


Chris Murtland
Studio Moxie, LLC
www.studiomoxie.com
336.773.1684
800.707.2367 fax/voicemail


-- 
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] searching Oracle 8i CLOB columns

2001-02-24 Thread Chris Murtland

Does anyone have any example code for searching Oracle 8i CLOB fields? Do I
have to create a stored procedure to be able to do this?

I want to be able to search a separate varchar column in addition to
searching the CLOB column.

Thanks,
Chris



Chris Murtland
Studio Moxie, LLC
www.studiomoxie.com
336.773.1684
800.707.2367 fax/voicemail


-- 
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] Please help - File Uploads, 2nd try

2001-02-24 Thread Gustavo Vieira Goncalves Coelho Rios

Ed Lazor wrote:
> 
> I upgraded my web server and now file uploads don't work.  A test script is
> listed below.  It puts the file on the server, but the file has
> 
> Content-Type: image/pjpeg^M
> ^M
> 
> pre-pended to it, thus breaking the file.  Do you know why it's doing this
> and how to fix it?
> 

This happens because you are dealing with DOS text in a unix
environment.
You can use dos2unix utility in order to correct this problem. Remenber,
always transfer text files unix->dos->unix using ascii mode.

-- 
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 while as for...

2001-02-24 Thread Steve Edberg

At 12:44 PM -0800 2/24/01, Felipe Lopes wrote:
>I was trying to code the following script using while instead of for,
>but I'm havig a lot of problems...Is it possible to do what I want?
>
>for ($count = 0; $count <= 10; $count++){
>echo "Number is $count \n";
>}
>
>Could anyone tell me how is it with while instead of for??
>Thank you!!


$count = 0;
while ($count <= 10) {
echo "Number is $count \n";
$count++;
}

I think - if you're feeling obscure - that

$count = 0;
while
(($count <= 10) && print 'Number is '.$count++." \n")
{}

will work too. As will - using alternate while syntax -

$count = 0;
while ($count <= 10):
echo 'Number is '.$count++." \n";
endwhile;

See:

http://www.php.net/manual/en/control-structures.while.php

for more info.

-steve


>Felipe Lopes
>MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
>Faça já o seu. É gratuito!!!


--
+--- "They've got a cherry pie there, that'll kill ya" --+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- FBI Special Agent Dale Cooper ---+

--
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] C vs PHP

2001-02-24 Thread James Moore


> As you may know, C does not provide any kind of support for garbage
> collection, every thing you want to be done you have to tell (in C) by
> yourself. But in PHP i have no ideia about how it manages memory. for
> instance:

You dont need to worry about mem mangement as PHP does it all for you.

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]




[PHP] Inserting user name and password into mysql...

2001-02-24 Thread Felipe Lopes

Hi!
Here I am again...I have a problem to insert user name, password and 
host into mysql...I'd like to know what commands I need to do that 
(since the command to start mysql on my computer) so that way I won't be 
able to do anything wrong!
Thank you

Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

-- 
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] Cookie References?

2001-02-24 Thread Jeff Oien

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]




Re: [PHP] $result = $$function

2001-02-24 Thread Simon Garner

From: "Peter Van Dijck" <[EMAIL PROTECTED]>

> Hi,
> I'd like to do:
> $function = "build_result()";
> $result = $$function;
> but it doesn't seem to work.


Try:




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] checking $more still does not work !

2001-02-24 Thread Simon Garner

From: "Web Admin" <[EMAIL PROTECTED]>

> Hi Kaab,
> There must be another problem, it should work. Maybe it helps if
> you send your code here. To see how a simple script works, try
> this tiny script named test.php:
> 
> 
> 
> 
>   if ($more) {print "Submit is pressed"; };
> ?>
> 
> If you first load the php page, you don't see anything rather than a 
> submit button. If you press submit, you will see a message.
>
> Ahmad Anvari



I think you need a value for the submit 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] Cookie References?

2001-02-24 Thread php3

Addressed to: <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from <[EMAIL PROTECTED]> Sat, 24 Feb 2001 16:42:09 -0600
>
> Could you give me some URLs for tutorials related
> to cookies and good reference material?

Not directly, but there are a number of tutorial links at:

   http://www.php.net/links.php


>
> One question I have is can a cookie never expire?

No, but a cookie that expires in ten years is almost as good.  I bet no
one will have the same cookie file long enough for that to expire.






Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.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] C vs PHP

2001-02-24 Thread Michael Kimsal

http://www.zend.com/zend/art/under-php4-hood.php
and
http://www.zend.com/zend/art/ref-count.php

are articles that go into a bit more depth on this topic.  Maybe not
as detailed as you'd like, but they explain a bit more about
how/why "PHP does it for you" is a valid reply to your question.

Gustavo Vieira Goncalves Coelho Rios wrote:

> Hi folks!
>
> I am a used C programmer and now my company decide to switch every non
> performance critical web stuf to php. Since i am just a php beginner i
> have some questions i could not find anywhere!
>
> As you may know, C does not provide any kind of support for garbage
> collection, every thing you want to be done you have to tell (in C) by
> yourself. But in PHP i have no ideia about how it manages memory. for
> instance:
>
> In C:
>
> str = (char *) malloc(10u);
>
> if i decide to alloc new memory for str (just for explanation purposes),
> and i do:
>
> str = (char *) malloc(33u);
>
> i would be in trouble, cause the reference for the previous allocated
> pool of memory would be lost.
> The approach could be to save the previous references or use realloc.
>
> Now, my doubt: How PHP deals with this:
>
> $query = "select * from apm where id=3";
>
> /* do my processing */
>
> /* and set query to a new string */
>
> $query = "Query done without errors";
>
> What will happen with the previous allocated memory for $query?
> I don't like my application eating memory without releasing it after
> they are no need any more.
>
> May some one explain how to prevent such scenarios ?
>
> Thanks a lot for your time and cooperation.
>
> best regrads.
>
> Gustavo Rios
>
> --
> 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] persistant user tracking

2001-02-24 Thread Mitchell Hagerty


What are some methods for persistant user tracking?

I need to limit the number of times a person can  search for certain material without 
forcing them to create a login.

Currently I am using cookies to limit the number of searches a person can do  but, 
quiting and removing the cookie 
file easily defeats that.  Storing their IP address locally would work but then not 
everyone has a static ip. Would 
grabbing the MAC from their ethernet card be doable? Again alot of people use modems. 

Any thoughts or resources you know of?
tks
mitch



-- 
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] Please help - File Uploads, 2nd try

2001-02-24 Thread Ed Lazor

At 06:44 PM 2/24/2001 +, Gustavo Vieira Goncalves Coelho Rios wrote:
>Ed Lazor wrote:
> >
> > I upgraded my web server and now file uploads don't work.  A test script is
> > listed below.  It puts the file on the server, but the file has
> >
> > Content-Type: image/pjpeg^M
> > ^M
> >
> > pre-pended to it, thus breaking the file.  Do you know why it's doing this
> > and how to fix it?
> >
>
>This happens because you are dealing with DOS text in a unix
>environment.
>You can use dos2unix utility in order to correct this problem. Remenber,
>always transfer text files unix->dos->unix using ascii mode.

I don't understand.  It's appending Content-Type to all of the files.  I 
tested a few other files like tgz files and it put a content type in them 
as well.  Since the files are being uploaded in a browser form, shouldn't 
the unix / dos issue be eliminated?

-Ed


-- 
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] Please help - File Uploads, 2nd try

2001-02-24 Thread Koncz Ádám

As Ed Lazor wrote:

> I upgraded my web server and now file uploads don't work.  A test script
is
> listed below.  It puts the file on the server, but the file has
> Content-Type: image/pjpeg^M
> ^M
> pre-pended to it, thus breaking the file.  Do you know why it's doing this
> and how to fix it?

That's a php 4.0.4pl1 BUG.

To find a _possible_ patch visit:

http://bugs.php.net/bugs.php?id=8995

AND use trim() to remove unwanted linebreaks (appear in the front of the
var. values)!



-- 
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] Please help - File Uploads, 2nd try

2001-02-24 Thread Koncz Ádám

Sorry, wrong link was added in my prev mail.

> To find a _possible_ patch visit:

http://marc.theaimsgroup.com/?l=php-dev&m=98233943916254&w=2



-- 
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] Database Paging using MSSQL 2000

2001-02-24 Thread Manuel Lemos

Hello Ankur,

On 21-Feb-01 06:09:04, you wrote:

>I am implementing a database application using PHP4 and MSSQL2000. I have a
>database table which has a large no. of tuples. I want to display the data in
>the form of pages with Prev Next buttons.

>I wanted to know if there is some syntax in the MSSQL Select statement which
>can allow me to limit the no. of records being returned. I am lookin at
>functionality which is similar to LIMIT in Mysql.

>for ex, LIMIT 10,10  in MYSQL returns to me a maximum of 10 records starting
>from the 10th record in the returned recordset.

>is there any similar functionality available in MSSQL.

You need to use server side cursors.  You may want to look how that is done
in Metabase, a PHP database independent package that has a function
MetabaseSetSelectedRowRange($database,$first,$limit) that may be used
before executing a query and it works like if you are using the
LIMIT $first,$limit query of MySQL.

You may want get Metabase for free here:

http://phpclasses.UpperDesign.com/browse.html/package/20

You may also want to look into this Query result table display class that
uses this Metabase feature to display query results split in pages:

http://phpclasses.UpperDesign.com/browse.html/package/130

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


-- 
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]

2001-02-24 Thread Kath

Don't forget to close the .  Netscape doesn't like it without that
sometimes.

- Kath

- Original Message -
From: "PHPBeginner.com" <[EMAIL PROTECTED]>
To: "Peter Houchin" <[EMAIL PROTECTED]>; "PHP MAIL GROUP"
<[EMAIL PROTECTED]>
Sent: Saturday, February 24, 2001 1:16 AM
Subject: RE: [PHP]  No it will give you the same value twice...
>
> you need a loop
>
>
> 
> ACT
> VIC
>
>
>
> looping the rows .,...{
>
>echo "".$row['state_abbr']."
> ";
>
> }
>
> 
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
>
>
> -Original Message-
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 1:17 PM
> To: PHP MAIL GROUP
> Subject: [PHP] 
>
> if i have a form with a select box in it how an i get the values to echo a
> php value ...
>
> ie
>
> 
> ACT
> VIC
> 
>
> can i change it to say
> 
> ACT
> VIC
> 
>
> so that when the page loads it shows which ever option is in the Data
base?
>
> 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 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] comparing numbers

2001-02-24 Thread Clayton Dukes


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




Re: [PHP] comparing numbers

2001-02-24 Thread Joe Stump

just replace the [] with ()

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

--Joe

On Sat, Feb 24, 2001 at 09:54:08PM -0500, Clayton Dukes wrote:
> 
> 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
> 

-- 

---
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] comparing numbers

2001-02-24 Thread David Harrison

Do you mean something like: 



--dave


-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 12:54 PM
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]




[PHP] PHP4 install question

2001-02-24 Thread Ed Lazor

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]




Re: [PHP] comparing numbers

2001-02-24 Thread Clayton Dukes

Ahh, cool, thanks :-)


- Original Message -
From: "Joe Stump" <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 24, 2001 10:03 PM
Subject: Re: [PHP] comparing numbers


> just replace the [] with ()
>
> if($id <= 59)
> {
>   $id = 81;
> }
>
> --Joe
>
> On Sat, Feb 24, 2001 at 09:54:08PM -0500, Clayton Dukes wrote:
> >
> > 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
> >
>
> --
>
> --
-
> Joe Stump, PHP Hacker,
 -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]




[PHP] compiling in imap probs

2001-02-24 Thread Mitchell Hagerty

ok last email from me for awhile :)

everyone on this list has been great and i've gotten some great tips and
advise! tks

i'm trying to compile in imap support --with-imap

freebsd 4.2
apache_1.3.14
php4.0.4pl1

followed the directions on http://www.php.net/manual/en/ref.imap.php
and php compiled with no complaints. When i go to compile apache I get
this:

/usr/local/lib/libc-client4.so: undefined reference to `mm_expunged'
14 more
/usr/local/lib/libc-client4.so: undefined reference to `mm_dlog'
 Error code 1

Stop in /src/apache_1.3.14/src/helpers
Error Output for sanity check ==
 end of error report ==

Aborting!

what gives? any suggestions?

tks
mitch



-- 
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] Detecting if JavaScript is enabled

2001-02-24 Thread Jochen Kächelin

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]




[PHP] generate e.g. circles on the fly with coordinates for postioning

2001-02-24 Thread Helmut Ott

Can php + what modules do this and 
has anybody succeeded to do something like the followingbefore?

I want to generate simple images on the fly, e.g. a 50px circle on a transparent 
background of 200x200 px using php.

I want to position the circle on the background using  x and y coodinates. Is this 
possible with what php and additional tools?

Thanks alot

Helmut



[PHP] Detecting JavaScript

2001-02-24 Thread Jochen Kächelin

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] generate e.g. circles on the fly with coordinates for postioning

2001-02-24 Thread Joe Conway

>Subject: [PHP] generate e.g. circles on the fly with coordinates for
postioning
>

>Can php + what modules do this and
>has anybody succeeded to do something like the followingbefore?
>
>I want to generate simple images on the fly, e.g. a 50px circle on a
transparent background of 200x200 px using php.
>
>I want to position the circle on the background using  x and y coodinates.
Is this possible with what php and additional tools?

Sure can. Take a look at: http://www.php.net/manual/en/ref.image.php

Hope this helps,

Joe


-- 
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/imap config.m4 php_imap.c php_imap.h

2001-02-24 Thread Dan Kalowsky

kalowskySat Feb 24 20:41:19 2001 EDT

  Modified files:  
/php4/ext/imap  config.m4 php_imap.c php_imap.h 
  Log:
  Updating the IMAP client to include quota support via the imap c-client2000 
libraries.
  # Y2K support is good...
  Removes the SA_QUOTA and SA_QUOTA_ALL defines 
  # After speaking with Mark Crispin, it is believed these never existed.
  Cleans up the imap_status() function to remove notion of quotas in a status message.
  # There is no quota setting in a STATUS message from c-client.  
  
  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.  
  Changed the directory search order for the include files as well.
  # Place the /usr/local/include last, and searched the
  # /usr/local/include/{c-client|imap} directories first
  
  (PHP imap_get_quota) Added
  (PHP imap_set_quota) Added
  
  @- IMAP quota support (imap_set_quota, imap_get_quota) enabled/added via 
  @  c-client2000
  
  PR:
  Submitted by:
  Reviewed by:
  Obtained from:
  
  
Index: php4/ext/imap/config.m4
diff -u php4/ext/imap/config.m4:1.22 php4/ext/imap/config.m4:1.23
--- php4/ext/imap/config.m4:1.22Mon Oct  2 15:16:53 2000
+++ php4/ext/imap/config.m4 Sat Feb 24 20:41:18 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.22 2000/10/02 22:16:53 rasmus Exp $
+dnl $Id: config.m4,v 1.23 2001/02/25 04:41:18 kalowsky Exp $
 
 AC_DEFUN(IMAP_INC_CHK,[if test -r $i$1/rfc822.h; then IMAP_DIR=$i; IMAP_INC_DIR=$i$1])
 
@@ -41,9 +41,9 @@
   if test "$PHP_IMAP" != "no"; then  
 for i in /usr/local /usr $PHP_IMAP; do
   IMAP_INC_CHK()
-  el[]IMAP_INC_CHK(/include)
-  el[]IMAP_INC_CHK(/include/imap)
   el[]IMAP_INC_CHK(/include/c-client)
+  el[]IMAP_INC_CHK(/include/imap)
+  el[]IMAP_INC_CHK(/include)
   el[]IMAP_INC_CHK(/imap)
   el[]IMAP_INC_CHK(/c-client)
   fi
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.57 php4/ext/imap/php_imap.c:1.58
--- php4/ext/imap/php_imap.c:1.57   Wed Feb 21 12:33:46 2001
+++ php4/ext/imap/php_imap.cSat Feb 24 20:41:18 2001
@@ -25,7 +25,7 @@
| PHP 4.0 updates:  Zeev Suraski <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: php_imap.c,v 1.57 2001/02/21 20:33:46 thies Exp $ */
+/* $Id: php_imap.c,v 1.58 2001/02/25 04:41:18 kalowsky Exp $ */
 
 #define IMAP41
 
@@ -101,6 +101,8 @@
PHP_FE(imap_createmailbox,  NULL)
PHP_FE(imap_renamemailbox,  NULL)
PHP_FE(imap_deletemailbox,  NULL)
+   PHP_FE(imap_get_quota,  NULL)
+   PHP_FE(imap_set_quota,  NULL)
PHP_FALIAS(imap_listmailbox, imap_list, NULL)
PHP_FALIAS(imap_getmailboxes, imap_list_full,   NULL)
PHP_FALIAS(imap_scanmailbox, imap_listscan, NULL)
@@ -355,6 +357,20 @@
  sizeof(MESSAGELIST));
 }
 
+/* Mail GET_QUOTA callback
+ * Called via the mail_parameter function in c-client:src/c-client/mail.c
+ * Author DRK
+ */
+void mail_getquota(MAILSTREAM *stream, char *qroot,QUOTALIST *qlist)
+{
+   /* this should only be run through once */
+   for (; qlist; qlist = qlist->next)
+   {
+   IMAPG(quota_usage) = qlist->usage;
+   IMAPG(quota_limit) = qlist->limit;
+   }
+}
+
 /* Mail garbage collect MESSAGELIST
  * Accepts: pointer to MESSAGELIST pointer
  * Author: CJH
@@ -532,16 +548,12 @@
REGISTER_MAIN_LONG_CONSTANT("SA_UIDVALIDITY",SA_UIDVALIDITY , CONST_PERSISTENT 
| CONST_CS);
/* UID validity value */
 
-#ifdef SA_QUOTA
-   sa_all |= SA_QUOTA;
-REGISTER_MAIN_LONG_CONSTANT("SA_QUOTA",SA_QUOTA , CONST_PERSISTENT | 
CONST_CS);
+   sa_all |= GET_QUOTA;
+REGISTER_MAIN_LONG_CONSTANT("GET_QUOTA",GET_QUOTA , CONST_PERSISTENT | 
+CONST_CS);
  /* Disk space taken up by mailbox. */
-#endif
-#ifdef SA_QUOTA_ALL
-   sa_all |= SA_QUOTA_ALL;
-REGISTER_MAIN_LONG_CONSTANT("SA_QUOTA_ALL",SA_QUOTA_ALL , CONST_PERSISTENT | 
CONST_CS);
+   sa_all |= GET_QUOTAROOT;
+REGISTER_MAIN_LONG_CONSTANT("GET_QUOTAROOT",GET_QUOTAROOT , CONST_PERSISTENT 
+| CONST_CS);
  /* Disk space taken up by all mailboxes owned by user. */
-#endif
REGISTER_MAIN_LONG_CONSTANT("SA_ALL", sa_all, CONST_PERSISTENT | CONST_CS);
  /* get all status information */

@@ -1000,6 +1012,80 @@
 /* }}} */
 
 
+/* {{{ proto array imap_get_quota(int stream_id, string qroot)
+   Returns the quota set to the mailbox account qroot */
+PHP_FUNCTION(imap_get_quota)
+{
+   zval **streamind, **qroot;
+
+   int ind, ind_type;
+   pils *imap_le_struct;
+
+   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &qroot) == 
+FAILURE) {
+   ZEND_WRONG_PARAM_COUNT();
+   }
+
+ 

[PHP] Temporarily turning off magic quotes?

2001-02-24 Thread Ben Cheng

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 Digest 25 Feb 2001 04:49:28 -0000 Issue 532

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


php-general Digest 25 Feb 2001 04:49:28 - Issue 532

Topics (messages 41497 through 41541):

Re: Class methods in PHP
41497 by: Christian Reiniger
41501 by: Kevin Beckford
41505 by: Aaron Tuller

Re: isset()
41498 by: Christian Reiniger

Re: DIsplaying page before script finnished
41499 by: James Moore
41500 by: Fredrik Wahlberg

Re: Binding A Socket
41502 by: Kyndig

Help with mass import to MySQL using PHP
41503 by: Clayton Dukes
41504 by: richard merit
41507 by: Clayton Dukes
41508 by: Clayton Dukes

parsing multiple xml documents
41506 by: Daniel Convissor

function mail
41509 by: Augusto Cesar Castoldi

file handle error? or something else?
41510 by: rick - SomersNet, Inc.
41511 by: CC Zona

Please help - File Uploads, 2nd try
41512 by: Ed Lazor
41516 by: Gustavo Vieira Goncalves Coelho Rios
41526 by: Ed Lazor
41527 by: Koncz Ádám
41528 by: Koncz Ádám

C vs PHP
41513 by: Gustavo Vieira Goncalves Coelho Rios
41518 by: James Moore
41524 by: Michael Kimsal

CLOB update difficulties
41514 by: Chris Murtland

searching Oracle 8i CLOB columns
41515 by: Chris Murtland

Re: Using while as for...
41517 by: Steve Edberg

Inserting user name and password into mysql...
41519 by: Felipe Lopes

Cookie References?
41520 by: Jeff Oien
41523 by: php3.developersdesk.com

Re: $result = $$function
41521 by: Simon Garner

Re: checking $more still does not work !
41522 by: Simon Garner

persistant user tracking
41525 by: Mitchell Hagerty

Re: Database Paging using MSSQL 2000
41529 by: Manuel Lemos

Re: 


On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
> Is there class methods in php?

Well, there are classes, classes can have methods, there are methods to 
handle classes, methods to inspect methods, methods to inspect classes 
and propably more.

I have no idea what you mean with your question, but I hope that some 
part of the above answers it...

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

"The number of Unix installations has grown to 10, with more expected."
 -- The Unix Programmer's Manual, 2nd Edition, June 1972




Well I meant class functions that do not need an object to be declared...
but don't worry about it - I found out. There are none in php.

- Original Message - From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>out
Sent: Saturday, February 24, 2001 11:49 AM
Subject: Re: [PHP] Class methods in PHP


: On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
: > Is there class methods in php?
:
: Well, there are classes, classes can have methods, there are methods to
: handle classes, methods to inspect methods, methods to inspect classes
: and propably more.
:
: I have no idea what you mean with your question, but I hope that some
: part of the above answers it...
:
: --
: Christian Reiniger
: LGDC Webmaster (http://sunsite.dk/lgdc/)
:
: "The number of Unix installations has grown to 10, with more expected."
:  -- The Unix Programmer's Manual, 2nd Edition, June 1972
:
: --
: 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]






that's not true.

you can call a static method with the "::" notation.

like ClassName::method();

there's doesn't need to be an instance to do that.

not sure if that's true for all of PHP4 or just 4.04 or whatnot.

-aaron

At 11:56 AM -0500 2/24/01, Kevin Beckford wrote:
>Well I meant class functions that do not need an object to be declared...
>but don't worry about it - I found out. There are none in php.
>
>- Original Message - From: "Christian Reiniger" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>out
>Sent: Saturday, February 24, 2001 11:49 AM
>Subject: Re: [PHP] Class methods in PHP
>
>
>: On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
>: > Is there class methods in php?
>:
>: Well, there are classes, classes can have methods, there are methods to
>: handle classes, methods to inspect methods, methods to inspect classes
>: and propably more.
>:
>: I have no idea what you mean with your question, but I hope that some
>: part of the above answers it...
>:
>: --
>: Christian Reiniger
>: LGDC Webmaster (http://sunsite.dk/lgdc/)
>:
>: "The number of Unix installations has grown to 10, with more expected."
>:  -- The Unix Programmer's Manual, 2nd Edition, June 1972
>:
>: --
>: 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]

Re: [PHP] Detecting JavaScript

2001-02-24 Thread Mitchell Hagerty

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: [EMAIL PROTECTED]




Re: [PHP] Temporarily turning off magic quotes?

2001-02-24 Thread Zeev Suraski

You can do it using .htaccess (or equivalent) directive:

php_flag magic_quotes_gpc off



On Sat, 24 Feb 2001, Ben Cheng wrote:

> 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
> 
> 

-- 
Zeev Suraski <[EMAIL PROTECTED]>
http://www.zend.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] Detecting JavaScript

2001-02-24 Thread Mitchell Hagerty


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 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] Unwanted Characters

2001-02-24 Thread Clayton Dukes


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




Re: [PHP] Unwanted Characters

2001-02-24 Thread Joe Stump

Look at the chr() function - figure out what the character is (number wise) and
then do an ereg_replace(chr(),'',$string) (from the hip - you can do a replace
with chr() on one of the replaces, I've done it before)

--Joe

On Sun, Feb 25, 2001 at 12:34:21AM -0500, 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
> 

-- 

---
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]




[PHP] php and apache 2.0

2001-02-24 Thread jeremy


will php 4.0.4 build as a module with apache 2.0?

- jeremy


-- 
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] Escaping double quotes?

2001-02-24 Thread Ben Cheng

How do you escape double quotes?  I have the following which is 
supposed to make any " in a string into \" but it doesn't seem to 
work.  What's wrong with it?

$tmp_string = str_replace ("\"", "\\\"", $tmp_string);

-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]




Re: [PHP] Escaping double quotes?

2001-02-24 Thread Joe Stump

addslashes() usually works for me...

--Joe

On Sun, Feb 25, 2001 at 01:46:30AM -0500, Ben Cheng wrote:
> How do you escape double quotes?  I have the following which is 
> supposed to make any " in a string into \" but it doesn't seem to 
> work.  What's wrong with it?
> 
> $tmp_string = str_replace ("\"", "\\\"", $tmp_string);
> 
> -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]

-- 

---
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]




[PHP] MYSQL HELP!!!

2001-02-24 Thread Felipe Lopes

Hi!
Here I am again...I have a problem to insert user name, password and 
host into mysql...I'd like to know what commands I need to do that 
(since the command to start mysql on my computer) so that way I won't be 
able to do anything wrong!
Thank you

Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

-- 
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] extract() help

2001-02-24 Thread Jaxon

Hi PHPers,

the following function is supposed to build an html table, creating a
content row for every row in a database table.  It is creating a table with
the correct number of rows, but NO content is being echoed...

I think I must be using the extract() function inside the for loop wrong...
any pointers?

tia!
jaxon


";


if (!isset($max)) $max=5; //upper limit of news boxes to build

for ($i = 1; $i <= $max; $i++)

{

$sql="select i.nID, i.date, i.headline, i.subtitle, i.blurb from
news_items i, news_box b where i.nID = b.nID and b.dID = $i";

$result = mysql_query($sql, $link_id);
$row = mysql_fetch_row($result);

extract($row); //the variables below match field names in this row

echo "
$headline
$subtitle
$date
$blurb
...more
 ";

echo "";
}
}
?>


-- 
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-24 Thread Jeff Lacy

I had this same exact problem just today.  It all stems from the variable
namespace, I think

A similar code 'snippet' is shown below.  I just made it up, but I think it
illustrates my point.



Good luck with whatever you are doing,

Jeff Lacy


""Jon Rosenberg"" <[EMAIL PROTECTED]> wrote in message
000901c09e7d$16835420$0100a8c0@slinkyboi5">news:000901c09e7d$16835420$0100a8c0@slinkyboi5...
> 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:
>
>  session_Start();
>
> $foo = "bar";
> session_register("foo");
>
> function bob($user){
> $username = $user . "one";
> $username2 = $user . "two";
> session_register("username");
> session_register("username2");
> return true;
> }
> ?>
>
>
> --
> 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] extract() help

2001-02-24 Thread CC Zona

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

> the following function is supposed to build an html table, creating a
> content row for every row in a database table.  It is creating a table with
> the correct number of rows, but NO content is being echoed...

> $sql="select i.nID, i.date, i.headline, i.subtitle, i.blurb from
> news_items i, news_box b where i.nID = b.nID and b.dID = $i";
> 
> $result = mysql_query($sql, $link_id);
> $row = mysql_fetch_row($result);
> 
> extract($row); //the variables below match field names in this row
> 
> echo "
> $headline
> $subtitle
> $date
> $blurb
> ...more

The elements in $row will have indexes like $row['i.headline'], rather than 
$row['headline'], just as the columns would have those names if you ran the 
query at the command line.

(BTW, I find that doing a var_dump() or print_r() on variables--such as 
$row, in this case--to be very helpful when data isn't coming out in the 
way I expected it to...)

-- 
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]




[PHP] really weird html - was "extract() help"

2001-02-24 Thread Jaxon

I replaced extract() with $row[] - much better.

Now I have the strangest thing happening - the  html
formatting only applies to the first iteration in the loop, even though it
shows up in the html source!!

regard,
jaxon


html generation:

for ($i = 1; $i <= 5; $i++)

{
$sql="select stuff from table";
$result = mysql_query($sql, $link_id);
$row = mysql_fetch_row($result);

echo "
$row[2]
$row[3]
$row[1]
$row[4]
...more

 
 ";
 
echo "";
}

resultant source:
-

First Headline
first subtitle
2001-02-24
get it right here now... this is the place to be, I tell
you
...more

 
SECOND HEADLINE!
second subtitle
-00-00
even more good stuff coming out of our second news
item!!!
...more

 
HEADLINE 3!!!
subtitle 3
2001-02-26
getcha third item here!!
...more

 


-- 
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-24 Thread CC Zona

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

> Look at the chr() function - figure out what the character is (number wise) 
> and
> then do an ereg_replace(chr(),'',$string) (from the hip - you can do a 
> replace
> with chr() on one of the replaces, I've done it before)
> 
> --Joe
> 
> On Sun, Feb 25, 2001 at 12:34:21AM -0500, 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"

And you might also want to look at strtr() 
.  You could, I suppose, use 
it to substitute some character that you know would never legitimately 
appear in $sometext, then do a straight str_replace() on the string for all 
occurences of that character.

-- 
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] really weird html - was "extract() help"

2001-02-24 Thread Jaxon

gak. everyone ignore me.
idiocy is setting in this late at night.

stoopid me put a  tag INSIDE the loop.

and thanks CC Zona for the pointer on the var_dump() - very helpful!

regards,
jaxon

On 2/25/01 2:38 AM, "Jaxon" <[EMAIL PROTECTED]> wrote:

> I replaced extract() with $row[] - much better.
> 
> Now I have the strangest thing happening - the  html
> formatting only applies to the first iteration in the loop, even though it
> shows up in the html source!!
> 
> regard,
> jaxon
> 
> 
> html generation:
> 
> for ($i = 1; $i <= 5; $i++)
>   
>   {
>   $sql="select stuff from table";
>   $result = mysql_query($sql, $link_id);
>   $row = mysql_fetch_row($result);
>   
>   echo "
>   $row[2]
>   $row[3]
>   $row[1]
>   $row[4]
>href=\"news.php?#$row[0]\">...more
>   
>
>";
>
>   echo "";
>   }
> 
> resultant source:
> -
> 
>   First Headline
>   first subtitle
>   2001-02-24
>   get it right here now... this is the place to be, I tell
> you
>href="news.php?#1">...more
>   
>
>   SECOND HEADLINE!
>   second subtitle
>   -00-00
>   even more good stuff coming out of our second news
> item!!!
>href="news.php?#2">...more
>   
>
>   HEADLINE 3!!!
>   subtitle 3
>   2001-02-26
>   getcha third item here!!
>href="news.php?#3">...more
>   
>
> 


-- 
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-24 Thread mwaples

Jeff Oien wrote:
> 
> Could you give me some URLs for tutorials related
> to cookies and good reference material?

www.cookiecentral.com/faq/ has some good general info

rfc2109 - more technical but useful 
http://www.cis.ohio-state.edu/htbin/rfc/rfc2109.html
> 
> 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]




  1   2   >