Re: [PHP] Sessions?

2001-04-14 Thread Plutarck

The way I do it is to stick all those global variables into an include file,
which I usually named something like global.php.

Just do that and require() the file at the top of all your scripts which
need it. Keep things like page color, text color, font, etc in the global
file.

If you ever need to change the color before you use them, just alter the
colors at the top of your scripts after the require(), but before you "do"
anything with them (such as echo them to the browser).


Once you have the site working like that, it's easy to add per-user
customization. So in the future you just check to see if a session variable
is set, and if it is you replace the global variable value with the session
variable value.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Ashley M. Kirchner"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I'm used to building pages that contain links that have variables
 passed on the URL  (somepage.php?var1=1var2=2...) and I'm now looking
 into building a site that will have quite a bit of these that will have
 to 'live' from page to page, occasionally getting reset, or changed by
 new page.  I'm told sessions are the way to go (specially since this
 will have several users using the site).

 And consequently, now I'm lost.  Sessions..okay..how does the
 variable 'live' from one to the other?  What do I have to do different
 when setting variables that will be used globally across the site (and
 reset/changed from time to time)?  I don't need to STORE any of these
 (say for a future log-in), however if it's easy (easier?) to do it that
 way, that's fine as well.  I may eventually start making the site
 customizable on a per user basis.  But for right now, I need a startup
 primer first.

 AMK4

 --
 W |
   |  I haven't lost my mind; it's backed up on tape somewhere.
   |
   ~
   Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
   SysAdmin / Websmith   . 800.441.3873 x130
   Photo Craft Laboratories, Inc. .eFax 248.671.0909
   http://www.pcraft.com  . 3550 Arapahoe Ave #6
   .. .  .  . .   Boulder, CO 80303, USA



 --
 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] Reading a file and changing a href tag values

2001-04-14 Thread Plutarck

All you need is a regular expression, provided by ereg function or preg
functions.

You'd have the regex look for a href then capture everything up to /a

Then just adjust the result as you want it to appear.


You'll need to either search around for code that already does this, or be
willing to learn regular expressions (which you should do anyway).

Otherwise it will seem impossible.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Brett"" [EMAIL PROTECTED] wrote in message
012701c0c4a2$cbc7f840$LocalHost@Default">news:012701c0c4a2$cbc7f840$LocalHost@Default...
 I have been able to find out how to read a file and replace certain
matches,
 but I want to be able to take a web page stored in a string and change the
 a href tags and add www.mysite.com?page=   before the actual link value
so
 the new url would read www.mysite.com?page=original_url.  Can I do this
and
 if so will someone give me an idea how?   Thanks.

 Brett


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




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




[PHP] PHP MySQL Search Results

2001-04-14 Thread Jason Caldwell

Does anyone know (or have) of a good example of how to create search results
like a Yahoo or MSN search?

for example:

Say I do a search for "cars" and there are 10,000 records in my table that
match "car"... I would like to show the results in blocks of (say) 25 at a
time, therefore I will need a "Next Results", "Previous Results", "Total
Records found that match my query", and perhaps, between the "Previous
Results" and "Next Results" a set of numbers like so;

Previous [1] [2] [3] [...] Next

The numbers being "jump to" links, etc.

Thanks.
Jason



-- 
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] antifraud logic for voting poll, banner clicks

2001-04-14 Thread Keyur Kalaria

Hello everybody,

I am working on a banner exchange site and a site rating script.

Can anyone suggest me how to avoid the fraud rating and fraud banner clicks.
What all things we need to take care for the same etc.

Thanks in advance.

Keyur


-- 
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] Need a URL....

2001-04-14 Thread rm

Thank you

rm


--- Keyur Kalaria [EMAIL PROTECTED] wrote:
 it is 
 
 http://marc.theaimsgroup.com/
 
 regards
 keyur
 
 


__
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] Forcing Case

2001-04-14 Thread midget2000x

Is there any way to force case...like if I have a string and want it to appear
in all lowercase (or uppercase, God forbid)?

Thanks,

Rory
 ---
providing the finest in midget technology

-- 
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] Backend system for skinz.org/deskmod.com?

2001-04-14 Thread Long Lam

I've been searching for a week for a script similar to the backend systems 
used on sites such as skinz.org and deskmod.com.  I'd like to adapt their 
user review/rating systems to allow my visitors to rate class courses and 
professors.  Does anyone know if there's a complete script available like 
this somewhere that I can setup and use?  I'm not a php developer so making 
something like that is impossible for me.  Please help.  I think something 
like this could be adapted for reviewing anything and would be great if it 
could be shared.


Thanks

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

2001-04-14 Thread Thies C. Arntzen

thies   Sat Apr 14 00:57:16 2001 EDT

  Modified files:  
/CVSROOTavail cvsusers 
  Log:
  add Andy Sautins + karma for oci8
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.144 CVSROOT/avail:1.145
--- CVSROOT/avail:1.144 Thu Apr 12 09:35:40 2001
+++ CVSROOT/avail   Sat Apr 14 00:57:16 2001
@@ -41,7 +41,7 @@
 avail|zeev|php4/ext/msql
 avail|fmk|php4/ext/mssql
 avail|zeev|php4/ext/mysql
-avail|ssb,thies|php4/ext/oci8
+avail|ssb,thies,asautins|php4/ext/oci8
 avail|ssb,kara,fmk|php4/ext/odbc
 avail|ssb,mitch,rasmus,kara,thies|php4/ext/oracle
 avail|andrei|php4/ext/pcre
Index: CVSROOT/cvsusers
diff -u CVSROOT/cvsusers:1.255 CVSROOT/cvsusers:1.256
--- CVSROOT/cvsusers:1.255  Thu Apr 12 09:35:40 2001
+++ CVSROOT/cvsusersSat Apr 14 00:57:16 2001
@@ -293,3 +293,4 @@
 fireclaw  Sean Preston[EMAIL PROTECTED]   PEAR 
Documentation
 hadar_p   Hadar Porat [EMAIL PROTECTED]  Hebrew 
translation
 zhang Wenhui Zhang[EMAIL PROTECTED]   Empress
+asautins  Andy Sautins[EMAIL PROTECTED]   OCI8



-- 
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] slashes added to template files

2001-04-14 Thread Floyd Piedad

Check your PHP config.  On the remote server, you probably have Magic Quotes Runtime 
Activated while on the local
machine it is not.  Best if you make both the same config.  Run php info command to 
check.

Floyd

Franklin Hays wrote:

 Apologies in advance if this has been discussed before or is a simple
 fubar on my part.  I can only search through the archives for so
 long...  :-)

 Experiencing a frustrating problem on this end with slashes being added to
 my template files.  Here are the details:

 Using PHP on a webhost that compiled php as a cgi in my www/cgi-bin
 directory.

 I have all HTML files in templates/filename.tpl and all PHP files in
 includes/filename.inc, this includes the template.inc file from PHPLib.

 I have a file called 'script' with the following in it:

  ?php
 require('includes/Directory.inc');
 include('includes/Header.inc');
 // Now parse a second template:
 $t-set_file("MainHandle","MainGadget.tpl");
 // wholePage.ihtml has "{MyOutput}" in it
 $vari= $t-parse("MyFinalOutput","MainHandle");
 // All {MyOutput}'s get replaced
 $t-p("MyFinalOutput");
 // output the value of MyFinalOutput
 /*eval( "?".$vari );*/
 include('includes/Footer.inc');
 ?

 include/Directory.inc has the following in it:

 ?php
 include('includes/Template.inc');
 $url_array=explode("/",$REQUEST_URI);
 $url_cat=$url_array[3];
 $url_grp=$url_array[4];
 $url_misc=$url_array[5];
 $t = new Template("/www/hostname/ocean/templates/");
 $title = "name";

 if($url_misc == 'misc') {
 $Handle='MiscHandle';
 $Template='MiscGadget.tpl';
 }
 elseif ($url_grp == 'tanks') {
 $Handle='TankHandle';
  $Template='TankGadget.tpl';
 }
 elseif ($url_cat == 'psupply') {
 // These three lines are the same as the first example:
 $Handle='PowerHandle';
 $Template='PowerGadget.tpl';
 }
 elseif ($url_cat == 'purpose') {
 $Handle='PurposeHandle';
 $Template='PurposeGadget.tpl';
 } else {
 $Handle='IntroHandle';
 $Template='IntroGadget.tpl';
 }
 $t-set_file("$Handle","$Template");
 $t-set_var("name",$title);
 $t-parse("MyOutput","$Handle");
 ?

 Now, this setup work without a hitch on my personal development server
 where PHP is loaded as a module in Apache. The file called via the
 'script' above is loaded into the MainGadget.tpl template and displayed
 without a problem. Everything, including javascript, works great.

 Now, I moved this code to the providers server, where the only difference
 I can tell is php works as a cgi , and I get output from the HTML files
 with slashes added to the HTML, such as:

 a href=\'about.php\'
 onMouseOut=\'MM_swapImgRestore()\" 
onMouseOver=\"MM_swapImage(\'about\',\'\',\'graphics/toolsbar3_01.gif\',1)\"img
 name=\"about\" border=\"0\" src=\"graphics/toolsbar_01.gif\" width=\"105\" 
height=\"35\"/a
 a href=\'contact.php\' onMouseOut=\'MM_swapImgRestore()\'
 onMouseOver=\'MM_swapImage(\'contact\',\'\',\'graphics/toolsbar3_02.gif\',1)\"img
 name=\"contact\" border=\"0\" src=\"graphics/toolsbar_02.gif\" width=\"96\" 
height=\"35\"/a

 Everything else is output just fine. The only HTML with this in it is the
 {MyOutput} files from templates directory (.tpl files). I am not very
 familiar with PHPLib but imagine there is some other not so subtle item I
 am missing since things work great on my linux/apache/php4 server.

 Any ideas? I have tried using stripslashes() in the 'script' above but get
 errors. Is there something unique to the php cgi I am missing? Something
 else?

 Any all help is greaty appreciated!!

 Thanks,

 //frank

 --
 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/oci8 CREDITS

2001-04-14 Thread Thies C. Arntzen

thies   Sat Apr 14 01:06:40 2001 EDT

  Modified files:  
/php4/ext/oci8  CREDITS 
  Log:
  the collections stuff s worth mentioning in the credits!
  
  
Index: php4/ext/oci8/CREDITS
diff -u php4/ext/oci8/CREDITS:1.1 php4/ext/oci8/CREDITS:1.2
--- php4/ext/oci8/CREDITS:1.1   Mon Nov 20 02:31:28 2000
+++ php4/ext/oci8/CREDITS   Sat Apr 14 01:06:40 2001
@@ -1,2 +1,2 @@
 OCI8
-Stig Bakken, Thies C. Arntzen
+Stig Bakken, Thies C. Arntzen, Andy Sautins



-- 
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: CVSROOT / avail

2001-04-14 Thread Thies C. Arntzen

thies   Sat Apr 14 01:26:21 2001 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  some karma for the 2 new oci8 guys
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.145 CVSROOT/avail:1.146
--- CVSROOT/avail:1.145 Sat Apr 14 00:57:16 2001
+++ CVSROOT/avail   Sat Apr 14 01:26:21 2001
@@ -7,7 +7,7 @@
 
avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,hholzgra|functable
 avail|rasmus,sterling,jimw,ssb|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,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,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,mctrash,berto,leobopp,tcr,subjective,mboeren,ufux,virtual,fireclaw,hadar_p|phpdoc
+avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,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,mctrash,berto,leobopp,tcr,subjective,mboeren,ufux,virtual,fireclaw,hadar_p,asautins,dbenson|phpdoc
 avail|andrei,fmk,zimt,jan,changelog,miester|php-gtk
 avail|jmoore,sfox,miester|php-gtk/docs
 avail|andrei,fmk,jmoore,jskinner,miester|php-gtk-web
@@ -41,7 +41,7 @@
 avail|zeev|php4/ext/msql
 avail|fmk|php4/ext/mssql
 avail|zeev|php4/ext/mysql
-avail|ssb,thies,asautins|php4/ext/oci8
+avail|ssb,thies,asautins,dbenson|php4/ext/oci8
 avail|ssb,kara,fmk|php4/ext/odbc
 avail|ssb,mitch,rasmus,kara,thies|php4/ext/oracle
 avail|andrei|php4/ext/pcre



-- 
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/oci8 CREDITS oci8.c

2001-04-14 Thread Thies C. Arntzen

thies   Sat Apr 14 01:38:46 2001 EDT

  Modified files:  
/php4/ext/oci8  CREDITS oci8.c 
  Log:
  @- Added temporary LOB support in OCI8 (Patch by David Benson)
  
  
Index: php4/ext/oci8/CREDITS
diff -u php4/ext/oci8/CREDITS:1.2 php4/ext/oci8/CREDITS:1.3
--- php4/ext/oci8/CREDITS:1.2   Sat Apr 14 01:06:40 2001
+++ php4/ext/oci8/CREDITS   Sat Apr 14 01:38:46 2001
@@ -1,2 +1,2 @@
 OCI8
-Stig Bakken, Thies C. Arntzen, Andy Sautins
+Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson
Index: php4/ext/oci8/oci8.c
diff -u php4/ext/oci8/oci8.c:1.115 php4/ext/oci8/oci8.c:1.116
--- php4/ext/oci8/oci8.c:1.115  Fri Apr 13 07:43:39 2001
+++ php4/ext/oci8/oci8.cSat Apr 14 01:38:46 2001
@@ -16,10 +16,11 @@
|  Thies C. Arntzen [EMAIL PROTECTED] 
   |
|  
   |
| Collection support by Andy Sautins [EMAIL PROTECTED]   |
+   | Temporary LOB support by David Benson [EMAIL PROTECTED] |
+--+
  */
 
