php-general Digest 8 Mar 2001 23:45:04 -0000 Issue 555 Topics (messages 43026 through 43091): PHP Site - New Design 43026 by: Miles Thompson [PHP-ES] (roberto celestino)MCAL! set-up. 43027 by: Celestino Roberto Alejandro Re: Microtime math and display 43028 by: Shaun Thomas GTK-PHP install doubt? 43029 by: Celestino Roberto Alejandro 43039 by: Adam Wright exec timing out revisited 43030 by: Bill.Hoffman.walgreens.com Re: Sessions, and timeout 43031 by: Bård Farstad Sessions Kill all 43032 by: Randy Johnson 43045 by: Christian Reiniger 43051 by: Randy Johnson 43058 by: Christian Reiniger PHPHOO2 support question 43033 by: Jim Knotts Date Question 43034 by: Chris 43036 by: Jeff Oien 43037 by: John Huggins 43038 by: Jason Jacobs 43040 by: John Huggins Qmail problem 43035 by: pete collins need help w/ Split() 43041 by: Scott Walter 43043 by: Nathaniel Hekman 43053 by: Christian Reiniger weeks 43042 by: Jason Jacobs 43056 by: Christian Reiniger Formatting Dates 43044 by: stas 43049 by: Joe Sheble (Wizaerd) Re: are sessions single threaded? 43046 by: Chris Carbaugh 43062 by: Chris Carbaugh Re: populate select box with contents of a file? 43047 by: Jerry Lake 43052 by: Joe Sheble (Wizaerd) 43057 by: Jerry Lake Re: Dynamic Links.. 43048 by: Jon Haworth 43065 by: Ashwin Kutty 43066 by: Boget, Chris 43067 by: Richard S. Crawford 43076 by: Ashwin Kutty refresh 43050 by: Miguel Loureiro Stumped Newbie: Can't get results in db query even though everything checks - what am I missing? 43054 by: Nicole Lallande 43055 by: Nicole Lallande 43059 by: Joe Sheble (Wizaerd) 43061 by: Nicole Lallande Re: Hebrew websites transition with php3 .. 43060 by: Boaz Yahav HELP!!! Date time problems!!!! 43063 by: Bruno Freire 43069 by: Pierre-Yves Lemaire 43082 by: karakedi 43085 by: karakedi 43088 by: Pierre-Yves Lemaire 43089 by: karakedi addslashes against single and double quotes 43064 by: Terry Romine Re: sending SMS messages via PHP 43068 by: Henrik Hansen Re: Developer certifications 43070 by: Krznaric Michael Tell me if this works 43071 by: Karl J. Stubsjoen 43072 by: Karl J. Stubsjoen Re: Announcement: Smarty template engine 1.3.1 released (1.3.1pl1) 43073 by: Monte Ohrt displaying information 43074 by: george HELP with Multi Dimensional Array Problem 43075 by: Yev $HTTP_POST_VARS 43077 by: mat t 43078 by: Jerry Lake 43079 by: Nathaniel Hekman strange files in my upload_tmp_dir 43080 by: Gerard Onorato image resize 43081 by: PeterOblivion.aol.com external data saving 43083 by: Petr Jùza 43086 by: Michael Hall Error codes from 'mysql_error()' 43084 by: Dennis Gearon newbie: ye ol' nemesis using mysql_fetch_array to load data 43087 by: Nicole Lallande 43090 by: Aaron Tuller how to use ob_get_contents() to send a page as email 43091 by: kaab kaoutar 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] ----------------------------------------------------------------------
Wow - it is much faster, good job, although the previous version was wonderfully exotic. Loved the popups for Quick Reference and Mirror Sites. I would like to see one backward step --- ability to resize the font. In Netscape 4.7 and Internet Explorer 5 changing the font size doesn't work. In fact, this is really a utility site, so I'd like to see most "designerish" elements pushed to the back, as I believe they have been. I can resize the displayed fonts in Netscape 6, but I don't usually run that browser. So - is this a site designed from the "This is the way the web is going?" point of view? Or did someone simply forget us old (50+) guys with bifocals? Anyone tried it with Amaya? Miles Thompson
Dear's partners... I download the source of the Mcal library and Drivers, and i have found a doubt, because when i compile it, ever, show an error that can't give me compile, then, i cant have correctly installed this library... ..I make the SF (structure of files), that this describe in its README, in this say ...make.. ../libmcal/ ../libmcal/icap/ ../libmcal/dummy/ ..Are icap an dummy drivers for MCAL (Modular Calendar Acces Library), and when i compile (also describe in README) i give the option ./configure --with-icap ./ make (failed) ./ make install (also failed, obvious) the error that i found is like the next: /*OUTPUT*/ gcc -O0 -Wall -g -I. -c mcal.c In file included from mcal.c:37: drivers.c:1: parse error before `-' drivers.c:1: stray '\' in program drivers.c:1: stray '\' in program mcal.c: In function `cal_getdriver': mcal.c:68: `driver_registry' undeclared (first use in this function) mcal.c:68: (Each undeclared identifier is reported only once mcal.c:68: for each function it appears in.) *** Error code 1 make: Fatal error: Command failed for target `mcal.o' /*\OUTPUT*/ ..and i have another doubt?, why if i want compile the driver alone (Ex: icap), this also give some errors...? Thanks, and Sorry..! I'm running in a Solaris 2.7, thanks! Celestino, Roberto Alejandro Argentina, Universidad Nacional de la Matanza
On Wed, 7 Mar 2001, Todd Cary wrote: > I want to check the time for queries. I have > > $starttime = getmicrotime(); > $endtime = getmicrotime(); > $delta = $endtime - $starttime; There is no such function as "getmicrotime". You're probably trying to use "microtime". Second of all, microtime returns a string containing "msec sec", so you'll need to do this: list($smsec, $ssec) = explode(" ", microtime()); list($emsec, $esec) = explode(" ", microtime()); $dSec = $esec - $ssec $dMsec = $emsec - $smsec Then, if you wanted the number of seconds it took, use $dSec. If you want the number of milliseconds, use $dMsec. Or, if you want to know both, just add $dSec and $dMsec and use the result. Take care -- +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Shaun M. Thomas INN Database Programmer | | Phone: (309) 743-0812 Fax : (309) 743-0830 | | Email: [EMAIL PROTECTED] AIM : trifthen | | Web : hamster.lee.net | | | | "Most of our lives are about proving something, either to | | "ourselves or to someone else." | | -- Anonymous | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
Friends, i get the source of the GTK-PHP module, or library, as you want to say, but, when i going to do, the steps that describe in their ebpage( http://gtk.php.net/), i do phpize ./configure make (This failed) make install (obviously failed) When i do the make, this say that the function php_if_gdk_window_new_dc in php_gtk_types.c have too many arguments to function zend_hash_get_current_key_ex (316line) and all-recursive Error. Why could be this? Thanks.
Make sure you're building against a 4.0.5 build of PHP. I tried this afternoon with the latest PHP from snaps.php.net and the GTK bindings, and it worked flawlessly. adamw ----- Original Message ----- From: "Celestino Roberto Alejandro" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 08, 2001 2:22 PM Subject: [PHP] GTK-PHP install doubt? > Friends, > i get the source of the GTK-PHP module, or library, as you want to say, > but, when i going to do, the steps that describe in their > ebpage( http://gtk.php.net/), i do > > phpize > ./configure > make (This failed) > make install (obviously failed) > > When i do the make, this say that the function php_if_gdk_window_new_dc in > php_gtk_types.c have too many arguments to function > zend_hash_get_current_key_ex (316line) > and all-recursive Error. > Why could be this? > Thanks. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I saw the post about exec("nohup mp3123 -y -Z --all 1>/dev/null/ 2>&1 > &"); I decided to do a little test of my own because I would like to add this functionality to some of my sites. Here is my env: Redhat 6.3 Apache 1.3.12 PHP 4.0.3 I wrote a little shell script to test with called sleep.ksh #!/bin/ksh sleep 30 DAT=`date` print "Woke up at $DAT" > /tmp/outfile I then wrote a little PHP script to test this in the background <html> <head> <title> Sleep test </title> </head> <body> <?php print "Trying to exec"; exec("nohup ./sleep.ksh &"); ?> </body> </html> When I run it from the command line it works as expected and returns the command line to me immediately. When I run it from the browser it takes 30 seconds to run Am I missing something? Is there a better way to run this? Thanx in advance, BEH
> Then how about check the server's response headers that sent to client? You > can view headers using wget or like. PHP might be sending global ini > var(which is set to small number) to client for some reason. Ok, this is the header information I get. HTTP/1.1 200 OK Date: Thu, 08 Mar 2001 11:52:37 GMT Server: Apache/1.3.14 (Unix) (Red-Hat/Linux) mod_ssl/2.7.1 OpenSSL/0.9.5a PHP/4.0.4pl1 mod_perl/1.24 X-Powered-By: PHP/4.0.4pl1 Expires: Thu, 19 Nov 1981 08:52:00 GMT Last-Modified: Thu, 08 Mar 2001 11:52:37GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: PHPSESSID=784c532834c6a36451f91c235ee44aa4; path=/ Connection: close Content-Type: text/html;charset=iso-8859-1 Code snippet from the script: ------------------ // Disable page chacing. Could this interfer with sessions?? : header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); // Turn on output buffering ob_start(); // start session handling session_start(); // settings for sessions ini_alter("session.gc_maxlifetime", "172800"); ini_alter("session.entropy_file","/dev/urandom"); ini_alter("session.entropy_length", "512"); ini_alter("session.cache_expire", "172800"); // set the session variable (inside a class): session_register( "eZSession" ); $GLOBALS["eZSession"] =& $this->Hash; // fetches the session information: $hash = $GLOBALS["eZSession"]; // flush buffer ob_end_flush(); ----- For more code (full class listing) you can check out: http://doc.ez.no/ezsession.src.html#1 That should be straight forward right? I have no idea why it times out. I've tested quite alot of things now:) I've tested with Konqueror, Netscape and Opera. Every browser times out. Also with cookieless sessions. > Do you mean just like trans-sid? I think you cannot as far as I know. PHP > Programmers/HTML designer have to write code manually to add query string. > Anyone?? Yes, I would like that trans-sid. Like if I could have code like. php_auto_append_variable( "MyVar", "foo bar" ); ( Of course that makes no sense when I get the sessions up and running. ) Regards, -- Bård Farstad Systems developer ez.no | developer.ez.no | zez.org
Is there a way as a server admin to kill all sessions to a site. I need a way to logout all members to a site. thanks randy
On Thursday 08 March 2001 03:45, you wrote: > Is there a way as a server admin to kill all sessions to a site. I > need a way to logout all members to a site. Well, usually you'd keep the session data in a database, so you can just empty the sessioninfo table. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...10001000110101011010101101011110111010113...????
Does anybody know where I could get more info on storing session data in a database rather than the default way? thanks randy -----Original Message----- From: Christian Reiniger [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 08, 2001 12:58 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Sessions Kill all On Thursday 08 March 2001 03:45, you wrote: > Is there a way as a server admin to kill all sessions to a site. I > need a way to logout all members to a site. Well, usually you'd keep the session data in a database, so you can just empty the sessioninfo table. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...10001000110101011010101101011110111010113...???? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Thursday 08 March 2001 07:17, you wrote: > Does anybody know where I could get more info on storing session data > in a database rather than the default way? Hmm, perhaps phpbuilder.com has an article on it. Alternatively I could send you some of my code -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...10001000110101011010101101011110111010113...????
Anyone know of a support forum for phpHoo2 (from http://www.cable-modems.org/phpHoo/)? I'm having two problems. Working version where I installed it is at: http://dev.crnaworld.com 1) Admin mode is not working properly. Says it cannot set the cookie. 2) Cannot add link to "Top" category (list that appears on the "home" page for the directory. Says it is an invalid category, but it was created by default when the script was set up. Thanks, - Jim _____________________________________________________________ ************************************** MarineCorps.com Everything Marine. For Marines. By Marines. Get free MarineCorps.com Email. http://www.MarineCorps.com ________________________________________ Legal Notice: Neither the United States Marine Corps nor any other component of the Department of Defense has approved, endorsed, or authorized this service.
Hi, Since there is no Date type in php, is there a way to compare dates? Something like: if ((3/8/2001) < (3/9/2001)){ // Date is newer } Thanks, Chris
If you put the date in YYYYMMDD format you can compare the numbers. http://www.php.net/manual/en/function.date.php Jeff Oien > Hi, > Since there is no Date type in php, is there a way to compare dates? > > Something like: > > if ((3/8/2001) < (3/9/2001)){ > // Date is newer > } > > Thanks, > Chris >
You might try converting these dates to Unix time and then compare the numbers as integers. Let's see, here is a function that converts the data from a MySQL date field to a Unix timestamp... function mysql_to_epoch ($datestr) { list($year,$month,$day,$hour,$minute,$second) = split("([^0-9])",$datestr); return date("U",mktime($hour,$minute,$second,$month,$day,$year)); } And here is where I use it to calculate the age of the item in the database. $epochTime = mysql_to_epoch($messageCreated); $currentEpochTime = time(); $ageInSeconds = $currentEpochTime - $epochTime; I hope this provides a clue for your application. John > -----Original Message----- > From: Chris [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 08, 2001 12:12 PM > To: php > Subject: [PHP] Date Question > > > Hi, > Since there is no Date type in php, is there a way to compare dates? > > Something like: > > if ((3/8/2001) < (3/9/2001)){ > // Date is newer > } > > Thanks, > Chris >
Ok, I understand that the epoch is a point in time that's static, but what exactly is the epoch? I've heard it mentioned a lot on the list, but I have no idea what it really is. :) Jason
If it is on a Unix box, it most likely is the Unix time value; It is the number of seconds since the UNIX Epoch which I believe starts at 0 seconds in January 1970. I am not quite sure about that date, but it is close. It also reveals the problem if you are dealing with dates before 1970 and after 2^32 seconds after that. Again, this specifics above may not be totally accurate, but are close enough to describe the point. John > -----Original Message----- > From: Jason Jacobs [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 08, 2001 12:22 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Date Question > > > Ok, I understand that the epoch is a point in time that's static, but what > exactly is the epoch? I've heard it mentioned a lot on the list, > but I have > no idea what it really is. :) > > Jason > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I keep getting: qmail-inject: fatal: read error I've tried everything. Sendmail is symlinked to /var/qmail/bin/sendmail wrapper $ ls -l /usr/lib/sendmail lrwxrwxrwx 1 root root 28 Aug 25 2000 /usr/lib/sendmail -> ../../var/qmail/bin/sendmail $ ls -l /usr/sbin/sendmail lrwxrwxrwx 1 root root 28 Aug 25 2000 /usr/sbin/sendmail -> ../../var/qmail/bin/sendmail I have tried every permutation for my sendmail_path in php.ini I tested the php code i'm using from my FreeBSD box which uses sendmail and it all works fine. I can use qmail fine from perl. Does anyone have any ideas? This is down right silly. ;-) Thanks --pete
I am attempting to take a line of text (a list) that has been entered into a form and split it into the appropriate parts, placing them into an array. I am splitting the input on commas, semi-colons, and spaces. Problem 1: Is with "white space". If the input has spaces after a comma, it splits on the comma, but enters each "space" as a separate element of the array. Problem 2: Is with "white space" also. If the input has just spaces between the appropriate parts, then it will split on the first "space", but enter the rest of the "spaces" as separate elements of the array. Here my code: $course_list = preg_split("/[\,\;\s*]/", $input_list); for ($i=0; $i<count($course_list); $i++) { echo("Item $i: $course_list[$i]<br>\n"); } Which on input "0101, 0102, 0103" produces [0101][ ][0102][ ][ ][ ][0103] Any help would be appreciated!!
Your regex is incorrect. You've written: /[\,\;\s*]/ That * means "match a *" because it's inside the brackets. Put it outside, like this (actually use a + instead): /[\,\;\s]+/ to match 1 or more of any of those characters. That may not be exactly what you want, since that will also cause this: input "0101, 0102,,,,,0103" ==> [0101][0102][0103] If you want repeated commas to create empty elements, then try something like this: /\s*[\,\;\s]\s*/ I haven't tried that, but it looks right at first glance... Optional white space, followed by exactly one of ',; ', followed by optional white space. Nate -----Original Message----- From: Scott Walter [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 08, 2001 10:44 AM To: [EMAIL PROTECTED] Subject: [PHP] need help w/ Split() I am attempting to take a line of text (a list) that has been entered into a form and split it into the appropriate parts, placing them into an array. I am splitting the input on commas, semi-colons, and spaces. Problem 1: Is with "white space". If the input has spaces after a comma, it splits on the comma, but enters each "space" as a separate element of the array. Problem 2: Is with "white space" also. If the input has just spaces between the appropriate parts, then it will split on the first "space", but enter the rest of the "spaces" as separate elements of the array. Here my code: $course_list = preg_split("/[\,\;\s*]/", $input_list); for ($i=0; $i<count($course_list); $i++) { echo("Item $i: $course_list[$i]<br>\n"); } Which on input "0101, 0102, 0103" produces [0101][ ][0102][ ][ ][ ][0103] Any help would be appreciated!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Thursday 08 March 2001 18:43, you wrote: > I am attempting to take a line of text (a list) that has been entered > into a form and split it into the appropriate parts, placing them into > an array. I am splitting the input on commas, semi-colons, and spaces. > > Problem 1: Is with "white space". If the input has spaces after a > comma, it splits on the comma, but enters each "space" as a separate > element of the array. > > Problem 2: Is with "white space" also. If the input has just spaces > between the appropriate parts, then it will split on the first "space", > but enter the rest of the "spaces" as separate elements of the array. > > Here my code: > $course_list = preg_split("/[\,\;\s*]/", $input_list); You can't put the asterisk in the character class - it's taken as literal asterisk in there. try preg_split("/([\,\;]\s*)|(\s+)/", $input_list); i.e. "either (',' or ';' eventually followed by spaces) or (at least one space)" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...10001000110101011010101101011110111010113...????
Anyone know offhand a way to organize the output from a query by week? I'm writing a work log app and I want the admin to see everyone's work ordered first by lastname, and then by date. But only want that week's data to show up, and maybe a dropdown with previous weeks available. Don't go thinking about an answer, cuz I'm doing that, but if anyone already knows how to solve this problem or part of it, lemme know. Thanks once again. Jason
On Thursday 08 March 2001 18:49, you wrote: > Anyone know offhand a way to organize the output from a query by week? > I'm writing a work log app and I want the admin to see everyone's work > ordered first by lastname, and then by date. But only want that week's > data to show up, and maybe a dropdown with previous weeks available. > Don't go thinking about an answer, cuz I'm doing that, but if anyone > already knows how to solve this problem or part of it, lemme know. > Thanks once again. for MySQL add a WHERE (WEEK(yourtimefield) = WEEK(NOW())) this will have the problem that it will show all of week X even if you're on 23:55 on the last day of that week WHERE ((yourtimefield >= NOW()) AND (yourtimefield <= DATE_ADD(NOW(), INTERVAL 1 WEEK)) might be better -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...10001000110101011010101101011110111010113...????
Hello, How can I format a date stored in the database in a Date field. It's in this format: yyyy-mm-dd I understand that date() function only works for current system date/time. I am looking for something like this: dateformat($date, "mask"), sort of like the one in ColdFusion. Thanks much! stas
You could use the mySQL function DATE_FORMAT() in your query string.. SELECT DATE_FORMAT( DateAdded, '%m/%d/%Y' ) as d_Added FROM myDB At 12:52 PM 1/8/01 -0500, stas wrote: >Hello, > >How can I format a date stored in the database in a Date field. It's in this >format: > >yyyy-mm-dd > >I understand that date() function only works for current system date/time. I >am looking for something like this: > >dateformat($date, "mask"), > >sort of like the one in ColdFusion. Thanks much! > >stas > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
By not using cookies, each browser window would have it's own session, propagated through the URL. Which I don't think you would want users with multi sessions in an intranet app. You didn't mention how you are storing your session data, but I'll assume it's the defualt (files). I would further quess that the hanging that you are seeing is do to a lock on the particular session file. Any body know for sure? I'm currently working on are pretty complex intranet app that has mulitple frames, each needing access to the session data independant of the others. In my situation, PHP sessions just couldn't do what I wanted. I ended up rolling my own session/authentication scheme backed by a DB. Chris On Wed, 7 Mar 2001, Bill Rausch wrote: > Date: Wed, 7 Mar 2001 15:00:41 -0800 > To: Ernest E Vogelsinger <[EMAIL PROTECTED]> > From: Bill Rausch <[EMAIL PROTECTED]> > Subject: Re: [PHP] are sessions single threaded? > > At 4:04 PM -0800 3/6/01, Ernest E Vogelsinger wrote: > >At 00:56 07.03.2001, Bill Rausch said: > >--------------------[snip]-------------------- > >>What I mean is, if a user is connected to a php page that uses > sessions and > >>that is involved in a time consuming operation (say 20 seconds or > more) > >>before returning an answer, and the user also opens a second window > in the > >>same browser to connect to another page in the same site that uses > sessions > >>the second window will hang till the first operation is complete. > >> > >>While testing, I was able to show that if I don't use sessions this > doesn't > >>happen. > >> > >>I need to use sessions and would like to allow users to have > multiple > >>windows connected to my site (it is an intranet application). > >--------------------[snip]-------------------- > > > >try not to use cookies - use session keys via URL/hidden form > fields. This > >way multiple browser connects can have multiple session keys, and > you won't > >"hang" > > Thanks for the answer. Help me to understand please. Is this a > limitation > of PHP somehow or is it a limitation of the browsers. Why does not > using > cookies make a difference? Where would I go to find more information > on > this issue? > > --- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
It's a PHP class that's included at the top of every page that needs session/authentication. It's cookie based only, no option for URL propagation. PHPLib can do the same, as well as some other classes floating around. Chris On Thu, 8 Mar 2001, Bill Rausch wrote: > Date: Thu, 8 Mar 2001 10:21:37 -0800 > To: [EMAIL PROTECTED] > From: Bill Rausch <[EMAIL PROTECTED]> > Subject: Re: Re: [PHP] are sessions single threaded? > > Thanks Chris. > > I've been looking at the PHP source code and have tentatively come to > the > same conclusion about the file locks. > > I'm going to play around with the no-cookies option and see where > that > takes me. > > Bill > > PS: The roll-your-own that you did. Did you modify the PHP program > or > just handle it in your web pages? > > > At 10:01 AM -0800 3/8/01, Chris Carbaugh wrote: > >By not using cookies, each browser window would have it's own > session, > >propagated through the URL. Which I don't think you would want > users > >with multi sessions in an intranet app. > > > >You didn't mention how you are storing your session data, but I'll > >assume it's the defualt (files). I would further quess that the > >hanging that you are seeing is do to a lock on the particular > session > >file. > > > >Any body know for sure? > > > >I'm currently working on are pretty complex intranet app that has > >mulitple frames, each needing access to the session data independant > of > >the others. In my situation, PHP sessions just couldn't do what I > >wanted. I ended up rolling my own session/authentication scheme > backed > >by a DB. > > > >Chris > > > >On Wed, 7 Mar 2001, Bill Rausch wrote: > >> Date: Wed, 7 Mar 2001 15:00:41 -0800 > >> To: Ernest E Vogelsinger <[EMAIL PROTECTED]> > >> From: Bill Rausch <[EMAIL PROTECTED]> > >> Subject: Re: [PHP] are sessions single threaded? > >> > >> At 4:04 PM -0800 3/6/01, Ernest E Vogelsinger wrote: > >> >At 00:56 07.03.2001, Bill Rausch said: > >> >--------------------[snip]-------------------- > >> >>What I mean is, if a user is connected to a php page that uses > >> sessions and > >> >>that is involved in a time consuming operation (say 20 seconds > or > >> more) > >> >>before returning an answer, and the user also opens a second > window > >> in the > >> >>same browser to connect to another page in the same site that > uses > >> sessions > >> >>the second window will hang till the first operation is > complete. > >> >> > >> >>While testing, I was able to show that if I don't use sessions > this > >> doesn't > >> >>happen. > >> >> > >> >>I need to use sessions and would like to allow users to have > >> multiple > >> >>windows connected to my site (it is an intranet application). > >> >--------------------[snip]-------------------- > >> > > >> >try not to use cookies - use session keys via URL/hidden form > >> fields. This > >> >way multiple browser connects can have multiple session keys, and > >> you won't > >> >"hang" > >> > >> Thanks for the answer. Help me to understand please. Is this a > >> limitation > >> of PHP somehow or is it a limitation of the browsers. Why does > not > >> using > >> cookies make a difference? Where would I go to find more > information > >> on > >> this issue? > >> > >> --- > >> Bill Rausch, Software Development, Unix, Mac, Windows > >> Numerical Applications, Inc. 509-943-0861 [EMAIL PROTECTED] > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> To contact the list administrators, e-mail: > >> [EMAIL PROTECTED] > >> > > --- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 [EMAIL PROTECTED] > >
Ok, I am using this modified code from the manual. It works great, but how do I modify it further to only show .jpg files ? <snip> <?php $handle=opendir('.'); echo "<select name=image_url>"; while (false!==($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<option "; echo "value=".$file.">"; echo $file; echo "</option>\n\r"; } } echo "</select>"; closedir($handle); ?> </snip Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Sean R. Bright [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 4:50 PM To: 'Jerry Lake'; 'Henrik Hansen'; 'php general' Subject: RE: [PHP] populate select box with contents of a file? Take a look at dir() and readdir(). Those along with echo() should help you out. Sean > -----Original Message----- > From: Jerry Lake [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 07, 2001 7:40 PM > To: Henrik Hansen; php general > Subject: [PHP] populate select box with contents of a file? > > > I would like to be able to populate > the options of a select box with the > contents of my images directory online > so I can select the image I want to > go with the form I am filling out. > what functions do I need to look into > to figure this one out? > > Jerry Lake - [EMAIL PROTECTED] > Web Designer > Europa Communications - http://www.europa.com > Pacifier Online - http://www.pacifier.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
<?php $handle=opendir('.'); echo "<select name=image_url>"; while (false!==($file = readdir($handle))) { // new code here $cExt = explode( ".", $file ); // and here if ($file != "." && $file != ".." && ( strtolower( $cExt[1] ) == "jpg" ) { echo "<option "; echo "value=".$file.">"; echo $file; echo "</option>\n\r"; } } echo "</select>"; closedir($handle); ?> At 10:04 AM 3/8/01 -0800, Jerry Lake wrote: >Ok, I am using this modified code from the >manual. It works great, but how do I modify >it further to only show .jpg files ? > ><snip> ><?php >$handle=opendir('.'); > echo "<select name=image_url>"; >while (false!==($file = readdir($handle))) { > if ($file != "." && $file != "..") { > echo "<option "; > echo "value=".$file.">"; > echo $file; > echo "</option>\n\r"; > } >} > echo "</select>"; >closedir($handle); >?> ></snip > >Jerry Lake - [EMAIL PROTECTED] >Web Designer >Europa Communications - http://www.europa.com >Pacifier Online - http://www.pacifier.com > > >-----Original Message----- >From: Sean R. Bright [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, March 07, 2001 4:50 PM >To: 'Jerry Lake'; 'Henrik Hansen'; 'php general' >Subject: RE: [PHP] populate select box with contents of a file? > > > >Take a look at dir() and readdir(). Those along with echo() should help you >out. > >Sean > > > -----Original Message----- > > From: Jerry Lake [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 07, 2001 7:40 PM > > To: Henrik Hansen; php general > > Subject: [PHP] populate select box with contents of a file? > > > > > > I would like to be able to populate > > the options of a select box with the > > contents of my images directory online > > so I can select the image I want to > > go with the form I am filling out. > > what functions do I need to look into > > to figure this one out? > > > > Jerry Lake - [EMAIL PROTECTED] > > Web Designer > > Europa Communications - http://www.europa.com > > Pacifier Online - http://www.pacifier.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks, that works great. Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 08, 2001 10:13 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] populate select box with contents of a file? <?php $handle=opendir('.'); echo "<select name=image_url>"; while (false!==($file = readdir($handle))) { // new code here $cExt = explode( ".", $file ); // and here if ($file != "." && $file != ".." && ( strtolower( $cExt[1] ) == "jpg" ) { echo "<option "; echo "value=".$file.">"; echo $file; echo "</option>\n\r"; } } echo "</select>"; closedir($handle); ?> At 10:04 AM 3/8/01 -0800, Jerry Lake wrote: >Ok, I am using this modified code from the >manual. It works great, but how do I modify >it further to only show .jpg files ? > ><snip> ><?php >$handle=opendir('.'); > echo "<select name=image_url>"; >while (false!==($file = readdir($handle))) { > if ($file != "." && $file != "..") { > echo "<option "; > echo "value=".$file.">"; > echo $file; > echo "</option>\n\r"; > } >} > echo "</select>"; >closedir($handle); >?> ></snip > >Jerry Lake - [EMAIL PROTECTED] >Web Designer >Europa Communications - http://www.europa.com >Pacifier Online - http://www.pacifier.com > > >-----Original Message----- >From: Sean R. Bright [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, March 07, 2001 4:50 PM >To: 'Jerry Lake'; 'Henrik Hansen'; 'php general' >Subject: RE: [PHP] populate select box with contents of a file? > > > >Take a look at dir() and readdir(). Those along with echo() should help you >out. > >Sean > > > -----Original Message----- > > From: Jerry Lake [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 07, 2001 7:40 PM > > To: Henrik Hansen; php general > > Subject: [PHP] populate select box with contents of a file? > > > > > > I would like to be able to populate > > the options of a select box with the > > contents of my images directory online > > so I can select the image I want to > > go with the form I am filling out. > > what functions do I need to look into > > to figure this one out? > > > > Jerry Lake - [EMAIL PROTECTED] > > Web Designer > > Europa Communications - http://www.europa.com > > Pacifier Online - http://www.pacifier.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
As a quick caveat you need to be *very* careful you're not obfuscating the target site.... copyright infringement, anyone? -----Original Message----- From: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Sent: 08 March 2001 00:02 To: Ashwin Kutty; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Dynamic Links.. At our company we solve this problem by including the second page in a frameset. That's what I would recommend for you. At 07:39 PM 3/7/01 -0400, Ashwin Kutty wrote: >No, not the URL and therefore not HTTP_REFERER.. > >This is how it is.. > >My_Script.php redirects to Someone_Elses_Dynamically_Generated_Page.html >Someone_Elses_Dynamically_Generated_Page.html has 'link' to another Page. >I want My_Script.php to grab the <a href="contents"> of the 'link' and >redirect to it, right after. > >The reason I want to do the above is, the first page dynamically creates a >session id and attaches it to the 'link'.. I need that session id to >continue on, and since this page is not on my server I cant control it.. > >Thanks.. ********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' **********************************************************************
We wont.. Their banners, logos, URL's etc. appear on the pages, so even if it is in the frameset, it will be fine.. Jon Haworth wrote: > As a quick caveat you need to be *very* careful you're not obfuscating the > target site.... copyright infringement, anyone? > > -----Original Message----- > From: Richard S. Crawford [mailto:[EMAIL PROTECTED]] > Sent: 08 March 2001 00:02 > To: Ashwin Kutty; [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Dynamic Links.. > > At our company we solve this problem by including the second page in a > frameset. That's what I would recommend for you. > > At 07:39 PM 3/7/01 -0400, Ashwin Kutty wrote: > > >No, not the URL and therefore not HTTP_REFERER.. > > > >This is how it is.. > > > >My_Script.php redirects to Someone_Elses_Dynamically_Generated_Page.html > >Someone_Elses_Dynamically_Generated_Page.html has 'link' to another Page. > >I want My_Script.php to grab the <a href="contents"> of the 'link' and > >redirect to it, right after. > > > >The reason I want to do the above is, the first page dynamically creates a > >session id and attaches it to the 'link'.. I need that session id to > >continue on, and since this page is not on my server I cant control it.. > > > >Thanks.. > > ********************************************************************** > 'The information included in this Email is of a confidential nature and is > intended only for the addressee. If you are not the intended addressee, > any disclosure, copying or distribution by you is prohibited and may be > unlawful. Disclosure to any party other than the addressee, whether > inadvertent or otherwise is not intended to waive privilege or confidentiality' > > ********************************************************************** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- "Wise men talk because they have something to say; fools talk because they have to say something." - Plato Ashwin Kutty Systems Administrator Dalhousie University Libraries (902) 494-2694
> > As a quick caveat you need to be *very* careful you're not > > obfuscating the target site.... copyright infringement, anyone? > We wont.. Their banners, logos, URL's etc. appear on the > pages, so even if it is in the frameset, it will be fine.. Yes, but their URL won't be in the address line. Not that it makes much of a difference, the site in question might actually care about that. A URL is as much a product brand as a logo is. Chris
Yes, I should have mentioned... we actually do develop contracts outlining co-branding agreements with our partners before we establish a frameset. I should also mention that we don't use PHP for session tracking; we use a home-grown Perl/Oracle hybrid for session tracking. But I imagine that establishing a frameset like this would work for PHP session tracking as well. At 02:46 PM 3/8/01 -0400, Jon Haworth wrote: > > As a quick caveat you need to be *very* careful you're not obfuscating the > > target site.... copyright infringement, anyone? -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow
I dont want to get into a long drawn out debate about the copyright infringements since we have already established our agreements with the companies.. You are right of course, sometimes the URL does tell it all, and as I mentioned, and if you read my note carefully, "Their banners, logos, URL's etc. appear on the pages.."; mind you this is also not required by the company in question, but we are doing it nonetheless.. Thanks for the heads up anyways.. "Boget, Chris" wrote: > > > As a quick caveat you need to be *very* careful you're not > > > obfuscating the target site.... copyright infringement, anyone? > > We wont.. Their banners, logos, URL's etc. appear on the > > pages, so even if it is in the frameset, it will be fine.. > > Yes, but their URL won't be in the address line. Not that it makes > much of a difference, the site in question might actually care about > that. A URL is as much a product brand as a logo is. > > Chris -- "Wise men talk because they have something to say; fools talk because they have to say something." - Plato Ashwin Kutty Systems Administrator Dalhousie University Libraries (902) 494-2694
Hello, to refresh a site I use this (<META HTTP-EQUIV="Refresh" CONTENT="300"> ), but, now I make some updates im my right page and I want to refresh other page( left page of frameset ).How can I do it? T.Y. Best Regards Miguel Loureiro <[EMAIL PROTECTED] >
Greetings, I keep getting the message that I cannot get results. I have a simple user authentication code that uses a mysql database to authenticate from. Initially I had the code working when I had the mysql_connect variables in the code itself. When I moved the connection variables to an include file and then called them as variables, it was necessary to change the variable names in the database (both were initially $username, $password). Now, while I have the connection and opening the db correct I can't get results. Here is my code: require("connect.inc.php"); $connection = mysql_connect("$hostname","$username","$password") or die ("Unable to connect to database."); echo "I'm connected.<br>"; **__A-OK here mysql_select_db("dnaUsers") or die ("Unable to select database."); echo "I've opened the dnaUsers db.<br>"; echo "$ruser, $rpass<br>"; //this is from the html login form **__Yup, no problem so far - // Formulate the query $sql = "SELECT rep_name FROM reps WHERE username='$ruser' and password='$rpass'"; // Execute the query and put the results in $result $result = mysql_query($sql,$connection) or die ("Couldn't get results."); **__Here it is - crash and burn - the database name is correct, the fields are correct, the username and password are in the db and have been input correctly and are even being passed from the form correctly. I have checked the names of all the fields to ensure they match the variables in the query, checked that the values in the fields are correct - (yes, I have checked that they match.) I have searched the archives but the hard thing about the archives is formulating the question in a way that will yield an answer. Sorry if this has been asked before. TIA, Nicole -- ######################## Nicole Lallande [EMAIL PROTECTED] 760.753.6766 ########################
Greetings, I keep getting the message that I cannot get results. I have a simple user authentication code that uses a mysql database to authenticate from. Initially I had the code working when I had the mysql_connect variables in the code itself. When I moved the connection variables to an include file and then called them as variables, it was necessary to change the variable names in the database (both were initially $username, $password). Now, while I have the connection and opening the db correct I can't get results. Here is my code: require("connect.inc.php"); $connection = mysql_connect("$hostname","$username","$password") or die ("Unable to connect to database."); echo "I'm connected.<br>"; **__A-OK here mysql_select_db("dnaUsers") or die ("Unable to select database."); echo "I've opened the dnaUsers db.<br>"; echo "$ruser, $rpass<br>"; //this is from the html login form **__Yup, no problem so far - // Formulate the query $sql = "SELECT rep_name FROM reps WHERE username='$ruser' and password='$rpass'"; // Execute the query and put the results in $result $result = mysql_query($sql,$connection) or die ("Couldn't get results."); **__Here it is - crash and burn - the database name is correct, the fields are correct, the username and password are in the db and have been input correctly and are even being passed from the form correctly. I have checked the names of all the fields to ensure they match the variables in the query, checked that the values in the fields are correct - (yes, I have checked that they match.) I have searched the archives but the hard thing about the archives is formulating the question in a way that will yield an answer. Sorry if this has been asked before. TIA, Nicole -- ######################## Nicole Lallande [EMAIL PROTECTED] 760.753.6766 ########################
I'd start by adding the mysql_error() function in your die() statement... $result = mysql_query($sql,$connection) or die ("Couldn't get results: " . mysql_error()); it might give more information to help you find the problem... At 10:15 AM 3/8/01 -0800, Nicole Lallande wrote: >Greetings, > >I keep getting the message that I cannot get results. I have a simple >user authentication code that uses a mysql database to authenticate >from. Initially I had the code working when I had the mysql_connect >variables in the code itself. When I moved the connection variables to >an include file and then called them as variables, it was necessary to >change the variable names in the database (both were initially >$username, $password). Now, while I have the connection and opening the >db correct I can't get results. Here is my code: > >require("connect.inc.php"); > >$connection = mysql_connect("$hostname","$username","$password") or die >("Unable to connect to database."); >echo "I'm connected.<br>"; >**__A-OK here > >mysql_select_db("dnaUsers") or die ("Unable to select database."); >echo "I've opened the dnaUsers db.<br>"; >echo "$ruser, $rpass<br>"; //this is from the html login form >**__Yup, no problem so far - > >// Formulate the query >$sql = "SELECT rep_name FROM reps WHERE username='$ruser' and >password='$rpass'"; >// Execute the query and put the results in $result >$result = mysql_query($sql,$connection) or die ("Couldn't get >results."); > >**__Here it is - crash and burn - the database name is correct, the >fields are correct, the username and password are in the db and have >been input correctly and are even being passed from the form correctly. > >I have checked the names of all the fields to ensure they match the >variables in the query, checked that the values in the fields are >correct - (yes, I have checked that they match.) > >I have searched the archives but the hard thing about the archives is >formulating the question in a way that will yield an answer. Sorry if >this has been asked before. > >TIA, > >Nicole >-- >######################## >Nicole Lallande >[EMAIL PROTECTED] >760.753.6766 >######################## > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks Joe - that showed me right away!! all better now -- on to the next step.. Nicole "Joe Sheble (Wizaerd)" wrote: > > I'd start by adding the mysql_error() function in your die() statement... > $result = mysql_query($sql,$connection) or die ("Couldn't get results: " . > mysql_error()); > > it might give more information to help you find the problem... > > At 10:15 AM 3/8/01 -0800, Nicole Lallande wrote: > >Greetings, > > > >I keep getting the message that I cannot get results. I have a simple > >user authentication code that uses a mysql database to authenticate > >from. Initially I had the code working when I had the mysql_connect > >variables in the code itself. When I moved the connection variables to > >an include file and then called them as variables, it was necessary to > >change the variable names in the database (both were initially > >$username, $password). Now, while I have the connection and opening the > >db correct I can't get results. Here is my code: > > > >require("connect.inc.php"); > > > >$connection = mysql_connect("$hostname","$username","$password") or die > >("Unable to connect to database."); > >echo "I'm connected.<br>"; > >**__A-OK here > > > >mysql_select_db("dnaUsers") or die ("Unable to select database."); > >echo "I've opened the dnaUsers db.<br>"; > >echo "$ruser, $rpass<br>"; //this is from the html login form > >**__Yup, no problem so far - > > > >// Formulate the query > >$sql = "SELECT rep_name FROM reps WHERE username='$ruser' and > >password='$rpass'"; > >// Execute the query and put the results in $result > >$result = mysql_query($sql,$connection) or die ("Couldn't get > >results."); > > > >**__Here it is - crash and burn - the database name is correct, the > >fields are correct, the username and password are in the db and have > >been input correctly and are even being passed from the form correctly. > > > >I have checked the names of all the fields to ensure they match the > >variables in the query, checked that the values in the fields are > >correct - (yes, I have checked that they match.) > > > >I have searched the archives but the hard thing about the archives is > >formulating the question in a way that will yield an answer. Sorry if > >this has been asked before. > > > >TIA, > > > >Nicole > >-- > >######################## > >Nicole Lallande > >[EMAIL PROTECTED] > >760.753.6766 > >######################## > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ######################## Nicole Lallande [EMAIL PROTECTED] 760.753.6766 ########################
Hi The case In Israel is different. It's not that we chose this browser over another... Netscape wouldn't support Hebrew and IE did. So there was no actual war. The data about the 3% is pretty accurate and is collaborated by all 3 major portals in Israel. Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -----Original Message----- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 04, 2001 6:45 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Hebrew websites transition with php3 .. Hello Boaz, On 01-Mar-01 04:17:25, you wrote: >The IE / NN war was one that left no chance for NN in Israel. >While MS spent millions in making all of their products in Hebrew, >including the free IE, NN refused to support Hebrew. I don't think this is a matter of browser wars. Ideally, portals should target their target audience not the other way arround. If your portal pages can't display in users browsers, they simply go away and won't bother telling you why. >While the 3% is correct for Israel, it's far from being true on an >international basis. If you got me right, if your portal only displays right in logical Hebrew, there is no reason for those 3% be just 0% because nobody returns to a portal that does not display in their browser, right? >With all due respect to people that like other browsers, developing >for all browsers costs lots of $$$ and as long as portals are free >and loosing lots of $$$ it's not profitable to develop for all. >Bottom line, as the CTO of one of those portals I say go >with Logical Hebrew and dump Netscape (In Israel Only). Personally I don't care about Netscape. My point was just to bring to the attention that when you think your are just dumping Netscape or whatever browser, what you are actually dumping is share of users that you believe that it is 3% but might be actually much more. I know that over here people assumed that was 10% but was in reality 30%. In a market like the Internet portals where the winner takes almost all, it may be worthy for you to rethink your options before you realize that your portal is not the winner because your not really evaluating the real user audience figures, but rather those that are technically more convinient. Just my 0.02 EUR. :-) Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi, My name is Bruno, From Brazil..... Yes...it's me again...hehehe.... Look...my problem is.. I wanna make something like this: (10 november 2001) - (5 November 2001) = 5 days (10 november 2001) - (10 December 2001) = 30 days How can i do this???? Thanks for any help!!!! Your friend, Bruno!!!! From !!!!!
Hello, this is a function I use on my site, you can problably find your answer, py // ===================================================== // This function returns the difference between a dates // and the current date. // arg1: separator // arg2: startdate date dd mm yyyy // return number of days of differences // ====================================================== function diff_date( $sep, $startdate ){ // Date of file in database $startdate = explode( "$sep", $startdate ); $startdate = mktime( 0, 0, 0, $startdate[1], $startdate[2], $startdate[0] ); // Now $enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") ); // get difference in days by dividing by 24*24*60 return ( $enddate - $startdate ) / ( 86400 ); } // end function ----- Original Message ----- From: Bruno Freire <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 08, 2001 7:05 PM Subject: [PHP] HELP!!! Date time problems!!!! > Hi, My name is Bruno, From Brazil..... > > Yes...it's me again...hehehe.... > > Look...my problem is.. > > I wanna make something like this: > > (10 november 2001) - (5 November 2001) = 5 days > > (10 november 2001) - (10 December 2001) = 30 days > > How can i do this???? > > > Thanks for any help!!!! > > Your friend, Bruno!!!! From !!!!! >
figured out the logic, but still cant make it run i put this command : echo diff_date("/", "05/03/2001") ; to test the function. but it doest seem to work :( any help ? btw i believe it must be 24*60*60 inorder to 24*24*60 :) ""Pierre-Yves Lemaire"" <[EMAIL PROTECTED]> wrote in message 01c301c0a7e0$17f85f00$9ceee740@py">news:01c301c0a7e0$17f85f00$9ceee740@py... > Hello, > this is a function I use on my site, you can problably find > your answer, > py > > // ===================================================== > // This function returns the difference between a dates > // and the current date. > // arg1: separator > // arg2: startdate date dd mm yyyy > // return number of days of differences > // ====================================================== > function diff_date( $sep, $startdate ){ > // Date of file in database > $startdate = explode( "$sep", $startdate ); > $startdate = mktime( 0, 0, 0, $startdate[1], $startdate[2], > $startdate[0] ); > // Now > $enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") ); > // get difference in days by dividing by 24*24*60 > return ( $enddate - $startdate ) / ( 86400 ); > } // end function > > > ----- Original Message ----- > From: Bruno Freire <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, March 08, 2001 7:05 PM > Subject: [PHP] HELP!!! Date time problems!!!! > > > > Hi, My name is Bruno, From Brazil..... > > > > Yes...it's me again...hehehe.... > > > > Look...my problem is.. > > > > I wanna make something like this: > > > > (10 november 2001) - (5 November 2001) = 5 days > > > > (10 november 2001) - (10 December 2001) = 30 days > > > > How can i do this???? > > > > > > Thanks for any help!!!! > > > > Your friend, Bruno!!!! From !!!!! > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
ok here is the right one working : smt was wrong with the arrays i beleive : <?php // ===================================================== // This function returns the difference between a dates // and the current date. // arg1: separator // arg2: startdate date dd mm yyyy // return number of days of differences // ====================================================== function diff_date( $sep, $startdate ){ // Date of file in database $startdate = explode( "$sep", $startdate ); $startdate = mktime( 0, 0, 0, $startdate[1], $startdate[0], $startdate[2] ); // Now $enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") ); // get difference in days by dividing by 24*60*60 return ( $enddate - $startdate ) / ( 86400 ); } // end function echo diff_date("/", "05/3/2001") ; ?> this one works :)
Yes, there was a little bug, it was set to handle date in yyyy/mm/dd and not dd/mm/yyy. Now this works ok. py function diff_date( $sep, $startdate ){ // Date of file in database $startdate = explode( $sep, $startdate ); $startdate = mktime( 0, 0, 0, $startdate[1], $startdate[0], $startdate[2] ); // Now $enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") ); // get difference in days by dividing by 24*24*60 return ( $enddate - $startdate ) / ( 86400 ); } // end function echo diff_date("/", "05/03/2001" ) ; ----- Original Message ----- From: karakedi <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 08, 2001 11:01 PM Subject: Re: [PHP] HELP!!! Date time problems!!!! > figured out the logic, > but still cant make it run > > i put this command : > > echo diff_date("/", "05/03/2001") ; > > to test the function. but it doest seem to work :( > any help ? > > btw i believe it must be 24*60*60 inorder to 24*24*60 :) > > ""Pierre-Yves Lemaire"" <[EMAIL PROTECTED]> wrote in message > 01c301c0a7e0$17f85f00$9ceee740@py">news:01c301c0a7e0$17f85f00$9ceee740@py... > > Hello, > > this is a function I use on my site, you can problably find > > your answer, > > py > > > > // ===================================================== > > // This function returns the difference between a dates > > // and the current date. > > // arg1: separator > > // arg2: startdate date dd mm yyyy > > // return number of days of differences > > // ====================================================== > > function diff_date( $sep, $startdate ){ > > // Date of file in database > > $startdate = explode( "$sep", $startdate ); > > $startdate = mktime( 0, 0, 0, $startdate[1], $startdate[2], > > $startdate[0] ); > > // Now > > $enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") ); > > // get difference in days by dividing by 24*24*60 > > return ( $enddate - $startdate ) / ( 86400 ); > > } // end function > > > > > > ----- Original Message ----- > > From: Bruno Freire <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, March 08, 2001 7:05 PM > > Subject: [PHP] HELP!!! Date time problems!!!! > > > > > > > Hi, My name is Bruno, From Brazil..... > > > > > > Yes...it's me again...hehehe.... > > > > > > Look...my problem is.. > > > > > > I wanna make something like this: > > > > > > (10 november 2001) - (5 November 2001) = 5 days > > > > > > (10 november 2001) - (10 December 2001) = 30 days > > > > > > How can i do this???? > > > > > > > > > Thanks for any help!!!! > > > > > > Your friend, Bruno!!!! From !!!!! > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
upss sorry couldnt see your latest post. thx anywy :)))))) ""karakedi"" <[EMAIL PROTECTED]> wrote in message 98942f$qcd$[EMAIL PROTECTED]">news:98942f$qcd$[EMAIL PROTECTED]... > ok here is the right one working : smt was wrong with the arrays i beleive : > > <?php > > > // ===================================================== > // This function returns the difference between a dates > // and the current date. > // arg1: separator > // arg2: startdate date dd mm yyyy > // return number of days of differences > // ====================================================== > function diff_date( $sep, $startdate ){ > // Date of file in database > $startdate = explode( "$sep", $startdate ); > $startdate = mktime( 0, 0, 0, $startdate[1], $startdate[0], > $startdate[2] ); > // Now > $enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") ); > // get difference in days by dividing by 24*60*60 > return ( $enddate - $startdate ) / ( 86400 ); > } // end function > > echo diff_date("/", "05/3/2001") ; > > ?> > > > this one works :) > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I'm having some problems with using addslashes($string) for preparing a text blob for a MySQL database. The $string can have single or double quotes in it, and depending on how I pass it on to the insert, it seems to work only for either single or double, but not for both. Input can be: This is John's quote "Hello" so I have to be able to capture both single and double and end up with: This is John\'s quote \"Hello\" but it seems like addslashes only handles one or the other but not both. Is this true? Or is it because I quote the $string in my form like this: $string = addslashes($string); echo(" ... <input type='hidden' name='string' value=\"$string\"> ... "); the problem happens before I get to the insert command, because I can echo the $string and see where it chops it if there are an odd number of quotes. In the example above, I would end up with: This is John's quote when I check the passed parameter, it is coded: string=This+is+John%27s+quote+ apparently because the first double quote of the <input> statement is matched to the double quote in the string even tho it was \". If I change the input to <input type='hidden' name='string' value=\'$string\'> then similar things happen, such as it gets chopped at the single quote. I've played around with the input string, both escaping it and using " vs. ' but nothing works for both. Any suggestions? Terry
> We send SMS messages from Oracle, but the method could be used in php I think. We use www.quios.com. They accept SMS messages as XML documents which you simply post to their site using http. The response, also by http, is an xml document. It is very easy to build your outgoing xml document, and the response document is so simple in structure that you could probably get by without an xml parser to interpret it. Does it cost anything? Do you need to be registered? Are there similar services? -- Henrik Hansen
OK now I'm pissed. I consider myself to be an above average programmer with extensive skill in PHP (amongst other things). NOW... I am not going to go jumping through hoops just because some ignorant/illiterate HR Recruiter/IS Head thinks that if you're not PHP certified by some company (eg. brainbench) you're not worth consideration. I REFUSE to do it. I WOULD NOT on my life take the MCSE of MCwhatever, however I may take the Cisco or the Oracle test. Things that require and properly compensate specialization I am open to. But things that test how well you can interact with a GUI (Windows) are bullshit. With respect to PHP there are other methods of determining ones competency with a particular language. What should be judged is a persons overall programming competency, or how well they can adapt to a new language, as oppose to specialization in PHP or PERL or ..... If you specialize in PHP, what are you going to do when there is no more PHP. (Not that we are expecting that). To summarize, judging a proficiency as it relates to a particular language shows the inexperience and ignorance of your future management. The bottom line is that "YOU DO NOT WANT TO WORK FOR PEOPLE LIKE THAT". I'm sure some experienced programmers around here know what I'm talking about. Mike -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 28, 2001 1:33 PM To: [EMAIL PROTECTED] Subject: [PHP] Developer certifications Does anyone know of a company which is offering or planning to offer PHP developer certifications? Arguments against certification programs aside[1], there are a lot of companies which prefer certified developers, even to the point of assuming a project done in ASP will be better than the same thing done in PHP simply because the ASP developers are Microsoft certified. While this seems like an interesting sideline for a company like Zend, I'm also somewhat curious about whether an "Open Source" test could be developed. It'd certainly have to be quite different from normal tests and that move away from easily memorized answers would probably be a very good thing. [1] We've all heard them before. I'm personally in favor only of certifications like certain devilishly hard Cisco exams which measure more than multiple-choice memory. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
I'm using the SetTimeOut function of JavaScript to refresh an image every 3 seconds. The SRC for the image is a PHP page which constructs a valid image with some text added to the image and returns the image to the colling Image. This works fine, however the information should be changing every so often for the image. The value to display in the image is a value being fetched from a table, that value is changing all the time. The value is set to the first-time-through value and then subsequent request of the image remain all the same (the image should be changing and it isn't). Is this a Javascript issue, browser issue, cache issue??? I've tested it on a couple of different platforms, with no luck. Here is my JavaScript code: function GetStat() { var Image2 Image2 = new Image(185,39) Image2.src = "GetStat.php" document.stat1.src = Image2 setTimeout('GetStat()',3000) status = " " } <img name="stat1" src="images/NumberDisplay.png" border=0> Thanks for the help!
never mind... 'or - i fixed my own problem! i enabled cacheing on both PHP pages, the page with the image who's source calls the PHP page that creates the image. ----- Original Message ----- From: "Karl J. Stubsjoen" <[EMAIL PROTECTED]> To: "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, March 08, 2001 12:52 PM Subject: [PHP] Tell me if this works > I'm using the SetTimeOut function of JavaScript to refresh an image every 3 > seconds. The SRC for the image is a PHP page which constructs a valid image > with some text added to the image and returns the image to the colling > Image. This works fine, however the information should be changing every so > often for the image. The value to display in the image is a value being > fetched from a table, that value is changing all the time. The value is set > to the first-time-through value and then subsequent request of the image > remain all the same (the image should be changing and it isn't). > > Is this a Javascript issue, browser issue, cache issue??? > I've tested it on a couple of different platforms, with no luck. Here is my > JavaScript code: > > function GetStat() { > var Image2 > Image2 = new Image(185,39) > Image2.src = "GetStat.php" > document.stat1.src = Image2 > setTimeout('GetStat()',3000) > status = " " > } > > <img name="stat1" src="images/NumberDisplay.png" border=0> > > Thanks for the help! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
1.3.1pl1 fixed a bug with a missing function _syntax_error. Monte Ohrt wrote: > > Homepage: > http://www.phpinsider.com/php/code/Smarty/ >
I am building a site which pulls FAQ's out of the database onto a page,but having just finished reading the FAQ's I realise that they will have to be spread over a few pages, how to I get the new page to take over where the old page finished. TIA george
Hi, I've been trying to figure this out all night, and need some assistance. I have a form that takes input, and I'm trying to read the variables directly into a MultiDim array ie: <input type=text name="field[text][email]" value="[EMAIL PROTECTED]"> <input type=text name="field[text][url]" value="http://www.email.com"> Now upon the form's submission, these variables are only accessible in $HTTP_GET_VARS (register_globals is Off) Now, in the backend, I use a form processing functions that check the input.. So, it sees $name="field[text][email]", and attempts to retrieve the value, so in essense $HTTP_GET_VARS[$name] should return "[EMAIL PROTECTED]", but it doesn't work.. However, if i try to access $HTTP_GET_VARS[field][text][email] that properly returns "[EMAIL PROTECTED]". This works perfectly if the input names are just plain variables, but when I try to read those variables into a predefined hash, I run into problems.. Does anyone have any pointers, or suggestions? Thanks in advance, Yev __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Please can you help: I can't send duplicate input types to $HTTP_POST_VARS For example: ---------------HTML------------------- First person: NAME <input type="text" name="Name" size="24" value=""> <input name="Name_type" type="hidden" value="textbox"> Phone No.<input type="text" name="Phone" size="24" value=""> <input name="Phone_type" type="hidden" value="textbox"> Second Person: NAME <input type="text" name="Name" size="24" value=""> <input name="Name_type" type="hidden" value="textbox"> Phone No.<input type="text" name="Phone" size="24" value=""> <input name="Phone_type" type="hidden" value="textbox"> ------------------------------------------------------- Then when I use : reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { echo "$key => $val<br>\n"; } Here is the output ----------------Output-------------------------- Name => Name_type => textbox Phone => Phone_type => textbox ------------------------------------------------ What happened to the Second person? How can I stop it ignoring duplicates and insert in the array 1 by 1? _____________________________________________________________ Pick up your email anywhere in the world ---> http://www.remail.net
You're not setting a value for the first variable ie.."Name" unless you put something in the text box to represent the variable it will come across as empty. Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: mat t [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 08, 2001 2:10 PM To: [EMAIL PROTECTED] Subject: [PHP] $HTTP_POST_VARS Please can you help: I can't send duplicate input types to $HTTP_POST_VARS For example: ---------------HTML------------------- First person: NAME <input type="text" name="Name" size="24" value=""> <input name="Name_type" type="hidden" value="textbox"> Phone No.<input type="text" name="Phone" size="24" value=""> <input name="Phone_type" type="hidden" value="textbox"> Second Person: NAME <input type="text" name="Name" size="24" value=""> <input name="Name_type" type="hidden" value="textbox"> Phone No.<input type="text" name="Phone" size="24" value=""> <input name="Phone_type" type="hidden" value="textbox"> ------------------------------------------------------- Then when I use : reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { echo "$key => $val<br>\n"; } Here is the output ----------------Output-------------------------- Name => Name_type => textbox Phone => Phone_type => textbox ------------------------------------------------ What happened to the Second person? How can I stop it ignoring duplicates and insert in the array 1 by 1? _____________________________________________________________ Pick up your email anywhere in the world ---> http://www.remail.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Explained here: http://www.php.net/manual/en/language.variables.external.php Basically name the variables with []. For example: <input type=text name="Name[]"> In your example, the second is actually overwriting the first. Nate -----Original Message----- From: mat t [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 08, 2001 3:10 PM To: [EMAIL PROTECTED] Subject: [PHP] $HTTP_POST_VARS Please can you help: I can't send duplicate input types to $HTTP_POST_VARS For example: ---------------HTML------------------- First person: NAME <input type="text" name="Name" size="24" value=""> <input name="Name_type" type="hidden" value="textbox"> Phone No.<input type="text" name="Phone" size="24" value=""> <input name="Phone_type" type="hidden" value="textbox"> Second Person: NAME <input type="text" name="Name" size="24" value=""> <input name="Name_type" type="hidden" value="textbox"> Phone No.<input type="text" name="Phone" size="24" value=""> <input name="Phone_type" type="hidden" value="textbox"> ------------------------------------------------------- Then when I use : reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { echo "$key => $val<br>\n"; } Here is the output ----------------Output-------------------------- Name => Name_type => textbox Phone => Phone_type => textbox ------------------------------------------------ What happened to the Second person? How can I stop it ignoring duplicates and insert in the array 1 by 1? _____________________________________________________________ Pick up your email anywhere in the world ---> http://www.remail.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello, I should probably know the answer to this but I do not. I was hoping someone here could offer me some incite. I recently changed my upload_tmp_dir from the apache default; actually it wasn't set at all, to another directory which I created for this purpose. The directory is outside of the normally accessible directory structure for apache web on my Linux box. I have no forms anywhere on the site which allow FTP just yet. I manually uploaded a few files and have been downloading them via a local VB program. So no PHP access to the directory yet. Today I noticed about 20 files, all named something like php??????. They are from various time during the day and have a zero file length with no content at all. I have no idea where these files are coming from. They are certainly not session files as those are appearing correctly in another directory. Any ideas on what these might be? Thanks very much! Gerard Onorato
My goal.. Take an image (gif,jpg) from a remote server, resize it into 200x150 and then save it on my local server. My friend gave me a premade script but that doesnt work. Anyone have something like this already done or know where to find it? - Thanks
Hi, I have one question, please. Can anybody help me with external data saving? I require to save the user data (I suppose data will be in the text format) from user (from his computer) to a database server. And I want not use ActiveX technology because it must run even under Netscape. Are there functions for work with files in Javascript? Thank you very much. Lot of regards, PETER
Petr: I'm not exactly clear about what you want to do, but ... PHP can process user data and save it to databases. This is probably what PHP does best. Javascript has nothing to do with this process (but you can use it in your PHP pages if you want). All I know about ActiveX is that it is a M$ technology that costs $$$ for the software involved and it is not as easy to use as PHP. Mick On Fri, 9 Mar 2001, [iso-8859-2] Petr Jùza wrote: > Hi, > I have one question, please. Can anybody help me with external data saving? > I require to save the user data (I suppose data will be in the text format) > from user (from his computer) to a database server. And I want not use > ActiveX technology because it must run even under Netscape. Are there > functions for work with files in Javascript? > > Thank you very much. > Lot of regards, PETER > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I do an insert using phpadmin, and i get back the error message (or maybe it's a warning?) The insert is of a duplicate on a unique field. I expected an error, but when I do mysql_error() or mysql_errno(), nothing comes back(and I do it the next line in the script). the 'mysql_query($sql, $link)' function DOES insert when the value is unique, DOES return false, but I'd like to inform the user what the error was. PHP Admin can get the 'error' why can't I? Please reply to me as well, OK? I'm trying to finish this script at work today. [EMAIL PROTECTED]
Hello all, I have an order form where I am trying to load an option button with a field column from a database file: This part works fine (actually Professional PHP has an example using the do...while statement - I wonder which is better?): $len = mysql_num_rows($result); for ($i=0; $i<=$len; $i++) { echo "<option value=\"$catid[$i]\">$catid</option>"; } The problem I have is loading the array - either I get the first or last element of the array as a scalar variable or I get arrays of the word 'Array': while ($row = mysql_fetch_array($result)) { $rowid[] = $row["dnaProd_ID"]; $catid[] = $row["Cat_ID"]; $desc[] = $row["Description"]; $size[] = $row["Pkg_size"]; $price[] = $row["Price"]; } and I have tried it without the [] - neither works. I also tried this with a for loop - replacing the while statement with for($j=0; $j<=$len; $j++) { $row = mysql_fetch_array($result); $rowid[$j] = $row["dnaProd_ID"]; $catid[$j] = $row["Cat_ID"]; etc, etc.... nope ;{ <sigh> - checked the archives, books - saw a similar question but I tried what they did and it did not work. This is one of those instances where the solution is so simple I can't find it. TIA for your help, Nicole -- ######################## Nicole Lallande [EMAIL PROTECTED] 760.753.6766 ########################
At 3:37 PM -0800 3/8/01, Nicole Lallande wrote: >$len = mysql_num_rows($result); >for ($i=0; $i<=$len; $i++) { > echo "<option value=\"$catid[$i]\">$catid</option>"; >} I believe your problem is in that code becuase it's ambiguous and because $catid is an array and you're treating it as a regular variable. what you should do is something like: while ($row = mysql_fetch_array($result)) { $rowid[] = $row["dnaProd_ID"]; $catid[] = $row["Cat_ID"]; $desc[] = $row["Description"]; $size[] = $row["Pkg_size"]; $price[] = $row["Price"]; } for($i = 0; $i < sizeof($catid); $i++) { $cat = $catid[$i]; echo "<option value=\"$cat\">$cat</option>"; } or you could build this up during your first loop: $optionValues = ""; while ($row = mysql_fetch_array($result)) { $cat = $row["Cat_ID"]; $optionValues .= "<option value=\"$cat\">$cat</option>\n"; } then just echo $optionValues whenever you want. OR you can create a generic function you can use anytime you want to make an option list, just pass in an array of options: GenerateOptionValues($optionArr) { $string = ""; foreach($optionArr as $option} { $string .= "<option value=\"$option\">$option</option>\n"; } return $string; } or if you need different values from the options, pass in an associateive array: GenerateOptionValues($optionArr) { $string = ""; foreach($optionArr as $option => $value} { $string .= "<option value=\"$value\">$option</option>\n"; } return $string; } alright, sorry for going on and on. -aaron
Hi I've tried what, one of u, has kindly suggested, to send the whole html page as email : i put at the beginning of the page <?mail('[EMAIL PROTECTED]', 'confirmation', ob_get_contents()); ?> and at the end, after </html> <? ob_end_flush();?> but i receive a blank email Can u please help ! THANKS _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.