Re[2]: [PHP] Getting short (DOS) name of file?
Hi, Tuesday, December 31, 2002, 5:14:18 PM, you wrote: LKB> Thanks... thing is, it can be anything from c:\whatever.exe to LKB> c:\program files\program name\bin\program.exe. I'll write a function LKB> that goes to each directory in a string and does a dir /x if I have to, LKB> but isn't there a simpler way? LKB> Michael Sims wrote: >>On Tue, 31 Dec 2002 01:12:47 -0500, you wrote: >> >> >> >>>I'm trying to run some (often user-defined) files on my windows server. >>>Thing is, it seems to want short names (like >>>C:\PROGRA~1\WHATEVER\PROG.EXE). Is there any way to get the short name >>> >>> >>>from a long name? >> >>Take a look at this: >> >>http://makeashorterlink.com/?V25A32BE2 >> >> >> Try putting the long file name in double quotes like "c:\program files\whatever" -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: PHP3 + session handling limitation
Hi, Tuesday, December 31, 2002, 4:54:36 PM, you wrote: e> hi i've just started a job and they are sadly using php3 , what is the work e> around for the session handling limitation ? i have an authentication class e> which will not work now beause it cant handles sessions :| Have a look at phplib http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date problem
Hello friends. Happy New Year to you all. Our school holds many seminars of varying durations and dates. I want to make a page which says "What's on today" which will show all the seminars that are on today. However the entry in the database will show two fields "Commencing Date" and "Ending date". Is there a routine in PHP I can use to find if today's date fits between the commencing date and the ending date? Thanks Denis
[PHP] Arrays of strings from regex
Am working through document to collect pieces that match and then insert them into an array so they can be used to construct another file. Looking in my doc for lines like this: {\*\cs43 \additive \sbasedon10 db_edition;} {\*\cs44 \additive \sbasedon10 db_editor;} {\*\cs45 \additive \sbasedon10 db_email;} Wrote this regex to find them: ^\{\\\*\\?(cs[0-9]{1,3}) (.*)\\[a-z0-9]+ (.*);\}$ Now looking for best method for getting the parts in parenthesis () into an array so it will contain these values by finding the above three lines: $matches [0][0][0] = cs43 , \additive \sbasedon10, db_edition $matches [1][1][1] = cs44 , \additive \sbasedon10, db_editor $matches [2][2][2] = cs45 , \additive \sbasedon10, db_email Thanks in advance for any pointers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: rtf....I knew it couldn't be this easy
"Edward Peloke" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Thanks, > > I tried it and don't get a blank line but it still shows all the code when > opened in word. Forgive how lengthy it is but here is the actual code: I > tried escaping the special characters in the string but that doesn't help > either. -- snip -- Eddie, I do not know the rtf format, but i managed to get it to work. It is better to use ' (single quote) instead of " (double) as single quotes will take the special characters like \r, \n, \t literally whereas double quotes will result in the special charater being ouputted. This is where you messed up. What i did was to create a blank document in Word, save it as rtf, open it in notepad (Word wrap off) copy the source and paste it to your PHP variable withing single quotes (luckily I dont have single or double quotes in my rtf source, check the format details and escape them if they are present). HTH, good luck gamin. (code tested with PHP 4.1.2 on WinXP running Apache 1.3.x) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Keeping script running, but returning control to user?
"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I need a way to keep the script running on the server, but control to > the user. I'm doing some lengthy processes on the server, and it seems > stupid to keep the user waiting pointlessly. I'm trying to do something > like: > if(array_key_exists('secondrun',$_GET)){ > print "Processing complete!"; > exit; > } > header("Location: > http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?secondrun=1"); > //Do long processing here > ?> > but it waits till the long processing is done, and then redirects. Is > there another way to do this? As you are asking this question, i presume your processing does not return anything that you would need on this page. Here is a simple solution for linux/unix based systems. You put your processing into a command line scirpt (passing it varibles that u need with $argv ) and call the scirpt like this : system("./yourscirpt.php &"); // & will cause the script to go in the background, thus u will get control of your script immideately. I dont know how one can put things in the background on a win machine, but thats the idea. HTH gamin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Error
I was able to successfully install the php on my win2k server. I am, however, getting an error any time I try to initialize a variable. This is the error I am getting: Notice: Undefined index: adv_auth in ...\mysql\lib.inc.php on line 132 I am not sure as to whether I forgot to do something when I installed php or whether I need to somehow modify IIS so that variable initialization will work. Thank you. Sincerely, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PLEASE HELP
"Dale" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I was able to successfully install the php on my win2k server. I am, > however, getting an error any time I try to initialize a variable. This is > the error I am getting: > > Notice: Undefined index: adv_auth in ...\mysql\lib.inc.php on line 132 > > I am not sure as to whether I forgot to do something when I installed php or > whether I need to somehow modify IIS so that variable initialization will > work. > > Thank you. > > Sincerely, > Dale > Are u getting this, everytime you declare a variable ? Or only in this one case, then you should post the relevant code. gamin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date problem
At 05:23 PM 12/31/02 +0800, Denis L. Menezes wrote: Hello friends. Is there a routine in PHP I can use to find if today's date fits between the commencing date and the ending date? SELECT * FROM Table WHERE NOW() >= StartDate AND NOW() <= EndDate Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
You forgot global $adb; at the beginning of your function, or use $sth = $GLOBALS['adb']->prepare($query); Martin S wrote: NOW what am I doing wrong?? function setCurrentDevGroup($devID) { $query = "SELECT dev_group FROM tracking WHERE (computer = $devID)"; $sth = $adb->prepare($query); if($sth) { $res = $sth->execute(); $resulttable = $sth->fetchrow_hash(); $lookuptable = $resulttable["dev_group"]; } echo $lookuptable; // gives e.g. printers return $lookuptable; // will not return the value to } . . . setCurrentDevGroup($this->ComputerID); // calling function $query = "SELECT name FROM $lookuptable WHERE (ID = $this->ComputerID)"; //debug line echo $lookuptable; // gives an empty string. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chunking a blob field. adding a large object chunk bychunk
You could do UPDATE table SET blob_field = CONCAT(blob_field, '$next_chunk') but I'm not sure if your sql server will not read the whole field into memory anyway. Mike Brancato wrote: if I wanted to read a very large object into a blob field, is there a way i could do it in 1MB chunks. using and UPDATE statement "field = field+'$data'". and just use fread to read 1MB at a time into $data. -- Mike Brancato -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Error
This is just a notice, somewhere in the code is something like this if($array['index']=='something') do_something(); but $array['index'] is undefined. Should be if(is_array($array) && array_key_exists('index',$array) && $array['index']=='something') ... (which is quite long). Another option is to set up error_reporting to E_ALL & ~E_NOTICE in your php.ini (you used php.ini-recomended, right?) Dale wrote: I was able to successfully install the php on my win2k server. I am, however, getting an error any time I try to initialize a variable. This is the error I am getting: Notice: Undefined index: adv_auth in ...\mysql\lib.inc.php on line 132 I am not sure as to whether I forgot to do something when I installed php or whether I need to somehow modify IIS so that variable initialization will work. Thank you. Sincerely, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
Marek Kilimajer wrote: > You forgot global $adb; at the beginning of your function, or use > > $sth = $GLOBALS['adb']->prepare($query); Nope sorry, I've just edited it from my post here. It is in the function. /Martin S. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays of strings from regex
David Pratt wrote: Am working through document to collect pieces that match and then insert them into an array so they can be used to construct another file. Looking in my doc for lines like this: {\*\cs43 \additive \sbasedon10 db_edition;} {\*\cs44 \additive \sbasedon10 db_editor;} {\*\cs45 \additive \sbasedon10 db_email;} Wrote this regex to find them: ^\{\\\*\\?(cs[0-9]{1,3}) (.*)\\[a-z0-9]+ (.*);\}$ ^ I suppose this wants to eat the whole line, use ([^ ]*) - all except space, or switch to perl expressions with its ungreedy match Now looking for best method for getting the parts in parenthesis () into an array so it will contain these values by finding the above three lines: $matches [0][0][0] = cs43 , \additive \sbasedon10, db_edition $matches [1][1][1] = cs44 , \additive \sbasedon10, db_editor $matches [2][2][2] = cs45 , \additive \sbasedon10, db_email Thanks in advance for any pointers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parameters and Access
Hi All, I'm trying to run a parameterised query in MS Access using odbc_prepare and odbc_execute but to no avail. The error message I'm getting is: Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecute in c: \inetpub\wwwroot\test\access_db.php on line 17 I've read conflicting messages saying that this paramaterised queries with Access do or don't work. Any definitive answer? Win XP Apache 1.3.24 PHP 4.2.3 Access ODBC driver: 4.00.6019.00 Thanks Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
On Tuesday 31 December 2002 20:02, Martin S wrote: > Marek Kilimajer wrote: > > You forgot global $adb; at the beginning of your function, or use > > > > $sth = $GLOBALS['adb']->prepare($query); > > Nope sorry, I've just edited it from my post here. It is in the function. Hmm, whenever you post code to the list you should *always* (where possible) copy and paste. If the code that you post is different to that which you are actually running then it makes it difficult for people to help you. So if you can, could you please post your complete unadulterated code? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* For I do not do the good I want, but the evil I do not want is what I do. -- Paul of Tarsus, (Saint Paul) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Making with $values!!!
escape $ with \, Alexander Guevara wrote: hi.. i have this and i cant get it work!!.. HERES THE CODE --- for ($i=1;$i<11;$i++){ echo" TEXT "; } --- so what i need is that the output in HTML shows tha value as is.. for example the output of the code above is like this (im going to show only the input part thats the one i need to resolve!) Remember the number depends on the $i.. i only showing one... thats what that code generates... what i need is like this: So in conclusion what i need is the "$nom1" for retrieving the value of that variable later if an error ocurrs during a trasanction: (when an error occurs and i have to go back to thhis page) Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
Jason Wong wrote: > On Tuesday 31 December 2002 20:02, Martin S wrote: >> Marek Kilimajer wrote: >> > You forgot global $adb; at the beginning of your function, or use >> > >> > $sth = $GLOBALS['adb']->prepare($query); >> >> Nope sorry, I've just edited it from my post here. It is in the function. > > Hmm, whenever you post code to the list you should *always* (where > possible) copy and paste. If the code that you post is different to that > which you are actually running then it makes it difficult for people to > help you. > > So if you can, could you please post your complete unadulterated code? > This is the function which should return e.g. "printers" for $lookuptable. But doesn't. function setCurrentDevGroup($devID) { global $adb; $query = "SELECT dev_group FROM tracking WHERE (computer = $devID)"; $sth = $adb->prepare($query); if($sth) { $res = $sth->execute(); $resulttable = $sth->fetchrow_hash(); $lookuptable = $resulttable["dev_group"]; // DEBUG echo $lookuptable; // this give the correct value } return $lookuptable; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
On Tuesday 31 December 2002 20:48, Martin S wrote: > This is the function which should return e.g. "printers" for $lookuptable. > But doesn't. > > function setCurrentDevGroup($devID) > { > global $adb; > $query = "SELECT dev_group FROM tracking WHERE (computer = > $devID)"; $sth = $adb->prepare($query); > if($sth) > { > $res = $sth->execute(); > $resulttable = $sth->fetchrow_hash(); > $lookuptable = $resulttable["dev_group"]; > // DEBUG > echo $lookuptable; // this give the correct value So here $lookuptable contains the correct value (eg "printers") ?? > } > return $lookuptable; > } But something like: echo setCurrentDevGroup($devID); gives the wrong/no value? If so, could you show how you are using this function in your code? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The whole world is a tuxedo and you are a pair of brown shoes. -- George Gobel */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] PHP Look Back 2002
Have fun reading! Indeed a funny reading! The only thing i missed was the december diberauschendenscussion "Quoting behaviour exposed". Reference: http://news.php.net/article.php?group=php.dev&article=%3CPine.LNX.4.50.0212281820140.1306-10%40eco.foo%3E Happy new year and hopefully an even better 2003 for all of us. marcus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting short (DOS) name of file?
On Tue, 31 Dec 2002 02:14:18 -0500, you wrote: >Thanks... thing is, it can be anything from c:\whatever.exe to >c:\program files\program name\bin\program.exe. I'll write a function >that goes to each directory in a string and does a dir /x if I have to, >but isn't there a simpler way? I don't know of anything built into PHP. There is a Win32 API call called GetShortPathName that would return the information. Maybe you can search and find a small binary that makes that API call and returns it's result. Another option is to use Perl. If you can install ActivePerl on your server you can use the following script: #!/usr/bin/perl use strict; use warnings; use Win32; use Getopt::Std; use File::Basename; our ($opt_p); getopts('p:'); my $path = $opt_p; if (!defined($path) || $path eq '') { print "Please specify a path with the -p option, for example: ". basename($0)." -p \"c:\\my long path\"\n"; exit; } my $short_path = Win32::GetShortPathName($path); print $short_path; exit 0; HTH... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
Jason Wong wrote: > On Tuesday 31 December 2002 20:48, Martin S wrote: > >> This is the function which should return e.g. "printers" for >> $lookuptable. But doesn't. >> >> function setCurrentDevGroup($devID) >> { >> global $adb; >> $query = "SELECT dev_group FROM tracking WHERE (computer = >> $devID)"; $sth = $adb->prepare($query); >> if($sth) >> { >> $res = $sth->execute(); >> $resulttable = $sth->fetchrow_hash(); >> $lookuptable = $resulttable["dev_group"]; >> // DEBUG >> echo $lookuptable; // this give the correct value > > So here $lookuptable contains the correct value (eg "printers") ?? Correct. At this point $lookuptable contains the value of dev_group. > >> } >> return $lookuptable; >> } > > But something like: > > echo setCurrentDevGroup($devID); That gives the correct value as well. But I wanted it as a variable ($lookuptable) ... What I am trying to do is: setCurrentDevGroup($this->Computer); // call function and get a device group switch ($lookuptable) { case "computers": bla bla bla case "printers": yada yada yada } However, getting the inspired moment from your post, I tried switch (setCurrentDevGroup($this->Computer)) { case "computers": bla bla bla case "printers": yada yada yada } And now this part works at least. My understanding was that the function would return a value for $lookuptable which was useable in the code above. This is incorrect then? /Martin S. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
On Tuesday 31 December 2002 21:44, Martin S wrote: > > But something like: > > > > echo setCurrentDevGroup($devID); > > That gives the correct value as well. But I wanted it as a variable > ($lookuptable) ... > > What I am trying to do is: > > setCurrentDevGroup($this->Computer); // call function and get a device > group switch ($lookuptable) { > case "computers": > bla bla bla > case "printers": > yada yada yada > } > > However, getting the inspired moment from your post, I tried > > switch (setCurrentDevGroup($this->Computer)) { > case "computers": > bla bla bla > case "printers": > yada yada yada > } > > And now this part works at least. > My understanding was that the function would return a value for > $lookuptable which was useable in the code above. This is incorrect then? If you want it so that the value of $lookuptable (in the global scope) is changed when you call your function then you have to do something like: More examples in manual > Variables > Variable scope -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* It's faster horses, Younger women, Older whiskey and More money. -- Tom T. Hall, "The Secret of Life" */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
Jason Wong wrote: > If you want it so that the value of $lookuptable (in the global scope) is > changed when you call your function then you have to do something like: > >function doo($dah, $dee, $etc) { > global $lookuptable; > $lookuptable = "Hello world"; > } > > doo(1, 2, 3); > echo $lookuptable; // prints "Hello world" > ?> > > More examples in manual > Variables > Variable scope Yes. I tried that (or rather global $adb, $lookuptable) at one point as that seemed the most natural remedy. It didn't work so I abandoned it. Perhaps I did something else stupid. I'll re-read the docs. Thanks for your help, and Happy New Year! Martin S. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
so you want $lookuptable=setCurrentDevGroup($devID); switch($lookuptable) { ... Martin S wrote: Jason Wong wrote: On Tuesday 31 December 2002 20:48, Martin S wrote: This is the function which should return e.g. "printers" for $lookuptable. But doesn't. function setCurrentDevGroup($devID) { global $adb; $query = "SELECT dev_group FROM tracking WHERE (computer = $devID)"; $sth = $adb->prepare($query); if($sth) { $res = $sth->execute(); $resulttable = $sth->fetchrow_hash(); $lookuptable = $resulttable["dev_group"]; // DEBUG echo $lookuptable; // this give the correct value So here $lookuptable contains the correct value (eg "printers") ?? Correct. At this point $lookuptable contains the value of dev_group. } return $lookuptable; } But something like: echo setCurrentDevGroup($devID); That gives the correct value as well. But I wanted it as a variable ($lookuptable) ... What I am trying to do is: setCurrentDevGroup($this->Computer); // call function and get a device group switch ($lookuptable) { case "computers": bla bla bla case "printers": yada yada yada } However, getting the inspired moment from your post, I tried switch (setCurrentDevGroup($this->Computer)) { case "computers": bla bla bla case "printers": yada yada yada } And now this part works at least. My understanding was that the function would return a value for $lookuptable which was useable in the code above. This is incorrect then? /Martin S. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail()
Hello all, For some reason, I have one computer running php that I can't get the mail function to work on. I get this error: Warning: Failed to Receive in c:\program files\apache group\apache\htdocs\mailtest.php on line 2 The machine is running windows and apache as the web server. In my php.ini file, I have the smtp set to localhost. Any suggestions? Thanks, Eddie
RE: [PHP] Date problem
> Our school holds many seminars of varying durations and dates. I want to > make a page which says "What's on today" which will show all the seminars > that are on today. However the entry in the database will show two fields > "Commencing Date" and "Ending date". > > Is there a routine in PHP I can use to find if today's date fits between > the commencing date and the ending date? SELECT * FROM table WHERE CURRENT_DATE BETWEEN commence_date AND ending_date ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems getting PHP to work (IIS5/XP Pro)
Now I tried this on the Windows list but didn't get any replies. I also found an old thread on another site that Rasmus had replied to and I tried that suggestion but no luck. I just ran the PHP installer and it set it up as a cgi I guess. I'd do the other way if I could find complete instructions. I tried the ones in the file included with the zip but it gave another error. I don't understand why I'm having issues, I installed PHP 4.1 and below just fine in this very same set up. However, I am receiving the following error: No input file specified. I have tried some of the suggested methods of fixing this but have not been able to solve it. Does anyone have a link or some info on how to fix this? Jeff
[PHP] Php 4.3.0 and Mail() function
I just upgraded to php 4.3.0 and all by bulletin board are now returning error about the mail function: Fatal error: Call to undefined function: mail() in /var/wwwx/htdocs/forum/private.php on line 687 I've checked in the pear list of installed packages and I have the latest mail (1.0.2). I'm running Apache 1.3.27 on linux. My configure line is: ./configure --with-apxs=/usr/local/sbin/apxs --enable-magic-quotes --with-zlib --with-mysql What could be missing? Thx for any help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Repeats of values
I'm running the following sql query which outputs a repeat value for each field in the html cell box. Like this: .. 3.3 3.3 78 78 2002-06-11 2002-06-11 ... which is not what I would like. I was trying to get: . 3.3 78 2002-06-11 I thought that by dropping off the $key in the $key - $value pair to: while(list (,$value) = each ($line)) would accomplish that. The SQL query is: SELECT level, pm, date FROM daytime WHERE pm >=75 The php script is: = 75"; $result = mysql_query ($query) or die ("Query failed"); // printing HTML result print ("Dates where water exceeded 75 degrees at Callicoon, New York - 2002"); print(""); print "\n"; while($line = mysql_fetch_array($result)){ print "\t\n"; while(list (,$value) = each ($line)) { print "$value\n"; } print "\t\n"; } print "\n"; mysql_close($link); ?> .. Any help would be greatly appreciated. Happy New Year! Tony Ritter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] openssl_csr_sign issues
Wondering if anyone else has run into the following problem (or if I'm missing something totally obvious). I've got a program that basically generates a key and certificate for a user who enters all the associated information (common name, passphrase, etc). So I've created a dummy CA cert and key that I keep on my server. Here's some example code: $cacert = "file://caselfsigncert.pem"; $cakey = array("file://caselfsignkey.pem", "insecureselfsignkey"); if ($privkey = openssl_pkey_new()) { openssl_pkey_export($privkey, $pkeyout, $passphrase); print "priv key$pkeyout"; } if ($csr = openssl_csr_new($dn, $privkey)) { openssl_csr_export($csr, $csrout); print "CSR:$csrout"; } if ($cert = openssl_csr_sign($csr, $cacert, $cakey, 365)) { openssl_x509_export($cert, $certout); print "x509:$certout"; } My problem is that the last stanza ($cert = openssl_csr_sign...) doesn't work. I know that the certificate and key file are loaded and that passphrase is working (if I change either of the three variables I get openssl and/or PHP errors complaing the files are not found or the passphrase is invalid). When it does seemingly work, my program ceases all output and terminates. I originally didn't have each step enclosed in _if_ statements and that resulted in null output from the entriee program (even that parts that were working). So it seems like either openssl_csr_sign is broken, or that I'm using it in the wrong way (though the docs on php.net imply this is proper). One other note, if I use NULL instead of $cacert as the signing certificate it works fine (i.e. self signed certs). Anyone have any ideas? openssl0.9.6h php4.2.3 Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 31 Dec 2002 15:58:36 -0000 Issue 1795
php-general Digest 31 Dec 2002 15:58:36 - Issue 1795 Topics (messages 129728 through 129779): Re: SQL Error 129728 by: John W. Holmes Re: PHP Look Back 2002 129729 by: John W. Holmes Making with $values!!! 129730 by: Alexander Guevara 129732 by: Maciek Ruckgaber Bielecki 129765 by: Marek Kilimajer Eocene -- An OO Framework for Web Devlopment 129731 by: Eocene printing documents on printer 129733 by: Larry Brown 129734 by: John W. Holmes 129735 by: Larry Brown 129736 by: Michael J. Pawlowsky PLEASE HELP 129737 by: Dale 129756 by: gamin FORM text formatting problem 129738 by: Pag 129739 by: John W. Holmes 129740 by: Pag Getting short (DOS) name of file? 129741 by: Leif K-Brooks 129748 by: Leif K-Brooks 129749 by: Tom Rogers 129769 by: Michael Sims chunking a blob field. adding a large object chunk by chunk 129742 by: Mike Brancato 129759 by: Marek Kilimajer Function misfunction - 2 129743 by: Martin S 129758 by: Marek Kilimajer 129761 by: Martin S 129764 by: Jason Wong 129766 by: Martin S 129767 by: Jason Wong 129770 by: Martin S 129771 by: Jason Wong 129772 by: Martin S 129774 by: Marek Kilimajer Re: PHP 4.3 JPG Support. Whats needed? 129744 by: Jason Wong Re: PHP3 + session handling limitation 129745 by: electroteque 129750 by: Tom Rogers Shopping Cart Credit Card Verification 129746 by: Josiah Peters 129747 by: Maciek Ruckgaber Bielecki Date problem 129751 by: Denis L. Menezes 129757 by: Rick Widmer 129775 by: John W. Holmes Arrays of strings from regex 129752 by: David Pratt 129762 by: Marek Kilimajer Re: rtfI knew it couldn't be this easy 129753 by: gamin Re: Keeping script running, but returning control to user? 129754 by: gamin PHP Error 129755 by: Dale 129760 by: Marek Kilimajer Parameters and Access 129763 by: rblack.datavisibility.co.uk Re: [PHP-DEV] PHP Look Back 2002 129768 by: Marcus Börger mail() 129773 by: Edward Peloke Problems getting PHP to work (IIS5/XP Pro) 129776 by: Jeff Lewis Php 4.3.0 and Mail() function 129777 by: Carl Bélanger Repeats of values 129778 by: Anthony Ritter openssl_csr_sign issues 129779 by: Larry Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- I don't think there's anything wrong with the queries themselves. Are you trying to run them all at once? You're getting an error because MySQL is reaching a semi-colon somewhere and that's causing a parse error... Show how you're trying to run all of these queries. Bottom line, you must do them one at a time with mysql_query, or run them through the command line in a file. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Stephen [mailto:[EMAIL PROTECTED]] Sent: Monday, December 30, 2002 7:15 PM To: PHP List Subject: [PHP] SQL Error I'm having some troubles. I have an install script which runs a lot of SQL statements to create tables then insert info into them. One of them is an emoticons table. Here's the error I'm getting: You have an error in your SQL syntax near '; INSERT INTO c_emotes VALUES \(':\)', 'emotes/smile.gif'\); INSERT INTO c_emo' at line 4 or, if I change my code a little, it's this: You have an error in your SQL syntax near '; INSERT INTO c_emotes VALUES \(':)', 'emotes/smile.gif'\); INSERT INTO c_emo' at line 4 Here's my code which inserts the information: INSERT INTO c_emotes VALUES (':)', 'emotes/smile.gif'); // I also have tried placing a \ infront of the )...no luck INSERT INTO c_emotes VALUES (';)', 'emotes/wink.gif'); INSERT INTO c_emotes VALUES (':(', 'emotes/sad.gif'); INSERT INTO c_emotes VALUES (':P', 'emotes/tounge.gif'); INSERT INTO c_emotes VALUES (':|', 'emotes/blank.gif'); INSERT INTO c_emotes VALUES (':-|', 'emotes/blank.gif'); INSERT INTO c_emotes VALUES (':-)', 'emotes/smile.gif'); INSERT INTO c_emotes VALUES (';-)', 'emotes/wink.gif'); INSERT INTO c_emotes VALUES (':-P', 'emotes/tounge.gif'); INSERT INTO c_emotes VALUES (':-(', 'emotes/sad.gif'); Anyone see the problem?? Thanks, Stephen Craton http://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us --- End Message --- --- Begin Message --- > We are almost at the end of 2002, and it seemed appropriate to look back > on the development issues of the past year. So starts the first PHP Look >
Re: [PHP] Repeats of values
Hi, I think changing while(list (,$value) = each ($line)) { to foreach ($line as $value) { might help but I'm unsure, either way foreach is easier to read :) Andrew - Original Message - From: "Anthony Ritter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 31, 2002 4:47 PM Subject: [PHP] Repeats of values > I'm running the following sql query which outputs a repeat value for each > field in the html cell box. > > Like this: > .. > 3.3 3.3 78 78 2002-06-11 2002-06-11 > ... > > which is not what I would like. > > I was trying to get: > . > 3.3 78 2002-06-11 > > > I thought that by dropping off the $key in the $key - $value pair > to: > > while(list (,$value) = each ($line)) > > would accomplish that. > > The SQL query is: > > SELECT level, pm, date FROM daytime WHERE pm >=75 > > > The php script is: > > $link = mysql_connect("", "", "") > or die ("Could not connect"); > mysql_select_db ("water") > or die ("Could not select database"); > > > $query = "SELECT level, pm, date FROM daytime WHERE pm >= 75"; > $result = mysql_query ($query) > or die ("Query failed"); > > // printing HTML result > > > print ("Dates where water exceeded 75 > degrees at Callicoon, New York - 2002"); > print(""); > print "\n"; > > while($line = mysql_fetch_array($result)){ > print "\t\n"; > while(list (,$value) = each ($line)) { >print " size=2>$value\n"; > } > print "\t\n"; > } > print "\n"; > > mysql_close($link); > ?> > .. > > Any help would be greatly appreciated. > Happy New Year! > > Tony Ritter > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Join
Stuck on this join temp >From one table I need to mysql_query("CREATE TEMPORARY TABLE temp TYPE=HEAP SELECT DISTINCT field1, field2 FROM $table"); both field1 and field2 have various repeating data and I need to return only the first occurance of the distinct data along with the rest of the data selected below for only those distinct rows. $result = mysql_query("SELECT $table.field3, $table.field2, $table.field1, $table.field4 FROM $table LEFT OUTER JOIN temp ON $table.indexfield0 = temp.indexfield0 ORDER BY $table.field1 DESC"); Running the above kills the distinct select and returns all of the rows. I see where it is broken in that temp.indexfield0 is not being collected into the temp table, but as indexfield0 is a primary key, all values are distinct and when added to the select distinct statement, all rows are returned. Is there any way to SELECT field0, (DISTINCT field1, field2) FROM table? Sure would make this easy! or SELECT field0 WHERE DISTINCT field1, field2 FROM table? There seems to be very little information anywhere on DISTINCT -- John Hinton - Goshen, VA. http://www.ew3d.com Those who dance are considered insane by those who can't hear the music -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Repeats of values
Hi, Wednesday, January 1, 2003, 2:47:57 AM, you wrote: AR> I'm running the following sql query which outputs a repeat value for each AR> field in the html cell box. AR> Like this: AR> .. AR> 3.3 3.3 78 78 2002-06-11 2002-06-11 AR> ... AR> which is not what I would like. AR> I was trying to get: AR> . AR> 3.3 78 2002-06-11 AR> AR> I thought that by dropping off the $key in the $key - $value pair AR> to: AR> while(list (,$value) = each ($line)) AR> would accomplish that. AR> The SQL query is: AR> SELECT level, pm, date FROM daytime WHERE pm >=75 AR> AR> The php script is: AR> $link = mysql_connect("", "", "") AR> or die ("Could not connect"); AR> mysql_select_db ("water") AR> or die ("Could not select database"); AR> $query = "SELECT level, pm, date FROM daytime WHERE pm >= 75"; AR> $result = mysql_query ($query) AR> or die ("Query failed"); AR> // printing HTML result AR> print ("Dates where water exceeded 75 AR> degrees at Callicoon, New York - 2002"); AR> print(""); AR> print "\n"; AR> while($line = mysql_fetch_array($result)){ AR> print "\t\n"; AR> while(list (,$value) = each ($line)) { AR>print ">$value\n"; AR> } AR> print "\t\n"; AR> } AR> print "\n"; AR> mysql_close($link); ?>> AR> .. AR> Any help would be greatly appreciated. AR> Happy New Year! AR> Tony Ritter change this line while($line = mysql_fetch_array($result)){ to while($line = mysql_fetch_assoc($result)){ mysql_fetch_array() builds a numerical and a associative array for each row. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Repeats of values
On Tue, 31 Dec 2002 10:47:57 -0600 [EMAIL PROTECTED] (Anthony Ritter) wrote: > while($line = mysql_fetch_array($result)){ > print "\t\n"; > while(list (,$value) = each ($line)) { Thats just wrong, mysql_fetch_array returns an array with all the fields accessible per field-id and field-name so you have each field twice. You can try this print_r($line); to see that. either access the rows by using mysql_fetch_row (only an enumerated array is returned so each value only once) or better access the values in the array directly: while($line = mysql_fetch_array($result)){ print "\t\n"; print "".$line['level']."\n"; print "".$line['pm']."\n"; print "".$line['date']."\n"; print "\t\n"; } Regards, Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function misfunction - 2
Um where is $lookuptable set? Seems like you should have: $lookuptable = setCurrentDevGroup($this->ComputerID); $query = "SELECT name FROM $lookuptable WHERE (ID=$this->ComputerID)"; echo $lookuptable; // gives an empty string. andy Martin S wrote: NOW what am I doing wrong?? function setCurrentDevGroup($devID) { $query = "SELECT dev_group FROM tracking WHERE (computer = $devID)"; $sth = $adb->prepare($query); if($sth) { $res = $sth->execute(); $resulttable = $sth->fetchrow_hash(); $lookuptable = $resulttable["dev_group"]; } echo $lookuptable; // gives e.g. printers return $lookuptable; // will not return the value to } . . . setCurrentDevGroup($this->ComputerID); // calling function $query = "SELECT name FROM $lookuptable WHERE (ID = $this->ComputerID)"; //debug line echo $lookuptable; // gives an empty string. -- Give a man a fish and you feed him for a day; teach him to use the Net and he won't bother you for weeks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL
Hello Everyone, I want to DELETE multiple items of multiple TABLES in a MySQL database. My version of MySQL is 3.23, which means this version doesn't support the DELETE functionality on multiple tables. The following is my PHP code, where $item_id is a multi-dimensional array containing the ids of the items I want to delete from the table. # DELETE records for ($i = 0; $i < count($item_id); $i++) { $query_item2 .= "DELETE QUICK FROM item_dimension WHERE item_id = '".$item_id[$i][0]."'; "; $query_item2 .= "DELETE QUICK FROM item_popup WHERE item_id = '".$item_id[$i][0]."'; "; } When I run this through the database using PHP, it returns a syntax error in the SQL. So what I did was echo out $query_item2, then copied and pasted the SQL into the MySQL application manually, and ran it through. Well the exact same SQL statement that I used in PHP worked when I entered it manually in MySQL. In other words it didn't work doing it through PHP, but it worked in MySQL directly. What gives? Is there a better way to delete multiple items from multiple tables with one SQL string? I don't want to separate the two DELETE functions and run them through two separate times because of overhead concerns. I tried looking on the MySQL and PHP website for better ways of using DELETE syntax on multiple tables, but I had no luck finding anything useful with my version of MySQL. Any help would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] assigning to $this in constructor?
I think I was once able to assign to the $this reference in the constructor of a php class. I don't seem to be able to do this anymore. Is this new in 4.3? Is there anyway to alter what object is returned from a php class constructor? For instance, there might have been an error so you would return an error object instead of the requested object. Thanks, Matt Friedman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] loading a db table into a php array from mysql
Hi, all -- I'm so far about knee-deep in my project where I'll be using php to talk to the mysql database and spit out my web pages. I wonder if I should be making individual calls to the database or loading a table into an array so that I can walk it without those calls. For instance, I have an instructors table, a clients table, and a schedule table that has an instructor number column, a client number column, and a time slot column. In order to print an instructor's schedule for the day, I have to query the instructors table to get the id where the name matches, and then query the schedule table to get the clients and times where the time slot matches some time today, and then I have to repeatedly query the clients table to get the names where the returned id matches. Since the schedule should be arranged in time order, I might even have client 1 and then client 2 and then client 1 again -- but I've already switched to 2 so I have to start over for 1. It seems a bit silly to, say, load the entire clients table into an array because there could be thousands or millions of clients, but it's an awful pain to go and make all of those mysql_query calls to walk the clients list. Should I just build a huge query something like $query = "select fname,lname from clients where " ; foreach ($results_from_previous_query_somehow as $clinum) { $query .= "id = '$clinum' or "; } $query .= "id = ''" ; # nice always-failing value; easier than pruning and then query that way, to get all of what I need in one shot but not the whole table (unless I need it all)? Does sql like big OR clauses like that? I don't know if this is a PHP or a MySQL question, so this once I've posted it to both lists. I'll also summarize to both. TIA & HAND & Happy New Year :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg91127/pgp0.pgp Description: PGP signature
Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL
>From experience, I don't think you can run more then one SQL statement at once in a single time. Try assigning each variable with delete, then query them all seperately. I also don't think you need the ; in the SQL statement... - Original Message - From: "@ Nilaab" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Tuesday, December 31, 2002 1:36 PM Subject: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL : Hello Everyone, : : I want to DELETE multiple items of multiple TABLES in a MySQL database. My : version of MySQL is 3.23, which means this version doesn't support the : DELETE functionality on multiple tables. The following is my PHP code, where : $item_id is a multi-dimensional array containing the ids of the items I want : to delete from the table. : :# DELETE records :for ($i = 0; $i < count($item_id); $i++) { : $query_item2 .= "DELETE QUICK FROM item_dimension WHERE item_id = : '".$item_id[$i][0]."'; "; : $query_item2 .= "DELETE QUICK FROM item_popup WHERE item_id = : '".$item_id[$i][0]."'; "; :} : : When I run this through the database using PHP, it returns a syntax error in : the SQL. So what I did was echo out $query_item2, then copied and pasted the : SQL into the MySQL application manually, and ran it through. Well the exact : same SQL statement that I used in PHP worked when I entered it manually in : MySQL. In other words it didn't work doing it through PHP, but it worked in : MySQL directly. What gives? Is there a better way to delete multiple items : from multiple tables with one SQL string? I don't want to separate the two : DELETE functions and run them through two separate times because of overhead : concerns. I tried looking on the MySQL and PHP website for better ways of : using DELETE syntax on multiple tables, but I had no luck finding anything : useful with my version of MySQL. Any help would be greatly appreciated. : : : -- : PHP General Mailing List (http://www.php.net/) : To unsubscribe, visit: http://www.php.net/unsub.php : : : -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serializing a DOM object
> Try encoding like this: > $retval = base64_encode(serialize( domxml_open_mem( $xml ))); > and on the next page: > $xml = unserialize(base64_decode($xml)); > It works via html but don't know enough about soap Well, you don't have to use soap - you can use sessions and get the same result. As for your suggestion, it didn't work. :( I can do a print_r() and a var_dump() on the variable before and after I serialize/encode it and get the save values each time: var_dump(): object(domdocument)(9) { ["name"]=> string(9) "#document" ["url"]=> string(0) "" ["version"]=> string(3) "1.0" ["standalone"]=> int(-1) ["type"]=> int(9) ["compression"]=> int(-1) ["charset"]=> int(1) [0]=> int(14) [1]=> int(138478176) } print_r(): domdocument Object ( [name] => #document [url] => [version] => 1.0 [standalone] => -1 [type] => 9 [compression] => -1 [charset] => 1 [0] => 14 [1] => 138478176 ) When I try to $DOMobject->dump_mem() before I serialize/encode it, I get the underlying XML. However, when I use dump_mem() afterwards, I am getting those errors mentioned in my previous post. I just don't understand why. I'm having no problems serializing and passing (through sessions or otherwise) other object, I'm just not having any luck with the internal DOM object. Chris
[PHP] Re: Keeping script running, but returning control to user?
What you could do is put your 'lengthy process' in a shutdow function (register_shutdown_function()), and just do the header. There is actually even a simpler way to do this, but it's not advised: - first @set_time_limit(0); // Make sure there is no limit ob_start(); // Start output buffering if(array_key_exists('secondrun',$_GET)) { print "Processing complete!"; exit(); }else{ header("Location:http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?secondrun=1"); ob_flush(); // This sends the output to your browser ignore_user_abort(true);// Makes sure the script continues... ... // Lengthy process here } ?> - Basicly, what it does here, is force the engine to flush the output (the redirect) to your browser, next, because the set_time_limit is set to 0 (unlimited), your script still goes on... While you can follow the other link. The ignore_user_aboort(true), makes sure the server continues till the script finishes. Otherwise it would kill it as soon as you'd press stop on your browser :) Hope that helps, - Tularis Leif K-Brooks wrote: I need a way to keep the script running on the server, but control to the user. I'm doing some lengthy processes on the server, and it seems stupid to keep the user waiting pointlessly. I'm trying to do something like: header("Location: http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?secondrun=1"); //Do long processing here ?> but it waits till the long processing is done, and then redirects. Is there another way to do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: loading a db table into a php array from mysql
Usually, using mysql to handle your tables is *way* faster than letting php handle it. That's what it was made for, speed...! In your case, you could just do a complex join I think. That would give all results in one table, and you could just order that on scheduletime, and voila, you'd have a pretty nice outcome, namely the schedule you were making via a complex way ;) David T-G wrote: Hi, all -- I'm so far about knee-deep in my project where I'll be using php to talk to the mysql database and spit out my web pages. I wonder if I should be making individual calls to the database or loading a table into an array so that I can walk it without those calls. For instance, I have an instructors table, a clients table, and a schedule table that has an instructor number column, a client number column, and a time slot column. In order to print an instructor's schedule for the day, I have to query the instructors table to get the id where the name matches, and then query the schedule table to get the clients and times where the time slot matches some time today, and then I have to repeatedly query the clients table to get the names where the returned id matches. Since the schedule should be arranged in time order, I might even have client 1 and then client 2 and then client 1 again -- but I've already switched to 2 so I have to start over for 1. It seems a bit silly to, say, load the entire clients table into an array because there could be thousands or millions of clients, but it's an awful pain to go and make all of those mysql_query calls to walk the clients list. Should I just build a huge query something like $query = "select fname,lname from clients where " ; foreach ($results_from_previous_query_somehow as $clinum) { $query .= "id = '$clinum' or "; } $query .= "id = ''" ; # nice always-failing value; easier than pruning and then query that way, to get all of what I need in one shot but not the whole table (unless I need it all)? Does sql like big OR clauses like that? I don't know if this is a PHP or a MySQL question, so this once I've posted it to both lists. I'll also summarize to both. TIA & HAND & Happy New Year :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FastCGI
Hi, obviously, I don't if this is the right newsgroup to ask such questions, but here it goes... what has happened with FastCGI support on the 4.3 version of PHP? On changelog I saw that SAPI/FastCGI was discontinued. But when I do phpinfo() it reports "Server API : CGI/FastCGI" and when I go with "php -v" the answer is: PHP 4.3.0 (cgi-fcgi), Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies and when I go with "php -h" there's an option : -b | Bind Path for external FASTCGI Server mode But when I do "php -b localhost:5000" it says there's no "b" command. What's up with FastCGI? Was it really discontinued? If so, where can I find good alternatives to FastCGI for my home made webserver running on WinXP and where can I find the reasons that lead to this? thankz Fernando -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: loading a db table into a php array from mysql
Tularis, et al -- ...and then Tularis said... % % Usually, % using mysql to handle your tables is *way* faster than letting php % handle it. Hmmm... OK. But that's so many queries... "Or is it?", he asks, reading farther. % % That's what it was made for, speed...! Well, yeah, I figured that :-) % % In your case, you could just do a complex join I think. That would give Ahhh... A new term. Back to the books for me! % all results in one table, and you could just order that on scheduletime, That certainly would be lovely :-) % and voila, you'd have a pretty nice outcome, namely the schedule you % were making via a complex way ;) I've been known to do that sort of thing :-) Thanks! & HAND & HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg91133/pgp0.pgp Description: PGP signature
Re: [PHP] Getting short (DOS) name of file?
I'm using exec(). Frank M. Kromann wrote: PHP should not have any problems with long file names. I use it often on both WIndows 2000 and Windows XP without anu problems. What is it you are trying to do ? - Frank Thanks... thing is, it can be anything from c:\whatever.exe to c:\program files\program name\bin\program.exe. I'll write a function that goes to each directory in a string and does a dir /x if I have to, but isn't there a simpler way? Michael Sims wrote: On Tue, 31 Dec 2002 01:12:47 -0500, you wrote: I'm trying to run some (often user-defined) files on my windows server. Thing is, it seems to want short names (like C:\PROGRA~1\WHATEVER\PROG.EXE). Is there any way to get the short name from a long name? Take a look at this: http://makeashorterlink.com/?V25A32BE2 -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
[PHP] fwrite() debugging
Could somebody please tell me what I'm doing wrong here? The code is: And I get the following error message: "Warning: fwrite(): supplied argument is not a valid File-Handle resource in c:\archivos de programa\apache group\apache\htdocs\visitrep\report_options.inc on line 111" Thanks a lot in advance and happy new year! Alberto Brea http://estudiobrea.com
Re: [PHP] fwrite() debugging
The $fd is the file handler now not the $filename. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Alberto Brea" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 6:27 AM Subject: [PHP] fwrite() debugging Could somebody please tell me what I'm doing wrong here? The code is: And I get the following error message: "Warning: fwrite(): supplied argument is not a valid File-Handle resource in c:\archivos de programa\apache group\apache\htdocs\visitrep\report_options.inc on line 111" Thanks a lot in advance and happy new year! Alberto Brea http://estudiobrea.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SUMMARY - Re: [PHP] Re: loading a db table into a php array from mysql
Tularis, et al -- ...and then David T-G said... % % ...and then Tularis said... % % % % Usually, % % using mysql to handle your tables is *way* faster than letting php % % handle it. ... % % % % In your case, you could just do a complex join I think. That would give % % Ahhh... A new term. Back to the books for me! A little RTFMing later, our hero returns... % % % all results in one table, and you could just order that on scheduletime, % % That certainly would be lovely :-) Look at that; I get out what I want in the order I'll want it in a single query! mysql> select substring(s.timeslot,1,13),i.fname,concat(c.fname,' ',c.lname) from personnel as i, clients as c, schedule as s where i.id = s.instr and c.id = s.client and i.fname = 'penelope' order by timeslot; ++--+-+ | substring(s.timeslot,1,13) | fname| concat(c.fname,' ',c.lname) | ++--+-+ | 2002-12-27 06 | penelope | david t-g | | 2002-12-27 07 | penelope | david t-g | | 2002-12-27 08 | penelope | laura t-g | | 2002-12-27 10 | penelope | david t-g | ++--+-+ 4 rows in set (0.00 sec) I'll probably have to refine this a bit as I also learn more about how to use this, but I'm well on my way.. Thanks again & HAND & HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg91137/pgp0.pgp Description: PGP signature
Re: [PHP] fwrite() debugging
Try *** REPLY SEPARATOR *** On 31/12/2002 at 5:27 PM Alberto Brea wrote: >Could somebody please tell me what I'm doing wrong here? > >The code is: >$fd=fopen($filename, "a"); >fwrite($filename, "xyz"); >fclose($fd); ?> > >And I get the following error message: >"Warning: fwrite(): supplied argument is not a valid File-Handle resource >in c:\archivos de programa\apache >group\apache\htdocs\visitrep\report_options.inc on line 111" > >Thanks a lot in advance and happy new year! >Alberto Brea >http://estudiobrea.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running PHP on Windows OS
I am having a problem getting Apache to load the php4apache.dll. I have tried putting the "/" and "\" in every way I can think of and I get an error that Apache cannot find c:/active_php/sapi/php4apache.dll (and it IS there). LoadModule php4_module c:/active_php/sapi/php4apache.dll I have even tried LoadModule php4_module php4apache.dll Where I put php4apache.dll in the base directory and I get the error that Apache cannot find it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Flow diagrams.-- Resending
On Mon, 2002-12-30 at 06:59, Sridhar Moparthy wrote: > Hi Jimmy, > > Thank You for the your reply. Here is the example. > > If > 1. Jobs 'B' and 'C' starts immediately after Completion of job'A' > 2. Job 'D' starts after completion of both Jobs 'B' and 'C'. > 3. Job 'E' starts after completion of job 'C' > 4. ... > job = object What makes the jobs different -- should the images for different jobs be different images? Do the connecting lines need to represent objects bouncing around inside a computer, a network or the real world? Do the objects transition between the real world - inside a computer and through networks? I just need to get a grasp. Do the connecting lines always connect to the same place or are they places on an object can connecting lines have bends? If they bend can they cross other lines or pass through objects they are not related to? (lots of other questions like this) Can you show me data from your db(change the names if security is an issue). Also some general descriptions or what each job is would be great. Such as is it a function or an object or class or is this data bouncing between servers and respective processes. And things that you are looking for in the image. H if the layout is always the same then the graphic class can be quite simple but if the layout changes it could make things much more complex. > The I would like to see the following image. > > > [image] > > > If you can not see the image, Please see the attached file. > > Thank you. > Sridhar. > > > > > > -Original Message- > From: Jimmy Brake [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 27, 2002 4:23 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Flow diagrams.-- Resending > > > can you give us some examples of the data .. > > the example I would like to see is: based on this information this is > what should be displayed > > > > On Fri, 2002-12-27 at 11:48, Sridhar Moparthy wrote: > > Hi Every one, > > > > I have information about some processes in the database that tells > different > > process dependencies. I need to display that information as a > process flow > > diagram. Do you know how to prepare and display process flow > diagrams > > dynamically. Do you know anything like JPGraph or Java script or > java applet > > that can do this? If so Please help me. > > > > I am using PHP 4.xx and IIS on Win NT platform. Please help me if > you know > > how to do. > > > > Thank You, > > Sridhar Moparthy > > -- Jimmy Brake <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] receiving XML stream as server via PHP
Hi, Using PHP with cURL, I am currently able to dynamically create XML documents and HTTP POST to a remote server, receive an XML response, and parse XML as needed. What I am having trouble finding information on is doing the reverse. Basically, I am trying to create a PHP script that acts as a server, so that a remote computer can HTTP POST XML to said script and then I parse and respond in XML. Again, I already have the reverse working using CURL - so basically I have created a client and now I need to create the server. The only part I need help understanding is how do I get the XML into an array/variable when my script is hit with someone using HTTP POST to pass XML to it. I have an idea below (vague).. I had the server guy HTTP POST some XML to a script which just had I see in the HTTP Request Headers of the phpinfo() output that it received content type text/xml but nowhere do I see what was actually received (the actual xml that was sent). I thought maybe PHP would take the stuff after the header and push it into an array/variable but no such luck (argv?). I am wondering if anyone has any helpful information. I imagine something like the following psuedo code: if($HTTP_CONTENT_TYPE=="text/xml"){ //use some php function(s) to pass incoming xml stream to an array that I can then pass to my //xml parser } I hope this gives you enough information to figure out my dilema. If someone can shed a little light on this subject it would be GREATLY appreciated. Thanks, Kris [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Missing logos
I have just installed 4.3.0 with apache2.0.43. Running a standard test.php file consisting solely of: results in incorrect html with the image sources of the logo incorrectly formed. See below. The src="d/public_html/test.php?=PHP... should, I think be src="~/public_html/test.php?=PHP. I regret I'm neither an html expert nor, yet, a PHP user, the objective as to get a system to learn with. As I can't find this reported here or in the bugs database, I suspect I have made in installation error. Can anyone enlighten me? Thanks, Richard phpinfo() http://www.php.net/";>PHP Version 4.3.0 System Linux rad1 2.4.21-pre1 #2 Wed Dec 18 13:34:39 UTC 2002 i686 Build Date Dec 28 2002 12:59:37 Configure Command './configure' '--prefix=/opt/httpd-2.0.43' '--with-config-file-path=/opt/httpd-2.0.43/conf' '--with-openssl' '--with-zlib' '--with-bz2' '--enable-calendar' '--with-gdbm' '--with-db3' '--with-gmp' '--with-mysql' '--with-ncurses' Server API CGI Virtual Directory Support disabled Configuration File (php.ini) Path /opt/httpd-2.0.43/conf PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, https, ftps, compress.bzip2, compress.zlib http://www.zend.com/";> This program makes use of the Zend Scripting Language Engine:Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Missing logos
- Original Message - From: "Richard A Downing" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 31, 2002 5:54 AM Subject: [PHP] Missing logos > I have just installed 4.3.0 with apache2.0.43. > Running a standard test.php file consisting solely of: > > > > results in incorrect html with the image sources of the logo incorrectly > formed. See below. The src="d/public_html/test.php?=PHP... should, I > think be src="~/public_html/test.php?=PHP. > > I regret I'm neither an html expert nor, yet, a PHP user, the objective as > to get a system to learn with. > > As I can't find this reported here or in the bugs database, I suspect I have > made in installation error. Can anyone enlighten me? > > Thanks, > Richard Nothing is wrong with your installation. The image is just being pulled from a non-traditional location. tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running PHP on Windows OS
I don't do Windows all that often, so I'm not sure this will work, but I seem to remember this problem a while back. You may want to try putting the php4apache.dll in the same directory as all the dll's that came with Apache, and load it like this LoadModule php4_module php4apache.dll HTH Todd Cary wrote: I am having a problem getting Apache to load the php4apache.dll. I have tried putting the "/" and "\" in every way I can think of and I get an error that Apache cannot find c:/active_php/sapi/php4apache.dll (and it IS there). LoadModule php4_module c:/active_php/sapi/php4apache.dll I have even tried LoadModule php4_module php4apache.dll Where I put php4apache.dll in the base directory and I get the error that Apache cannot find it. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using strtotime on 'old' dates.
Sorry to bug, but any ideas? "David J. Johnson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is there any way to use strtotime on dates earlier than the Unix epoch? I'm > using strtotime to reformat the date information for insertion into MySQL. > I know that if strtotime is not accomodating, I can use a javascript to > force the date to be entered in a certain format. But now I think that the > 'last week' type input to strtotime is very valuable. > > Thanks, > David > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] receiving XML stream as server via PHP
The variables will created (as of 4.x) in the $_POST and $_GET global arrays and you can then access them using what ever functions you need to use. As for XML if it is posted as raw you will get an error from Apache saying Bad Request. I have just setup an example to see what is possible to get around this... keep you posted. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Kristopher Yates" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 7:20 AM Subject: [PHP] receiving XML stream as server via PHP > Hi, > > Using PHP with cURL, I am currently able to dynamically create XML > documents and HTTP POST to a remote server, receive an XML response, and > parse XML as needed. > > What I am having trouble finding information on is doing the reverse. > Basically, I am trying to create a PHP script that acts as a server, so > that a remote computer can HTTP POST XML to said script and then I parse > and respond in XML. Again, I already have the reverse working using > CURL - so basically I have created a client and now I need to create the > server. > > The only part I need help understanding is how do I get the XML into an > array/variable when my script is hit with someone using HTTP POST to > pass XML to it. I have an idea below (vague).. > > I had the server guy HTTP POST some XML to a script which just had > > > I see in the HTTP Request Headers of the phpinfo() output that it > received content type text/xml but nowhere do I see what was actually > received (the actual xml that was sent). I thought maybe PHP would take > the stuff after the header and push it into an array/variable but no > such luck (argv?). > > I am wondering if anyone has any helpful information. I imagine > something like the following psuedo code: > > if($HTTP_CONTENT_TYPE=="text/xml"){ > //use some php function(s) to pass incoming xml stream to an array > that I can then pass to my > //xml parser > } > > I hope this gives you enough information to figure out my dilema. If > someone can shed a little light on this subject it would be GREATLY > appreciated. > > Thanks, > > Kris > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Missing logos
I have just installed 4.3.0 with apache-2.0.43. I did not have this problem with 4.3.0RC4 which this build overwrote. My system is Linux-2.4.21pre1, gcc-3.2.1, glibc-2.3.1. Running a standard test.php file consisting solely of: results in incorrect html with the image sources of the php and zend logos incorrectly formed. See below. The src="d/public_html/test.php?=PHP... should, I think be src="~/public_html/test.php?=PHP. The page is being served from the public_html directory in my home directory. I regret I'm neither an html expert nor, yet, a PHP user, the objective as to get a system to learn with. As I can't find this reported here or in the bugs database, I suspect I have made in installation error. Can anyone enlighten me? Thanks, Richard snip http://www.php.net/";>PHP Version 4.3.0 snip http://www.zend.com/";> snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL
I was hoping for better news. Thanks for the suggestion, but it will put a very big strain on my application since every DELETE query will open and close the mysql connection everytime. Think about deleting 100s of records one at a time. Surely someone has thought of a better way to do this with MySQL 3.23. Also, I don't want to run persistent connections, as I only have a limited number of simultaneous connections to the database currently. Is there a better way to do all this? Anyone? > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 31, 2002 1:10 PM > To: @ Nilaab > Cc: PHP List > Subject: Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using > PHP and MySQL > > > From experience, I don't think you can run more then one SQL statement at > once in a single time. Try assigning each variable with delete, then query > them all seperately. I also don't think you need the ; in the SQL > statement... > > > - Original Message - > From: "@ Nilaab" <[EMAIL PROTECTED]> > To: "Php-General" <[EMAIL PROTECTED]> > Sent: Tuesday, December 31, 2002 1:36 PM > Subject: [PHP] How To Delete Multiple Items Of Multiple Tables > Using PHP and > MySQL > > > : Hello Everyone, > : > : I want to DELETE multiple items of multiple TABLES in a MySQL > database. My > : version of MySQL is 3.23, which means this version doesn't support the > : DELETE functionality on multiple tables. The following is my PHP code, > where > : $item_id is a multi-dimensional array containing the ids of the items I > want > : to delete from the table. > : > :# DELETE records > :for ($i = 0; $i < count($item_id); $i++) { > : $query_item2 .= "DELETE QUICK FROM item_dimension WHERE item_id = > : '".$item_id[$i][0]."'; "; > : $query_item2 .= "DELETE QUICK FROM item_popup WHERE item_id = > : '".$item_id[$i][0]."'; "; > :} > : > : When I run this through the database using PHP, it returns a > syntax error > in > : the SQL. So what I did was echo out $query_item2, then copied and pasted > the > : SQL into the MySQL application manually, and ran it through. Well the > exact > : same SQL statement that I used in PHP worked when I entered it > manually in > : MySQL. In other words it didn't work doing it through PHP, but it worked > in > : MySQL directly. What gives? Is there a better way to delete > multiple items > : from multiple tables with one SQL string? I don't want to > separate the two > : DELETE functions and run them through two separate times because of > overhead > : concerns. I tried looking on the MySQL and PHP website for > better ways of > : using DELETE syntax on multiple tables, but I had no luck > finding anything > : useful with my version of MySQL. Any help would be greatly appreciated. > : > : > : -- > : PHP General Mailing List (http://www.php.net/) > : To unsubscribe, visit: http://www.php.net/unsub.php > : > : > : > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] receiving XML stream as server via PHP
You can post to your server with a mimetype of "text/xml" and in your script pickup the raw post as: $HTTP_RAW_POST_DATA Then just process this string as XML and return to buffer or not. Have fun. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Kristopher Yates" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 7:20 AM Subject: [PHP] receiving XML stream as server via PHP > Hi, > > Using PHP with cURL, I am currently able to dynamically create XML > documents and HTTP POST to a remote server, receive an XML response, and > parse XML as needed. > > What I am having trouble finding information on is doing the reverse. > Basically, I am trying to create a PHP script that acts as a server, so > that a remote computer can HTTP POST XML to said script and then I parse > and respond in XML. Again, I already have the reverse working using > CURL - so basically I have created a client and now I need to create the > server. > > The only part I need help understanding is how do I get the XML into an > array/variable when my script is hit with someone using HTTP POST to > pass XML to it. I have an idea below (vague).. > > I had the server guy HTTP POST some XML to a script which just had > > > I see in the HTTP Request Headers of the phpinfo() output that it > received content type text/xml but nowhere do I see what was actually > received (the actual xml that was sent). I thought maybe PHP would take > the stuff after the header and push it into an array/variable but no > such luck (argv?). > > I am wondering if anyone has any helpful information. I imagine > something like the following psuedo code: > > if($HTTP_CONTENT_TYPE=="text/xml"){ > //use some php function(s) to pass incoming xml stream to an array > that I can then pass to my > //xml parser > } > > I hope this gives you enough information to figure out my dilema. If > someone can shed a little light on this subject it would be GREATLY > appreciated. > > Thanks, > > Kris > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail()
On Tuesday 31 December 2002 22:05, Edward Peloke wrote: > Hello all, > > For some reason, I have one computer running php that I can't get the mail > function to work on. I get this error: Warning: Failed to Receive in > c:\program files\apache group\apache\htdocs\mailtest.php on line 2 > > The machine is running windows and apache as the web server. In my php.ini > file, I have the smtp set to localhost. > > Any suggestions? You're running Windows and you're telling PHP to use the SMTP server at localhost -- do you actually have an SMTP running on that same server? If not then you'll have to do the obvious, ie either install an SMTP server, or point php.ini to a valid server. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I once decorated my apartment entirely in ten foot salad forks!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Join
On Wednesday 01 January 2003 00:21, John Hinton wrote: > Stuck on this join temp > > From one table I need to > > mysql_query("CREATE TEMPORARY TABLE temp TYPE=HEAP SELECT DISTINCT > field1, field2 FROM $table"); > > both field1 and field2 have various repeating data and I need to return > only the first occurance of the distinct data along with the rest of the > data selected below for only those distinct rows. > > $result = mysql_query("SELECT $table.field3, $table.field2, > $table.field1, $table.field4 FROM $table LEFT OUTER JOIN temp ON > $table.indexfield0 = temp.indexfield0 ORDER BY $table.field1 DESC"); > > Running the above kills the distinct select and returns all of the rows. > I see where it is broken in that temp.indexfield0 is not being collected > into the temp table, but as indexfield0 is a primary key, all values are > distinct and when added to the select distinct statement, all rows are > returned. > > Is there any way to > > SELECT field0, (DISTINCT field1, field2) FROM table? Sure would make > this easy! > > or SELECT field0 WHERE DISTINCT field1, field2 FROM table? > > There seems to be very little information anywhere on DISTINCT This looks suspiciously like a MySQL question, better to ask on the mysql list. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The end move in politics is always to pick up a gun. -- Buckminster Fuller */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL
On Wednesday 01 January 2003 06:30, [EMAIL PROTECTED] wrote: > I was hoping for better news. Thanks for the suggestion, but it will put a > very big strain on my application since every DELETE query will open and > close the mysql connection everytime. Think about deleting 100s of records > one at a time. Surely someone has thought of a better way to do this with > MySQL 3.23. Also, I don't want to run persistent connections, as I only > have a limited number of simultaneous connections to the database > currently. Is there a better way to do all this? Anyone? You can use something like: DELETE FROM table WHERE column IN (val1, val2, val3, ..., valN); -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Most people want either less corruption or more of a chance to participate in it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] receiving XML stream as server via PHP
> Using PHP with cURL, I am currently able to dynamically > create XML documents and HTTP POST to a remote server, > receive an XML response, and parse XML as needed. > What I am having trouble finding information on is doing > the reverse. Basically, I am trying to create a PHP script > that acts as a server, so You might want to look into SOAP. It sounds like it will fit your needs very well. PEAR has a SOAP implementation that's still in testing and there is a class out there called NuSOAP that's supposedly very good. I just started toying around with it recently and it seems to work very well. Chris
[PHP] Running PHP on Windows OS
After wasting a day on trying to get Apache to load PHP, I discovered what I believe to be the probllem, but no solution: M$!!! I have another box that has Win 2K running on it *AND* it does not have SP 3! Apache loads like a dream and so does PHP So, there is something in the new security of XP and Win 2K SP 3 that does not let the dll load and run. Ever since I loaded SP 3 I have had problems - like many others! Now to figure why it will not let Apache load and run the dll? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTTP_IF_MODIFIED_SINCE
Are there any settings I need to change in order to get the HTTP_IF_MODIFIED_SINCE variable set when applicable? I saw some threads on google about session_cache_limiter() but even after following that, I still don't get access to the HTTP_IF_MODIFIED_SINCE variable when revisiting a page with the Last-Modified header. The page I'm testing this on _is_ sending the Last-Modified header, but the HTTP_IF_MODIFIED_SINCE variable is not available. Thanks. -- Ian Evans Digital Hit Entertainment http://www.digitalhit.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Running PHP on Windows OS
> So, there is something in the new security of XP and Win 2K > SP 3 that > does not let the dll load and run. Ever since I loaded SP 3 > I have had > problems - like many others! Don't know about Win2k as I haven't tried it but Apache/PHP/MySQL is working perfectly well on my Win XP laptop. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] use included GD of external
Hi list, What is better to use? The included GD library or the external ( Boutell.com ) GD library? On the Boutell.com site I found that the included GD version is alike to 2.0.2 from their site. But sins 2.0.9 is out, I would like to know witch version to use. Thanks in advance, and a happy new year Richard Pijnenburg
Re: [PHP] Php 4.3.0 and Mail() function
At 10:11 AM 12/31/02 -0500, Carl Bélanger wrote: I just upgraded to php 4.3.0 and all by bulletin board are now returning error about the mail function: Fatal error: Call to undefined function: mail() in /var/wwwx/htdocs/forum/private.php on line 687 What could be missing? ./configure looks for sendmail if it is not found the mail function is not compiled in, resulting in the undefined function call. Mine is in /usr/sbin/sendmail. Grep the results of ./configure for 'sendmail' to see what happened. ./configure ... > tempfile grep sendmail tempfile Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: loading a db table into a php array from mysql
At 02:57 PM 12/31/02 -0500, David T-G wrote: ...and then Tularis said... % % Usually, % using mysql to handle your tables is *way* faster than letting php % handle it. Yes, do as much as you can in the database. The people who wrote it spent a lot of time trying to optimize it. % % In your case, you could just do a complex join I think. That would give Ahhh... A new term. Back to the books for me! Here is a query from one of my projects... $R1 = $DB->Query( "SELECT ScheduleID, CourseName, DepartmentName, " . " TimeStart, TimeStop, BuildingName, " . " BuildingNumber, RoomName, RoomNumber, " . " a.GradeLevel AS MinGrade, " . " b.GradeLevel AS MaxGrade " . "FROM Schedule " . "LEFT JOIN Courses USING( CourseID ) " . "LEFT JOIN Departments " . " ON Schedule.DepartmentID = Departments.DepartmentID " . "LEFT JOIN Periods " . " ON Schedule.PeriodID = Periods.PeriodID " . "LEFT JOIN Rooms " . " ON Schedule.RoomID = Rooms.RoomID " . "LEFT JOIN Buildings USING( BuildingID ) " . "LEFT JOIN Levels a " . " ON a.LevelID = MinLevel " . "LEFT JOIN Levels b " . " ON b.LevelID = MaxLevel " . "WHERE YearID = '$CurrYearID' " . " AND TeacherID = '{$_SESSION[ 'CurrentUserID' ]}' " . "ORDER BY TimeStart " ); This combines data from seven different tables, and pulls two different values out of one of the tables (Levels) to create a single result set. In many cases you can collect all the data you need in a single query. Every field in the Schedule table is a key to another table that has to be looked up and translated to something people will understand. Note the two different ways of connecting tables with LEFT JOIN. USING( fieldname ) connects the table being joined, with the table listed right before it, using the same fieldname in both. The ON syntax allows you to use differently named fields, and/or a different table. Courses has two fields (MinLevel, MaxLevel) that contain the highest and lowest grade that is allowed to take the course. Look closely at how the table aliases (a and b) are used to join two different fields to the same table. (Levels) The table structures are listed below. Rick CREATE TABLE Buildings ( BuildingID bigint(20) NOT NULL auto_increment, BuildingName varchar(20) default NULL, BuildingNumber varchar(20) default NULL, NumRooms int(11) default NULL, FirstYear bigint(20) default NULL, LastYear bigint(20) default NULL, PRIMARY KEY (BuildingID), KEY BuildingName (BuildingName) ) TYPE=MyISAM; CREATE TABLE Courses ( CourseID bigint(20) NOT NULL auto_increment, DepartmentID bigint(20) NOT NULL default '0', CurriculumID bigint(20) NOT NULL default '0', CourseName varchar(20) default NULL, MinLevel bigint(20) NOT NULL default '0', MaxLevel bigint(20) NOT NULL default '0', BeginYear bigint(20) default NULL, EndYear bigint(20) default NULL, PRIMARY KEY (CourseID), KEY DepartmentID (DepartmentID), KEY CurriculumID (CurriculumID) ) TYPE=MyISAM; CREATE TABLE Departments ( DepartmentID bigint(20) NOT NULL auto_increment, DepartmentHead bigint(20) default NULL, DepartmentName varchar(30) default NULL, MinGrade int(11) default NULL, MaxGrade int(11) default NULL, DepartmentOrder decimal(4,2) default NULL, PRIMARY KEY (DepartmentID) ) TYPE=MyISAM; CREATE TABLE Levels ( LevelId bigint(20) NOT NULL auto_increment, DepartmentID bigint(20) NOT NULL default '0', LevelName varchar(30) default NULL, GradeLevel int(11) default NULL, PRIMARY KEY (LevelId) ) TYPE=MyISAM; CREATE TABLE Periods ( PeriodID bigint(20) NOT NULL auto_increment, PeriodGroupID bigint(20) default NULL, TimeStart time default NULL, TimeStop time default NULL, Days set('Sun','Mon','Tue','Wed','Thu','Fri','Sat') default NULL, RollReqd char(2) default NULL, PRIMARY KEY (PeriodID), KEY DepartmentID (PeriodGroupID) ) TYPE=MyISAM; CREATE TABLE Rooms ( RoomID bigint(20) NOT NULL auto_increment, BuildingID bigint(20) NOT NULL default '0', RoomName varchar(20) default NULL, RoomNumber varchar(20) default NULL, PRIMARY KEY (RoomID), KEY BuildingID (BuildingID) ) TYPE=MyISAM; CREATE TABLE Schedule ( ScheduleID bigint(20) NOT NULL auto_increment, YearID bigint(20) NOT NULL default '0', DepartmentID bigint(20) NOT NULL default '0', PeriodID bigint(20) NOT NULL default '0', RoomID bigint(20) NOT NULL default '0', CourseID bigint(20) NOT NULL default '0', TeacherID bigint(20) NOT NULL default '0', PRIMARY KEY (ScheduleID), KEY YearID (YearID), KEY DepartmentID (DepartmentID), KEY PeriodID (PeriodID), KEY
[PHP] PHP 4.3.0 (Win32, zip) not bundled with PEAR?
Hi PHP-lovers! Happy new year! I just downloaded the PHP 4.3.0 binaries (Win32, zip) and saw, that no PEAR related stuff is included... is that right or is there a mistake in it? I thought, PEAR would be integral part of PHP since some versions... Regards! Toby -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] use included GD of external
At 03:13 AM 1/1/03 +0100, Richard Pijnenburg wrote: Hi list, What is better to use? The included GD library or the external ( Boutell.com ) GD library? Unless you have to use the external library because other things are sharing it, just use the GD that comes with PHP. We are talking about 4.3.0, right? Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] use included GD of external
Yeah, I want to install 4.3.0 And I only want to use GD with php. But isn't it so that the external GD version is "more advanced" then the internal? I've got this from the GD site: php 4.3.0 is available, and it includes a version of gd as "standard equipment." I have only taken a brief preliminary look at it, but it seems to include mainstream gd fixes up through version 2.0.2. but sins 2.0.9 is out, witch version should I use ? thanks. Richard Pijnenburg Klik-on Internet Solutions > -Original Message- > From: Rick Widmer [mailto:[EMAIL PROTECTED]] > Sent: 01 January 2003 04:18 > To: Richard Pijnenburg; [EMAIL PROTECTED] > Subject: Re: [PHP] use included GD of external > > At 03:13 AM 1/1/03 +0100, Richard Pijnenburg wrote: > >Hi list, > > > >What is better to use? The included GD library or the external ( > >Boutell.com ) GD library? > > Unless you have to use the external library because other things are > sharing it, just use the GD that comes with PHP. > > We are talking about 4.3.0, right? > > Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] makeing an array
Can someone help me make an array ... I have $foo amount of loops to preform (1-20), and would like to make the veriable work for me like $comment_1, $comment_2 etc etc. http://nz.php.net/manual/en/function.array.php makes no sence to me after i read it and read it ... help me please --- Philip J. Newman. Head Developer. PhilipNZ.com New Zealand Ltd. http://www.philipnz.com/ [EMAIL PROTECTED] Mob: +64 (25) 6144012. Tele: +64 (9) 5769491. VitalKiwi Site: Philip J. Newman Internet Developer http://www.newman.net.nz/ [EMAIL PROTECTED] * Friends are like Stars, You can't always see them, But you know they are there. * ICQ#: 20482482 MSN ID: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] AIM: newmanpjkiwi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 1 Jan 2003 04:58:08 -0000 Issue 1796
php-general Digest 1 Jan 2003 04:58:08 - Issue 1796 Topics (messages 129780 through 129823): Re: Repeats of values 129780 by: Andrew Brampton 129782 by: Tom Rogers 129783 by: Thomas Seifert MySQL Join 129781 by: John Hinton 129811 by: Jason Wong Re: Function misfunction - 2 129784 by: Andrew Wallace How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL 129785 by: . Nilaab 129788 by: Stephen 129808 by: . Nilaab 129812 by: Jason Wong assigning to $this in constructor? 129786 by: Matt Friedman loading a db table into a php array from mysql 129787 by: David T-G 129791 by: Tularis 129793 by: David T-G 129819 by: Rick Widmer Re: Serializing a DOM object 129789 by: Boget, Chris Re: Keeping script running, but returning control to user? 129790 by: Tularis FastCGI 129792 by: Fernando Serboncini Re: Getting short (DOS) name of file? 129794 by: Leif K-Brooks fwrite() debugging 129795 by: Alberto Brea 129796 by: Timothy Hitchens \(HiTCHO\) 129798 by: Michael J. Pawlowsky SUMMARY - Re: [PHP] Re: loading a db table into a php array from mysql 129797 by: David T-G Running PHP on Windows OS 129799 by: Todd Cary 129804 by: John Nichel 129814 by: Todd Cary 129816 by: David Freeman Re: Flow diagrams.-- Resending 129800 by: Jimmy Brake receiving XML stream as server via PHP 129801 by: Kristopher Yates 129806 by: Timothy Hitchens \(HiTCHO\) 129809 by: Timothy Hitchens \(HiTCHO\) 129813 by: Boget, Chris Missing logos 129802 by: Richard A Downing 129803 by: Tyler Longren 129807 by: Richard A Downing Re: Using strtotime on 'old' dates. 129805 by: David J. Johnson Re: mail() 129810 by: Jason Wong HTTP_IF_MODIFIED_SINCE 129815 by: Ian M. Evans use included GD of external 129817 by: Richard Pijnenburg 129821 by: Rick Widmer 129822 by: Richard Pijnenburg Re: Php 4.3.0 and Mail() function 129818 by: Rick Widmer PHP 4.3.0 (Win32, zip) not bundled with PEAR? 129820 by: Tobias Schlitt makeing an array 129823 by: Philip J. Newman Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Hi, I think changing while(list (,$value) = each ($line)) { to foreach ($line as $value) { might help but I'm unsure, either way foreach is easier to read :) Andrew - Original Message - From: "Anthony Ritter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 31, 2002 4:47 PM Subject: [PHP] Repeats of values > I'm running the following sql query which outputs a repeat value for each > field in the html cell box. > > Like this: > .. > 3.3 3.3 78 78 2002-06-11 2002-06-11 > ... > > which is not what I would like. > > I was trying to get: > . > 3.3 78 2002-06-11 > > > I thought that by dropping off the $key in the $key - $value pair > to: > > while(list (,$value) = each ($line)) > > would accomplish that. > > The SQL query is: > > SELECT level, pm, date FROM daytime WHERE pm >=75 > > > The php script is: > > $link = mysql_connect("", "", "") > or die ("Could not connect"); > mysql_select_db ("water") > or die ("Could not select database"); > > > $query = "SELECT level, pm, date FROM daytime WHERE pm >= 75"; > $result = mysql_query ($query) > or die ("Query failed"); > > // printing HTML result > > > print ("Dates where water exceeded 75 > degrees at Callicoon, New York - 2002"); > print(""); > print "\n"; > > while($line = mysql_fetch_array($result)){ > print "\t\n"; > while(list (,$value) = each ($line)) { >print " size=2>$value\n"; > } > print "\t\n"; > } > print "\n"; > > mysql_close($link); > ?> > .. > > Any help would be greatly appreciated. > Happy New Year! > > Tony Ritter > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- End Message --- --- Begin Message --- Hi, Wednesday, January 1, 2003, 2:47:57 AM, you wrote: AR> I'm running the following sql query which outputs a repeat value for each AR> field in the html cell box. AR> Like this: AR> .. AR> 3.3 3.3 78 78 2002-06-11 2002-06-11 AR> ... AR> which is not what I would like. AR> I was trying to get: AR> . AR> 3.3 78 2002-06-11 AR>
Re: [PHP] makeing an array
Example of an Array: $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third'); You can now access these like so: echo $my_first_array[1]; etc etc of if you had this: $my_first_array = array('first_name' => 'Philip', 'last_name' => 'Newman'); You could do this: echo $my_first_array['first_name']; The thing to remember is that array's start at 0 "see below!!" (I started at 1 at the top to make it easier). You can also make an array like so: $first[] = 'Philip'; $first[] = 'John'; $first[] = 'Paul'; Now you can simply do: echo $first[0]; // this could output 'Philip'; You can then look at multi dimensional etc... I trust this get's you on your way. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Philip J. Newman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 2:57 PM Subject: [PHP] makeing an array > Can someone help me make an array ... > > I have $foo amount of loops to preform (1-20), and would like to make the > veriable work for me like $comment_1, $comment_2 etc etc. > > http://nz.php.net/manual/en/function.array.php makes no sence to me after i > read it and read it ... > > help me please > > --- > Philip J. Newman. > Head Developer. > PhilipNZ.com New Zealand Ltd. > http://www.philipnz.com/ > [EMAIL PROTECTED] > > Mob: +64 (25) 6144012. > Tele: +64 (9) 5769491. > > VitalKiwi Site: > Philip J. Newman > Internet Developer > http://www.newman.net.nz/ > [EMAIL PROTECTED] > > * > Friends are like Stars, > You can't always see them, > But you know they are there. > > * > > ICQ#: 20482482 > MSN ID: [EMAIL PROTECTED] > Yahoo: [EMAIL PROTECTED] > AIM: newmanpjkiwi > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Serializing a DOM object
Hi, Wednesday, January 1, 2003, 5:28:43 AM, you wrote: >> Try encoding like this: >> $retval = base64_encode(serialize( domxml_open_mem( $xml ))); >> and on the next page: >> $xml = unserialize(base64_decode($xml)); >> It works via html but don't know enough about soap BC> Well, you don't have to use soap - you can use sessions and get the BC> same result. BC> As for your suggestion, it didn't work. :( I can do a print_r() and a BC> var_dump() on the variable before and after I serialize/encode it and BC> get the save values each time: BC> var_dump(): BC> object(domdocument)(9) { BC> ["name"]=> BC> string(9) "#document" BC> ["url"]=> BC> string(0) "" BC> ["version"]=> BC> string(3) "1.0" BC> ["standalone"]=> BC> int(-1) BC> ["type"]=> BC> int(9) BC> ["compression"]=> BC> int(-1) BC> ["charset"]=> BC> int(1) BC> [0]=> BC> int(14) BC> [1]=> BC> int(138478176) BC> } BC> print_r(): BC> domdocument Object BC> ( BC> [name] => #document BC> [url] => BC> [version] => 1.0 BC> [standalone] => -1 BC> [type] => 9 BC> [compression] => -1 BC> [charset] => 1 BC> [0] => 14 BC> [1] => 138478176 BC> ) BC> When I try to $DOMobject->dump_mem() before I serialize/encode it, I BC> get the underlying XML. However, when I use dump_mem() afterwards, I BC> am getting those errors mentioned in my previous post. BC> I just don't understand why. I'm having no problems serializing and BC> passing (through sessions or otherwise) other object, I'm just not BC> having any luck with the internal DOM object. BC> Chris Well to get rid of the error message you need to create a dummy dom object b4 you unserialize like: $obj = domxml_new_doc('1.0'); But I could not get serialize to do the whole dom object only the first level -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] makeing an array
So in saything that I could do this ... $s = 10 $comment[1] = '$comment_1'; $comment[2] = '$comment_2'; $comment[3] = '$comment_2'; for($i = 0; $i <= $s; $i++) { echo $comment[$i].""; } - Original Message - From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> To: "Philip J. Newman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 6:12 PM Subject: Re: [PHP] makeing an array > Example of an Array: > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third'); > > You can now access these like so: > > echo $my_first_array[1]; etc etc > > of if you had this: $my_first_array = array('first_name' => 'Philip', > 'last_name' => 'Newman'); > > You could do this: > > echo $my_first_array['first_name']; > > The thing to remember is that array's start at 0 "see below!!" (I started at > 1 at the top to make it easier). > > You can also make an array like so: > > $first[] = 'Philip'; > $first[] = 'John'; > $first[] = 'Paul'; > > Now you can simply do: > > echo $first[0]; // this could output 'Philip'; > > You can then look at multi dimensional etc... > > I trust this get's you on your way. > > > Timothy Hitchens (HiTCHO) > [EMAIL PROTECTED] > > > HiTCHO | Open Platform Web Development > Consulting - Outsourcing - Training - Support > > > - Original Message - > From: "Philip J. Newman" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, January 01, 2003 2:57 PM > Subject: [PHP] makeing an array > > > > Can someone help me make an array ... > > > > I have $foo amount of loops to preform (1-20), and would like to make the > > veriable work for me like $comment_1, $comment_2 etc etc. > > > > http://nz.php.net/manual/en/function.array.php makes no sence to me after > i > > read it and read it ... > > > > help me please > > > > --- > > Philip J. Newman. > > Head Developer. > > PhilipNZ.com New Zealand Ltd. > > http://www.philipnz.com/ > > [EMAIL PROTECTED] > > > > Mob: +64 (25) 6144012. > > Tele: +64 (9) 5769491. > > > > VitalKiwi Site: > > Philip J. Newman > > Internet Developer > > http://www.newman.net.nz/ > > [EMAIL PROTECTED] > > > > * > > Friends are like Stars, > > You can't always see them, > > But you know they are there. > > > > * > > > > ICQ#: 20482482 > > MSN ID: [EMAIL PROTECTED] > > Yahoo: [EMAIL PROTECTED] > > AIM: newmanpjkiwi > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] makeing an array
Use the count like following inside to ensure that you don't call on a non existent index. for ($i = 0, $x = count($comment); $i < $x; $i++) { echo $comment[$i].''; } Why do you want to echo out $comment_1 ??? Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Philip J. Newman" <[EMAIL PROTECTED]> To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 3:29 PM Subject: Re: [PHP] makeing an array > So in saything that I could do this ... > > $s = 10 > > $comment[1] = '$comment_1'; > $comment[2] = '$comment_2'; > $comment[3] = '$comment_2'; > > for($i = 0; $i <= $s; $i++) { > > echo $comment[$i].""; > > } > > > > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "Philip J. Newman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 01, 2003 6:12 PM > Subject: Re: [PHP] makeing an array > > > > Example of an Array: > > > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third'); > > > > You can now access these like so: > > > > echo $my_first_array[1]; etc etc > > > > of if you had this: $my_first_array = array('first_name' => 'Philip', > > 'last_name' => 'Newman'); > > > > You could do this: > > > > echo $my_first_array['first_name']; > > > > The thing to remember is that array's start at 0 "see below!!" (I started > at > > 1 at the top to make it easier). > > > > You can also make an array like so: > > > > $first[] = 'Philip'; > > $first[] = 'John'; > > $first[] = 'Paul'; > > > > Now you can simply do: > > > > echo $first[0]; // this could output 'Philip'; > > > > You can then look at multi dimensional etc... > > > > I trust this get's you on your way. > > > > > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > > HiTCHO | Open Platform Web Development > > Consulting - Outsourcing - Training - Support > > > > > > - Original Message - > > From: "Philip J. Newman" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, January 01, 2003 2:57 PM > > Subject: [PHP] makeing an array > > > > > > > Can someone help me make an array ... > > > > > > I have $foo amount of loops to preform (1-20), and would like to make > the > > > veriable work for me like $comment_1, $comment_2 etc etc. > > > > > > http://nz.php.net/manual/en/function.array.php makes no sence to me > after > > i > > > read it and read it ... > > > > > > help me please > > > > > > --- > > > Philip J. Newman. > > > Head Developer. > > > PhilipNZ.com New Zealand Ltd. > > > http://www.philipnz.com/ > > > [EMAIL PROTECTED] > > > > > > Mob: +64 (25) 6144012. > > > Tele: +64 (9) 5769491. > > > > > > VitalKiwi Site: > > > Philip J. Newman > > > Internet Developer > > > http://www.newman.net.nz/ > > > [EMAIL PROTECTED] > > > > > > * > > > Friends are like Stars, > > > You can't always see them, > > > But you know they are there. > > > > > > * > > > > > > ICQ#: 20482482 > > > MSN ID: [EMAIL PROTECTED] > > > Yahoo: [EMAIL PROTECTED] > > > AIM: newmanpjkiwi > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: PHP3 + session handling limitation
yes sorry to be vague i've started to try and implement this , but is tedious to get going, plus it has the pear db like functions so upgrading shouldnt be a problem then when it comes round to it -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 31, 2002 7:57 PM To: electroteque Cc: [EMAIL PROTECTED] Subject: Re: [PHP] RE: PHP3 + session handling limitation Hi, Tuesday, December 31, 2002, 4:54:36 PM, you wrote: e> hi i've just started a job and they are sadly using php3 , what is the work e> around for the session handling limitation ? i have an authentication class e> which will not work now beause it cant handles sessions :| Have a look at phplib http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: PHP3 + session handling limitation
oh have you got an example proper usage of it ? i had it working then suddenly i didnt :| -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 31, 2002 7:57 PM To: electroteque Cc: [EMAIL PROTECTED] Subject: Re: [PHP] RE: PHP3 + session handling limitation Hi, Tuesday, December 31, 2002, 4:54:36 PM, you wrote: e> hi i've just started a job and they are sadly using php3 , what is the work e> around for the session handling limitation ? i have an authentication class e> which will not work now beause it cant handles sessions :| Have a look at phplib http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] RE: PHP3 + session handling limitation
Hi, Wednesday, January 1, 2003, 4:01:35 PM, you wrote: DR> oh have you got an example proper usage of it ? i had it working then DR> suddenly i didnt :| DR> -Original Message- DR> From: Tom Rogers [mailto:[EMAIL PROTECTED]] DR> Sent: Tuesday, December 31, 2002 7:57 PM DR> To: electroteque DR> Cc: [EMAIL PROTECTED] DR> Subject: Re: [PHP] RE: PHP3 + session handling limitation DR> Hi, DR> Tuesday, December 31, 2002, 4:54:36 PM, you wrote: e>> hi i've just started a job and they are sadly using php3 , what is the DR> work e>> around for the session handling limitation ? i have an authentication DR> class e>> which will not work now beause it cant handles sessions :| DR> Have a look at phplib DR> http://www.sanisoft.com/phplib/manual/intro.php#intro.whatis.phplib DR> -- DR> regards, DR> Tom I have never had to use it for session functions so I don't have any examples. There should be some in the docs I would think. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: PHP3 + session handling limitation
on 31/12/02 5:54 PM, electroteque ([EMAIL PROTECTED]) wrote: > hi i've just started a job and they are sadly using php3 , what is the work > around for the session handling limitation ? i have an authentication class > which will not work now beause it cant handles sessions :| I don't think there's a work-around that will be able to port your class into the PHP3 environment. Using PHP3 (in ye olde days) meant either: a) rolling your own session handling system b) using PHPLib, a library of files and document templates that include session handling Either way, you're probably talking about a pretty major redevelopment / extension of your code to suit. The easiest solution is to just upgrade or move to a host using PHP4... really, it's been YEARS since PHP4, and I can't see any reason to hang around with PHP3. Good luck, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Alternatives for Meta Refresh
on 31/12/02 2:48 AM, Stephen ([EMAIL PROTECTED]) wrote: > I'm writing a PHP chat script and I'm rather stumped on this. I either want > the chat window to refresh when there's a new message or refresh every few > seconds but not with meta refresh, rather something with less noise (the > infamous IE clicking sound) and/or something faster. The only thing I can > think of is the header function. Any ideas? The header() function (like everything in PHP) happens SERVER SIDE before the page hits the browser, so this won't help. META refresh is the only standard, HTML way to do it, AFAIK -- and even then, i'm not 100% sure that all browsers and user agents support it. Another option would be for javascript to refresh the page, but again, this will probably invoke the IE clicking sound. Most chat programs do use either meta refresh, or some sort of Java applet instead of refreshing. I think there are also some Flash chat things out there too. Cheers, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Alternatives for Meta Refresh
Let me give you a direction with this one. You can use a http/1.1 stream and keep flushing the buffer with an script timeout set to 0. Simply open the page then just add something to the buffer and flush and then wait a little while then flush... just like a database would do. I do have a working application somewhere. No clicking... but remember that IE has a 2 connection limit per domain. (without registry changes) Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 5:42 PM Subject: Re: [PHP] Alternatives for Meta Refresh > on 31/12/02 2:48 AM, Stephen ([EMAIL PROTECTED]) wrote: > > > I'm writing a PHP chat script and I'm rather stumped on this. I either want > > the chat window to refresh when there's a new message or refresh every few > > seconds but not with meta refresh, rather something with less noise (the > > infamous IE clicking sound) and/or something faster. The only thing I can > > think of is the header function. Any ideas? > > The header() function (like everything in PHP) happens SERVER SIDE before > the page hits the browser, so this won't help. > > META refresh is the only standard, HTML way to do it, AFAIK -- and even > then, i'm not 100% sure that all browsers and user agents support it. > > Another option would be for javascript to refresh the page, but again, this > will probably invoke the IE clicking sound. > > > Most chat programs do use either meta refresh, or some sort of Java applet > instead of refreshing. > > > I think there are also some Flash chat things out there too. > > > Cheers, > > Justin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php