-/* $Id: oci8.c,v 1.115 2001/04/13 14:43:39 thies Exp $ */
+/* $Id: oci8.c,v 1.116 2001/04/14 08:38:46 thies Exp $ */
 
 /* TODO list:
  *
@@ -51,10 +52,9 @@
 /* {{{ includes  stuff */
 
 #include "php.h"
-
-#include "ext/standard/head.h"
 #include "ext/standard/info.h"
 
+/* #define WITH_TEMP_LOBS 1 */
 #define WITH_COLLECTIONS 1
 
 #if HAVE_OCI8
@@ -209,6 +209,10 @@
 PHP_FUNCTION(ocistatementtype);
 PHP_FUNCTION(ocirowcount);
 PHP_FUNCTION(ocisetprefetch);
+#ifdef WITH_TEMP_LOBS
+PHP_FUNCTION(ociwritetemporarylob);
+PHP_FUNCTION(ocicloselob);
+#endif
 #ifdef WITH_COLLECTIONS
 PHP_FUNCTION(ocinewcollection);
 PHP_FUNCTION(ocifreecoll);
@@ -324,6 +328,10 @@
 static zend_function_entry php_oci_lob_class_functions[] = {
 PHP_FALIAS(load,   ociloadlob,   NULL)
 PHP_FALIAS(writetofile,ociwritelobtofile,NULL)
+#ifdef WITH_TEMP_LOBS
+PHP_FALIAS(writetemporary, ociwritetemporarylob,NULL)
+PHP_FALIAS(close,  ocicloselob,  NULL)
+#endif
 PHP_FALIAS(save,   ocisavelob,   NULL)
 PHP_FALIAS(savefile,ocisavelobfile,   NULL)
 PHP_FALIAS(free,   ocifreedesc,  NULL)
@@ -576,7 +584,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.115 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.116 $");
 #ifndef PHP_WIN32
php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -3174,6 +3182,151 @@
 }
 /* }}} */
 
+#ifdef WITH_TEMP_LOBS
+/* {{{ proto int ociwritetemporarylob(int stmt, int loc, string var)
+   Return the row count of an OCI statement */
+
+PHP_FUNCTION(ociwritetemporarylob)
+{
+zval *id, **var;
+   OCILobLocator *mylob;
+   oci_connection *connection;
+   oci_descriptor *descr;
+   ub4 offset = 1;
+   ub4 loblen;
+
+oci_debug ("oci_write_temporary_lob");
+
+   if ((id = getThis()) == 0) {
+RETURN_FALSE;
+}
+
+if (_oci_get_ocidesc(id,descr) == 0) {
+RETURN_FALSE;
+}
+
+mylob = (OCILobLocator *) descr-ocidescr;
+
+if (! mylob) {
+RETURN_FALSE;
+}
+
+connection = descr-conn;
+
+if (zend_get_parameters_ex(1, var) == FAILURE) {
+WRONG_PARAM_COUNT;
+}
+
+convert_to_string_ex(var);
+
+connection-error = 
+OCILobCreateTemporary(connection-pServiceContext,
+  connection-pError,
+  mylob,
+  OCI_DEFAULT,
+  OCI_DEFAULT,
+  OCI_TEMP_CLOB,
+  TRUE,
+  OCI_DURATION_SESSION);
+
+if (connection-error) {
+oci_error(connection-pError, "OCILobCreateTemporary", connection-error);
+oci_handle_error(connection, connection-error);
+RETURN_FALSE;
+}
+
+connection-error = 
+OCILobOpen(connection-pServiceContext,
+   connection-pError,
+   mylob,
+   OCI_LOB_READWRITE);
+
+if (connection-error) {
+oci_error(connection-pError, "OCILobOpen", connection-error);
+oci_handle_error(connection, connection-error);
+RETURN_FALSE;
+}
+
+convert_to_string_ex(var);
+loblen = (*var)-value.str.len;
+   
+if (loblen  1) {
+php_error(E_WARNING, "Cannot save a lob wich size is less than 1 byte");
+RETURN_FALSE;
+}
+
+connection-error = 
+OCILobWrite(connection-pServiceContext,
+   connection-pError,
+   

Re: [PHP] PHP MySQL Search Results

2001-04-14 Thread Plutarck

In a MySQL query you can use the LIMIT keyword, like in phpmyadmin.

Use limit 0,10 to get the first ten results in a query.

Then do the query again but use 10,10 for the limit.

The first number is the "offset", and the second one is the maximum results
to return.

That's the way most people do "pages".


--
Plutarck
Should be working on something...
...but forgot what it was.


""Jason Caldwell"" [EMAIL PROTECTED] wrote in message
9b8rgd$oot$[EMAIL PROTECTED]">news:9b8rgd$oot$[EMAIL PROTECTED]...
 Does anyone know (or have) of a good example of how to create search
results
 like a Yahoo or MSN search?

 for example:

 Say I do a search for "cars" and there are 10,000 records in my table that
 match "car"... I would like to show the results in blocks of (say) 25 at a
 time, therefore I will need a "Next Results", "Previous Results", "Total
 Records found that match my query", and perhaps, between the "Previous
 Results" and "Next Results" a set of numbers like so;

 Previous [1] [2] [3] [...] Next

 The numbers being "jump to" links, etc.

 Thanks.
 Jason



 --
 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] sorting multi-dimensional arrays

2001-04-14 Thread Delbono

Try this (it should work):

while(list($k, $v) = each($myarray)){
  $myarray[$k] = (int) $v;
}
arsort($myarray);
reset($myarray);
while(list($k, $v) = each($myarray)){
  echo $k, ' == ', $v, "BR\n;
}



For better comprehension look at this post:

Hey guys..

I have this array that looks like this:

$myarray = ( "apples" = 0, "oranges" = 2, "peaches" = 9, "pineapples" =
12, "stovetopstuffing" = 3, "grits" = 8);

Fine and dandy. But, when I try to sort it in reverse order:

arsort($myarray);

I get THIS for output, obviously NOT what I want:

peaches = 9
grits = 8
stovetopstuffing = 3
oranges = 2
pineapples = 12
apples = 0

Obviously, I want the pineapples entry to be at the top, since it has the
highest value. What do I need to do?

You have stored strings as your values, instead of ints.

IE:(string) '9'  (string) '12' returns TRUE

You will need to take care in creating your array to have (int) values
instead of strings.

If all else fails, the following should work:

while(list($k, $v) = each($myarray)){
  $myarray[$k] = (int) $v;
}
arsort($myarray);
reset($myarray);
while(list($k, $v) = each($myarray)){
  echo $k, ' == ', $v, "BR\n;
}

















- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 14, 2001 5:19 AM
Subject: [PHP] sorting multi-dimensional arrays


 I have a question about sorting multidimensional arrays. Here is my
problem:

 I have an 2-d array:
 $joke[1][rating]=10;
 $joke[2][rating]=20;
 $joke[3][rating]=15;
 

 I would like to sort the jokes into an array based on the rating from
highest
 to lowest. The end result would be something like this:
 Joke 2 : 20 points
 Joke 3: 15 points
 Joke 1: 10 points

 How do I accomplish this?

 I have tried fooling around with sort(), arsort(), and array_multisort(),
but
 I just can't get it. Thank you very much for your time.

 Shane



-- 
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] sorting multi-dimensional arrays

2001-04-14 Thread Delbono

hh, no, maybe the samplecode I posted it's not your case, sorry...





 I have a question about sorting multidimensional arrays. Here is my
problem:

 I have an 2-d array:
 $joke[1][rating]=10;
 $joke[2][rating]=20;
 $joke[3][rating]=15;
 

 I would like to sort the jokes into an array based on the rating from
highest
 to lowest. The end result would be something like this:
 Joke 2 : 20 points
 Joke 3: 15 points
 Joke 1: 10 points

 How do I accomplish this?

 I have tried fooling around with sort(), arsort(), and array_multisort(),
but
 I just can't get it. Thank you very much for your time.

 Shane



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

2001-04-14 Thread Ashley M. Kirchner

Plutarck wrote:

 The way I do it is to stick all those global variables into an include file,
 which I usually named something like global.php.

  Um no.  These aren't static variables.  They change from page to
page.  For example, page one

  $foo=0, $bar=3, $baz='Closed'

They follow a particular link that changes them to,

  $foo=1, $bar=3, $baz='Open'

They follow yet another link, and this time only $bar changes,

  $foo=1, $bar=2, $baz='Open'

  Right now, the way I've always done that was to include it in the
URL: next_page.php?foo=0$bar=3baz='Closed' - they follow a link, and
those variables get tacked again.  If it's a form, I pass hidden input
tags.

  But, there's got to be a better, transparent way of doing this.  No?

AMK4

--
H | Hi, I'm currently out of my mind.  Please leave a message.  BP!
  |
  ~
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc. .eFax 248.671.0909
  http://www.pcraft.com  .3550 Arapahoe Ave, #6
  .. .  .  . .Boulder, CO 80303, U.S.A.



-- 
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/oci8 config.m4 oci8.c oci8.dsp

2001-04-14 Thread Thies C. Arntzen

thies   Sat Apr 14 02:51:29 2001 EDT

  Modified files:  
/php4/ext/oci8  config.m4 oci8.c oci8.dsp 
  Log:
  enable temporary LOBs when we detect oracle 8.1
  enabled by default in Win32 project!
  
  
Index: php4/ext/oci8/config.m4
diff -u php4/ext/oci8/config.m4:1.26 php4/ext/oci8/config.m4:1.27
--- php4/ext/oci8/config.m4:1.26Tue Mar 27 12:34:37 2001
+++ php4/ext/oci8/config.m4 Sat Apr 14 02:51:29 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.26 2001/03/27 20:34:37 sniper Exp $
+dnl $Id: config.m4,v 1.27 2001/04/14 09:51:29 thies Exp $
 
 AC_DEFUN(AC_OCI8_VERSION,[
   AC_MSG_CHECKING([Oracle version])
@@ -73,6 +73,7 @@
8.1)
  PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
  PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+ AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
  ;;
*)
   AC_MSG_ERROR(Unsupported Oracle version!)
Index: php4/ext/oci8/oci8.c
diff -u php4/ext/oci8/oci8.c:1.116 php4/ext/oci8/oci8.c:1.117
--- php4/ext/oci8/oci8.c:1.116  Sat Apr 14 01:38:46 2001
+++ php4/ext/oci8/oci8.cSat Apr 14 02:51:29 2001
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.116 2001/04/14 08:38:46 thies Exp $ */
+/* $Id: oci8.c,v 1.117 2001/04/14 09:51:29 thies Exp $ */
 
 /* TODO list:
  *
@@ -54,7 +54,7 @@
 #include "php.h"
 #include "ext/standard/info.h"
 
-/* #define WITH_TEMP_LOBS 1 */
+/* #define HAVE_OCI8_TEMP_LOB 1 */
 #define WITH_COLLECTIONS 1
 
 #if HAVE_OCI8
@@ -209,7 +209,7 @@
 PHP_FUNCTION(ocistatementtype);
 PHP_FUNCTION(ocirowcount);
 PHP_FUNCTION(ocisetprefetch);
-#ifdef WITH_TEMP_LOBS
+#ifdef HAVE_OCI8_TEMP_LOB
 PHP_FUNCTION(ociwritetemporarylob);
 PHP_FUNCTION(ocicloselob);
 #endif
@@ -328,7 +328,7 @@
 static zend_function_entry php_oci_lob_class_functions[] = {
 PHP_FALIAS(load,   ociloadlob,   NULL)
 PHP_FALIAS(writetofile,ociwritelobtofile,NULL)
-#ifdef WITH_TEMP_LOBS
+#ifdef HAVE_OCI8_TEMP_LOB
 PHP_FALIAS(writetemporary, ociwritetemporarylob,NULL)
 PHP_FALIAS(close,  ocicloselob,  NULL)
 #endif
@@ -584,7 +584,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.116 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.117 $");
 #ifndef PHP_WIN32
php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -3182,7 +3182,7 @@
 }
 /* }}} */
 
-#ifdef WITH_TEMP_LOBS
+#ifdef HAVE_OCI8_TEMP_LOB
 /* {{{ proto int ociwritetemporarylob(int stmt, int loc, string var)
Return the row count of an OCI statement */
 
Index: php4/ext/oci8/oci8.dsp
diff -u php4/ext/oci8/oci8.dsp:1.9 php4/ext/oci8/oci8.dsp:1.10
--- php4/ext/oci8/oci8.dsp:1.9  Thu Aug 24 10:48:25 2000
+++ php4/ext/oci8/oci8.dsp  Sat Apr 14 02:51:29 2001
@@ -44,7 +44,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I 
"..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D 
"_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I 
"..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\oci805\include" /D 
ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /D 
"ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D COMPILE_DL_OCI8=1 /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I 
+"..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\oci805\include" /D 
+ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /D 
+"ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D 
+COMPILE_DL_OCI8=1 /YX /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x406 /d "NDEBUG"
@@ -71,7 +71,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I 
"..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" 
/D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" 
/I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\oci805" /D 
ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D 
"FTP_EXPORTS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D 
COMPILE_DL_OCI8=1 /FR /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" 
+/I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\oci805" /D 
+ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D 
+"FTP_EXPORTS" /D ZTS=1 /D 

[PHP] Installing PHP 4 as rpm on RedHat 6.2 !!

2001-04-14 Thread Mohamedou

Hello All,


I have already php 3.0.18 installed on my RH 6.2 box.
I want to install PHP 4 now.
But if I still the following message:

[root@proxy mohamedou]# rpm -Uvh php-4.0.4pl1-3.i386.rpm
error: failed dependencies:
libdb-3.1.so is needed by php-4.0.4pl1-3
libgd.so.1.8 is needed by php-4.0.4pl1-3
libc.so.6(GLIBC_2.1.3) is needed by php-4.0.4pl1-3
libc.so.6(GLIBC_2.2) is needed by php-4.0.4pl1-3
libresolv.so.2(GLIBC_2.2) is needed by php-4.0.4pl1-3
php = 3.0.18 is needed by php-imap-3.0.18-6.2horde1
php = 3.0.18 is needed by php-mysql-3.0.18-6.2horde1
[root@proxy mohamedou]#  

Which rpms are responsible for that?

Every help will be apreciated
Thnx in advance

Moh



[PHP-CVS] cvs: php4 / TODO-4.1.txt

2001-04-14 Thread Thies C. Arntzen

thies   Sat Apr 14 03:30:05 2001 EDT

  Modified files:  
/php4   TODO-4.1.txt 
  Log:
  .
  
  
Index: php4/TODO-4.1.txt
diff -u php4/TODO-4.1.txt:1.2 php4/TODO-4.1.txt:1.3
--- php4/TODO-4.1.txt:1.2   Fri Apr 13 16:52:15 2001
+++ php4/TODO-4.1.txt   Sat Apr 14 03:30:05 2001
@@ -12,3 +12,6 @@
 
 * renaming functions so that they all are conform to one standard form
 
+* allow foreach($arrray as $key = value)
+
+* clean up "$instance = new object" syntax.



-- 
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] PHP for Apache 2.0

2001-04-14 Thread Patrick Dunford

According to Apache, modules made for Apache 1.3 will not work as-is in 2.0 
due to changes in the API.

Is a version of PHP 4 for Apache 2.0 coming out?

-- 
===
Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/

   Ill-gotten treasures are of no value, but righteousness delivers
from death.
-- Proverbs 10:2
http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010414
===
Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/

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

2001-04-14 Thread James Moore

RTFM:

http://www.php.net/manual/en/function.strtoupper.php
http://www.php.net/manual/en/function.strtolower.php
http://www.php.net/manual/en/function.ucfirst.php

- James

 -Original Message-
 From: midget2000x [mailto:[EMAIL PROTECTED]]
 Sent: 14 April 2001 08:16
 To: [EMAIL PROTECTED]
 Subject: [PHP] Forcing Case
 
 
 Is there any way to force case...like if I have a string and want 
 it to appear
 in all lowercase (or uppercase, God forbid)?
 
 Thanks,
 
 Rory
  ---
 providing the finest in midget technology
 
 -- 
 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] Any one have PHP voteBOOTH source code...?!?

2001-04-14 Thread news.php.net

hello... anyone know where i can downlaod voteBOOTH.php w/ the image
viewer?! or does anyone have it that you can send to me..?

thanxz!




-- 
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] header( )

2001-04-14 Thread Christian Reiniger

On Saturday 14 April 2001 03:47, you wrote:

 On 11 Apr 2001 08:12:20 -0700 AD in php.general, Chris Lee said:
 I'll post you a simple HTTP auth script. but you should realize =
 something about header()
 
 client - server
 server - client
 
 the client sends some HTTP request to the server, then the server
  sends = some HTTP response to the client. php is strictly server
  side, you have = full control over the HTTP headers sent to the user,
  but not from the = user to the server. ie. method=3D'post' that is
  sending client data to = the server, you will have no control over
  this at all...

 There are in fact two different servers: the web server and the PHP
 server. IMO it should be possible for the PHP server, executing PHP

Wrong. PHP runs as part of the webserver.

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

...1000100011010101101010110100111010113...

--
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] user info?

2001-04-14 Thread Ramiro Radjiman

Hi there,

I'm just wondering if there is a method to extract user specific info when
this user connects to the site.

U user must have a handle, but i don't want him to login. So i thaught if i
can get specific userinfo from the client, this info would be his handle to
walk trough the site.

If he logs in it aint a problem :-)

Could someone help.

I know there must be something, i ones read it.

with kind regards,

Ramiro Radjiman

HOLLAND



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

2001-04-14 Thread Christian Reiniger

On Saturday 14 April 2001 09:15, you wrote:
 Is there any way to force case...like if I have a string and want it to
 appear in all lowercase (or uppercase, God forbid)?

http://www.php.net/strtolower

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

...1000100011010101101010110100111010113...

--
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] Big sites running PHP

2001-04-14 Thread Phil Driscoll

For those who need to convince their bosses that PHP (+mysql +apache) is up
to the job, the following (recently slashdotted) link may be useful:

http://www.webtechniques.com/archives/2001/05/hong/

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org




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

2001-04-14 Thread E K L

Hi,
   Is there anybody can help to do this:

   My web site has 3 pages :a.php, b.php and c.php. I want to capture the 
session in those 3 pages. Without an id, visitor can't view my page. When 
visitors leave the site, thier session should be removed.

   The problem is how to remove the session. I have tried several function 
of session such as session_destroy(), session_unregister. But, i still faild 
to clear the session. What should i do?

  For ur information, the session.cookie_lifetime is set to 0 in my server. 
Should i   change the value? If yes, then how to do it? Please give me your 
hands, thank you

E K
_
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] Abnormal performance of PHP_MSSQL70.DLL

2001-04-14 Thread Jia Li

hi, thank you for taking time reading this email.
i experienced an abnormal happening from my php_MSSQL70.dll. My computer 
config:
AMD 850+SDRAM 256
OS: MS Windows 2000 SERVER + sp1
HTTPD Server :  Apache 1.3.19
PHP version : 4.0.4
MSSQL version : 2000

i altered the Extension part of the php.ini file so that it loads 
php_mssql70.dll (seems there is no php_mssql2000.dll for my MSSQL2000). the 
problem is whenever i load a local page (by typing add in the add bar or 
clicking a hyperlink) in IE, it takes around 10 sec. and i observed that 
when the page is being loaded, the cpu usage reflected from the Task Manager 
is 100% and stays for about 5 sec. THIS HAPPENS EVEN IF THE SCRIPT DIDN"T 
CALL MSSQL FUNCITONS. the problem disappears if i comment that line in 
php.ini which loads that dll.
Why is this happening? anyone can help me?

aijil
_
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] CLASSES AND OBJECTS..

2001-04-14 Thread alberto

Anyone know if one day PHP will support multiple inheritance?
I think it's very important...

For example, will PHP support this code:

class A extends B,  extends C   {

}

where B and C are classes?

Thanks!
Alberto



-- 
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] CLASSES AND OBJECTS..

2001-04-14 Thread Plutarck

Nope, I'm afraid not.

Currently PHP will support single level inheritance only. So A can extend B,
but C cannot extend B. You will need to create a class of B to extend it
with C.

I suppose PHP may one day support it, but I am guessing that the Zend API
can't currently handle it. I think it will need to be retooled.


Sounds like a nice thing to shoot for for PHP5, perhaps?


--
Plutarck
Should be working on something...
...but forgot what it was.


""alberto"" [EMAIL PROTECTED] wrote in message
9b9eu7$s6n$[EMAIL PROTECTED]">news:9b9eu7$s6n$[EMAIL PROTECTED]...
 Anyone know if one day PHP will support multiple inheritance?
 I think it's very important...

 For example, will PHP support this code:

 class A extends B,  extends C   {
 
 }

 where B and C are classes?

 Thanks!
 Alberto



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

2001-04-14 Thread Peter Van Dijck

Hi,
i installed Apache, PHP and mySQL on winNT.
I am trying to get htaccess files to work.

I created a .htaccess file in a directory with this line in it:
errordocument 404 /404.php

I changed the httpd.conf file for apache and restarted apache like this:
# AllowOverride None
AllowOverride All

But when I enter a url that doesn't exist I get this error in the browser:
Not found
The requested URL /peter personal/applications 
development/generic/htdocs/subfolder/dfdfdf was not found on this server.
Additionally, a 500 Internal Server Error error was encountered while 
trying to use an ErrorDocument to handle the request.

What is a good way to check if htaccess files are working, and what can I 
do to get them to work?
Thanks for any ideas, hints, ...!
Peter
~~
http://liga1.com building multiple language/culture websites
http://poorbuthappy.editthispage.com online ethnology, updown


-- 
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] sorting multi-dimensional arrays

2001-04-14 Thread Plutarck

The easiest way is probably to just use a for loop.

For instance (no pun intended...well, maybe just a little one):

$imax = sizeof($joke);

for ($i = 0; $i  $imax; $i++)
{
if (sizeof($joke[$i])  1)
{
sort($joke[$i]);
}
}


That will handle the sorting of any two-dimensional array. It won't effect
the first dimension however, so if you want to sort that you will need to do
it first.


--
Plutarck
Should be working on something...
...but forgot what it was.



[EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a question about sorting multidimensional arrays. Here is my
problem:

 I have an 2-d array:
 $joke[1][rating]=10;
 $joke[2][rating]=20;
 $joke[3][rating]=15;
 

 I would like to sort the jokes into an array based on the rating from
highest
 to lowest. The end result would be something like this:
 Joke 2 : 20 points
 Joke 3: 15 points
 Joke 1: 10 points

 How do I accomplish this?

 I have tried fooling around with sort(), arsort(), and array_multisort(),
but
 I just can't get it. Thank you very much for your time.

 Shane




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

2001-04-14 Thread Peter Van Dijck

Also,
I am trying to find a way to get this to work:
within the directory I'm in,

1/5/2/3
should be rewritten to
index.php?a=1b=5c=2d=3

I'm sure lots of people have done this before, but the Apache examples 
don't seem to include this. Where can I find a working example?
Thanks!
Peter


Hi,
i installed Apache, PHP and mySQL on winNT.
I am trying to get htaccess files to work.

I created a .htaccess file in a directory with this line in it:
errordocument 404 /404.php

I changed the httpd.conf file for apache and restarted apache like this:
# AllowOverride None
AllowOverride All

But when I enter a url that doesn't exist I get this error in the browser:
Not found
The requested URL /peter personal/applications 
development/generic/htdocs/subfolder/dfdfdf was not found on this server.
Additionally, a 500 Internal Server Error error was encountered while 
trying to use an ErrorDocument to handle the request.

What is a good way to check if htaccess files are working, and what can I 
do to get them to work?
Thanks for any ideas, hints, ...!
Peter
~~
http://liga1.com building multiple language/culture websites
http://poorbuthappy.editthispage.com online ethnology, updown


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


~~
http://liga1.com building multiple language/culture websites
http://poorbuthappy.editthispage.com online ethnology, updown


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

2001-04-14 Thread Plutarck

Ahh. I reread your post and now I see what you were originally asking.


Yes, sessions are the best way to handle it then. The variables "live" by
sending a specially augmented header to the client. The header sort of
"sticks" to the client so that their session ID is automatically sent in
their requests for new pages. It's basically a cookie that isn't stored on
the persons hard drive.

There are instances where a person's browser is, for lack of a better word,
"teflon coated" so that the header/cookie just doesn't "stick" to them.
That's when PHP appends the "PHPSESSID=[long string of characters]" to all
of your links.

So the short answer to your question is "Yes, it's the best way to handle
it".

But it must be noted that when someone submits a variable through the URL it
will _not_ change the value of any session variables. You must do that
explicitly in your code.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Ashley M. Kirchner"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Plutarck wrote:

  The way I do it is to stick all those global variables into an include
file,
  which I usually named something like global.php.

   Um no.  These aren't static variables.  They change from page to
 page.  For example, page one

   $foo=0, $bar=3, $baz='Closed'

 They follow a particular link that changes them to,

   $foo=1, $bar=3, $baz='Open'

 They follow yet another link, and this time only $bar changes,

   $foo=1, $bar=2, $baz='Open'

   Right now, the way I've always done that was to include it in the
 URL: next_page.php?foo=0$bar=3baz='Closed' - they follow a link, and
 those variables get tacked again.  If it's a form, I pass hidden input
 tags.

   But, there's got to be a better, transparent way of doing this.  No?

 AMK4

 --
 H | Hi, I'm currently out of my mind.  Please leave a message.  BP!
   |
   ~
   Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
   Director of Internet Operations / SysAdmin. 800.441.3873 x130
   Photo Craft Laboratories, Inc. .eFax 248.671.0909
   http://www.pcraft.com  .3550 Arapahoe Ave, #6
   .. .  .  . .Boulder, CO 80303, U.S.A.



 --
 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] W2K Install Problem

2001-04-14 Thread Jeff Oien

When I try to run a PHP script through a Web browser it just
displays the code. I did a clean install of W2K and installed
Apache. I copied the php.ini to the WINNT and system folders.
Not sure where to go from here.

BTW how do you open a command window in W2K? Thanks.
Jeff Oien

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




[PHP] Explain recordset

2001-04-14 Thread Mike P

I'm trying to figure out the way recordsets are handled with php and 
mysql.After I issue a query to the Db with $result = mysql_query ($query) 
is the recordset contained in $result or is this just a pointer.I want a 
persistant recordset on the client computer that can be manipulated without 
going to the server.Is this possable.fetchrow seems to go to the server 
each time or am i wrong?
Thanks
Mike P
[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] counter reseting help!

2001-04-14 Thread McShen

hi

I am writing a small counter for my site. But i am not sure how to reset the
counter every 24h. How should i do it? any suggestions would be much
appreaciated!



-- 
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 on something simple?

2001-04-14 Thread Andrew Durk

I can get connected to my host's MySQL database w/o error, but I cannot seem
to do anything after that.

I do:
$db = mysql_connect("localhost", "username");
mysql_select_db("subsurface_net",$db);

No problem, but if I do this:
$result = mysql_query("SELECT * FROM customer_genre",$db);

I eventually get:
Warning: 0 is not a MySQL result index in /test.phtml on line 35

And customer_genre _is_ a table in my database...

Help, anyone!?
--
Andrew Durk
[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] Selected Radio Buttons

2001-04-14 Thread Jordan Elver

Hi,
I think I'm being stupid. Why won't this code work. The $article_active 
variable is showing y when I echo it?


if($article_active == 'y') {
echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"y\" SELECTEDYes";
} else {
echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"y\"Yes";
}

if($article_active == 'n') {
echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"n\" SELECTEDNo";
} else {
echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"n\"No";
}


Thanks,

Jord

-- 
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] counter reseting help!

2001-04-14 Thread Plutarck

How are you saving the current counter amount?

For instance if it's in a database, add a date field.

Check to see if the date is more than 24 hours old before displaying the
current counter. If it is then update the database and make the counter
number 0. If it's not older than 24 hours, just do your counter as normal.


--
Plutarck
Should be working on something...
...but forgot what it was.


""McShen"" [EMAIL PROTECTED] wrote in message
9b9mg0$26o$[EMAIL PROTECTED]">news:9b9mg0$26o$[EMAIL PROTECTED]...
 hi

 I am writing a small counter for my site. But i am not sure how to reset
the
 counter every 24h. How should i do it? any suggestions would be much
 appreaciated!



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

2001-04-14 Thread Plutarck

$result holds a "resource id". When you do anything like mysql_fetch_row it
sends a request to the database. All results, until you "fetch" them, are
kept in MySQL.

If you want to store the results away from the DB you will need to do
something like:

while ($array[] = mysql_fetch_row($result));

That will store all the results into $array...hopefully.


--
Plutarck
Should be working on something...
...but forgot what it was.



"Mike P" [EMAIL PROTECTED] wrote in message
9b9lvb$u57$[EMAIL PROTECTED]">news:9b9lvb$u57$[EMAIL PROTECTED]...
 I'm trying to figure out the way recordsets are handled with php and
 mysql.After I issue a query to the Db with $result = mysql_query ($query)
 is the recordset contained in $result or is this just a pointer.I want a
 persistant recordset on the client computer that can be manipulated
without
 going to the server.Is this possable.fetchrow seems to go to the server
 each time or am i wrong?
 Thanks
 Mike P
 [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]




Re: [PHP] PHP for Apache 2.0

2001-04-14 Thread Alexander Wagner

Patrick Dunford wrote:
 According to Apache, modules made for Apache 1.3 will not work as-is
 in 2.0 due to changes in the API.

 Is a version of PHP 4 for Apache 2.0 coming out?

Try the configure-option --with-apxs2 instead of --with-apxs and it 
should work with Apache 2.

PHP 4 supports far more than one Webserver-API.

regards
Wagner

-- 
'When the computer industry is at a low, beer drinking is at a high.' 
Jon 'maddog' Hall said.
By combining both industries into a single course you can make sure you 
always have a job.

-- 
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 on something simple?

2001-04-14 Thread Plutarck

What function are you calling on $result when it returns the error?

Try doing this, all in one place:

$db = mysql_connect("localhost", "username");
mysql_select_db("subsurface_net", $db);

$result = mysql_query("SELECT * FROM customer_genre", $db);

echo mysql_num_rows($result);


When you use a SELECT query the function "mysql_affected_rows" is not valid.
When using an UPDATE, INSERT, or DELETE query, "mysql_num_rows" is invalid.

That may be your problem, because the code you paste in seems not to have
anything wrong with it.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Andrew Durk"" [EMAIL PROTECTED] wrote in message
9b9n47$7ej$[EMAIL PROTECTED]">news:9b9n47$7ej$[EMAIL PROTECTED]...
 I can get connected to my host's MySQL database w/o error, but I cannot
seem
 to do anything after that.

 I do:
 $db = mysql_connect("localhost", "username");
 mysql_select_db("subsurface_net",$db);

 No problem, but if I do this:
 $result = mysql_query("SELECT * FROM customer_genre",$db);

 I eventually get:
 Warning: 0 is not a MySQL result index in /test.phtml on line 35

 And customer_genre _is_ a table in my database...

 Help, anyone!?
 --
 Andrew Durk
 [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] Extract from string

2001-04-14 Thread n e t b r a i n

Hi all,
anyone have or know where I can find a small function in order to extract
from a string the most relevant words in it?

something like this:

$var="I love coffe ... Coffe is from Brazil and coffe with milk ..";
$occurence=2;
//$occurence means word that are repeat 2 or more times
my_dream_funct($var,$occurence);
//the funct now return the word _ coffe _

many thanks in advance
max

ps.plz note: I need that it works on php3


-- 
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] Selected Radio Buttons

2001-04-14 Thread Plutarck

I'm not sure I understand. In the first loop you are seing if
$article_active equals y. And no where in the code do you set
$article_active to anything else.

Why would you think $article_active would be anything but "y" or "n"?


--
Plutarck
Should be working on something...
...but forgot what it was.


"Jordan Elver" [EMAIL PROTECTED] wrote in message
01041415474000.10298@localhost">news:01041415474000.10298@localhost...
 Hi,
 I think I'm being stupid. Why won't this code work. The $article_active
 variable is showing y when I echo it?


 if($article_active == 'y') {
 echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"y\" SELECTEDYes";
 } else {
 echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"y\"Yes";
 }

 if($article_active == 'n') {
 echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"n\" SELECTEDNo";
 } else {
 echo"INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"n\"No";
 }


 Thanks,

 Jord

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




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




[PHP] PHP without a webserver

2001-04-14 Thread Plutarck

I've heard much about how PHP is far more than just a language for web
programming, and I agree. I agree enough that I would like to actually try
it. I'd like to use PHP scripting in a C/C++ program that doesn't need a
webserver as an intermediary. I basically want to use PHP in a
standalone/TCP-IP program rather than having to build a whole "IMF-esk"
hairball myself.


Are there any articles or documentation which focuses, or at least would
give me useful information, on how such a task would be accomplished? I'm
looking at the API documentation itself which will be helpful, but is there
anything a little more "pointed" than that?

I'd love to see PHP grow an arm of offline scripting. It would just be
_perfect_ for compiling high-level developer-friendly scripts into a format
usable for 3D real-time environment manipulation, for instance.



--
Plutarck
Should be working on something...
...but forgot what it was.





-- 
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 14 Apr 2001 15:38:40 -0000 Issue 627

2001-04-14 Thread php-general-digest-help
ld work):

while(list($k, $v) = each($myarray)){
  $myarray[$k] = (int) $v;
}
arsort($myarray);
reset($myarray);
while(list($k, $v) = each($myarray)){
  echo $k, ' == ', $v, "BR\n;
}



For better comprehension look at this post:

Hey guys..

I have this array that looks like this:

$myarray = ( "apples" = 0, "oranges" = 2, "peaches" = 9, "pineapples" =
12, "stovetopstuffing" = 3, "grits" = 8);

Fine and dandy. But, when I try to sort it in reverse order:

arsort($myarray);

I get THIS for output, obviously NOT what I want:

peaches = 9
grits = 8
stovetopstuffing = 3
oranges = 2
pineapples = 12
apples = 0

Obviously, I want the pineapples entry to be at the top, since it has the
highest value. What do I need to do?

You have stored strings as your values, instead of ints.

IE:(string) '9'  (string) '12' returns TRUE

You will need to take care in creating your array to have (int) values
instead of strings.

If all else fails, the following should work:

while(list($k, $v) = each($myarray)){
  $myarray[$k] = (int) $v;
}
arsort($myarray);
reset($myarray);
while(list($k, $v) = each($myarray)){
  echo $k, ' == ', $v, "BR\n;
}

















- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 14, 2001 5:19 AM
Subject: [PHP] sorting multi-dimensional arrays


 I have a question about sorting multidimensional arrays. Here is my
problem:

 I have an 2-d array:
 $joke[1][rating]=10;
 $joke[2][rating]=20;
 $joke[3][rating]=15;
 

 I would like to sort the jokes into an array based on the rating from
highest
 to lowest. The end result would be something like this:
 Joke 2 : 20 points
 Joke 3: 15 points
 Joke 1: 10 points

 How do I accomplish this?

 I have tried fooling around with sort(), arsort(), and array_multisort(),
but
 I just can't get it. Thank you very much for your time.

 Shane






hh, no, maybe the samplecode I posted it's not your case, sorry...





 I have a question about sorting multidimensional arrays. Here is my
problem:

 I have an 2-d array:
 $joke[1][rating]=10;
 $joke[2][rating]=20;
 $joke[3][rating]=15;
 

 I would like to sort the jokes into an array based on the rating from
highest
 to lowest. The end result would be something like this:
 Joke 2 : 20 points
 Joke 3: 15 points
 Joke 1: 10 points

 How do I accomplish this?

 I have tried fooling around with sort(), arsort(), and array_multisort(),
but
 I just can't get it. Thank you very much for your time.

 Shane






The easiest way is probably to just use a for loop.

For instance (no pun intended...well, maybe just a little one):

$imax = sizeof($joke);

for ($i = 0; $i  $imax; $i++)
{
if (sizeof($joke[$i])  1)
{
sort($joke[$i]);
}
}


That will handle the sorting of any two-dimensional array. It won't effect
the first dimension however, so if you want to sort that you will need to do
it first.


--
Plutarck
Should be working on something...
...but forgot what it was.



[EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a question about sorting multidimensional arrays. Here is my
problem:

 I have an 2-d array:
 $joke[1][rating]=10;
 $joke[2][rating]=20;
 $joke[3][rating]=15;
 

 I would like to sort the jokes into an array based on the rating from
highest
 to lowest. The end result would be something like this:
 Joke 2 : 20 points
 Joke 3: 15 points
 Joke 1: 10 points

 How do I accomplish this?

 I have tried fooling around with sort(), arsort(), and array_multisort(),
but
 I just can't get it. Thank you very much for your time.

 Shane







Hello All,


I have already php 3.0.18 installed on my RH 6.2 box.
I want to install PHP 4 now.
But if I still the following message:

[root@proxy mohamedou]# rpm -Uvh php-4.0.4pl1-3.i386.rpm
error: failed dependencies:
libdb-3.1.so is needed by php-4.0.4pl1-3
libgd.so.1.8 is needed by php-4.0.4pl1-3
    libc.so.6(GLIBC_2.1.3) is needed by php-4.0.4pl1-3
libc.so.6(GLIBC_2.2) is needed by php-4.0.4pl1-3
libresolv.so.2(GLIBC_2.2) is needed by php-4.0.4pl1-3
php = 3.0.18 is needed by php-imap-3.0.18-6.2horde1
php = 3.0.18 is needed by php-mysql-3.0.18-6.2horde1
[root@proxy mohamedou]#  

Which rpms are responsible for that?

Every help will be apreciated
Thnx in advance

Moh




According to Apache, modules made for Apache 1.3 will not work as-is in 2.0 
due to changes in the API.

Is a version of PHP 4 for Apache 2.0 coming out?

-- 
===
Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/

   Ill-gotten treasures are of no value, but righteousness delivers
from death.
-- Proverbs 10:2
http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010414
===
Created by Mail2Sig - http://pdunfor

RE: [PHP] W2K Install Problem

2001-04-14 Thread Long Lam

Win2k's command prompt is located under the start 
button/programs/accessories/command prompt.


At 09:53 AM 4/14/2001 -0500, Jeff Oien wrote:
I got it to work. I would still like to know how to open a command
window in W2K though.

I had a reference to d:/php4/ instead of d:/php/ which is where I
have it.
Jeff Oien

  When I try to run a PHP script through a Web browser it just
  displays the code. I did a clean install of W2K and installed
  Apache. I copied the php.ini to the WINNT and system folders.
  Not sure where to go from here.
 
  BTW how do you open a command window in W2K? Thanks.
  Jeff Oien
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

--
PHP 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] Javascript in a header

2001-04-14 Thread Dan Harrington

Hello,
Am I brain damaged or will something like this work?

header("Location:javascript:window.open('http://login.php?arg1arg2','','windowname')");

I want to popup a login script in a sub-browser window, and then pass
the results back to the main window.  Someone told me that the javascript
in the header would work but so far it won't.

However, that javascript typed into the browser "location" field
does work as  I want it to.

ideas?
Thanks
Dan



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

2001-04-14 Thread n e t b r a i n

Hi all,
I don't know why this (quick  dirty) small function:

function esiste_url($file){
@$fp=fopen($file,"r");
if(!$fp){return false;}else{return true;}
@fclose($fp);
}
//it checks if a url submit via form client exist

in two different pages:

a.php3 --- works fine
b.php3 --- produce an Internal Error Server

In both file, it's used like this:
if(esiste_url($url)==false){ etc. etc.

I'm sure (?!) that in b.php3 the error is due to this function 'cause w/o
it, the page b.php3 works fine ...

(I'm on linux box,apache,php3)

Any ideas??
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]




Re: [PHP] PHP MySQL Search Results

2001-04-14 Thread Jason Caldwell

Hi Jason,

Say you have a search form that says search for "searchbox" and the search
box has a variable name of "search":

?

/* Include connection details, with a variable of $connection */

if (!$page) {
$page = 1;
}

$limit = $page * 25;
$limit = $limit - 25;

$sql = "SELECT FROM table WHERE searchdata LIKE '$search' ORDER BY
searchdata DESC LIMIT $limit,25";

$result = @mysql_query($sql, $connection)
or die (mysql_error());

$num = mysql_num_rows($result);

if ($num == 0) {

?

NO Valid search results.

?

} else {

while($row = mysql_fetch_array($result)) {
$url = $row['url'];
$name = $row['name'];

?

a href="? echo "$url"; ?"? echo "$name"; ?BR

? }

if ($page  1) {
echo "a
href=\"search.php?search=".$search."page=".(page -1)."\"Previous/a";
}

if (($num  25)  (($limit + 25)  $num)) {
echo "a href=\"search.php?search=".$search."page=".($page +
1)."\"Next/a.";
}

/* End the initial "Else" */
}

?


__

Here you will see that if no page is assigend as a variable, it is force
assigned to 1.  The limit is the number of results the search is limited to.
If you do some mathematics (ouch) you will see that the limit works like
this:

if the page is equal to 1:
limit is 1 * 25 = 25.
limit = 25 - 25 = 0

The limit in the sql query limits 0,25 (first 25 matches).

if the page is equal to 2:
limit is 2 * 25 = 50
limit is 50 - 25 = 25

The limit in the sql query limits 25,25 (25 matches After the first 25
matches).

if the page is equal to 3:
limit is 3 * 25 = 75
limit = 75 - 50

The limit in the sql query is 50,25 (next 25 matches after the first 50).


Now, towards the bottom of the code I have supplied, I have next and
previous links:

if page is greater than 1, you can show a link to a previous page:
search.php?search=".$search."page=".($page - 1)

This links back to the search page with the searchg criteria, and the page -
1.

if there are more than 25 results ($num) and the (limit + 25) is less than
the total number of pages, we can add a next link.

If you wanted to add page numbers as links, you could do a while or for
loop, but I'd have to use my brain a little more to try and explain that to
you.

I hope that makes a little sense, I'm not very good at explaining these
things.  There's a really good tutorial on this at devshed.com

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

2001-04-14 Thread Phil Driscoll

It may not be responsible for the error, but you ought to move your fclose
to before your return(true) statement, as it never gets executed at all in
your code.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
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] Do any of you provide hosting?

2001-04-14 Thread Manuel Lemos

Hello Chris,

On 12-Apr-01 14:05:38, you wrote:


I currently am using Thehostpros.com for my hosting, but I can't say its been
a pleasant experience. I had to have them install PHP because they are more
ASP oriented. So that cost me more. Then I wanted MySQL and they have spent 3
months saying they'll install that. Basicly here's what I need: Someone who
can host my domain (I own the domain already) Can provide MySQL and PHP. Both
up-to-date. Can give around 60 meg of space (ballpark, less should be fine)
Also a way to set up subdomains without needing to go through the admin (some
hosts can do his). But this isn't necessary. Can anyone help with that?

For about 3 years I have been hosting my sites at my ISP (
http://phphosting.adgrafix.com/ ) mostly because it provides flexibility
like what you and more.  One of my sites is the popular PHP Classes site
that has now over 30.000 subscribers ( http://phpclasses.UpperDesign.com/ ).

If I need I can ask for human support, but most things like sub-domain and
e-mail account creation (extra subdomains and e-mail accounts are free) can
be configured on demand via a Web interface (give it a try in the address
above).

Even though I am on a virtual server, I can have the database servers I
want provided there is enough space and, except for dedicated servers, it
doesn't require a root account to install the software.

So, in my virtual server account I have a MySQL server, a PostgreSQL
server and a CVS server.  I even had a IRC server although I am not using
it.

I also have PHP and Apache compiled with modules and extensions I need
because I can choose what I want.

To keep all my sites automatic I even have access to my account crontab to
execute periodic operations or verify if all the servers are working ok.

I also have telnet/ssh account access so I can configure things on my own
when I want, but the good part is that when you need help or don't have the
time and patience to do it by yourself, my account manager can do it for
me.  He is very skilled and quick to assist me.

He doesn't work for the hosting company.  He just gets a commission from
them.  So it is in the best of his interest to serve me and other clients
well.  If you are interested in get such 5 stars support service, just mail
me back and I'll orient you to sign-in making sure you get my account
manager as yours too.

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]




[PHP] Using gnupg with php - errors

2001-04-14 Thread sohara

Hello all,

This has been covered before, but I can't get it to work and I've searched 
all the archives already.

I am trying to encrypt a small string of data. I am using a script by 
Richard Lynch as my starting point. I found it here:
http://www.weberdev.com/get_example.php3?count=1379

Now, I am on MacOSX trying to get this thing to work. I installed an OSX 
version of gnupg 1.04, without any problems, and created to sets of keys. 
My idea is to get this to work on my local machine first, then eventually 
get it to work on my web hosting account.

Here is the code I am using:

   putenv("HOME=/Users/sohara/");
   
 //Explanationfollows...
 $command = "echo '$data' | /usr/local/bin/gpg -a --batch 
 --no-secmem-warning -e -u '[EMAIL PROTECTED]' -r 'alien8@alien8recordings.
 com'" ;
   
   //Actuallyexecutethecommand
   $result = exec($command, $encrypted, $errorcode);

   if ($errorcode)
   {
   echo "Error $errorcode encrypting your data.br\n";
   exit;
   }

   $encrypteddata = implode("\n", $encrypted);
echo "This is the encrypted data:br $encrypted \n";

And this always gives returns an error number 2. I can't find a list of 
error numbers at gnupg, so the error number isn't very helpful so far. 
Does anyone know about the gnupg error numbers, or just using gnupg with 
php?

Thanks,
Sean

--
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] Supplied argument is not a valid MS SQL-Link resource

2001-04-14 Thread davek

Does anybody know how to fix this error?  "Supplied argument is not a valid
MS SQL-Link resource"  I am running:

NT4
MSSQL7.0
IIS4
PHP 4.0.4pl1

I've been running php3 for some time now without any problems but want to
upgrade to 4.  This error seems to be occuring at the mssql_query()
function.

$Conn=mssql_connect('192.168.1.20','username','password');
$ThisConnect=mssql_select_db('My_Database',$Conn);
$QueryString="select id, name from my_table";
$Test=mssql_query($QueryString, $ThisConnect);

Please help! Thanks.
Dave







-- 
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] HTML and PHP?

2001-04-14 Thread Brian Clark

Hi Steve,

@ 11:34:26 PM on 4/13/2001, Steve Werby wrote:

...
 ?
 echo STOP

 html
 Yes, echo can use here-docs!  Is it really that *hard* to take 1 minute to
 test for yourself? ;-)
 And you can use whatever marker (the 'STOP' above and below) you choose.
 Just make sure you don't indent the closing marker or the parser will miss
 it!
 /html

 STOP;
?

Why even bother? Why not just do this?

?

html
  Boo
/html

?php

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please do not carbon copy me on list replies.



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




RE: [PHP] PHP without a webserver

2001-04-14 Thread Jeroen Wesbeek

well actually you could compile php4
on it's own so you get a php executable which
you can use as an interpreter for php4 scripts...
no webserver needed


dowebwedo
Jeroen Wesbeek
.programming
Nieuwekade 213 | 3511 RW Utrecht
The Netherlands
p 030 2380544 | f 020 8632045


[roses are red, violets are blue,
 I am schizophrenic and so am I ]


-Original Message-
From: Brian Clark [mailto:[EMAIL PROTECTED]]
Sent: zaterdag 14 april 2001 19:53
To: PHP is not a drug.
Subject: Re: [PHP] PHP without a webserver


Hi Plutarck,

@ 11:37:09 AM on 4/14/2001, Plutarck wrote:

 I've heard much about how PHP is far more than just a language for
 web programming, and I agree. I agree enough that I would like to
 actually try it. I'd like to use PHP scripting in a C/C++ program
 that doesn't need a webserver as an intermediary.

It doesn't. You don't have to have a web server installed in order to
use PHP.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please do not carbon copy me on list replies.



-- 
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] HTML and PHP?

2001-04-14 Thread Les Neste

I think the echo approach is pretty handy if you want a subroutine to spit
out a common chunk of HTML which is less than an entire page.  And the
here-doc marker lets you just paste existing HTML in place without having
to escape all the quotation marks.  To me, this is a Good Thing.

At 01:56 PM 4/14/2001 -0400, Brian Clark wrote:
Hi Steve,

@ 11:34:26 PM on 4/13/2001, Steve Werby wrote:

...
 ?
 echo STOP

 html
 Yes, echo can use here-docs!  Is it really that *hard* to take 1 minute to
 test for yourself? ;-)
 And you can use whatever marker (the 'STOP' above and below) you choose.
 Just make sure you don't indent the closing marker or the parser will miss
 it!
 /html

 STOP;
?

Why even bother? Why not just do this?

?

html
  Boo
/html

?php

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please do not carbon copy me on list replies.



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




Les Neste  678-778-0382  http://www.lesneste.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] PHP without a webserver

2001-04-14 Thread Les Neste

Can anybody comment on PHPTriad?  This appears to be PHP+MySQL+Apache for
the Windows desktop.  

At 07:51 PM 4/14/2001 +0200, Jeroen Wesbeek wrote:
well actually you could compile php4
on it's own so you get a php executable which
you can use as an interpreter for php4 scripts...
no webserver needed


dowebwedo
Jeroen Wesbeek
.programming
Nieuwekade 213 | 3511 RW Utrecht
The Netherlands
p 030 2380544 | f 020 8632045


[roses are red, violets are blue,
 I am schizophrenic and so am I ]


-Original Message-
From: Brian Clark [mailto:[EMAIL PROTECTED]]
Sent: zaterdag 14 april 2001 19:53
To: PHP is not a drug.
Subject: Re: [PHP] PHP without a webserver


Hi Plutarck,

@ 11:37:09 AM on 4/14/2001, Plutarck wrote:

 I've heard much about how PHP is far more than just a language for
 web programming, and I agree. I agree enough that I would like to
 actually try it. I'd like to use PHP scripting in a C/C++ program
 that doesn't need a webserver as an intermediary.

It doesn't. You don't have to have a web server installed in order to
use PHP.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please do not carbon copy me on list replies.



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




Les Neste  678-778-0382  http://www.lesneste.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] Red Hat 7.0

2001-04-14 Thread Mauricio Junqueira

I am trying to start the server and it returns the following in the
interbase.log.

ns1.mautec.com (Client) Sat Apr 14 22:06:05 2001
INET/inet_error: connect errno = 111
 
ns1.mautec.com (Client) Sat Apr 14 22:06:05 2001
/opt/interbase/bin/ibguard: guardian starting bin/ibserver
 
 
ns1.mautec.com (Client) Sat Apr 14 22:06:20 2001
INET/inet_error: read errno = 104
 
ns1.mautec.com (Client) Sat Apr 14 22:06:20 2001
INET/inet_error: receive in try_connect errno = 104
 
ns1.mautec.com (Client) Sat Apr 14 22:06:20 2001
/opt/interbase/bin/ibguard: bin/ibserver normal shutdown.

I have been using interbase super server before but in the
SuSe 7.1 with 2.2.18 without any problems.

I have tried the rpm and the tar installation with the
same results...

Can anyone help me out?

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




Re: [PHP] PHP without a webserver

2001-04-14 Thread Plutarck

Ah, even better. However, how would the script be passed to PHP? As a
command line argument?


--
Plutarck
Should be working on something...
...but forgot what it was.


"Jeroen Wesbeek" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 well actually you could compile php4
 on it's own so you get a php executable which
 you can use as an interpreter for php4 scripts...
 no webserver needed


 dowebwedo
 Jeroen Wesbeek
 .programming
 Nieuwekade 213 | 3511 RW Utrecht
 The Netherlands
 p 030 2380544 | f 020 8632045


 [roses are red, violets are blue,
  I am schizophrenic and so am I ]


 -Original Message-
 From: Brian Clark [mailto:[EMAIL PROTECTED]]
 Sent: zaterdag 14 april 2001 19:53
 To: PHP is not a drug.
 Subject: Re: [PHP] PHP without a webserver


 Hi Plutarck,

 @ 11:37:09 AM on 4/14/2001, Plutarck wrote:

  I've heard much about how PHP is far more than just a language for
  web programming, and I agree. I agree enough that I would like to
  actually try it. I'd like to use PHP scripting in a C/C++ program
  that doesn't need a webserver as an intermediary.

 It doesn't. You don't have to have a web server installed in order to
 use PHP.

 -Brian
 --
  PGP is spoken here: 0xE4D0C7C8
  Please do not carbon copy me on list replies.



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




Re: [PHP] Supplied argument is not a valid MS SQL-Link resource

2001-04-14 Thread Plutarck

http://us.php.net/manual/en/function.mssql-select-db.php

*_select_db does not return a connection id, it returns true or false.

Just change your script like this:

$Conn=mssql_connect('192.168.1.20','username','password');
mssql_select_db('My_Database',$Conn);
$QueryString="select id, name from my_table";
$Test=mssql_query($QueryString, $Conn);


That should work just fine.


--
Plutarck
Should be working on something...
...but forgot what it was.




""davek"" [EMAIL PROTECTED] wrote in message
9ba2po$jnb$[EMAIL PROTECTED]">news:9ba2po$jnb$[EMAIL PROTECTED]...
 Does anybody know how to fix this error?  "Supplied argument is not a
valid
 MS SQL-Link resource"  I am running:

 NT4
 MSSQL7.0
 IIS4
 PHP 4.0.4pl1

 I've been running php3 for some time now without any problems but want to
 upgrade to 4.  This error seems to be occuring at the mssql_query()
 function.

 $Conn=mssql_connect('192.168.1.20','username','password');
 $ThisConnect=mssql_select_db('My_Database',$Conn);
 $QueryString="select id, name from my_table";
 $Test=mssql_query($QueryString, $ThisConnect);

 Please help! Thanks.
 Dave







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




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




Re: [PHP] PHP without a webserver

2001-04-14 Thread Brian Clark

Hi Plutarck,

@ 2:11:35 PM on 4/14/2001, Plutarck wrote:

 Ah, even better. However, how would the script be passed to PHP? As
 a command line argument?

Install the CGI executable of PHP in c:\php

In your autoexec.bat:

SET PATH=c:\php;%PATH%

Reboot.

From the command line:

php -q script.php

And read about $argc and $argv. If you're familiar with C, those
shouldn't be a problem.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] user info?

2001-04-14 Thread Brian Clark

Hi Ramiro,

@ 6:48:38 AM on 4/14/2001, Ramiro Radjiman wrote:

...
 I'm just wondering if there is a method to extract user specific
 info when this user connects to the site.

http://www.php.net/manual/nl/function.getenv.php

May be what you're looking for.

 U user must have a handle, but i don't want him to login. So i
 thaught if i can get specific userinfo from the client, this info
 would be his handle to walk trough the site.

 If he logs in it aint a problem :-)

I'd use sessions:

http://www.php.net/manual/nl/ref.session.php

Because you can't depend on something like IP addresses or hostnames
to build Unique IDs because of things like proxies. And I wouldn't
depend solely on cookies either.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



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




Re: [PHP] PHP without a webserver

2001-04-14 Thread Plutarck

Ahh, so it's the location of the script that get's passed.

Now, if the script was coming from a program, is there a way to hand the
file directly to PHP, or will a temporary file have to be used?

So if a user filled in a form and clicked a button in the program, the
program would toy with the form a little, then send the form to PHP. Is that
possible using the CGI executible?


--
Plutarck
Should be working on something...
...but forgot what it was.


"Brian Clark" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Plutarck,

 @ 2:11:35 PM on 4/14/2001, Plutarck wrote:

  Ah, even better. However, how would the script be passed to PHP? As
  a command line argument?

 Install the CGI executable of PHP in c:\php

 In your autoexec.bat:

 SET PATH=c:\php;%PATH%

 Reboot.

 From the command line:

 php -q script.php

 And read about $argc and $argv. If you're familiar with C, those
 shouldn't be a problem.

 -Brian
 --
  PGP is spoken here: 0xE4D0C7C8
  Please, DO NOT carbon copy me on list replies.



 --
 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] Any one have PHP voteBOOTH source code...?!?

2001-04-14 Thread Brian Clark


@ 6:50:49 AM on 4/14/2001, news.php.net wrote:

 hello... anyone know where i can downlaod voteBOOTH.php w/ the image
 viewer?! or does anyone have it that you can send to me..?

I don't know anything about a poll type script with an image viewer,
but look around here:

http://www.hotscripts.com/

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



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

2001-04-14 Thread Brian Clark

Hi James,

@ 6:44:08 AM on 4/14/2001, James Moore wrote:

...
 http://www.php.net/manual/en/function.strtoupper.php
 http://www.php.net/manual/en/function.strtolower.php
 http://www.php.net/manual/en/function.ucfirst.php

Another extremely useful one is ucwords()

http://www.php.net/manual/en/function.ucwords.php

:)

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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 config.m4 ircg.c

2001-04-14 Thread Sascha Schumann

sas Sat Apr 14 11:49:04 2001 EDT

  Modified files:  
/php4/ext/ircg  config.m4 ircg.c 
  Log:
  Make it possible to build ircg without thttpd
  
  
Index: php4/ext/ircg/config.m4
diff -u php4/ext/ircg/config.m4:1.6 php4/ext/ircg/config.m4:1.7
--- php4/ext/ircg/config.m4:1.6 Tue Mar 27 12:34:30 2001
+++ php4/ext/ircg/config.m4 Sat Apr 14 11:49:04 2001
@@ -16,6 +16,9 @@
   PHP_EVAL_INCLINE(`$IRCG_CONFIG --cppflags`)
   PHP_ADD_LIBRARY_WITH_PATH(ircg, $PHP_IRCG/lib)
   PHP_ADD_INCLUDE($PHP_IRCG/include)
+  if test "$PHP_SAPI" = "thttpd"; then
+AC_DEFINE(IRCG_WITH_THTTPD, 1, [Whether thttpd is available])
+  fi
   AC_DEFINE(HAVE_IRCG, 1, [Whether you want IRCG support])
   PHP_EXTENSION(ircg, $ext_shared)
 fi
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.56 php4/ext/ircg/ircg.c:1.57
--- php4/ext/ircg/ircg.c:1.56   Tue Apr  3 12:41:23 2001
+++ php4/ext/ircg/ircg.cSat Apr 14 11:49:04 2001
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.56 2001/04/03 19:41:23 sas Exp $ */
+/* $Id: ircg.c,v 1.57 2001/04/14 18:49:04 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -633,6 +633,7 @@
 
 PHP_FUNCTION(ircg_set_current)
 {
+#ifdef IRCG_WITH_THTTPD
zval **p1;
php_irconn_t *conn;
 
@@ -656,6 +657,7 @@
msg_empty_buffer(conn);
 
RETURN_TRUE;
+#endif
 }
 
 PHP_FUNCTION(ircg_new_window)



-- 
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] antifraud logic for voting poll, banner clicks

2001-04-14 Thread Brian Clark

Hi Keyur,

@ 2:57:56 AM on 4/14/2001, Keyur Kalaria wrote:

...
 Can anyone suggest me how to avoid the fraud rating and fraud banner clicks.
 What all things we need to take care for the same etc.

Have a look at how those are implemented in phpAds and phpPolls:

http://www.phpwizard.net/

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] HTML and PHP?

2001-04-14 Thread Brian Clark

Hi Les,

@ 2:09:01 PM on 4/14/2001, Les Neste wrote:

 I think the echo approach is pretty handy if you want a subroutine
 to spit out a common chunk of HTML which is less than an entire
 page. And the here-doc marker lets you just paste existing HTML in
 place without having to escape all the quotation marks. To me, this
 is a Good Thing.

And you can do the exact same thing with what I posted.

?php

function foo()
{
   ?
   bar. didn't "example.com" ain't aren't
   ?php
}


foo();

?

Granted, one wouldn't bother when only one string needed to be
printed, but it works just fine for large amounts of HTML.

If you needed to interpolate variables, then you'd probably want to
print(), echo() or use here-doc.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] A tricky problem

2001-04-14 Thread David Tandberg-Johansen

This is maybe of topic, but I try.

I have this site where the user first selects a langueage, and then i use
session_register() to register the information.
Then I use the the registered onformatin to dispaly the site text in the
user selected language.

The user put the selected things in a temp TABLE and when they are finnished
the info in the temp TABLE transfere over to a real TABLE. This isn't the
problem

The problem is:
If a user leaves the site because the user doesn't want to go thrue with the
order, or if the user closes the broser, then the recods of the selected
info are still in the temp TABLE. How can I delete this info when the user
leaves or close the browser?

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] R: [PHP] CLASSES AND OBJECTS..

2001-04-14 Thread alberto

Yes...
Becouse in some large projects, it's very hard to wok with a single level
inheritance...
i think that PHP is a very good language and come better every day... so i
hope in the future programmers can use multiple inheritante with classes in
PHP.

Thank for the answer
Alberto


"Plutarck" [EMAIL PROTECTED] wrote in message
9b9ih0$81h$[EMAIL PROTECTED]
 Nope, I'm afraid not.

 Currently PHP will support single level inheritance only. So A can extend
B,
 but C cannot extend B. You will need to create a class of B to extend it
 with C.

 I suppose PHP may one day support it, but I am guessing that the Zend API
 can't currently handle it. I think it will need to be retooled.


 Sounds like a nice thing to shoot for for PHP5, perhaps?


 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.


 ""alberto"" [EMAIL PROTECTED] wrote in message
 9b9eu7$s6n$[EMAIL PROTECTED]">news:9b9eu7$s6n$[EMAIL PROTECTED]...
  Anyone know if one day PHP will support multiple inheritance?
  I think it's very important...
 
  For example, will PHP support this code:
 
  class A extends B,  extends C   {
  
  }
 
  where B and C are classes?
 
  Thanks!
  Alberto
 
 
 
  --
  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] What's XML's Purpose??

2001-04-14 Thread Chris Anderson

Alright I'll start this out by saying I have a subscription to "Visual Basic 
Programmers Journal". Before I converted and realized that I loved PHP so much I used 
ASP. Well it seems that in this magazine that XML is a hot topic in the MS world. I 
know XML can be used by PHP, but is there a point? I only know 2 things about it:
1) You can make your own tags:
mytag/mytag
2) It's supposedly good for databasing?

If its for databasing, why not just use MySQL( or a variation). Am I missing something 
here?



Re: [PHP] PHP without a webserver

2001-04-14 Thread Brian Clark

Hi Plutarck,

@ 2:40:28 PM on 4/14/2001, Plutarck wrote:

 Ahh, so it's the location of the script that get's passed.

Yes:

% cat test.php
?php

while(list($i,$arg) = each($argv))
{
  print "$i: $arg\n";
}

?

% php -q test.php a b c d e f g
0: test.php
1: a
2: b
3: c
4: d
5: e
6: f
7: g
%

 Now, if the script was coming from a program, is there a way to hand the
 file directly to PHP, or will a temporary file have to be used?

I have no idea. What language? Using system() in C and Perl, I'm
sure you could concoct something. Why would you want to do that?

 So if a user filled in a form and clicked a button in the program, the
 program would toy with the form a little, then send the form to PHP. Is that
 possible using the CGI executible?

I have no idea what you're talking about here, but if you're wanting
to build some type of GUI based application you might as well either
use PHP-GTK (http://gtk.php.net) or just use a HTML, PHP and a web
server.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] A tricky problem

2001-04-14 Thread Brian Clark

Hi David,

@ 3:06:19 PM on 4/14/2001, David Tandberg-Johansen wrote:

...
 The problem is:
 If a user leaves the site because the user doesn't want to go thrue with the
 order, or if the user closes the broser, then the recods of the selected
 info are still in the temp TABLE. How can I delete this info when the user
 leaves or close the browser?

You don't. Just store the age of the session (date,time,whatever) in
the table along with the other information. Then, when someone visits
the site, the dates are checked in the table and the old entries are
cleared.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] What's XML's Purpose??

2001-04-14 Thread Brian Clark

Hi Chris,

@ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:

 Am I missing something here?

This has been discussed many times. There was an extremely long thread
last year about XML, but I can't find it in the archives.

Here's a good start:

http://marc.theaimsgroup.com/?l=php-generalm=97969195010857w=2

Use the 'next in thread' link to follow the thread.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



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

2001-04-14 Thread Ulysses Almeida

Hi...
 
   Is there a way to use posix_setuid without set Apache to run as root?
   Or, is there some other function to do the same thing?


  []s

.~.  Ulysses Almeida
   / V \  [EMAIL PROTECTED]
 / (   ) \  Seja livre, use GNU/Linux! 
   ^^-^^


-- 
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] What's XML's Purpose??

2001-04-14 Thread Chris Anderson

thanks that helped
I stll think it sounds like its more geared for the MS crowd
- Original Message - 
From: "Brian Clark" [EMAIL PROTECTED]
To: "PHP is not a drug." [EMAIL PROTECTED]
Sent: Saturday, April 14, 2001 3:29 PM
Subject: Re: [PHP] What's XML's Purpose??


 Hi Chris,
 
 @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:
 
  Am I missing something here?
 
 This has been discussed many times. There was an extremely long thread
 last year about XML, but I can't find it in the archives.
 
 Here's a good start:
 
 http://marc.theaimsgroup.com/?l=php-generalm=97969195010857w=2
 
 Use the 'next in thread' link to follow the thread.
 
 -Brian
 --
  PGP is spoken here: 0xE4D0C7C8
  Please, DO NOT carbon copy me on list replies.
 
 
 
 -- 
 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] What's XML's Purpose??

2001-04-14 Thread Brian Clark

Hi Chris,

@ 1:17:25 PM on 4/14/2001, Chris Anderson wrote:

...
 I stll think it sounds like its more geared for the MS crowd

No way.

"XML is a set of rules, guidelines, conventions, whatever you want to
call them, for designing text formats for such data, in a way that
produces files that are easy to generate and read (by a computer),
that are unambiguous, and that avoid common pitfalls, such as lack of
extensibility, lack of support for internationalization/localization,
and platform-dependency."

http://www.w3.org/XML/


-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] What's XML's Purpose??

2001-04-14 Thread Plutarck

I use to be really enthusiastically pro-XML just as I was getting into PHP,
but now I've basically taken a "XML shmexXML" approach. I get the initial
attraction, but I would think the love would fade off a bit.

The key that so many people seem to forget is the best way to do HTML is
with, *gasp*, HTML!

If you just want a webpage, XML is using a canon to kill a fly. It's like
creating classes and objects in PHP for sending text emails.

Sure you can do it...but why?

XML is new. Common society doesn't do well with new. They always manage to
screw it up somehow.

XML started as an extensible markup language...that's it. That's all it was
supposed to do! Now people are using it to query databases, and concoct
entire search engines, and they are trying to use it to control access to
restricted data, etc etc.

It's the same thing that happened with Java. People just aren't good with
"new".


XML is nice, and for some things it's even great. But it's not the death of
plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was "the
future of telecom"?).

I fear that there are too many cooks in the kitchen on XML, all with a
seasoning all their own that they are dead set on adding to the broth.


But for me, I say let people play with their Java and XML and new fangled
widgets. I'll take my PHP and plain-old HTML, and I'll create twice as much
material with just as high a quality, and I won't need to spend an extra
minute learning a bleeding-edge technology.

Life's too short to spend it learning how to live it. Translation: Better to
program than to learn yet _another_ language.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Chris Anderson"" [EMAIL PROTECTED] wrote in message
002001c0c506$c70d7f00$0d1012d1@null">news:002001c0c506$c70d7f00$0d1012d1@null...
 thanks that helped
 I stll think it sounds like its more geared for the MS crowd
 - Original Message -
 From: "Brian Clark" [EMAIL PROTECTED]
 To: "PHP is not a drug." [EMAIL PROTECTED]
 Sent: Saturday, April 14, 2001 3:29 PM
 Subject: Re: [PHP] What's XML's Purpose??


  Hi Chris,
 
  @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:
 
   Am I missing something here?
 
  This has been discussed many times. There was an extremely long thread
  last year about XML, but I can't find it in the archives.
 
  Here's a good start:
 
  http://marc.theaimsgroup.com/?l=php-generalm=97969195010857w=2
 
  Use the 'next in thread' link to follow the thread.
 
  -Brian
  --
   PGP is spoken here: 0xE4D0C7C8
   Please, DO NOT carbon copy me on list replies.
 
 
 
  --
  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]




Re: [PHP] PHP without a webserver

2001-04-14 Thread Plutarck

Btw, thanks for all your answers to far ;)

 I have no idea. What language? Using system() in C and Perl, I'm
 sure you could concoct something. Why would you want to do that?


A move recently being made by game programmers has been to move an
increasing amount of work into a scripting engine. My idea is to jump ahead
of the slow move, so that the program is far more abstracted.

The program, written in C/C++ (or Java, or any language really), is
basically turned into a dumb bot. It's a mindless intermediary. The outer
layer is the Display Engine, which could be a Quake Engine or an MFC style
GUI, which takes all of it's commands from the intermediary layer.

The final layer is the scripting engine. In the script if a move_elevator()
function is called, the script interpreter bundles up some commands and
passes it over to the intermediary layer. The intermediary looks at the
display engine, figures out what commands must be called to fufill the
wishes of the script, and passes over the commands.

This would allow the vast majority of the real "content" of a game or
application to be written in a scripting language, much like web apps are
now. The script would run just as well on Linux as it would on windows.

The intermediary understands the universally written script, and figures out
how to actually do what the script asks it to. So an entire application
could be written to run using OpenGL, DirectX, and a selection of different
engines. So you could switch from using a Quake engine to a Midtown Madness
engine for maximum effectiveness, only by tweaking the intermediary level.
Since there are only so many ways to "rotate camera", code could be reused
to the point that the intermediary level comes packaged with all it needs to
know. And thus the sheer amount of people who have the ability to run such
applications skyrockets.


The creators of the Dark Forces star wars game (correct name?) created a
specific programming language for doing things like moving elevators,
dialog, etc. Now adays everyone has their own script.

Asheron's Call has their own little internal quest scripting, and Ever Quest
made their own, Doom has one, Daggerfall has some, et al. But why go to the
trouble of making a whole stinking language, reinventing the wheel, when
thousands of people have spent years to develop a versitile and extensible
scripting engine in PHP?


Anyway, that's my idea. I'd just be happy to outsource some of my C++ work
to PHP. If I use MFC, goodbye platform independence. If I don't use it, it's
a huge pain in the butt to do heavy string manipulation. So I figure, why
not just have PHP do it, since I already know the language?



--
Plutarck
Should be working on something...
...but forgot what it was.



"Brian Clark" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Plutarck,

 @ 2:40:28 PM on 4/14/2001, Plutarck wrote:

  Ahh, so it's the location of the script that get's passed.

 Yes:

 % cat test.php
 ?php

 while(list($i,$arg) = each($argv))
 {
   print "$i: $arg\n";
 }

 ?

 % php -q test.php a b c d e f g
 0: test.php
 1: a
 2: b
 3: c
 4: d
 5: e
 6: f
 7: g
 %

  Now, if the script was coming from a program, is there a way to hand the
  file directly to PHP, or will a temporary file have to be used?

 I have no idea. What language? Using system() in C and Perl, I'm
 sure you could concoct something. Why would you want to do that?

  So if a user filled in a form and clicked a button in the program, the
  program would toy with the form a little, then send the form to PHP. Is
that
  possible using the CGI executible?

 I have no idea what you're talking about here, but if you're wanting
 to build some type of GUI based application you might as well either
 use PHP-GTK (http://gtk.php.net) or just use a HTML, PHP and a web
 server.

 -Brian
 --
  PGP is spoken here: 0xE4D0C7C8
  Please, DO NOT carbon copy me on list replies.



 --
 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] HTML and PHP?

2001-04-14 Thread Jason Caldwell

  Just make sure you don't indent the closing marker or the parser will
miss
  it!

YES!! -- I struggled with that one for a long time... (at least a couple of
hours, before I said, hmmm... let me [for giggles] remove the TABS before
the closing marker... -- bam... Parser Error went away...)

FYI to other readers: you can indent (or Tab) the leading marker, but the
trailing maker cannot have tabs infront of it.

for example

?

print SOMESTUFF // leading marker

here is a line of text and HTML
html
head

SOMESTUFF; // notice no tabs here on the end marker "SOMESTUFF"

?

Jason


"Brian Clark" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Steve,

 @ 11:34:26 PM on 4/13/2001, Steve Werby wrote:

 ...
  ?
  echo STOP

  html
  Yes, echo can use here-docs!  Is it really that *hard* to take 1 minute
to
  test for yourself? ;-)
  And you can use whatever marker (the 'STOP' above and below) you choose.
  Just make sure you don't indent the closing marker or the parser will
miss
  it!
  /html

  STOP;
 ?

 Why even bother? Why not just do this?

 ?

 html
   Boo
 /html

 ?php

 -Brian
 --
  PGP is spoken here: 0xE4D0C7C8
  Please do not carbon copy me on list replies.



 --
 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] What's XML's Purpose??

2001-04-14 Thread phpman

hold on here,
XML and HTML have, as far as I'm concerned, nothing to do with each other.
I'm using XML to link databases
on the sites I write (with PHP) with disparate databases on other Inernet
servers. A good example would be linking
up with UPS's online rates application server. I send an XML request with
shipment info and get a response XML
file with the pricing, time to delivery, etc..

The tags just tell you what the info between them is. XML is awesome, and
will become very big in the next couple years. You can write all kinds of
business 2 business appz with it.

-dave





""Chris Anderson"" [EMAIL PROTECTED] wrote in message
000201c0c501$50264b60$0d1012d1@null">news:000201c0c501$50264b60$0d1012d1@null...
Alright I'll start this out by saying I have a subscription to "Visual Basic
Programmers Journal". Before I converted and realized that I loved PHP so
much I used ASP. Well it seems that in this magazine that XML is a hot topic
in the MS world. I know XML can be used by PHP, but is there a point? I only
know 2 things about it:
1) You can make your own tags:
mytag/mytag
2) It's supposedly good for databasing?

If its for databasing, why not just use MySQL( or a variation). Am I missing
something here?




-- 
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] What's XML's Purpose??

2001-04-14 Thread Jason Caldwell

amen brother!


""Plutarck"" [EMAIL PROTECTED] wrote in message
9baam8$6sh$[EMAIL PROTECTED]">news:9baam8$6sh$[EMAIL PROTECTED]...
 I use to be really enthusiastically pro-XML just as I was getting into
PHP,
 but now I've basically taken a "XML shmexXML" approach. I get the initial
 attraction, but I would think the love would fade off a bit.

 The key that so many people seem to forget is the best way to do HTML is
 with, *gasp*, HTML!

 If you just want a webpage, XML is using a canon to kill a fly. It's like
 creating classes and objects in PHP for sending text emails.

 Sure you can do it...but why?

 XML is new. Common society doesn't do well with new. They always manage to
 screw it up somehow.

 XML started as an extensible markup language...that's it. That's all it
was
 supposed to do! Now people are using it to query databases, and concoct
 entire search engines, and they are trying to use it to control access to
 restricted data, etc etc.

 It's the same thing that happened with Java. People just aren't good with
 "new".


 XML is nice, and for some things it's even great. But it's not the death
of
 plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was
"the
 future of telecom"?).

 I fear that there are too many cooks in the kitchen on XML, all with a
 seasoning all their own that they are dead set on adding to the broth.


 But for me, I say let people play with their Java and XML and new fangled
 widgets. I'll take my PHP and plain-old HTML, and I'll create twice as
much
 material with just as high a quality, and I won't need to spend an extra
 minute learning a bleeding-edge technology.

 Life's too short to spend it learning how to live it. Translation: Better
to
 program than to learn yet _another_ language.


 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.


 ""Chris Anderson"" [EMAIL PROTECTED] wrote in message
 002001c0c506$c70d7f00$0d1012d1@null">news:002001c0c506$c70d7f00$0d1012d1@null...
  thanks that helped
  I stll think it sounds like its more geared for the MS crowd
  - Original Message -
  From: "Brian Clark" [EMAIL PROTECTED]
  To: "PHP is not a drug." [EMAIL PROTECTED]
  Sent: Saturday, April 14, 2001 3:29 PM
  Subject: Re: [PHP] What's XML's Purpose??
 
 
   Hi Chris,
  
   @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:
  
Am I missing something here?
  
   This has been discussed many times. There was an extremely long thread
   last year about XML, but I can't find it in the archives.
  
   Here's a good start:
  
   http://marc.theaimsgroup.com/?l=php-generalm=97969195010857w=2
  
   Use the 'next in thread' link to follow the thread.
  
   -Brian
   --
PGP is spoken here: 0xE4D0C7C8
Please, DO NOT carbon copy me on list replies.
  
  
  
   --
   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 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] 2 Different Mysql Server Connection Problem

2001-04-14 Thread Mesut TUNGA

Hi All,

we have 2 mysql server located two dfiferent iss. one of them compiled
latin1 with php-4.0.4pl1  and other one compiled latin5 with
php-4.0.3.pl1. when we tried to connect from latin1 compiled one to
latin5 compiled one, it gives this error:

Warning: MySQL Connection Failed: Can't initialize character set 30
(path: default) in /home/user/public_html/createtable.php on line 2

on createtable.php line 2 there is mysql_connection command.

Is it a bug of php or there would a mistake. if it is a bug is there any
patch to solve it?

Regards,
Mesut Tunga...




-- 
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] Sorry :(

2001-04-14 Thread Chris Anderson

I realized that'll that I don't do much to help this community. I rarely reply to 
people's questions. Mainly because I have 56.6 and when I get mail people answered 
already. I also ask alot of questions. Just saying thanks for putting up with me.
Chris, The 17 yr Old Php Coder



Re: [PHP] Sorry :(

2001-04-14 Thread Richard

Hey, take it easy, I started like that too, I think we all did.

- Richard

""Chris Anderson"" [EMAIL PROTECTED] wrote in message
001301c0c51c$3cb49e40$0d1012d1@null">news:001301c0c51c$3cb49e40$0d1012d1@null...
I realized that'll that I don't do much to help this community. I rarely
reply to people's questions. Mainly because I have 56.6 and when I get mail
people answered already. I also ask alot of questions. Just saying thanks
for putting up with me.
Chris, The 17 yr Old Php Coder




-- 
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] What's XML's Purpose??

2001-04-14 Thread Michael Kimsal



Plutarck wrote:

 I use to be really enthusiastically pro-XML just as I was getting into PHP,
 but now I've basically taken a "XML shmexXML" approach. I get the initial
 attraction, but I would think the love would fade off a bit.

 The key that so many people seem to forget is the best way to do HTML is
 with, *gasp*, HTML!

 If you just want a webpage, XML is using a canon to kill a fly. It's like
 creating classes and objects in PHP for sending text emails.


Agreed, but if you have a set of data that you'd like to be able to
"fairly easily" convert into multiple presentation systems (HTML, PDF
and WAP spring to mind), then taking a more structured data and
abstraction approach can pay off quite handsomely on larger projects.



 Sure you can do it...but why?


Because what you need to do might change some in the future.  Yes,
use mail() all you want, but when you start needing to send attachments,
already you need a class of some sort.   - Aha - I see you qualified and said
'text' attachments.  OK...



 XML is new. Common society doesn't do well with new. They always manage to
 screw it up somehow.


Depends on what you mean by 'screw it up'.  The notion of a commercial
internet, to me, seems to have been adopted QUITE quickly - even my
parents have coped quite well with this 'new' stuff, and they STILL
can't set their VCR clocks.


 XML started as an extensible markup language...that's it. That's all it was
 supposed to do! Now people are using it to query databases, and concoct
 entire search engines, and they are trying to use it to control access to
 restricted data, etc etc.


I don't know what you're talking about here.  I've not heard of anyone using
XML to 'control access' to 'restricted data'.  The XML itself IS the data.



 It's the same thing that happened with Java. People just aren't good with
 "new".


Don't lump Java in with other 'new' technology wholesale.  Sun has made,
imo, a HUGE number of mistakes pushing Java out, so the
less-than-stellar adoption of Java has as much or more to do with Sun themselves

rather than people's ability to adopt to 'new' things.  Again, imo.



 XML is nice, and for some things it's even great. But it's not the death of
 plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was "the
 future of telecom"?).

 I fear that there are too many cooks in the kitchen on XML, all with a
 seasoning all their own that they are dead set on adding to the broth.

 But for me, I say let people play with their Java and XML and new fangled
 widgets. I'll take my PHP and plain-old HTML, and I'll create twice as much
 material with just as high a quality, and I won't need to spend an extra
 minute learning a bleeding-edge technology.


Twice as much material?  Is there a contest going on?  Some of us are trying
to use PHP to create advanced applications where we exchange data with
disparate parties.  Having a common standard by which we can exchange
data is a necessity - XML can be that commonality in many cases.

Keep making your HTML webpages - no one is trying to convert you.  Realize
2 things:

1.  The impact and use of 'internet' and related technologies are much larger
than you or I alone can grasp.
2.  New things can come along that don't disrupt your world - you don't need to
come down so heavily on something you don't need or use.


 Life's too short to spend it learning how to live it. Translation: Better to
 program than to learn yet _another_ language.


Go back to VIC-20 BASIC then.  Things change, and eventually you need to adapt.
At one point you didn't know PHP.  Why did you learn it?  Why not stick
with what you were using before?  Because PHP offered you benefits
you couldn't get elsewhere for the same effort.  SAME thing with XML.  There are

growing pains, yes, and political pissing matches between the "big boys" but
all in all it's a good idea that some of us have a use for.

:)




-- 
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 from string, version 2.0

2001-04-14 Thread Steve Edberg

OK, this is less elegant (to me, anyway), and probably a bit slower, but:

function word_occurrence($word,$phrase) {
$word = strtolower($word); # this way,
$phrase = strtolower($phrase); # case is irrelevant

$Bits = split('[^[:alnum:]]+', $phrase);
$count = 0;
for ($i=0; $icount($Bits); $i++) {
   if ($Bits[$i] == $word) { $count++; }
}

return ($count);
}

It should also handle hyphenated  apostrophied (is that a word?) 
words correctly, such as

coffe's a drag
or
coffe-heads are strange

If you want to count words that INCLUDE dashes or apostrophes, you'd 
have to use "[^[:alnum:]'-]+" in the split() function. Or, just break 
the string up by whitespace, and use '[[:space:]]+'.

-steve



---Original Message ---
At 11:07 PM +0200 4/14/01, n e t b r a i n wrote:
Hi all,
anyone have or know where I can find a small function in order to extract
from a string the most relevant words in it?

something like this:

$var="I love coffe ... Coffe is from Brazil and coffe with milk ..";
$occurence=2;
//$occurence means word that are repeat 2 or more times
my_dream_funct($var,$occurence);
//the funct now return the word _ coffe _

many thanks in advance
max

ps.plz note: I need that it works on php3



Well, just offthetopofmyhead:

function word_occurrence($word,$phrase) {
$word = strtolower($word); # this way,
$phrase = strtolower($phrase); # case is irrelevant

$Bits = split($word.'[^[:alnum:]]*', $phrase);

return (count($Bits)-1);
}

I tested this, and it works fine (php 3.0.12) EXCEPT it counts 
'coffecoffe' as TWO words, not zero. If that's the behavior you want, 
then it's fine. Now I'm intrigued...I want to find a single regular 
expression that will NOT match 'coffecoffe'. Perhaps preg_ functions 
(available on PHP = 3.0.9).

And, I tried things like

split('[^[:alnum:]]*'.$word.'[^[:alnum:]]*', " $phrase ")

...didn't work.

-steve

-- 
+--- 12 April 2001: Forty years of manned spaceflight ---+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- www.yurisnight.net --+

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




[PHP] next release?

2001-04-14 Thread Michael Kimsal

I'm seeing references to functions that 'are' in 4.0.6, but I wasn't
even
aware that 4.0.5 was released yet.  I've seen references to RCs for
4.0.5,
but nothing's on the php.net page.  Did I miss something?




-- 
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] Sorry :(

2001-04-14 Thread Brian Clark

Hi Chris,

@ 3:51:02 PM on 4/14/2001, Chris Anderson wrote:

 I realized that'll that I don't do much to help this community. I
 rarely reply to people's questions. Mainly because I have 56.6 and
 when I get mail people answered already. I also ask alot of
 questions. Just saying thanks for putting up with me. Chris, The 17
 yr Old Php Coder

As far as I'm concerned, you don't have a thing to be sorry about.

There isn't a thing wrong with asking questions here. In fact, if you
have a good book and this list to get help from, you're far more
likely to become successful with PHP.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] Sorry :(

2001-04-14 Thread Chris Anderson

Well thanks everyone, don't feel like I'm "leeching" from the community
anymore. Now when it comes to me and napster, thats another story
- Original Message -
From: "Brian Clark" [EMAIL PROTECTED]
To: "PHP is not a drug." [EMAIL PROTECTED]
Sent: Saturday, April 14, 2001 7:47 PM
Subject: Re: [PHP] Sorry :(


 Hi Chris,

 @ 3:51:02 PM on 4/14/2001, Chris Anderson wrote:

  I realized that'll that I don't do much to help this community. I
  rarely reply to people's questions. Mainly because I have 56.6 and
  when I get mail people answered already. I also ask alot of
  questions. Just saying thanks for putting up with me. Chris, The 17
  yr Old Php Coder

 As far as I'm concerned, you don't have a thing to be sorry about.

 There isn't a thing wrong with asking questions here. In fact, if you
 have a good book and this list to get help from, you're far more
 likely to become successful with PHP.

 -Brian
 --
  PGP is spoken here: 0xE4D0C7C8
  Please, DO NOT carbon copy me on list replies.



 --
 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] 2 Different Mysql Server Connection Problem

2001-04-14 Thread Brian Clark

Hi Mesut,

@ 6:19:04 PM on 4/14/2001, Mesut TUNGA wrote:

...
 Warning: MySQL Connection Failed: Can't initialize character set 30
 (path: default) in /home/user/public_html/createtable.php on line 2


http://www.mysql.com/doc/C/a/Cannot_initialize_character_set.html


-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



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

2001-04-14 Thread Yasuo Ohgaki
I guess you are using "files" session module.
If you take a look at note in PHP Manual, there is my note why your session
files are not deleted.
(See Session reference)

Hope this helps.
--
Yasuo Ohgaki


""E K L"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
Is there anybody can help to do this:

My web site has 3 pages :a.php, b.php and c.php. I want to capture the
 session in those 3 pages. Without an id, visitor can't view my page. When
 visitors leave the site, thier session should be removed.

The problem is how to remove the session. I have tried several function
 of session such as session_destroy(), session_unregister. But, i still faild
 to clear the session. What should i do?

   For ur information, the session.cookie_lifetime is set to 0 in my server.
 Should i   change the value? If yes, then how to do it? Please give me your
 hands, thank you

 E K
 _
 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] converting DATETIME to a readable date.

2001-04-14 Thread DRN

Hi, I have a MySQL table recording errors, 1 of the fields is a
DATETIME, to give me the time of the error.
I have made a file which will then display a table of errors.

I would like to display the date and time in a more readable format,
even just with spaces between the years  months etc.

Having a look through the php online documentation I found this
example:

~~
If you have a MySQL column with of the DATETIME type, and you want to
format the values to a different representation, use this code:

$date = $row["date"];

$new_date = date("l, j M Y, G:i:s", strtotime($date));
~~

but I cannot get this to work :(, I get an "unexpected error in
date()"

I don't (yet) know enough about php to work out what this error is,
could someone help.


Cheers for your help,  Donald
__
As well as learning more,
I learn that there is even more I don't know

http://www.donaldrnoble.f2s.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] converting DATETIME to a readable date.

2001-04-14 Thread Brian Clark

Hi DRN,

@ 8:34:08 PM on 4/14/2001, DRN wrote:

...
 $date = $row["date"];

 $new_date = date("l, j M Y, G:i:s", strtotime($date));
 ~~

 but I cannot get this to work :(, I get an "unexpected error in
 date()"
...

Try this and see if it functions correctly:

?php

$date = str_replace('-','/',$row["date"]);
$new_date = date("l, j M Y, G:i:s", strtotime($date));

?

Your original code gives me the same error, but the above code
functions normally for me.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] Display Formatted Query Results

2001-04-14 Thread Jeff Holzfaster

Hi All,

My apologies if this is too wordy.

This is driving me nuts.  I have very little experience or knowledge of PHP
and MySQL but have been put in a position that requires me to build several
applications that require me to figure them out.  I am making progress,
though.  Here is my first delimit:

I have a form page that looks like this:
http://www.webtinker.com/fran_info.htm This form has several things going
on.  1st, the first pull down list needs to reflect the same info as the two
location descriptions.  2nd, the two locations "Round Table Discussion" will
grow to an unknown number of entries over time so the two may become 6 or 8
or...  My first big (for me) hurdle is to figure out how to get these to
show up at the top of this form in order of the date with the closest one
first.  They need to be in the same format as they appear but with
additional rows showing as more entries are made.  The ones showing can't be
past due, or, don't show past dates.

What I have figured out so far is how to populate the pull down, how to make
the admin form to fill in the needed info into the MySQL table and I have
had limited success in displaying the meeting info at the top of the form.
I just can't figure out how to make them wrap into groups of info, say with
5 entries of different meetings.  Do I need a separate query for each row of
info using the limit statement in the query or is there a way to do this
using gulp arrays?  I have just about every book available and just can't
find a good example of this type of formatted query results.  How do I
approach this?

Here is the table I am using:

CREATE TABLE rnd_tbl (
   id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
   location varchar(100) NOT NULL,
   address varchar(45) NOT NULL,
   address2 varchar(45) NOT NULL,
   city varchar(50) NOT NULL,
   state char(2) NOT NULL,
   zip varchar(14) NOT NULL,
   day char(3) NOT NULL,
   date varchar(25) NOT NULL,
   time varchar(25) NOT NULL,
   phone varchar(15) NOT NULL,
   PRIMARY KEY (id)
);

Many Thanks!!
Short Circuit


-- 
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] Display Formatted Query Results

2001-04-14 Thread Brian Clark

Hi Jeff,

@ 8:52:10 PM on 4/14/2001, Jeff Holzfaster wrote:

...
 My apologies if this is too wordy.

A little confusing, but here we go. If this makes no sense what so
ever, maybe someone else can provide a better way of doing what you're
describing here.

...
 I have a form page that looks like this:
 http://www.webtinker.com/fran_info.htm This form has several things
 going on. 1st, the first pull down list needs to reflect the same
 info as the two location descriptions.

That's easy. If you're getting the two locations' data from a mysql
table, just reuse the same information for the pull down.

Is 'location' in your table the 'label' for that meeting? Ie., is
'location' in your SQL below going to be something like "Chicogo Round
Table Discussion"?

If not, add another column for that label and use that for the
listings above the form, and use that again for the select.

 2nd, the two locations "Round Table Discussion" will grow to an
 unknown number of entries over time so the two may become 6 or 8
 or... My first big (for me) hurdle is to figure out how to get these
 to show up at the top of this form in order of the date with the
 closest one first. They need to be in the same format as they appear
 but with additional rows showing as more entries are made. The ones
 showing can't be past due, or, don't show past dates.

For the date column in your SQL below, use either the value of time()
from PHP, or use one of the built in mysql date functions like
DATETIME.

Then you'll just need to compare the current date to the ones listed
in the table and only show the meetings dated for the current day or
greater. If the expired meetings won't change, you could leave them in
the table and only modify the date down the road. If they're a one
time thing, you can drop the expired listings as you're doing your
date check for the current/future meetings to extract from the table.

Since you're reusing the 'location,' your drop down matching the top
listings should already be taken care of.

 What I have figured out so far is how to populate the pull down, how
 to make the admin form to fill in the needed info into the MySQL
 table and I have had limited success in displaying the meeting info
 at the top of the form.

You'll just need to read the data using mysql_fetch_array() or
mysql_fetch_object(). There are examples of those in the manual at
http://www.php.net. (enough to do what you're wanting to do.)

As you read the data, you can print rows with two cells. If you have 5
meeting entries, you'll end up with a 2 x 3 table with the 2nd cell in
the last row being empty.

Since you'll be reusing the 'location label' from the rows' printing,
your select should be populated with the same information.

 I just can't figure out how to make them wrap into groups of info

No idea what you mean by 'groups of info' unless you mean rows from
the table.

 , say with 5 entries of different meetings. Do I need a separate
 query for each row of info using the limit statement in the query or
 is there a way to do this using gulp arrays?

Grabbing the data into an array is going to be a lot quicker than
making several separate queries, probably. If you're having trouble
with arrays, there are lots of folks here willing to help to clarify
them when you get into trouble.

...
 Here is the table I am using:

 CREATE TABLE rnd_tbl (
id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
location varchar(100) NOT NULL,
address varchar(45) NOT NULL,
address2 varchar(45) NOT NULL,
city varchar(50) NOT NULL,
state char(2) NOT NULL,
zip varchar(14) NOT NULL,
day char(3) NOT NULL,
date varchar(25) NOT NULL,
time varchar(25) NOT NULL,

time and date could be combined. You can use PHP's date conversion
functions to convert the date and time into any format you'd like, or
vise versa.

phone varchar(15) NOT NULL,
PRIMARY KEY (id)
 );


-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
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] converting DATETIME to a readable date.

2001-04-14 Thread Chris Adams

On 14 Apr 2001 17:31:02 -0700, DRN [EMAIL PROTECTED] wrote:
$date = $row["date"];

$new_date = date("l, j M Y, G:i:s", strtotime($date));
~~

but I cannot get this to work :(, I get an "unexpected error in
date()"

At a guess strtotime() is choking on the format MySQL used to return the date,
which would lead date() to fail as well.

The best way of handling this is to eliminate the need for your program to
worry about the day formats. Modify your mysql query so that instead of "SELECT
date" you have something like "SELECT UNIX_TIMESTAMP(date) AS date". Then you
can simply use date($row["date"]) directly. Alternately, you could use MySQL's
date formatting function to return the desired format directly. In either case,
you'll save a great deal of trouble by avoiding the need for PHP and MySQL to
be parsing each other's human-readable date formats.

-- 
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] converting DATETIME to a readable date.

2001-04-14 Thread DRN


Brian Clark [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| Hi DRN,
| Try this and see if it functions correctly:
|
| ?php
|
| $date = str_replace('-','/',$row["date"]);
| $new_date = date("l, j M Y, G:i:s", strtotime($date));
|
| ?
|
That works great, thanks Donald



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