php-general Digest 24 Jan 2001 18:42:37 -0000 Issue 474 Topics (messages 36342 through 36450): Re: as stupid as I normally am..... ( Nope!) 36342 by: Samantha Savvakis 36343 by: Jacky.lilst storing query result in arrays: waste of memory? 36344 by: Tyson Lloyd Thwaites problem with \n 36345 by: Roman 36346 by: Philip Olson 36351 by: Philip Olson session.save_path 36347 by: Jimmy Bäckström 36360 by: Richard Lynch |O:T| Can anyone translate for me this Perl code into PHP? 36348 by: Maxim Maletsky 36412 by: Chris Hayes db connection error 36349 by: Jacky.lilst 36350 by: Maxim Maletsky db connection error: need help badly 36352 by: Jacky.lilst 36353 by: Jørg V. Bryne Re: Zend Store products questions 36354 by: Adi Brand Re: Shared Memory with Yast-installed mod_php4 from SuSE. 36355 by: Thomas Weber 36397 by: Christian Reiniger 36401 by: Thomas Weber Re: Mysql question(s) 36356 by: Richard Lynch Re: where does database go at host 36357 by: Richard Lynch Re: Bad file descriptors 36358 by: Richard Lynch Re: Repition Reduction ? 36359 by: Richard Lynch Missing php_imap.so module, PLEASE HELP 36361 by: Dezider Góra 36407 by: Richard Lynch Status of debugger_on( ) 36362 by: tarique.sanisoft.com Any PHP/MySQL webhosts that allow 'load data infile' statement ? 36363 by: Margot Re: To much PHP (Newbie) 36364 by: Iván Sánchez Ortega \"MR\" Re: Sending a mail in HTML format 36365 by: Jon Haworth last_insert_id function 36366 by: Jacky.lilst 36367 by: Maxim Maletsky 36369 by: Maxim Maletsky 36371 by: Mark Lipscombe 36372 by: Jacky.lilst 36373 by: Maxim Maletsky 36374 by: Maxim Maletsky 36375 by: Maxim Maletsky 36376 by: Jacky.lilst 36377 by: Maxim Maletsky 36381 by: Alain Fontaine 36444 by: Don Read Bi-directional popen()? 36368 by: Mark Lipscombe 36408 by: Richard Lynch Re: sleep and usleep not working ?? 36370 by: Daniel Grace Re: Sockets 36378 by: Jason Brooke Form data is not "remembered" 36379 by: Alain Fontaine 36391 by: Klepto 36398 by: Alain Fontaine 36411 by: Steve Edberg 36438 by: Monte Ohrt Re: Funny php://stdout behaviour 36380 by: ARTEK 36414 by: Dotan Cohen Re: last_insert_id function: I did already 36382 by: Jacky.lilst 36383 by: Alain Fontaine Re: PHP Editors 36384 by: Piotr Duszynski Extending PHP 36385 by: Thomas Wentzel 36387 by: Rasmus Lerdorf Beginner in php! 36386 by: kaab kaoutar 36390 by: Tshering Norbu 36392 by: Jon Haworth Saving Images... 36388 by: Miguel Loureiro last_insert_id:sql internal function 36389 by: Jacky.lilst error with REPLACE or UPDATE 36393 by: mfourny.bluewin.ch 36409 by: Richard Lynch 36426 by: CC Zona Re: Newbie frustration! 36394 by: Christian Reiniger Re: Session problems 36395 by: Johannes Janson Re: file or fopen to fetch a web page??? 36396 by: Christian Reiniger strangeness with is_dir() 36399 by: hsmith.twilyt.com 36404 by: Daniel Lundqvist Checking if files are there? 36400 by: Sam 36402 by: Jon Haworth roxen 36403 by: Remigiusz Sokolowski Use variables, functions ect. in a textfile 36405 by: Henrik S. Andersen 36410 by: Richard Lynch PHP and PDF!!!!! 36406 by: Bruno Freire Editors, again (was Re: [PHP] Beginner in php!) 36413 by: Steve Edberg eval() to string??? 36415 by: [ rswfire ] 36420 by: Thomas Weber 36421 by: Robert S. White 36422 by: Thomas Weber 36423 by: indrek siitan Prob with blobs 36416 by: davey sonya declare variable 36417 by: kaab kaoutar 36419 by: Alexander Wagner HTTP_REFERER vs. session_whatever() vs. header() 36418 by: Scott Fletcher Re: file storage/downloader... 36424 by: johnny p. licencing php 36425 by: Miguel Martinez 36441 by: Rasmus Lerdorf Integration of PHP with MS Outlook? 36427 by: Jon Haworth 36445 by: Chris Lee Failed to write session data (files)? 36428 by: bill It;s good to be back 36429 by: jason cox HELP!!! PDFLIB FOR PHP!!!!! 36430 by: Bruno Freire Test for Cookies 36431 by: Karl J. Stubsjoen 36433 by: Brian V Bonini 36435 by: Hardy Merrill 36448 by: Karl J. Stubsjoen 36449 by: Karl J. Stubsjoen 36450 by: April About old GD DLL and PHP 4.0.4pl1 36432 by: Vladimir Novakovic problem with imagecolorsforindex() 36434 by: Subbie Mitsman Posting to list 36436 by: Brian V Bonini pdflib: unable to generate on the fly, need to write to file 36437 by: Dominic Re: "Authenticating" across sites/servers 36439 by: Donncha O Caoimh 36446 by: Michael Kimsal date question 36440 by: Fang Li 36447 by: Hardy Merrill Displaying Date correctly 36442 by: Sam building a language pack 36443 by: jeremyf10.excite.com 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] ----------------------------------------------------------------------
When you insert into the user table, the "Host" column is where you are connecting "FROM" not where you want to connect to. This could be something you have wrong. You want to connect to "216.122.146.147" ?? And you have inserted into the user table that you are coming from 216.122.146.147. So, if I can make assumptions, the host where you are connecting from and where you want to connect to are on the same machine? You can just use "localhost" for that if that is the case. Have you looked in the mysql log files to see what errors it is giving or a reason why this user can't connect? Other than that, you have taken the right steps to create a new db user, and if you have done the reload, everything should work. > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 25 January 2001 05:45 > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] as stupid as I normally am..... ( Nope!) > > > Nope, it still not working after i refresh the page. I went to database > mysql again and check table "user" and see username "freesale" there with > the host IP and it is empty at the password field in the table. > I also went to check table "db" and look at the fields Host, user > and I also > see correct Host IP together with username "freesale". > And the code to set up db connection at the page is below: > ********************************************** > $connection = mysql_connect("216.122.146.147", "freesale", "") or die > ("Could not connect"); > mysql_select_db("FreeSale", $connection); > *********************************************** > Please enlighten me what I have done wrong because I nearly went crazy now > :-) > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Samantha Savvakis <[EMAIL PROTECTED]> > To: Jacky@lilst <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 12:29 AM > Subject: RE: [PHP] as stupid as I normally am..... > > > > hi, > > > > ok, you did the reload, and now when you try your connect, does it work? > > > > The reload command does not return anything. > > > > Sam > > > > > > > -----Original Message----- > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, 25 January 2001 05:23 > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > > Subject: Re: [PHP] as stupid as I normally am..... > > > > > > > > > I did use "./mysqladmin reload" and I got this back on the > > > interface ( using > > > telnet) > > > ********************** > > > mysql> ./mysqladmin reload > > > -> > > > ********************* > > > and it does not do anything, is that mean the db serevr has > already been > > > reloaded? > > > cheers > > > Jack > > > [EMAIL PROTECTED] > > > "There is nothing more rewarding than reaching the goal you set for > > > yourself" > > > ----- Original Message ----- > > > From: Samantha Savvakis <[EMAIL PROTECTED]> > > > To: Jacky@lilst <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > > > Sent: Tuesday, January 23, 2001 11:34 PM > > > Subject: RE: [PHP] as stupid as I normally am..... > > > > > > > > > > you are forgetting to do a reload. > > > > > > > > ./mysqladmin reload > > > > > > > > > -----Original Message----- > > > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > > > Sent: Thursday, 25 January 2001 04:36 > > > > > To: [EMAIL PROTECTED] > > > > > Subject: [PHP] as stupid as I normally am..... > > > > > > > > > > > > > > > Hi people, > > > > > Off the topic here again but hope it won't be too much to ask. As > > > > > inexperience person on setup new Db on Mysql for new php project, > > > > > I need to add new database on Mysql for new project, as stupid as > > > > > I normally am, I don't really know what exactly to do about the > > > > > set up of user and password on that new db after it is added. So > > > > > the db connection could not connect at the code. > > > > > What I did was that after I added new db, log in to Mysql admin > > > > > via telnet, say "use Mysql" database and add new user at "user" > > > > > table (without password,leave it blank), with this query: > > > > > > > > > > > insert into user values ('216.122.146.147','freesale', > > > > > '','y','y','y','y','y','y','y','y','y','y','y','y','y','y'); > > > > > > > > > > and freesale is of course username and I left password field as > > > > > blank and given all previliges as yes. > > > > > > > > > > Then add that username into Db table together with the database > > > > > name using this query : > > > > > > > > > > >insert into db values > > > > > ('216.122.146.147','FreeSale','freesale','y','y','y','y','y','y',' > > > > > y','y','y','y'); > > > > > > > > > > while FreeSale is database name and freesale is username. > > > > > > > > > > > > > > > Database connection still could not establish, Anything > else I miss > > > here? > > > > > cheers > > > > > Jack > > > > > [EMAIL PROTECTED] > > > > > "There is nothing more rewarding than reaching the goal you set > > > > > for yourself" > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.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] > > > > > >
How do I look in to mysql log files? Anyway, the IP 216.122.146.147 is the IP of db server where the page tries connect to (and my developing machine is on ISDN line and the ip is 192.168.0.100 in which I think it does not quite relevant to bring it up here) . But The actual IP of the server that host the php files is 216.122.146.146 . But when I looked at other username and password that has set up on other PHP project, at the host field of both "user" table and "db" table, it use 216.122.146.147 and the application is working fine with the same sniplet for db connection. cheers Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Samantha Savvakis <[EMAIL PROTECTED]> To: Jacky@lilst <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 12:56 AM Subject: RE: [PHP] as stupid as I normally am..... ( Nope!) > When you insert into the user table, the "Host" column is where you are > connecting "FROM" not where you want to connect to. > > This could be something you have wrong. You want to connect to > "216.122.146.147" ?? And you have inserted into the user table that you are > coming from 216.122.146.147. So, if I can make assumptions, the host where > you are connecting from and where you want to connect to are on the same > machine? You can just use "localhost" for that if that is the case. > > Have you looked in the mysql log files to see what errors it is giving or a > reason why this user can't connect? > > Other than that, you have taken the right steps to create a new db user, and > if you have done the reload, everything should work. > > > -----Original Message----- > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, 25 January 2001 05:45 > > To: [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] as stupid as I normally am..... ( Nope!) > > > > > > Nope, it still not working after i refresh the page. I went to database > > mysql again and check table "user" and see username "freesale" there with > > the host IP and it is empty at the password field in the table. > > I also went to check table "db" and look at the fields Host, user > > and I also > > see correct Host IP together with username "freesale". > > And the code to set up db connection at the page is below: > > ********************************************** > > $connection = mysql_connect("216.122.146.147", "freesale", "") or die > > ("Could not connect"); > > mysql_select_db("FreeSale", $connection); > > *********************************************** > > Please enlighten me what I have done wrong because I nearly went crazy now > > :-) > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > ----- Original Message ----- > > From: Samantha Savvakis <[EMAIL PROTECTED]> > > To: Jacky@lilst <[EMAIL PROTECTED]> > > Sent: Wednesday, January 24, 2001 12:29 AM > > Subject: RE: [PHP] as stupid as I normally am..... > > > > > > > hi, > > > > > > ok, you did the reload, and now when you try your connect, does it work? > > > > > > The reload command does not return anything. > > > > > > Sam > > > > > > > > > > -----Original Message----- > > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, 25 January 2001 05:23 > > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > > > Subject: Re: [PHP] as stupid as I normally am..... > > > > > > > > > > > > I did use "./mysqladmin reload" and I got this back on the > > > > interface ( using > > > > telnet) > > > > ********************** > > > > mysql> ./mysqladmin reload > > > > -> > > > > ********************* > > > > and it does not do anything, is that mean the db serevr has > > already been > > > > reloaded? > > > > cheers > > > > Jack > > > > [EMAIL PROTECTED] > > > > "There is nothing more rewarding than reaching the goal you set for > > > > yourself" > > > > ----- Original Message ----- > > > > From: Samantha Savvakis <[EMAIL PROTECTED]> > > > > To: Jacky@lilst <[EMAIL PROTECTED]>; > > <[EMAIL PROTECTED]> > > > > Sent: Tuesday, January 23, 2001 11:34 PM > > > > Subject: RE: [PHP] as stupid as I normally am..... > > > > > > > > > > > > > you are forgetting to do a reload. > > > > > > > > > > ./mysqladmin reload > > > > > > > > > > > -----Original Message----- > > > > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > > > > Sent: Thursday, 25 January 2001 04:36 > > > > > > To: [EMAIL PROTECTED] > > > > > > Subject: [PHP] as stupid as I normally am..... > > > > > > > > > > > > > > > > > > Hi people, > > > > > > Off the topic here again but hope it won't be too much to ask. As > > > > > > inexperience person on setup new Db on Mysql for new php project, > > > > > > I need to add new database on Mysql for new project, as stupid as > > > > > > I normally am, I don't really know what exactly to do about the > > > > > > set up of user and password on that new db after it is added. So > > > > > > the db connection could not connect at the code. > > > > > > What I did was that after I added new db, log in to Mysql admin > > > > > > via telnet, say "use Mysql" database and add new user at "user" > > > > > > table (without password,leave it blank), with this query: > > > > > > > > > > > > > insert into user values ('216.122.146.147','freesale', > > > > > > '','y','y','y','y','y','y','y','y','y','y','y','y','y','y'); > > > > > > > > > > > > and freesale is of course username and I left password field as > > > > > > blank and given all previliges as yes. > > > > > > > > > > > > Then add that username into Db table together with the database > > > > > > name using this query : > > > > > > > > > > > > >insert into db values > > > > > > ('216.122.146.147','FreeSale','freesale','y','y','y','y','y','y',' > > > > > > y','y','y','y'); > > > > > > > > > > > > while FreeSale is database name and freesale is username. > > > > > > > > > > > > > > > > > > Database connection still could not establish, Anything > > else I miss > > > > here? > > > > > > cheers > > > > > > Jack > > > > > > [EMAIL PROTECTED] > > > > > > "There is nothing more rewarding than reaching the goal you set > > > > > > for yourself" > > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.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] > > > > > > > > > >
Hi all, I am writing an object-oriented program in PHP, and some of the child objects require similar data to their parents, but from different columns of the same table. Is it better to retrieve the whole table up-front and store it in a session array, or to run the queries seperately each time the data is needed and specify the column targets? My first thought was to store it all in an array, but the problem is that some of the data is CLOB data, and this is for a site that will have may thousands of concurrent users, so I don't want to use up all the server's memory by putting unnecessary things in arrays. Another thought is that you could run the queries up-front and make the query global, but only fetch rows as needed. Any thoughts on this? The bottom line is that I am not sure whether it is worse to run numerous smaller queries, or to run one large query and possibly use more memory. Thanks for any insights! Regards, Tyson Lloyd Thwaites IT&e Limited e-Commerce Division Adelaide (08) 8346 3888
I have PHP 4.0.4 version but i have problem with this escape command : \n : don't work. what's the problem another escape command work with no problems... Thanx, roman
How are you using it (code snip) and what is it not doing for you? Philip On Wed, 24 Jan 2001, Roman wrote: > I have PHP 4.0.4 version but i have problem with this escape command : \n : > don't > work. what's the problem another escape command work with no problems... > > > Thanx, roman > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
\n is not a new line to the browser window although if you look at the HTML source, a new line will exist. You want to use <br> here. Now to demonstrate, use pre, which values whitespace : <pre> <?php echo "top\nblah\ntext\n\n\n\nboo"; ?> </pre> At any rate, \n does not return a new line within browser window, this is common question/issue so don't fret :-). newlines are treated like any other whitespace to browser. This is why we have the function nl2br : http://www.php.net/manual/en/function.nl2br.php Using newlines allows our html source to be pretty and simpler to debug. And they are useful in such things as in email messages. Philip On Wed, 24 Jan 2001, Roman wrote: > for example echo "text1 \n"; > echo "text2 "; > and result is text1text2 > > > -----Original Message----- > From: Philip Olson [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 8:58 AM > To: Roman > Cc: Php-General > Subject: Re: [PHP] problem with \n > > > > > > How are you using it (code snip) and what is it not doing for you? > > Philip > > > On Wed, 24 Jan 2001, Roman wrote: > > > I have PHP 4.0.4 version but i have problem with this escape command : \n > : > > don't > > work. what's the problem another escape command work with no problems... > > > > > > Thanx, roman > > > > > > -- > > PHP General Mailing List (http://www.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] >
Yo! I'm sending this call for help once again, since I didn't get an answer to my problem last time. I'm working a little with sessions, but I get a message like this: Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m (2) in h:\program\apache\htdocs/boa/sessionTest.php on line 5 Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 I have a tmp directory under my apache directory (i'm running win2k btw) Is it suppose to go anywhere else? Please help me!
Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m (2) in h:\program\apache\htdocs/boa/sessionTest.php on line 5 Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 I have a tmp directory under my apache directory (i'm running win2k btw) Is it suppose to go anywhere else? Please help me! PHP is trying to open "/tmp", which would be a Un*x sorta equivalent of "C:/tmp", only you've created a tmp dir down inside the Apache directory... And your machine ain't got a "/tmp" dir, and never could have one, since Windows kinda requires that drive letter thingie. Edit your php.ini file and change the session.save_path to be something not unlike this: session.save_path = "h:/program/apache/tmp" Only I'm not sure you want h: and I'm not sure you want a trailing slash or not... But for sure, you can't leave it as "/tmp" and have it work on Windows. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
Hello guys, I *know* it is totally OT, but, I need your help... Below is a piece of PERL code that I am trying to "translate" into PHP. It is quite simple code needed to send emails within a newsletter. I kind of tried to rewrite it in PHP but since I know *nothing* about Perl I found myself asking what does that means and what this... Could anyone who knows Perl that well write me a sketch of the equal script in PHP? It is simple, I can see it, but I do not understand what is that RegEx for, what is $pid ( fork() ) and where does it actually send emails... Thanks in advance, Maxim Maletsky <snip> #!/usr/bin/perl read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; } else { $INPUT{$name} = $value; } } $pid = fork(); print "Content-type: text/html \n\n fork failed: $!" unless defined $pid; if ($pid) { ... bla bla bla } else { close (STDOUT); open(LIST,"$INPUT{'address_file'}"); @addresses=<LIST>; close(LIST); foreach $line(@addresses) { chomp($line); open(MAIL, "|$INPUT{'mail_prog'} -t") || &error("Could not send out emails"); print MAIL "To: $line \n"; print MAIL "From: $INPUT{'listname'} <$INPUT{'from'}>\n"; print MAIL "Subject: $INPUT{'subject'}\n"; if ($INPUT{'html'}) { print MAIL "MIME-Version: 1.0\n"; print MAIL "Content-Type: text/html;\n"; print MAIL "Content-Transfer-Encoding: 7bit\n\n"; } print MAIL "$INPUT{'body'}"; print MAIL "\n\n"; if ($INPUT{'unsubchk'}) { print MAIL "===========================================================\n"; print MAIL "You have received this email because you subscribed to the $INPUT{'listname'} Mailing Service. To unsubscribe simply visit the link below.\n"; print MAIL "$INPUT{'url'}/unsub.phtml?list=$INPUT{'list'}&email=$line\n"; } print MAIL "\n\n"; close (MAIL); } } </snip> Maxim Maletsky - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Webmaster, J-Door.com / J@pan Inc. LINC Media, Inc. TEL: 03-3499-2175 x 1271 FAX: 03-3499-3109 http://www.j-door.com <http://www.j-door.com/> http://www.japaninc.net <http://www.japaninc.net/> http://www.lincmedia.co.jp <http://www.lincmedia.co.jp/>
Hi Maxim, > It is simple, I can see it, but I do not understand what is that RegEx for, > what is $pid ( fork() ) and where does it actually send emails... right... you look like Blair and Clinton saying the Human Genome has been 'completely' discovered. Simple, but.... ## the first part is not needed in PHP, untile the ###### line > #!/usr/bin/perl > > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); > @pairs = split(/&/, $buffer); > foreach $pair (@pairs) { > ($name, $value) = split(/=/, $pair); Until here he reads in the URL variables into the array $pair. I know the famous formmail from Matts' script archive (free and translated to php somewhere) has a good routine to read either GET or POST variables. Check the formmail.php to see if that part is translated to php. > $value =~ tr/+/ /; change plus to space. If you use a form with the GET method the variables are put in this line in the URL (path/file.php?var1=words&var2=123&var3=a good day) But var3 has spaces between the words so the browser usually replaces the spaces in a form element with %20 but sometimes (old browsers? at altavista you could see it, maybe still) the space was changed to a plus. So this is just changing the value back. > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; So if the space was turned into %20 change it back to a space. And same for other characters that were safely changed to a %00 to %FF code in the URL (tabs, new lines etc) using some mystery pack function. The equivalent of this line in PHP is urldecode($value); (see php manual) It looks like this is specially for the way you have to deal with this in CGI. > if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; } > else { $INPUT{$name} = $value; } > } ########################## Everything up till here is NOT NECESSARY IN PHP! PHP has some built-in functionality making form handling a lot simpler. If you use a form, give every elemant a name. Use method=POST and all names are available in the called php page as $name. (For arrays look at this newslist archives). No need for translations of variable values. > $pid = fork(); I've seen the question on this mailing list more often from previous perl programmes: 'how can i fork.' and it seemed as if they meant to call another function and have two functions run simultaneously. I'ld say, ignore it. Just make sure you don't overload the server with too many emails at once, if you syuspect that build in a break after sending one mail, i think function pause() does that. Many PHPeople use qmail, don't know why. > print "Content-type: text/html \n\n fork failed: $!" unless defined $pid; Apparently when you call fork the message has to split up in several simultaneous runs and the print line is only read when that fails. Ignore it, it seems not necessary for PHP and sendmail. > if ($pid) { > > ... bla bla bla > > } > else { > > close (STDOUT); Finally the Perl script is finished woth the variables. Praise PHP! > open(LIST,"$INPUT{'address_file'}"); > @addresses=<LIST>; > close(LIST); here he reads in a list of adresses form a file defined in the form in a field called address_file. Check the PHP manual for reading in lines from files like this. > foreach $line(@addresses) { for every email address he found > chomp($line); probably trim() the read line to remove spaces. Perl tends to be anarchistic in choosing function names. > open(MAIL, "|$INPUT{'mail_prog'} -t") || &error("Could not send out > print MAIL "\n\n"; > close (MAIL); The part between open and close (MAIL) do the mailing. In the open line you see he checks which email program to use. In PHP in stead of print MAIL.= use $message.= First complete the $message then use sendmail() instead. for this: > if ($INPUT{'html'}) { use if isset($html) >[EMAIL PROTECTED] shit have i been working for an inc? Damn. That'll be $FF (hex) then please! 8-P Chris -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
Hi all, I got the error below when I tried to establish db coonection. Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/sites/site1/web/FreeSale/submitagree.php3 on line 2 The sniplet is : $connection = mysql_connect("216.122.146.146", "freesale", "secret"); what is the problem here? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
It says that the username or password are incorrect. Just Double Check them! Cheers, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 6:07 AM To: [EMAIL PROTECTED] Subject: [PHP] db connection error Hi all, I got the error below when I tried to establish db coonection. Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/sites/site1/web/FreeSale/submitagree.php3 on line 2 The sniplet is : $connection = mysql_connect("216.122.146.146", "freesale", "secret"); what is the problem here? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
Quoting from my previous message. I think my exact question is that when I add a new db on to db server, How do I set up username and password to access that db? All I did was just run the query at "mysql" database to insert Host, username at "user" table ( left password blank)and gave all privileges as Y. And insert Host, User at "db" table with Y privileges as well. And what I added to the Host field on both tables is 216.122.146.146 ( which is the same IP susing at the code to establish db connection below.). But the IP for my db server is 216.122.146.147. Then I write "mysqladmin reload " . It still did not work. Somone told me that what added into the host field on bothe table ( db and user) should be where I connect from, which in this case should be 216.122.146.146, not the other IP, And the host IP in the db connection sniplet should be the same too, right? So is there anything I miss here? error mesage: ******************** Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) in /home/sites/site1/web/FreeSale/submitagree.php3 on line 2 ***************************** The sniplet is : $connection = mysql_connect("216.122.146.146", "freesale", ""); **************************************** Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 2:06 AM Subject: RE: [PHP] db connection error > It says that the username or password are incorrect. > > Just Double Check them! > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 6:07 AM > To: [EMAIL PROTECTED] > Subject: [PHP] db connection error > > > Hi all, > I got the error below when I tried to establish db coonection. > > Warning: MySQL Connection Failed: Access denied for user: > '[EMAIL PROTECTED]' (Using password: YES) in > /home/sites/site1/web/FreeSale/submitagree.php3 on line 2 > > > The sniplet is : > > $connection = mysql_connect("216.122.146.146", "freesale", "secret"); > > what is the problem here? > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > PHP General Mailing List (http://www.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 always use mysql_setpermission, which is a script for easy adding of users and permissions etc. step by step. It comes with the standard dist. of mysql. Mvh Jørg ----- Original Message ----- From: "Jacky@lilst" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 10:45 PM Subject: [PHP] db connection error: need help badly > Quoting from my previous message. I think my exact question is that when I > add a new db on to db server, How do I set up username and password to > access that db? All I did was just run the query at "mysql" database to > insert Host, username at "user" table ( left password blank)and gave all > privileges as Y. And insert Host, User at "db" table with Y privileges as > well. > And what I added to the Host field on both tables is 216.122.146.146 ( which > is the same IP susing at the code to establish db connection below.). But > the IP for my db server is 216.122.146.147. > Then I write "mysqladmin reload " . > It still did not work. Somone told me that what added into the host field > on bothe table ( db and user) should be where I connect from, which in this > case should be 216.122.146.146, not the other IP, And the host IP in the db > connection sniplet should be the same too, right? > So is there anything I miss here? > error mesage: > ******************** > Warning: MySQL Connection Failed: Access denied for user: > '[EMAIL PROTECTED]' (Using password: NO) in > /home/sites/site1/web/FreeSale/submitagree.php3 on line 2 > ***************************** > The sniplet is : > > $connection = mysql_connect("216.122.146.146", "freesale", ""); > **************************************** > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Maxim Maletsky <[EMAIL PROTECTED]> > To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 2:06 AM > Subject: RE: [PHP] db connection error > > > > It says that the username or password are incorrect. > > > > Just Double Check them! > > > > Cheers, > > Maxim Maletsky > > > > -----Original Message----- > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 6:07 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] db connection error > > > > > > Hi all, > > I got the error below when I tried to establish db coonection. > > > > Warning: MySQL Connection Failed: Access denied for user: > > '[EMAIL PROTECTED]' (Using password: YES) in > > /home/sites/site1/web/FreeSale/submitagree.php3 on line 2 > > > > > > The sniplet is : > > > > $connection = mysql_connect("216.122.146.146", "freesale", "secret"); > > > > what is the problem here? > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > > > -- > > PHP General Mailing List (http://www.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] >
Hello Andrew, Thank you for contacting Zend and your interest in our products. Regarding your questions, the answers are: 1. YES. The Encoder Plugins are perpetual and have no time limitation. 2. You will receive all the prducts at nce, and you are entitled to all major S/W upgrades within this period. 3. If your H/W fails or need to be replaced, please contact Zend and we will provide you with a substitute license. Best regards, Adi J. Brand VP International Sales Zend Technologies Voice: +972 (0)3 613 9665, x.116 Cell: +972 (0)56 505 005 www.zend.com ---------------------------------------------------------- Visit the Zend Store at http://www.zend.com/store/ -----Original Message----- From: Andrew Sitnikov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 12:57 AM To: [EMAIL PROTECTED] Subject: Zend Store products questions Hello , I have some questions about new products from Zend. 1. After the my "Commercial Subscription Plan" expire, will scripts coded with "Zend Encoder SE" working ? (if it work in users servers with "Zend Encoder SE Runtime plugins"). 2. If I shall choose payment 12 months, I shall receive products at once or in 12 months? 3. When I install the "Zend IDE", " Zend Encoder SE " ... On one The computer also I receive the licenses (FLEXlm) for it, when I will need to make upgrade hardware or change IP or move all software to other computer, I can receive The new license? Best regards, Andrew Sitnikov e-mail : [EMAIL PROTECTED] GSM: (+372) 56491109
-----Ursprungliche Nachricht----- Von: Thomas Weber [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 24. Januar 2001 09:50 An: [EMAIL PROTECTED] Betreff: AW: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE. Thanks Stathis.... i tried it twice to compile it, ./configure ...., make, make install..... but i don't get a new libphp4.so! I found only a libphp4.a wich is 9MB (the original libphp4.so is only 2.5MB ..... can't be the same) and when i try to load this module (and not the libphp4.so from SuSE) is get an syntax-error in httpd.conf (SuSE support says this happens when a module is not functioning.) Hit Thomas, you need to recompile PHP with the options you want (as a shared apache module) and then replace libphp4.so on /usr/lib/apache/ with your own version. A good thing is to keep SuSE's version as a backup:-) Don't forget to restart apache afterwards. (/etc/rc.d/apache stop; /etc/rc.d/apache start) A SuSE.6.4 user. -Stathis. Thomas Weber wrote: > > Hi, > > i try to use the shared memory functions on a SuSE Linux 7.0 server with > Apache and mod_php4 out of the box installed with yast. For shmop i need to > configure PHP with --enable-shmop with isn't enabled in this installation. > > I know how to enable this when compiling and installing the source of > mod_php4, what is to difficult for me, i think. But how to enable it in the > SuSE-RPM-Distribution? I found a mod_php4.spec in /usr/src/packages/SPECS in > wich the configuration options are, butr i don't know how to use it to > install this RPM with my own configuration. Can anyone help me? > > Sincerly, > --- > Thomas Weber > > CYNOBIA Community Online Service AG > Kühbachstraße 11 > 81543 München > fon 089-78 06 0(280) > fax 089-78 06 01 99 > email [EMAIL PROTECTED] > net http://www.CYNOBIA.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Wednesday 24 January 2001 09:55, Thomas Weber wrote: > Thanks Stathis.... i tried it twice to compile it, ./configure ...., > make, make install..... but i don't get a new libphp4.so! I found only > a libphp4.a wich is 9MB (the original libphp4.so is only 2.5MB ..... You forgot the --with-apxs switch to ./configure Also , try doing a strip --strip-unneeded libphp4.so afterwards -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra
Yea, thank you!!!! It worked! Formerly i used the --with-apache command (wich hasn't worked) and now with the --with-apxs it works. Great, thank you very much! :)) -- Thomas -----Ursprüngliche Nachricht----- Von: Christian Reiniger [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 24. Januar 2001 12:15 An: Php-General Betreff: Re: WG: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE. On Wednesday 24 January 2001 09:55, Thomas Weber wrote: > Thanks Stathis.... i tried it twice to compile it, ./configure ...., > make, make install..... but i don't get a new libphp4.so! I found only > a libphp4.a wich is 9MB (the original libphp4.so is only 2.5MB ..... You forgot the --with-apxs switch to ./configure Also , try doing a strip --strip-unneeded libphp4.so afterwards -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.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 created a table with FaceMysql that had one field and I could not add data > to it .Only when I recreated it with 2 fields and a primary key did it > work.Is there any reason for this?Must there always be a primary key in > Mysql?I've never known this to be true of relational Db's.Especially if you > can't implement a foriegn key.Mike P > [EMAIL PROTECTED] I thought phpMyAdmin had a similar thing when it came to deleting records -- If you didn't have an auto_increment or unique key or whatever, it couldn't be sure which record to delete... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
> I'm going to created a database with the use of a php/html page on my > commercial host (forsite.net). I have yet to master the unix directory > system so I don't want to play around looking for it. Does a database have > to "live" in the MySQL directory, or can it be in my html web directory? > How does it usually get set up? If it can be stored in my web directory, > how do I get it there? You can configure MySQL to store its data directory virtually anywhere you like. I can see how it would seem kind of attractive to sort of have everything in once central location, but it would probably be a particularly Bad Idea (tm) to put it in your web directory: The internals of your MySQL database are then visible to the public just by them surfing to them. Odds are really, really good some hacker can then more easily run a dictionary attack against any passwords stored in your database, including MySQL's "root" access, which if they break that, they can probably use MySQL to over-write the login daemon on the whole machine and then snag "root" access to the OS, and then it's all over. I've never heard of this happening, mind you, but I've never heard of anybody putting their MySQL data directory inside their web directory. It usually gets set up so that there's a "data" directory under your mysql directory, I think. You're probably best off to leave it there unless you have some over-riding concern about the file sizes growing inordinately large and have another drive/partition where they need to go.
There are only so many files that your OS can have open at any one time -- Perhaps you are hitting that limit?... I think you can increase this with... "ulimit"??? Another possibility is that if you need to copy an entire directory structure, rather than making PHP walk through it copying one file at a time, you could just do: <?php exec("cp /path/to/source/dir /path/to/dest/dir", $results, $error); while (list(,$line) = each($results)){ echo $line,"<BR>\n"; } if ($error){ die("OS Error $error. Usually paths/permissions.<BR>\n"); } ?> You probably need some flags to that cp like -r -f or whatever, depending on what you want to over-write what. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Kif" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Tuesday, January 23, 2001 10:55 PM Subject: [PHP] Bad file descriptors > Hi > > I recently wrote a script that copies about 200 data files from a remote > server, and stores them locally. > > It does this under cron every night > > Everything has been fine for a couple of weeks, but now when running the > script I get an error message that reads > > Warning: file(http://remote.server.com/file.html) - Bad file descriptor in > /home/convert.php on line ... > > And the files that the script is copying and referring to are all zero > length. > > This doesn't happen all the time. some nights I may get no error messages > and other times I get lots of them. > Last night it was nearly all of them. > > The problem seems to be getting increasingly worse as time passes. > > I have checked the data files (about half are html and half are images) and > they seem fine. > > I'm a bit new to php and I really have no idea what the error message means. > Can someone help and explain what might be going on please > > Thanks > > Kif > [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] >
> I'm making a small quiz script, and wanted to know how > I could minimize repition of questions to a single > user. > > And also how to randomize all the questions ? If you put all the questions in an array, and then call http://php.net/shuffle on it, you'll do both.
I dunno what's wrong. I have wu-imap installed and running. I want to compile php with imap support, so I downloaded and untarred wu-imapd. When compiling php I specified the locaiton of c-client files in the source dir of wu-imap. Make, make install ran withou error ( or I didn't notice any ). Apache starts, php runs, only apache complains about non-existing php_imap.so. What have I screwed up? pls help, I have to create webmail system for our company and the deadline if breathing on my neck.... 8-| If it's possible, can anybody send me this module? I'll try what it does.... tia Dezider.
Double-check the output of configure in config.cache and config.log (?) and make sure there were no errors about imap. For some extensions, configure goes ahead and creates a working make setup ever if there were errors... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Dezider Góra <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Wednesday, January 24, 2001 2:56 AM Subject: [PHP] Missing php_imap.so module, PLEASE HELP > I dunno what's wrong. > I have wu-imap installed and running. I want to compile php with imap > support, so I downloaded and untarred wu-imapd. When compiling php I > specified the locaiton of c-client files in the source dir of wu-imap. > Make, make install ran withou error ( or I didn't notice any ). > Apache starts, php runs, only apache complains about non-existing > php_imap.so. > What have I screwed up? > > pls help, I have to create webmail system for our company and the > deadline if breathing on my neck.... 8-| > If it's possible, can anybody send me this module? I'll try what it > does.... > > tia > Dezider. > > > ---------------------------------------------------------------------------- ---- > -- > PHP General Mailing List (http://www.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 Can someone tell me the present status of debugger_on( ) function? Does it still exist? the documentation says it does! Is there someone who is really using it? Thanks in advance Tarique -- ========================================= B2B Application Providers http://www.sanisoft.com Vortal for Nagpur http://nagpurcity.net =========================================
Does anyone know of any reputable PHP/MySQL webhosting companies that allow clients to use the "load data ... infile" statement? Many enquiries to well known webhosts have resulted in a universal '"no". TIA Margot.
""Chris Lee"" ... > If your refering to old Pascal pre-3.0 in how you could only have X number > of bytes in a file (32k I think) then pascal would not parse the rest, then > no php isnt limited to this, your pages will just get slower and slower > because of more hits. Anyway, if your pages are served too slow, it's not your fault - your web just needs a bigger and better server. (better, say that it's the DBA fault)
I can't understand why you don't just use: $address = "[EMAIL PROTECTED]"; $subject = "This is an HTML message"; $headers = "Content-Type: text/html\n"; $message = "<html><body>\n"; $message .= "<h1>This should use H1</h1>\n"; $message .= "<h2>This should use H2</h2>\n"; $message .= "<p>This should use P</p>\n"; $message .= "<a href=\"http://127.0.0.1/\">This should be a link</a>\n"; $message .= "</body></html>\n"; mail ($addr, $subject, $message, $headers); Did I miss something? I've just run this as a function called from a do...while loop that reads addresses from a MySQL database, and it did 500 emails in 72 seconds on a crufty old P2. Not the most efficient bulk mailer, but adequate for a small list. Cheers Jon -----Original Message----- From: Alex Black [mailto:[EMAIL PROTECTED]] Sent: 23 January 2001 21:12 To: [EMAIL PROTECTED] Subject: Re: [PHP] Sending a mail in HTML format that html mail class is fantastical :) _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] ("Jade Ohlhauser") > Newsgroups: php.general > Date: 23 Jan 2001 12:51:45 -0800 > Subject: Re: [PHP] Sending a mail in HTML format > > 1.that won't always display properly > 2.that doesn't allow for inline images > > To do it properly use MIME. Richard Heyes has already done all the hard work > for you: > http://www.zend.com/codex.php?id=103&single=1 > > ............. Jade Ohlhauser > [website architect]........... http://bandwidthplace.com > > > ----- Original Message ----- > From: "Kristi Russell" <[EMAIL PROTECTED]> > To: "Pascal Clerin" <[EMAIL PROTECTED]> > Cc: "php" <[EMAIL PROTECTED]> > Sent: Saturday, January 20, 2001 11:31 PM > Subject: Re: [PHP] Sending a mail in HTML format > > >> Nothing special, just add <html> at the beginning of what you're trying to >> send as HTML. Always worked for me? >> >> Kristi >> >> ----- Original Message ----- >> From: "Pascal Clerin" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Saturday, January 20, 2001 8:46 PM >> Subject: [PHP] Sending a mail in HTML format >> >> >>> Hello, >>> >>> I want to send a mail in HTML format with the mail() function. >>> I have tried to send html stuff in the message parameter, but when I > read >> it >>> in my hotmail account, I just see the html code and not what the html is >>> supposed to show. >>> I suppose that it is necessary to send some additional headers to > specify >> that >>> the mail is in html format. >>> Thanks for your help. >>> >>> Pascal >>> >>> ____________________________________________________________________ >>> Get free email and a permanent address at http://www.netaddress.com/?N=1 >>> >>> -- >>> PHP General Mailing List (http://www.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]
I got this quote right out of the php manual. My Id field happen to be type BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be error said "unidentified function". Any clue? ******************************************* mysql_insert_id() converts the return type of the native MySQL C API function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column has a column type of BIGINT, the value returned by mysql_insert_id() will be incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). ******************************************** Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
LAST_INSERT_ID() is a mySQL function, non PHP... in PHP you can use mysql_insert_id() which will return you what you the last inserted ID. Cheers, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 7:16 AM To: [EMAIL PROTECTED] Subject: [PHP] last_insert_id function I got this quote right out of the php manual. My Id field happen to be type BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be error said "unidentified function". Any clue? ******************************************* mysql_insert_id() converts the return type of the native MySQL C API function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column has a column type of BIGINT, the value returned by mysql_insert_id() will be incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). ******************************************** Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
for example: $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; now you have to insert into another table where you need to relate that user to the entry: $SQL2 = "INSERT INTO questions SET question='how did you sleep?', made_by=LAST_INSERT_ID()"; LAST_INSERT_ID() will be here equal to the auto_incremented id of the first $SQL statement. Hope this helps, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 7:16 AM To: [EMAIL PROTECTED] Subject: [PHP] last_insert_id function I got this quote right out of the php manual. My Id field happen to be type BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be error said "unidentified function". Any clue? ******************************************* mysql_insert_id() converts the return type of the native MySQL C API function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column has a column type of BIGINT, the value returned by mysql_insert_id() will be incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). ******************************************** Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
Someone jump in here and correct me if I'm wrong, but by the time you get around to executing the second query, LAST_INSERT_ID() from MySQL isn't necessarily going to be the desired value, because another record may well have been inserted in that time? On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > for example: > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > now you have to insert into another table where you need to relate that user > to the entry: > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > made_by=LAST_INSERT_ID()"; > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the first > $SQL statement. > > Hope this helps, > Maxim Maletsky > > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP] last_insert_id function > > > I got this quote right out of the php manual. My Id field happen to be type > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > error said "unidentified function". Any clue? > ******************************************* > mysql_insert_id() converts the return type of the native MySQL C API > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column > has a column type of BIGINT, the value returned by mysql_insert_id() will be > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > ******************************************** > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
So can I do either way as I show below here? first could be : $sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')"; $result = mysql_query($sql); $sql1 = "insert into userFriend (userId,friendName,) values(LAST_INSERT_ID(),'John');" $result1 = mysql_query($sql1); or second way is: $sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')"; $lastId = mysql_insert_id(); $result = mysql_query($sql); $sql1 = "insert into userFriend (userId,friendName,) values($lastId,'John');" $result1 = mysql_query($sql1); Are these correct? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 3:25 AM Subject: RE: [PHP] last_insert_id function > for example: > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > now you have to insert into another table where you need to relate that user > to the entry: > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > made_by=LAST_INSERT_ID()"; > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the first > $SQL statement. > > Hope this helps, > Maxim Maletsky > > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP] last_insert_id function > > > I got this quote right out of the php manual. My Id field happen to be type > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > error said "unidentified function". Any clue? > ******************************************* > mysql_insert_id() converts the return type of the native MySQL C API > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column > has a column type of BIGINT, the value returned by mysql_insert_id() will be > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > ******************************************** > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
no it will keep it very well. In fact most common errors with this function is that it still keeps the same value when you do something wrong. This issue is described in more details on every single manual that has LAST_INSERT_ID() in it - read where you found it ... it is written there ... I am sure ... However, on my opinion this function is very reliable. I use it a lot when have to create a script which splits some few huge tables into a dozen of well designed ones. Because redesigning the database you really have to relate your data to each other. LAST_INSERT_ID() does a good job. Cheers, Maxim Maletsky -----Original Message----- From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 5:28 AM To: Maxim Maletsky Cc: 'Jacky@lilst'; [EMAIL PROTECTED] Subject: RE: [PHP] last_insert_id function Someone jump in here and correct me if I'm wrong, but by the time you get around to executing the second query, LAST_INSERT_ID() from MySQL isn't necessarily going to be the desired value, because another record may well have been inserted in that time? On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > for example: > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > now you have to insert into another table where you need to relate that user > to the entry: > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > made_by=LAST_INSERT_ID()"; > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the first > $SQL statement. > > Hope this helps, > Maxim Maletsky > > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP] last_insert_id function > > > I got this quote right out of the php manual. My Id field happen to be type > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > error said "unidentified function". Any clue? > ******************************************* > mysql_insert_id() converts the return type of the native MySQL C API > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column > has a column type of BIGINT, the value returned by mysql_insert_id() will be > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > ******************************************** > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Yes, except that in the second case you first will have to do the insertion of $sql and then assign $lastId to mysql_insert_id(); Cheers, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 7:36 AM To: Maxim Maletsky; [EMAIL PROTECTED] Subject: Re: [PHP] last_insert_id function So can I do either way as I show below here? first could be : $sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')"; $result = mysql_query($sql); $sql1 = "insert into userFriend (userId,friendName,) values(LAST_INSERT_ID(),'John');" $result1 = mysql_query($sql1); or second way is: $sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')"; $lastId = mysql_insert_id(); $result = mysql_query($sql); $sql1 = "insert into userFriend (userId,friendName,) values($lastId,'John');" $result1 = mysql_query($sql1); Are these correct? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 3:25 AM Subject: RE: [PHP] last_insert_id function > for example: > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > now you have to insert into another table where you need to relate that user > to the entry: > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > made_by=LAST_INSERT_ID()"; > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the first > $SQL statement. > > Hope this helps, > Maxim Maletsky > > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP] last_insert_id function > > > I got this quote right out of the php manual. My Id field happen to be type > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > error said "unidentified function". Any clue? > ******************************************* > mysql_insert_id() converts the return type of the native MySQL C API > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column > has a column type of BIGINT, the value returned by mysql_insert_id() will be > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > ******************************************** > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
a thing to understand (just in case you didn't) that mysql_insert_id() must be called after mysql_query($sql) was made... otherwise how do we know the last id... ? Cheers, Maxim Maletsky -----Original Message----- From: Maxim Maletsky Sent: Wednesday, January 24, 2001 6:38 PM To: 'Jacky@lilst'; [EMAIL PROTECTED] Subject: RE: [PHP] last_insert_id function Yes, except that in the second case you first will have to do the insertion of $sql and then assign $lastId to mysql_insert_id(); Cheers, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 7:36 AM To: Maxim Maletsky; [EMAIL PROTECTED] Subject: Re: [PHP] last_insert_id function So can I do either way as I show below here? first could be : $sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')"; $result = mysql_query($sql); $sql1 = "insert into userFriend (userId,friendName,) values(LAST_INSERT_ID(),'John');" $result1 = mysql_query($sql1); or second way is: $sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')"; $lastId = mysql_insert_id(); $result = mysql_query($sql); $sql1 = "insert into userFriend (userId,friendName,) values($lastId,'John');" $result1 = mysql_query($sql1); Are these correct? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 3:25 AM Subject: RE: [PHP] last_insert_id function > for example: > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > now you have to insert into another table where you need to relate that user > to the entry: > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > made_by=LAST_INSERT_ID()"; > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the first > $SQL statement. > > Hope this helps, > Maxim Maletsky > > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP] last_insert_id function > > > I got this quote right out of the php manual. My Id field happen to be type > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > error said "unidentified function". Any clue? > ******************************************* > mysql_insert_id() converts the return type of the native MySQL C API > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column > has a column type of BIGINT, the value returned by mysql_insert_id() will be > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > ******************************************** > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > PHP General Mailing List (http://www.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]
Can we store the value retrieved by last_insert_id for later use? say we want to related 3 queries together and under that case, we will then need to store the first "last_insert_id value" somewhere and then retrive the second "last_insert_id value" from the second insert query before both values will be inserted into the third query. Can we do that? If not, I will have to come back to mysql_insert_id(); but it won't work with a field with data type BIGINT, will it? So I guess I would have to change the data type too, right? please enlighten me about this Thank Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Mark Lipscombe' <[EMAIL PROTECTED]> Cc: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 3:36 AM Subject: RE: [PHP] last_insert_id function > no it will keep it very well. In fact most common errors with this function > is that it still keeps the same value when you do something wrong. > > This issue is described in more details on every single manual that has > LAST_INSERT_ID() in it - read where you found it ... it is written there ... > I am sure ... > > However, on my opinion this function is very reliable. I use it a lot when > have to create a script which splits some few huge tables into a dozen of > well designed ones. Because redesigning the database you really have to > relate your data to each other. LAST_INSERT_ID() does a good job. > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 5:28 AM > To: Maxim Maletsky > Cc: 'Jacky@lilst'; [EMAIL PROTECTED] > Subject: RE: [PHP] last_insert_id function > > > Someone jump in here and correct me if I'm wrong, but by the time you > get around to executing the second query, LAST_INSERT_ID() from MySQL > isn't necessarily going to be the desired value, because another record > may well have been inserted in that time? > > On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > > for example: > > > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > > > now you have to insert into another table where you need to relate that > user > > to the entry: > > > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > > made_by=LAST_INSERT_ID()"; > > > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the > first > > $SQL statement. > > > > Hope this helps, > > Maxim Maletsky > > > > > > -----Original Message----- > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 7:16 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] last_insert_id function > > > > > > I got this quote right out of the php manual. My Id field happen to be > type > > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > > error said "unidentified function". Any clue? > > ******************************************* > > mysql_insert_id() converts the return type of the native MySQL C API > > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT > column > > has a column type of BIGINT, the value returned by mysql_insert_id() will > be > > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > > ******************************************** > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > > > -- > > PHP General Mailing List (http://www.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 am not really sure about this one, but the first thing I would do is that I would try it. It could be though ... Cheers, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 7:53 AM To: Maxim Maletsky; 'Mark Lipscombe' Cc: [EMAIL PROTECTED] Subject: Re: [PHP] last_insert_id function Can we store the value retrieved by last_insert_id for later use? say we want to related 3 queries together and under that case, we will then need to store the first "last_insert_id value" somewhere and then retrive the second "last_insert_id value" from the second insert query before both values will be inserted into the third query. Can we do that? If not, I will have to come back to mysql_insert_id(); but it won't work with a field with data type BIGINT, will it? So I guess I would have to change the data type too, right? please enlighten me about this Thank Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Mark Lipscombe' <[EMAIL PROTECTED]> Cc: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 3:36 AM Subject: RE: [PHP] last_insert_id function > no it will keep it very well. In fact most common errors with this function > is that it still keeps the same value when you do something wrong. > > This issue is described in more details on every single manual that has > LAST_INSERT_ID() in it - read where you found it ... it is written there ... > I am sure ... > > However, on my opinion this function is very reliable. I use it a lot when > have to create a script which splits some few huge tables into a dozen of > well designed ones. Because redesigning the database you really have to > relate your data to each other. LAST_INSERT_ID() does a good job. > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 5:28 AM > To: Maxim Maletsky > Cc: 'Jacky@lilst'; [EMAIL PROTECTED] > Subject: RE: [PHP] last_insert_id function > > > Someone jump in here and correct me if I'm wrong, but by the time you > get around to executing the second query, LAST_INSERT_ID() from MySQL > isn't necessarily going to be the desired value, because another record > may well have been inserted in that time? > > On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > > for example: > > > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > > > now you have to insert into another table where you need to relate that > user > > to the entry: > > > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > > made_by=LAST_INSERT_ID()"; > > > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the > first > > $SQL statement. > > > > Hope this helps, > > Maxim Maletsky > > > > > > -----Original Message----- > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 7:16 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] last_insert_id function > > > > > > I got this quote right out of the php manual. My Id field happen to be > type > > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > > error said "unidentified function". Any clue? > > ******************************************* > > mysql_insert_id() converts the return type of the native MySQL C API > > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT > column > > has a column type of BIGINT, the value returned by mysql_insert_id() will > be > > incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). > > ******************************************** > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > > > -- > > PHP General Mailing List (http://www.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]
Hi, Anyway, as far as I know, mysql_insert_id() is just a PHP implementation calling the exact same code as mySQL's internal last_insert_id() function; except for the drawback with the BIGINT thing, the functionality should be exactly the same for both. "Maxim Maletsky" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > I am not really sure about this one, but the first thing I would do is that > I would try it. > > It could be though ... > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:53 AM > To: Maxim Maletsky; 'Mark Lipscombe' > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] last_insert_id function > > > Can we store the value retrieved by last_insert_id for later use? say we > want to related 3 queries together and under that case, we will then need to > store the first "last_insert_id value" somewhere and then retrive the second > "last_insert_id value" from the second insert query before both values will > be inserted into the third query. > Can we do that? If not, I will have to come back to mysql_insert_id(); but > it won't work with a field with data type BIGINT, will it? So I guess I > would have to change the data type too, right? > please enlighten me about this > Thank > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Maxim Maletsky <[EMAIL PROTECTED]> > To: 'Mark Lipscombe' <[EMAIL PROTECTED]> > Cc: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 3:36 AM > Subject: RE: [PHP] last_insert_id function > > > > no it will keep it very well. In fact most common errors with this > function > > is that it still keeps the same value when you do something wrong. > > > > This issue is described in more details on every single manual that has > > LAST_INSERT_ID() in it - read where you found it ... it is written there > ... > > I am sure ... > > > > However, on my opinion this function is very reliable. I use it a lot when > > have to create a script which splits some few huge tables into a dozen of > > well designed ones. Because redesigning the database you really have to > > relate your data to each other. LAST_INSERT_ID() does a good job. > > > > Cheers, > > Maxim Maletsky > > > > -----Original Message----- > > From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 5:28 AM > > To: Maxim Maletsky > > Cc: 'Jacky@lilst'; [EMAIL PROTECTED] > > Subject: RE: [PHP] last_insert_id function > > > > > > Someone jump in here and correct me if I'm wrong, but by the time you > > get around to executing the second query, LAST_INSERT_ID() from MySQL > > isn't necessarily going to be the desired value, because another record > > may well have been inserted in that time? > > > > On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > > > for example: > > > > > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > > > > > now you have to insert into another table where you need to relate that > > user > > > to the entry: > > > > > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > > > made_by=LAST_INSERT_ID()"; > > > > > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the > > first > > > $SQL statement. > > > > > > Hope this helps, > > > Maxim Maletsky > > > > > > > > > -----Original Message----- > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, January 25, 2001 7:16 AM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] last_insert_id function > > > > > > > > > I got this quote right out of the php manual. My Id field happen to be > > type > > > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > > > error said "unidentified function". Any clue? > > > ******************************************* > > > mysql_insert_id() converts the return type of the native MySQL C API > > > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT > > column > > > has a column type of BIGINT, the value returned by mysql_insert_id() > will > > be > > > incorrect. Instead, use the internal MySQL SQL function > LAST_INSERT_ID(). > > > ******************************************** > > > Jack > > > [EMAIL PROTECTED] > > > "There is nothing more rewarding than reaching the goal you set for > > > yourself" > > > > > > -- > > > PHP General Mailing List (http://www.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] >
On 24-Jan-01 Mark Lipscombe wrote: > Someone jump in here and correct me if I'm wrong, but by the time you > get around to executing the second query, LAST_INSERT_ID() from MySQL > isn't necessarily going to be the desired value, because another record > may well have been inserted in that time? You're wrong; from the manual: " ... The last ID that was generated is maintained in the server on a per-connection basis. It will not be changed by another client. " Regards, -- Don Read [EMAIL PROTECTED] -- The problem with people who have no vices is that you can be sure they're going to have some pretty annoying virtues.
Hi, Is it at all possible, no matter how much trickery and such involved, to do something similar to popen(), but bi-directional? Thanks, Mark
> Is it at all possible, no matter how much trickery and such involved, to > do something similar to popen(), but bi-directional? The user-contributed notes indicate that popen() *is* bi-directional for those OSes that support them... Meanwhile, if yours doesn't, you could maybe wrangle something into http://php.net/fsockopen to work... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
""Benny Nissen"" <[EMAIL PROTECTED]> wrote in message 94k0ql$em$[EMAIL PROTECTED]">news:94k0ql$em$[EMAIL PROTECTED]... > Hi All > > I have tried to get this to work but it does not produce any output in the > browser - why > > $i = 1; > while ($i) > { > if(connection_aborted()) > break; > > echo $i; > echo "<BR>"; > $i++; > > sleep(1); > //usleep(1000); > } > If you're trying to get a delayed output affect (which isn't recommended, but would probably work in this case as long as you're not inside a table), you'll either need to do: ob_implicit_flush(1); // at the beginning of the script (use 0 to turn it back off) or: flush(); // after the echo and before the sleep. Side note: When you're using PHP for shell scripts (Don't look at me like that) and the like, ob_implicit_flush is your friend. -- - Daniel Grace <http://dewin.oldbattery.com/> "Space may be the final frontier but its made in a Hollywood basement." - Red Hot Chili Peppers - Californication
The online manual has some working examples Also, using the socket funcs in Php isn't very different from using them in C - try searching www.google.com if the examples in the manual aren't enough jason ----- Original Message ----- From: "Boget, Chris" <[EMAIL PROTECTED]> To: "Php (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 8:00 AM Subject: [PHP] Sockets > Are there any tutorials on how to use Sockets in PHP? > If so, where can I find them? I've looked on several of > the sites that are linked from the main php.net site but > found nothing... :/ > > Thanks. > > Chris >
Hi, I have a page with a couple of form fields that are being POSTed to a processing PHP script. The page that contains these form fields is itself a PHP page that uses sessions and so on. I have to make "server-side data validation" on the fields because of their complexity. When the user hits submit and comes to the result page, if there was any error I ask the user to go back to the form and correct the mistakes, using either his browser BACK button or by clicking on a link that does a javascript:history.back(). The problem is, when the user gets back to the form page, all of the values he had typed in are gone, and he has to start all over again. Does anyone have an idea why this is so, and how to circumvent it without saving the user data into a session variable and then setting it back again once the user hits the form page again ? I have seen many pages where your previous data would stay in the form after you make a "Back" operation, but here, it disappears. Thanks for any ideas, and have a very nice day.
Try the "GET" method in the form. Jaks ----- Original Message ----- From: Alain Fontaine <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 2:11 AM Subject: [PHP] Form data is not "remembered" > Hi, > > I have a page with a couple of form fields that are being POSTed to a > processing PHP script. The page that contains these form fields is itself a > PHP page that uses sessions and so on. > > I have to make "server-side data validation" on the fields because of their > complexity. When the user hits submit and comes to the result page, if there > was any error I ask the user to go back to the form and correct the > mistakes, using either his browser BACK button or by clicking on a link that > does a javascript:history.back(). > > The problem is, when the user gets back to the form page, all of the values > he had typed in are gone, and he has to start all over again. Does anyone > have an idea why this is so, and how to circumvent it without saving the > user data into a session variable and then setting it back again once the > user hits the form page again ? I have seen many pages where your previous > data would stay in the form after you make a "Back" operation, but here, it > disappears. > > Thanks for any ideas, and have a very nice day. > > > > -- > PHP General Mailing List (http://www.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, Thanks for the hint, but using GET method doesn't change anything, unfortunately. "Klepto" <[EMAIL PROTECTED]> a écrit dans le message news: 001401c085f2$3c8801a0$[EMAIL PROTECTED] > Try the "GET" method in the form. > > Jaks > ----- Original Message ----- > From: Alain Fontaine <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 2:11 AM > Subject: [PHP] Form data is not "remembered" > > > > Hi, > > > > I have a page with a couple of form fields that are being POSTed to a > > processing PHP script. The page that contains these form fields is itself > a > > PHP page that uses sessions and so on. > > > > I have to make "server-side data validation" on the fields because of > their > > complexity. When the user hits submit and comes to the result page, if > there > > was any error I ask the user to go back to the form and correct the > > mistakes, using either his browser BACK button or by clicking on a link > that > > does a javascript:history.back(). > > > > The problem is, when the user gets back to the form page, all of the > values > > he had typed in are gone, and he has to start all over again. Does anyone > > have an idea why this is so, and how to circumvent it without saving the > > user data into a session variable and then setting it back again once the > > user hits the form page again ? I have seen many pages where your previous > > data would stay in the form after you make a "Back" operation, but here, > it > > disappears. > > > > Thanks for any ideas, and have a very nice day. > > > > > > > > -- > > PHP General Mailing List (http://www.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] >
At 2:41 AM -0800 1/24/01, Klepto wrote: >Try the "GET" method in the form. > >Jaks >----- Original Message ----- >From: Alain Fontaine <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, January 24, 2001 2:11 AM >Subject: [PHP] Form data is not "remembered" > > >> Hi, >> >> I have a page with a couple of form fields that are being POSTed to a >> processing PHP script. The page that contains these form fields is itself >a >> PHP page that uses sessions and so on. >> >> I have to make "server-side data validation" on the fields because of >their >> complexity. When the user hits submit and comes to the result page, if >there >> was any error I ask the user to go back to the form and correct the >> mistakes, using either his browser BACK button or by clicking on a link >that >> does a javascript:history.back(). >> >> The problem is, when the user gets back to the form page, all of the >values >> he had typed in are gone, and he has to start all over again. Does anyone >> have an idea why this is so, and how to circumvent it without saving the >> user data into a session variable and then setting it back again once the >> user hits the form page again ? I have seen many pages where your previous >> data would stay in the form after you make a "Back" operation, but here, >it > > disappears. > > Some browsers will save the entered info when you hit the BACK button, some won't; it also depends on your HTTP header settings (no-cache, must-revalidate, etc.). Probably bad idea to rely on that. In a nutshell, if your validation fails, don't tell the user to hit the back button. Instead, redisplay the form with the data fields already filled in. I usually write my form display & process programs something like this (assuming $Submit is the name attribute of the submit button): ... if ($Submit = 'Enter your data') { $ErrorList = validate_form_data(); if (is_array($ErrorList)) { show_form($ErrorList); } else { process_data(); } } else { show_form(); } ... Where: validate_form_data is a function that returns an array of error messages like $ErrorList[<form field name>] = <error message>, or FALSE if all tests passed. If there are errors, I redisplay the form with entered data (from $HTTP_POST_VARS or wherever), and error messages displayed alongside the appropriate form fields. show_form displays the entry form, with any existing data (from HTTP_POST_VARS, etc.) filled in and error messages, if any, displayed. Basically, the FORM tag action attribute refers to the same program as displayed the form - that is, $PHP_SELF. Hope this is clear...I getting tired, and I don't even think an intravenous drip of concentrated Mountain Dew syrup will help. - steve -- +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
If the form page is not being cached, it would probably get reloaded when they clicked back, thus losing the data. I'd suggest redrawing the form with the fields populated and with the appropriate error messages. Then you don't need to mess with caches or sessions for that matter, and the user doesn't need to take an extra step to get back to the form. Alain Fontaine wrote: > > Hi, > > I have a page with a couple of form fields that are being POSTed to a > processing PHP script. The page that contains these form fields is itself a > PHP page that uses sessions and so on. > > I have to make "server-side data validation" on the fields because of their > complexity. When the user hits submit and comes to the result page, if there > was any error I ask the user to go back to the form and correct the > mistakes, using either his browser BACK button or by clicking on a link that > does a javascript:history.back(). > > The problem is, when the user gets back to the form page, all of the values > he had typed in are gone, and he has to start all over again. Does anyone > have an idea why this is so, and how to circumvent it without saving the > user data into a session variable and then setting it back again once the > user hits the form page again ? I have seen many pages where your previous > data would stay in the form after you make a "Back" operation, but here, it > disappears. > > Thanks for any ideas, and have a very nice day. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Monte Ohrt <[EMAIL PROTECTED]> http://www.ispi.net/
Hi Richard, thank you for your answer: >> When calling the php4 code below, sometimes the browser receives >> -the "HTML estandar text" >> -sometimes the "Text generated from PHP" (but NEVER both!) >> -and ocassionaly the error: >> "Warning: fopen("php://stdout","w") - Bad file descriptor in >> /home/sites/site74/web/_proc/pruebas/stdout-test.php on line 7 >> unable to open device" > >I actually was getting prompted to download the .php file sometimes... > >That was a known bug with an earlier release of PHP4 under high load, I >think... Or maybe that was the one where turning the engine on/off in >different domains was messing up?... Or maybe both conditions had to be >true. > >Meanwhile, not sure how fopen() is involved. > >Maybe try whatever corresponds to stdout on your OS, be it "/dev/0" or >"/dev/stdout" or whatever -- Just to see if you can duplicate it with the >normal file-system stuff. I tried "/dev/stdout" as the manual states, but I get an error in PHP4 (I think it works for PHP3). Even in Windows similar behaviour occurs. > >And try the same thing with some other files/pages etc. > The same occurs with other files. >One thing that occurs to me -- stdout starts off by being the browser, so >it's kinda funky to open it -- You've already got it open... I *think* it >really only makes sense to fopen() stdout from the command line. At least, >I'm not clear on what it would mean to open it from a HTTP environment... You may be right, it's quite weird. The use it was intended for was to generate an HTML page on the fly or a static one, according to certain conditions. > >-- >Visit the Zend Store at http://www.zend.com/store/ >Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm >Volunteer a little time: http://chatmusic.com/volunteer.htm -- Saludos, Rubén Blanco. ______________________________________________________ A r t e k - 928.52.20.77 - http://www.artek.es
> I actually was getting prompted to download the .php file sometimes... So, the user would be able to open the file in, say, VI and see your code? Big security hole, no? Of which versions of php4 was this characteristic? Dotan Cohen ------------------------------------------- MySQL php4 50 megs $9.99 http://TerribleHost.com -------------------------------------------
I did try already. What I did was I assign value from LAST_INSERT_ID(); onto a virable after I run the first insert query the same way we do to mysql_insert_id and the result when the page is executed, it said " unidentified function" which of course because php does not know LAST_INSERT_ID like you said previously. By the way, what even drive me crazy more is that with using mysql_insert_id();, it returns me value 0 (zero) which I suspected it comes from the fact that data type of that field is BIGINT, correct me if I'm wrong. any thought? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Jacky@lilst' <[EMAIL PROTECTED]>; 'Mark Lipscombe' <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 4:06 AM Subject: RE: [PHP] last_insert_id function > I am not really sure about this one, but the first thing I would do is that > I would try it. > > It could be though ... > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 7:53 AM > To: Maxim Maletsky; 'Mark Lipscombe' > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] last_insert_id function > > > Can we store the value retrieved by last_insert_id for later use? say we > want to related 3 queries together and under that case, we will then need to > store the first "last_insert_id value" somewhere and then retrive the second > "last_insert_id value" from the second insert query before both values will > be inserted into the third query. > Can we do that? If not, I will have to come back to mysql_insert_id(); but > it won't work with a field with data type BIGINT, will it? So I guess I > would have to change the data type too, right? > please enlighten me about this > Thank > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Maxim Maletsky <[EMAIL PROTECTED]> > To: 'Mark Lipscombe' <[EMAIL PROTECTED]> > Cc: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 3:36 AM > Subject: RE: [PHP] last_insert_id function > > > > no it will keep it very well. In fact most common errors with this > function > > is that it still keeps the same value when you do something wrong. > > > > This issue is described in more details on every single manual that has > > LAST_INSERT_ID() in it - read where you found it ... it is written there > ... > > I am sure ... > > > > However, on my opinion this function is very reliable. I use it a lot when > > have to create a script which splits some few huge tables into a dozen of > > well designed ones. Because redesigning the database you really have to > > relate your data to each other. LAST_INSERT_ID() does a good job. > > > > Cheers, > > Maxim Maletsky > > > > -----Original Message----- > > From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 5:28 AM > > To: Maxim Maletsky > > Cc: 'Jacky@lilst'; [EMAIL PROTECTED] > > Subject: RE: [PHP] last_insert_id function > > > > > > Someone jump in here and correct me if I'm wrong, but by the time you > > get around to executing the second query, LAST_INSERT_ID() from MySQL > > isn't necessarily going to be the desired value, because another record > > may well have been inserted in that time? > > > > On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > > > for example: > > > > > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > > > > > now you have to insert into another table where you need to relate that > > user > > > to the entry: > > > > > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > > > made_by=LAST_INSERT_ID()"; > > > > > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the > > first > > > $SQL statement. > > > > > > Hope this helps, > > > Maxim Maletsky > > > > > > > > > -----Original Message----- > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, January 25, 2001 7:16 AM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] last_insert_id function > > > > > > > > > I got this quote right out of the php manual. My Id field happen to be > > type > > > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to be > > > error said "unidentified function". Any clue? > > > ******************************************* > > > mysql_insert_id() converts the return type of the native MySQL C API > > > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT > > column > > > has a column type of BIGINT, the value returned by mysql_insert_id() > will > > be > > > incorrect. Instead, use the internal MySQL SQL function > LAST_INSERT_ID(). > > > ******************************************** > > > Jack > > > [EMAIL PROTECTED] > > > "There is nothing more rewarding than reaching the goal you set for > > > yourself" > > > > > > -- > > > PHP General Mailing List (http://www.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] >
Hi, To use mySQL's internal function, try something like this: mysql_query("insert into mytable values(1,2,3)"); $rs = mysql_query("select LAST_INSERT_ID() from mytable"); $theLastInsertedID = mysql_result($rs,0,0); ""Jacky@lilst"" <[EMAIL PROTECTED]> a écrit dans le message news: 05f701c0865b$a2fe61e0$[EMAIL PROTECTED] > I did try already. > What I did was I assign value from LAST_INSERT_ID(); onto a virable after I > run the first insert query the same way we do to mysql_insert_id > and the result when the page is executed, it said " unidentified function" > which of course because php does not know LAST_INSERT_ID like you said > previously. > By the way, what even drive me crazy more is that with using > mysql_insert_id();, it returns me value 0 (zero) which I suspected it comes > from the fact that data type of that field is BIGINT, correct me if I'm > wrong. > any thought? > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Maxim Maletsky <[EMAIL PROTECTED]> > To: 'Jacky@lilst' <[EMAIL PROTECTED]>; 'Mark Lipscombe' > <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 4:06 AM > Subject: RE: [PHP] last_insert_id function > > > > I am not really sure about this one, but the first thing I would do is > that > > I would try it. > > > > It could be though ... > > > > Cheers, > > Maxim Maletsky > > > > -----Original Message----- > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 7:53 AM > > To: Maxim Maletsky; 'Mark Lipscombe' > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] last_insert_id function > > > > > > Can we store the value retrieved by last_insert_id for later use? say we > > want to related 3 queries together and under that case, we will then need > to > > store the first "last_insert_id value" somewhere and then retrive the > second > > "last_insert_id value" from the second insert query before both values > will > > be inserted into the third query. > > Can we do that? If not, I will have to come back to mysql_insert_id(); but > > it won't work with a field with data type BIGINT, will it? So I guess I > > would have to change the data type too, right? > > please enlighten me about this > > Thank > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > ----- Original Message ----- > > From: Maxim Maletsky <[EMAIL PROTECTED]> > > To: 'Mark Lipscombe' <[EMAIL PROTECTED]> > > Cc: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Wednesday, January 24, 2001 3:36 AM > > Subject: RE: [PHP] last_insert_id function > > > > > > > no it will keep it very well. In fact most common errors with this > > function > > > is that it still keeps the same value when you do something wrong. > > > > > > This issue is described in more details on every single manual that has > > > LAST_INSERT_ID() in it - read where you found it ... it is written there > > ... > > > I am sure ... > > > > > > However, on my opinion this function is very reliable. I use it a lot > when > > > have to create a script which splits some few huge tables into a dozen > of > > > well designed ones. Because redesigning the database you really have to > > > relate your data to each other. LAST_INSERT_ID() does a good job. > > > > > > Cheers, > > > Maxim Maletsky > > > > > > -----Original Message----- > > > From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, January 25, 2001 5:28 AM > > > To: Maxim Maletsky > > > Cc: 'Jacky@lilst'; [EMAIL PROTECTED] > > > Subject: RE: [PHP] last_insert_id function > > > > > > > > > Someone jump in here and correct me if I'm wrong, but by the time you > > > get around to executing the second query, LAST_INSERT_ID() from MySQL > > > isn't necessarily going to be the desired value, because another record > > > may well have been inserted in that time? > > > > > > On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > > > > for example: > > > > > > > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > > > > > > > now you have to insert into another table where you need to relate > that > > > user > > > > to the entry: > > > > > > > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > > > > made_by=LAST_INSERT_ID()"; > > > > > > > > LAST_INSERT_ID() will be here equal to the auto_incremented id of the > > > first > > > > $SQL statement. > > > > > > > > Hope this helps, > > > > Maxim Maletsky > > > > > > > > > > > > -----Original Message----- > > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, January 25, 2001 7:16 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP] last_insert_id function > > > > > > > > > > > > I got this quote right out of the php manual. My Id field happen to be > > > type > > > > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out to > be > > > > error said "unidentified function". Any clue? > > > > ******************************************* > > > > mysql_insert_id() converts the return type of the native MySQL C API > > > > function mysql_insert_id() to a type of long. If your AUTO_INCREMENT > > > column > > > > has a column type of BIGINT, the value returned by mysql_insert_id() > > will > > > be > > > > incorrect. Instead, use the internal MySQL SQL function > > LAST_INSERT_ID(). > > > > ******************************************** > > > > Jack > > > > [EMAIL PROTECTED] > > > > "There is nothing more rewarding than reaching the goal you set for > > > > yourself" > > > > > > > > -- > > > > PHP General Mailing List (http://www.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] >
> Everyone has their favorite editor, and FWIW mine is editplus. I've > programmed for almost 20 years with many different editors and in > my opinion, this is the best editor I've ever used. It works > great with PHP. > www.editplus.com I use PHPED (www.phped.com). It has some bugs but I like it. What is important that it has online manual (F1 clicked on word you search for) -- Piotr Duszynski http://www.softomat.com.pl http://filmomat.3miasto.pl http://www.3miasto.pl
Hi, I would like to know if anybody has had any luck in writing a PHP module, that uses an external (C) library, using ext_skel, buildconf/phpize... I've been reading the apidocs as well as "Web Application Development with PHP 4.0" but I still can't get it to work.. The problem is that allthough PHP is willing to load the compiled (PHP) module it can't find any of the functions provided by the external library.... What is wrong? When I try to use the library from a plain C-program there are no problems...Only when I try to use it from my PHP module... After 3½ day with the same stupid problem I am borderline crazy and beginning to get REALLY fed up with PHP ;-) Could it be a bug in the ext_skel "and friends" utilities??? Any suggestions will be greatly appreciated... Thanks Thomas
> After 3½ day with the same stupid problem I am borderline crazy and > beginning to get REALLY fed up with PHP ;-) > Could it be a bug in the ext_skel "and friends" utilities??? No, they work quite well. Try going to http://conf.php.net and pick the New York Linuxworld Advanced presentation near the bottom. Then go to slide #26. This is a walkthrough of building a simple extension which adds functions for the external libstocks.a library (http://libstocks.sourceforge.net/) Grab the library and try each step and see if you get a working extension at the end of it. I have actually given this talk a couple of times and performed each step right in front of everybody and ended up with a perfectly working extension. -Rasmus
Hi guys! I'm working on an NT workstation, i used to work with asp, but i heard a lot about php! that i decided to start working with it ! so i'm using PWS4 and i'm wondering which free php editor is more suitible for me ? and also what links to get free more tutorials, i got one of phpnet but still .... Regards _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Here is collection I got from this list; www.editplus.com www.codecharge.com www.phpedit.com www.ultraedit.com NOBBY ----- Original Message ----- From: kaab kaoutar <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 4:28 PM Subject: [PHP] Beginner in php! > Hi guys! > > I'm working on an NT workstation, i used to work with asp, but i heard a lot > about php! that i decided to start working with it ! > so i'm using PWS4 and i'm wondering which free php editor is more suitible > for me ? and also what links to get free more tutorials, i got one of phpnet > but still .... > > Regards > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi, welcome to the wonderful world of PHP... <grin> You can use any text editor you like to write your PHP, my personal favourite is EditPlus 2 (www.editplus.com), but this is holy war territory so try a few out and see which one you get on with best. There are loads of great tutorials all over the www, IMHO you could do a lot worse than starting off at Webmonkey (http://hotwired.lycos.com/webmonkey/programming/php/) where there are a shedload of articles to do with loads of different aspects of PHP. If you're using NT Workstation and you're currently stuck with PWS (a big pile of sh*te), you might want to have a look at Apache (www.apache.org) which is considerably better. For databases, I'd heartily recommend MySQL (www.mysql.com). This combination - Apache/PHP/MySQL - is used by a huge number of websites and the support is superb from the open source community. The best thing about the whole lot is it's easy to persuade management to go for projects where the overall price tag is £0.00! HTH Jon -----Original Message----- From: kaab kaoutar [mailto:[EMAIL PROTECTED]] Sent: 24 January 2001 10:29 To: [EMAIL PROTECTED] Subject: [PHP] Beginner in php! Hi guys! I'm working on an NT workstation, i used to work with asp, but i heard a lot about php! that i decided to start working with it ! so i'm using PWS4 and i'm wondering which free php editor is more suitible for me ? and also what links to get free more tutorials, i got one of phpnet but still .... Regards _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi, could you tell me how to save image created ( with ImageCreate , and other stuff ..), there is any SaveImageAs... or something like that ? Do you know where can I find tutorials about creating, using thumb nails? Thanks your time... Miguel Loureiro < [EMAIL PROTECTED] > ENJOY LIFE...
Don't you have to do something like this? $something = mysql_query("into mytable....."); $result = mysql_query($something); $rs = mysql_query("select LAST_INSERT_ID() from mytable"); $theLastInsertedID = mysql_result($rs,0,0); corerct? Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Alain Fontaine <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 4:18 AM > Subject: Re: [PHP] last_insert_id function: I did already > > > > Hi, > > > > To use mySQL's internal function, try something like this: > > > > mysql_query("insert into mytable values(1,2,3)"); > > $rs = mysql_query("select LAST_INSERT_ID() from mytable"); > > $theLastInsertedID = mysql_result($rs,0,0); > > > > ""Jacky@lilst"" <[EMAIL PROTECTED]> a écrit dans le message news: > > 05f701c0865b$a2fe61e0$[EMAIL PROTECTED] > > > I did try already. > > > What I did was I assign value from LAST_INSERT_ID(); onto a virable > after > > I > > > run the first insert query the same way we do to mysql_insert_id > > > and the result when the page is executed, it said " unidentified > function" > > > which of course because php does not know LAST_INSERT_ID like you said > > > previously. > > > By the way, what even drive me crazy more is that with using > > > mysql_insert_id();, it returns me value 0 (zero) which I suspected it > > comes > > > from the fact that data type of that field is BIGINT, correct me if I'm > > > wrong. > > > any thought? > > > Jack > > > [EMAIL PROTECTED] > > > "There is nothing more rewarding than reaching the goal you set for > > > yourself" > > > ----- Original Message ----- > > > From: Maxim Maletsky <[EMAIL PROTECTED]> > > > To: 'Jacky@lilst' <[EMAIL PROTECTED]>; 'Mark Lipscombe' > > > <[EMAIL PROTECTED]> > > > Cc: <[EMAIL PROTECTED]> > > > Sent: Wednesday, January 24, 2001 4:06 AM > > > Subject: RE: [PHP] last_insert_id function > > > > > > > > > > I am not really sure about this one, but the first thing I would do is > > > that > > > > I would try it. > > > > > > > > It could be though ... > > > > > > > > Cheers, > > > > Maxim Maletsky > > > > > > > > -----Original Message----- > > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, January 25, 2001 7:53 AM > > > > To: Maxim Maletsky; 'Mark Lipscombe' > > > > Cc: [EMAIL PROTECTED] > > > > Subject: Re: [PHP] last_insert_id function > > > > > > > > > > > > Can we store the value retrieved by last_insert_id for later use? say > we > > > > want to related 3 queries together and under that case, we will then > > need > > > to > > > > store the first "last_insert_id value" somewhere and then retrive the > > > second > > > > "last_insert_id value" from the second insert query before both values > > > will > > > > be inserted into the third query. > > > > Can we do that? If not, I will have to come back to mysql_insert_id(); > > but > > > > it won't work with a field with data type BIGINT, will it? So I guess > I > > > > would have to change the data type too, right? > > > > please enlighten me about this > > > > Thank > > > > Jack > > > > [EMAIL PROTECTED] > > > > "There is nothing more rewarding than reaching the goal you set for > > > > yourself" > > > > ----- Original Message ----- > > > > From: Maxim Maletsky <[EMAIL PROTECTED]> > > > > To: 'Mark Lipscombe' <[EMAIL PROTECTED]> > > > > Cc: 'Jacky@lilst' <[EMAIL PROTECTED]>; > > <[EMAIL PROTECTED]> > > > > Sent: Wednesday, January 24, 2001 3:36 AM > > > > Subject: RE: [PHP] last_insert_id function > > > > > > > > > > > > > no it will keep it very well. In fact most common errors with this > > > > function > > > > > is that it still keeps the same value when you do something wrong. > > > > > > > > > > This issue is described in more details on every single manual that > > has > > > > > LAST_INSERT_ID() in it - read where you found it ... it is written > > there > > > > ... > > > > > I am sure ... > > > > > > > > > > However, on my opinion this function is very reliable. I use it a > lot > > > when > > > > > have to create a script which splits some few huge tables into a > dozen > > > of > > > > > well designed ones. Because redesigning the database you really have > > to > > > > > relate your data to each other. LAST_INSERT_ID() does a good job. > > > > > > > > > > Cheers, > > > > > Maxim Maletsky > > > > > > > > > > -----Original Message----- > > > > > From: Mark Lipscombe [mailto:[EMAIL PROTECTED]] > > > > > Sent: Thursday, January 25, 2001 5:28 AM > > > > > To: Maxim Maletsky > > > > > Cc: 'Jacky@lilst'; [EMAIL PROTECTED] > > > > > Subject: RE: [PHP] last_insert_id function > > > > > > > > > > > > > > > Someone jump in here and correct me if I'm wrong, but by the time > you > > > > > get around to executing the second query, LAST_INSERT_ID() from > MySQL > > > > > isn't necessarily going to be the desired value, because another > > record > > > > > may well have been inserted in that time? > > > > > > > > > > On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote: > > > > > > for example: > > > > > > > > > > > > $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'"; > > > > > > > > > > > > now you have to insert into another table where you need to relate > > > that > > > > > user > > > > > > to the entry: > > > > > > > > > > > > $SQL2 = "INSERT INTO questions SET question='how did you sleep?', > > > > > > made_by=LAST_INSERT_ID()"; > > > > > > > > > > > > LAST_INSERT_ID() will be here equal to the auto_incremented id of > > the > > > > > first > > > > > > $SQL statement. > > > > > > > > > > > > Hope this helps, > > > > > > Maxim Maletsky > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > > > > > > Sent: Thursday, January 25, 2001 7:16 AM > > > > > > To: [EMAIL PROTECTED] > > > > > > Subject: [PHP] last_insert_id function > > > > > > > > > > > > > > > > > > I got this quote right out of the php manual. My Id field happen > to > > be > > > > > type > > > > > > BIGINT as it said so I tried using LAST_INSERT_ID(); and turn out > > to > > > be > > > > > > error said "unidentified function". Any clue? > > > > > > ******************************************* > > > > > > mysql_insert_id() converts the return type of the native MySQL C > API > > > > > > function mysql_insert_id() to a type of long. If your > AUTO_INCREMENT > > > > > column > > > > > > has a column type of BIGINT, the value returned by > mysql_insert_id() > > > > will > > > > > be > > > > > > incorrect. Instead, use the internal MySQL SQL function > > > > LAST_INSERT_ID(). > > > > > > ******************************************** > > > > > > Jack > > > > > > [EMAIL PROTECTED] > > > > > > "There is nothing more rewarding than reaching the goal you set > for > > > > > > yourself" > > > > > > > > > > > > -- > > > > > > PHP General Mailing List (http://www.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] > > >
Hello, I getting dificulties with an updating records procedure: like I have an Auto-Increment field I try to use the REPLACE (but without the the auto-increment I tried also UPDATE). I checked also the variables with an echo, and also all the usual things I could imagine... Now I am quite desperate. Here you are my code. Thanks to evrybody Marc $connect = mysql_connect(xxxxxx); or die ("dBase not connect.") $db = mysql_select_db("dBASE", $connect) or die ("dBase not select."); $total_price = $qty * $price; $date = date("Y-m-d"); $sql = "REPLACE CLIENT SET ID = \"$id\", ITEM = \"$item\", TITLE =\"$title\", AUTHOR = \"$author\", PUBLISHER = \"$publisher\", DELIVERY = \"$delivery\", QTY = qty\", PRICE = \"$price\", TOTAL_PRICE = \"$total_price\", DATE = \"$date\", RECORD\"$record\" WHERE RECORD = \"$record\""; $sql_result = mysql_query($sql,$connect) or die ("Couldn't update!");
> I getting dificulties with an updating records procedure: like I have an > Auto-Increment field I try to use the REPLACE (but without the the > auto-increment I tried also UPDATE). I checked also the variables with > an echo, and also all the usual things I could imagine... What goes wrong?... #> $sql_result = mysql_query($sql,$connect) or die ("Couldn't update!"); $sql_result = mysql_query($sql,$connect) or die(mysql_error()); -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: <snip> > $connect = mysql_connect(xxxxxx); or die ("dBase not connect.") <snip> > $sql = "REPLACE CLIENT SET ID = \"$id\", ITEM = \"$item\", TITLE > =\"$title\", AUTHOR = \"$author\", PUBLISHER = \"$publisher\", DELIVERY > = \"$delivery\", QTY = qty\", PRICE = \"$price\", TOTAL_PRICE = > \"$total_price\", DATE = \"$date\", RECORD\"$record\" WHERE RECORD = > \"$record\""; Check the manual at mysql.com for the "REPLACE" syntax. It's used like "INSERT", not "UPDATE". -- CC
On Tuesday 23 January 2001 22:03, Gerry wrote: > All I need is to be able to learn how to load everything from a script > and how to call the script with a URL to the directory. > eg. <? if (Yarns/) > { > include "header,nav, fetch content,footer"; > else "?"; > } > ?> > > <a href="http://mysite.com/Yarns/"> Yarns</a> Read http://www.phpbuilder.com/columns/tim19990117.php3 Basically you create "virtual directories", e.g. a PHP script named "Yarns" which simply include()s your one "real" script. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra
I don't know if it'll help but here my bit of the php.ini: session.save_handler = files ; handler used to store/retrieve data session.save_path = C:\Programme\Apache Group\Apache\cgi-bin\php4\sessiondata ; argument passed to save_handler ; in the case of files, this is the ; path where data files are stored session.use_cookies = 1 ; whether to use cookies session.name = PHPSESSID ; name of the session ; is used as cookie name session.auto_start = 0 ; initialize session on request startup session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted try this test-script: <? session_start(); session_register("SESSION"); if (! isset($SESSION)) { $SESSION["count"] = 0; echo "<li>Counter initialized, please reload this page to see it increment"; } else { echo "<li>Waking up session $PHPSESSID"; $SESSION["count"]++; } echo "<li>The counter is now $SESSION[count] "; ?> johannes "Jimmy Bäckström" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 007801c0859d$8ef1e0f0$554d59d5@broder">news:007801c0859d$8ef1e0f0$554d59d5@broder... Yeah I used a path name with '\' instead of '/' but it still does not work. Help! "Johannes Janson" <[EMAIL PROTECTED]> wrote in message 94kpfm$4cc$[EMAIL PROTECTED]">news:94kpfm$4cc$[EMAIL PROTECTED]... > you have to set the 'session.save_path' in your php.ini. > be careful with the slashes you use. as you can see from > the error msg by default it's '/' but windows uses '\'. > > good luck > Johannes > > > "Jimmy Bäckström" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > 001201c08564$f7398660$554d59d5@broder">news:001201c08564$f7398660$554d59d5@broder... > Yo! > I'm playing a little bit with sessions for the moment and I get a really > scary errormessage: > > Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m > (2) in h:\program\apache\htdocs/boa/sessionTest.php on line 5 > > Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m > (2) in Unknown on line 0 > > Warning: Failed to write session data (files). Please verify that the > current setting of session.save_path is correct (/tmp) in Unknown on line 0 > > I understand that there is a folder missing somewhere (tmp) and I tried to > create one in the apache directory, but it still does not work. I'm using > Win2k proffesional with an apache webserver and I don't have a clue what > changes I should do to php.ini. > Please help! > /Broder B > > > > > -- > PHP General Mailing List (http://www.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 Wednesday 24 January 2001 01:25, Richard Lynch wrote: > > I wonder myself, which method is better to fetch a web page: > > > > $file = fopen($url, "r"); > > $page = fread($file, 50000); > > > > or > > > > $file = join('', file($url)); > > Probably about the same either way... Perhaps. In an earlier version of PHP I had a problem where the above code (fopen...) read *more* than the page length. I.e. the page was e.g. 20k big and the fread appended ~5k of junk to it. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra
Hi all I'm trying to use is_dir to go thru a dir to list all dirs of that I have a dir with 3 other dirs in them [root@universe templates]# pwd /www/docs/webit/admin/templates [root@universe templates]# ls -l total 12 drwxr-xr-x 4 root root 4096 Jan 12 13:16 1/ drwxr-xr-x 4 root root 4096 Jan 12 13:16 2/ drwxr-xr-x 2 root root 4096 Jan 12 13:16 CVS/ when I run this script section it only shows the CVS .. <? $handle=opendir('/www/docs/webit/admin/templates'); echo "Directory handle: $handle\n"; echo "Files:<br>"; while (($file = readdir($handle))!==false) { if (is_dir($file)){ print "$file<BR>"; } } closedir($handle); ?> can anybody help out why it doesn't see 1 and 2 as directories ? Henti
On Wed, Jan 24, 2001 at 01:48:29PM +0200, [EMAIL PROTECTED] wrote: > Hi all > > I'm trying to use is_dir to go thru a dir to list all dirs of that > > I have a dir with 3 other dirs in them > > [root@universe templates]# pwd > /www/docs/webit/admin/templates > [root@universe templates]# ls -l > total 12 > drwxr-xr-x 4 root root 4096 Jan 12 13:16 1/ > drwxr-xr-x 4 root root 4096 Jan 12 13:16 2/ > drwxr-xr-x 2 root root 4096 Jan 12 13:16 CVS/ > > > when I run this script section it only shows the CVS .. > > <? > $handle=opendir('/www/docs/webit/admin/templates'); > echo "Directory handle: $handle\n"; > echo "Files:<br>"; > while (($file = readdir($handle))!==false) { Are you sure it should !== and not != ? > if (is_dir($file)){ > print "$file<BR>"; > } > } > closedir($handle); > ?> > /Daniel -- Contact: email: [EMAIL PROTECTED] | UIN: 635335 Fortune: Ban the bomb. Save the world for conventional warfare.
Hi all, I was wondering if you could use PHP to test if a picture is there? I.E. checking if you could open the picture or not, and displaying a message either way. I have tried $file = fopen ("../images/maps/$filename.jpg", "r"); if (!$file) { print "This is no map for this trip."; exit; } else { print "<img src=/images/maps/$filename.jpg>"; } This works but also brings up a warning message as well, which is not wanted. Is there a way to get rid of the warning message? Thanks in advance Sam Rose
Yep. $file = @fopen (......... The @ sign suppresses the warning messages. Should work fine after this. HTH Jon -----Original Message----- From: Sam [mailto:[EMAIL PROTECTED]] Sent: 24 January 2001 12:19 To: 'php' Subject: [PHP] Checking if files are there? Hi all, I was wondering if you could use PHP to test if a picture is there? I.E. checking if you could open the picture or not, and displaying a message either way. I have tried $file = fopen ("../images/maps/$filename.jpg", "r"); if (!$file) { print "This is no map for this trip."; exit; } else { print "<img src=/images/maps/$filename.jpg>"; } This works but also brings up a warning message as well, which is not wanted. Is there a way to get rid of the warning message? Thanks in advance Sam Rose -- PHP General Mailing List (http://www.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! Anybody has some experince with working Roxen+PHP? How about speed, features in compare to Apache for example? TIA RemS -- -------------------------------------------------------------------/\------ Remigiusz Sokolowski e-mail: [EMAIL PROTECTED] / \ -----------------------------------------------------------------/____\-----
Hi all, Im working on a site where we want to put all the text into text-files. Im having troubles doing this, though. If I have a text like this "Today there are more than XXXX users registered", and I put it in a .txt-file, how can I execute the code wich should return the numer XXXX? Im building functions for all returns from databases. XXXX could be something like <?PHP echo countMembers() ?>. The .txt-file is builde like this: "[H]Welcome[/H][S]Welcome to this site. We are proud to introduce you to more than[C] echo countMembers[/C][/S][S]Please enjoy your stay.[S]" Where [S] meaning start/end text and [C] start/end code. The reason why I want to do it this way are that someone without any HTML/PHP-skills should be able to edit the text and it would be much easier to build a site in different languages. Im open to other ways of doing it. Best regards /henrik
>Im working on a site where we want to put all the text into text-files. Im having troubles doing this, though. If I have a text like this "Today there are more than XXXX users registered", and I put it in a .txt-file, how can I execute the code wich should return the numer XXXX? Im building functions for all returns from databases. > >XXXX could be something like <?PHP echo countMembers() ?>. > >The .txt-file is builde like this: > >"[H]Welcome[/H][S]Welcome to this site. We are proud to introduce you to more than[C] echo countMembers[/C][/S][S]>Please enjoy your stay.[S]" > >Where [S] meaning start/end text and [C] start/end code. > >The reason why I want to do it this way are that someone without any HTML/PHP-skills should be able to edit the text and it would be much easier to build a site in different languages. > >Im open to other ways of doing it. $text = str_replace("[C]", 42, $text); Since you have just described the basic functionality of PHPlib, FastTemplate, and about forty 'leven other Templates systems, I have to suggest that you check them out before building YetAnotherTemplate. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
I Know that PHP can make PDF files..... But Some body PLEASE can pass to me a Binary instalation of this library?? Or tell me where i can find it???? THANKS!!!!
At 4:40 PM +0600 1/24/01, Tshering Norbu wrote: >Here is collection I got from this list; > >www.editplus.com >www.codecharge.com >www.phpedit.com >www.ultraedit.com > See this list: http://www.itworks.demon.co.uk/phpeditors.htm Some of the comments are a bit out of date - for instance, BBEdit 6.0 (Macintosh) now has PHP syntax highlighting - but it's a got starting point. - steve > >----- Original Message ----- >From: kaab kaoutar <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, January 24, 2001 4:28 PM >Subject: [PHP] Beginner in php! > > >> Hi guys! >> >> I'm working on an NT workstation, i used to work with asp, but i heard a >lot >> about php! that i decided to start working with it ! >> so i'm using PWS4 and i'm wondering which free php editor is more suitible >> for me ? and also what links to get free more tutorials, i got one of >phpnet >> but still .... >> >> Regards >> _________________________________________________________________________ > > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. >> -- +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
I want to evaluate some PHP code to a string. How can I do this? $php_code = "echo 'hello';" I would like to evaluate the code to "hello" in another string...
try eval("\$php_code;"); -----Ursprüngliche Nachricht----- Von: [ rswfire ] [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 24. Januar 2001 15:36 An: [EMAIL PROTECTED] Betreff: [PHP] eval() to string??? I want to evaluate some PHP code to a string. How can I do this? $php_code = "echo 'hello';" I would like to evaluate the code to "hello" in another string...
How is this going to help me? I want to evaluate the code in $php_code to *another* string... ----- Original Message ----- From: Thomas Weber <> To: Php-General <> Sent: Wednesday, January 24, 2001 10:14 AM Subject: AW: [PHP] eval() to string??? > try > > eval("\$php_code;"); > > -----Ursprüngliche Nachricht----- > Von: [ rswfire ] [mailto:[EMAIL PROTECTED]] > Gesendet: Mittwoch, 24. Januar 2001 15:36 > An: [EMAIL PROTECTED] > Betreff: [PHP] eval() to string??? > > > I want to evaluate some PHP code to a string. How can I do this? > > $php_code = "echo 'hello';" > > I would like to evaluate the code to "hello" in another string... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
okay, i see.... here is an example: $php_code = "$foo + $bar"; eval("\$var = \"$php_code\";); now in $var there should be the eval of $foo + $bar -----Ursprüngliche Nachricht----- Von: Robert S. White [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 24. Januar 2001 16:20 An: [EMAIL PROTECTED] Betreff: Re: [PHP] eval() to string??? How is this going to help me? I want to evaluate the code in $php_code to *another* string... ----- Original Message ----- From: Thomas Weber <> To: Php-General <> Sent: Wednesday, January 24, 2001 10:14 AM Subject: AW: [PHP] eval() to string??? > try > > eval("\$php_code;"); > > -----Ursprüngliche Nachricht----- > Von: [ rswfire ] [mailto:[EMAIL PROTECTED]] > Gesendet: Mittwoch, 24. Januar 2001 15:36 > An: [EMAIL PROTECTED] > Betreff: [PHP] eval() to string??? > > > I want to evaluate some PHP code to a string. How can I do this? > > $php_code = "echo 'hello';" > > I would like to evaluate the code to "hello" in another string... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Hi, > I want to evaluate the code in $php_code to *another* string... you have to do it through output buffering: ob_start(); eval($php_code); $another_string=ob_get_contents(); ob_end_clean(); Rgds, Tfr --==< [EMAIL PROTECTED] >==< http://tfr.cafe.ee/ >==< +372-50-17621 >==--
Can anyone help with inserting a blob field into a database Interbase 6? I am using a textarea field for user input/text and need to insert the field into my database. I am getting the following error if I do a normal insert statement: 'conversion error from string "BLOB"' Thanks in advance. __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/
Hi all! first thanks for urvreplies about the editors and tutorials! well while trying a my first php form i had to use a loop in the confirmation part which looks like: <?php echo " " . $personal["name"]. "\n" . $personal["email"] . "<br> " ; echo Count($beer); $i=0; for ($i=0;$i<Count($beer);$i++) echo $beer[i]; ?> i have the same error the constant i is not defined ... how acn i fix it ? by the way the html form looks like : <form action="conf_form.php" method="post"> Name: <input type="text" name="personal[name]"><br> Email: <input type="text" name="personal[email]"><br> Beer: <br> <select multiple name="beer[]"> <option value="warthog">Warthog <option value="guinness">Guinness <option value="stuttgarter">Stuttgarter Schwabenbräu </select> <input type="submit"> </form> THANKS _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
kaab kaoutar wrote: > <?php > echo " " . $personal["name"]. "\n" . $personal["email"] . "<br> " ; > echo Count($beer); > $i=0; > for ($i=0;$i<Count($beer);$i++) echo $beer[i]; > ?> > > i have the same error the constant i is not defined ... > how acn i fix it ? Try for ($i=0;$i<Count($beer);$i++) echo $beer[$i]; A $ in front of a variable can do wonders... Wagner -- One maniac alone can do what 20 together cannot
Hi Everyone! I did post the note in the past about the problem with HTTP_REFERER which doesn't work in Netscape 6.0. It turned out that I was looking at the wrong thing the whole time. What I found is that it isn't really Netscape problem. It turned out that Netscape 6.0 can't use 2 times at one time, probably due to the fact that it is slower. ----------------------------------------- What I have in the script are .. $salt = strtoupper(md5(uniqid(rand())).md5(uniqid(rand()))); session_id($salt); session_start(); session_register("user_detail"); // $test = $GLOBALS["HTTP_REFERER"]; // echo $test."<br>"; $ask = "INSERT INTO SESSIONS VALUES('".$PHPSESSID."','".$user_detail[USER_ID]."',CURRENT TIMESTAMP,CURRENT TIMESTAMP,'".$REMOTE_ADDR."') "; $result = odbc_exec($cid,$ask); header("Location: https://www.test.org/test.php?".SID); break; And the 2nd file, test.php, contain the script ... $GLOBALS["HTTP_REFERER"]; ----------------------------------------- When I just add the code for testing which is followed by remark code "//" . Without the remark, the code work but I get the error message stating .... Warning: Cannot add header information - headers already sent by (output started at test.php) in test.php on line ** -------------------------------------- When I put in the remark, the 2nd file, test.php couldn't use $GLOBAL["HTTP_REFERER"] because it couldn't find the last file. I was thinking that maybe the HTTP_REFERER couldn't reach the last file because of the way the header work. Any solution? Any idea? Thanks, Scott
> -----Original Message----- > From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 22, 2001 11:01 AM > To: johnny p. > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] file storage/downloader... > > > On Sun, 21 Jan 2001, johnny p. wrote: > > > Ok, here's the prolem: I'm trying to create a feature on my site similar to > > xdrive.com. Basically I want the user to be able to upload a file and have > > it stored on my server. I also want to have the ability for the user to > > download the file at a later time. Account authentiaction is handled, no > > problem, but I have no idea where to put the files. I create a directory, > > it may be guessed and even the filename might be guessed and any user may be > > able to download the file, breaking user authentication. If I store the > > file in a non-apache directory, how does the user download the file? > > > > My goal is to have the second scenario work, create a directory for each > > user for file storage, and somehow get the user to be able to download it > > after being authenticated. I do not want to use .htaccess files for this, > > either. I want it to be seemless with the rest of the features of the site. > > > > Thanks in advance for any ideas, > > > > johnny p. > > > > Use a database for this. Store the mimetype of the uploaded file so that it > can be dwnloaded properly afterwards. No file/directory permissions problems, > unlimited flexibility for authentication... what more could you want? > > -- > Ignacio Vazquez-Abrams <[EMAIL PROTECTED]> > Thanks for responding. I would love to use my database to store the files, but there may be more that 4GB of files, and the documentation says only some OS's support file sizes larger than 4GB. I use RH6.2 and I think this would apply to the ext2 filesys. Perhaps switching to the 2.4 kernel would be a good idea later, and I'll see about changing it then, perhaps. But I like the suggestion about creating a directory for each user and have a script create the links and send the files. thanks again, johnny p.
Hi: We are a web programming company and a custom ask us for those things: The client is really interested on the distribution of CD-Roms which include a webserver (apache) with support for interpretive language (php3) and a database (mysql). That is why we have though to include in this Cd-Rom the programming that we are going to do to him, so that could be used in a PC with operating system Microsoft Windows 95/98/ME/NT without internet connection. We know that your sofware is completely free and we would like to know if we are able to distribute it freely or if we need any kind of license to distribute this Cd-Rom. Many thanks for your help and time. Best regards,
This is covered by the LICENSE file that comes with PHP. And yes, you can distribute PHP on a CD-Rom like that as long as you abide by the terms of the license. -Rasmus On Wed, 24 Jan 2001, Miguel Martinez wrote: > Hi: > > > We are a web programming company and a custom ask us for those things: > > The client is really interested on the distribution of CD-Roms which include a >webserver (apache) with support for interpretive language (php3) and a database >(mysql). That is why we have though to include in this Cd-Rom the programming that we >are going to do to him, so that could be used in a PC with operating system Microsoft >Windows 95/98/ME/NT without internet connection. > > We know that your sofware is completely free and we would like to know if we are >able to distribute it freely or if we need any kind of license to distribute this >Cd-Rom. > > Many thanks for your help and time. > > Best regards, > >
Hi list, Is it possible to get PHP to create entities in Outlook, specifically tasks and calendar entries? TIA Jon Please visit us on the Internet: http://www.witanjardine.co.uk 'The information included in this e-mail 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 of confidentiality'
Well, php is server side, so wahtever you want todo serverside php can probably try todo. is outlook express on the server? if not I doubt you'll have any luck at all. You might be able to do this is if you had php dynamically write VBscript and email that to the client. I dont know about that. PHP on a windows box can use windows DOM, if outlook express was on the server then you might be able to use this too, I cant say for sure. All I can say for sure is that php is serverside, so if ou want php todo anything but serverside your looking in the wrong spot. Chris Lee Mediawaveonline.com "Jon Haworth" <[EMAIL PROTECTED]> wrote in message 431205EC9190D4119E2800D0B720FA3F397343@BOOTROS">news:431205EC9190D4119E2800D0B720FA3F397343@BOOTROS... > Hi list, > > Is it possible to get PHP to create entities in Outlook, specifically tasks > and calendar entries? > > TIA > Jon > > > Please visit us on the Internet: > http://www.witanjardine.co.uk > > 'The information included in this e-mail 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 of > 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] >
When I try to use sessions without cookies, I get the following error. Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 What does that mean? Of course, the session data isn't saved when this happens. The script works fine if cookies are enabled on the browser. I'm using PHP 4.0.3pl1 as a cgi on a Unix machine. thanks in advance, bill
I've been off the list for a couple of months after having been on for 2 years and I must say, it's good to be back. Unfortunately, my latest job advancement left me using jsp/servlets but there's always hope... jason __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/
I need learn how to install this library to create pdf files dinamicaly.!!!
Hi, I need to test for cookies. What is the simplest way to do this? Thanks - Karl
By trying to set a cookie and read it back. > -----Original Message----- > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 11:50 AM > To: PHP Mailing List > Subject: [PHP] Test for Cookies > > > Hi, > > I need to test for cookies. What is the simplest way to do this? > > Thanks - Karl > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Karl J. Stubsjoen [[EMAIL PROTECTED]] wrote: > Hi, > > I need to test for cookies. What is the simplest way to do this? Be a little more specific - do you want to know if there are cookies at all, or if there are specific cookies? Depends on the settings in the Data Handling section of your php.ini. With register_globals = On and track_vars = On, I can do this: if (sizeof($HTTP_COOKIE_VARS) == 0) { error_log("no cookies!!!"); } or if (empty($HTTP_COOKIE_VARS["my_cookie_1"])) { error_log("my_cookie_1 doesn't exist!"); } HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com > > Thanks - Karl > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> Karl J. Stubsjoen [[EMAIL PROTECTED]] wrote: > > Hi, > > > > I need to test for cookies. What is the simplest way to do this? > > Be a little more specific - do you want to know if there > are cookies at all, or if there are specific cookies? > > Depends on the settings in the Data Handling section of your > php.ini. With register_globals = On and track_vars = On, I > can do this: both of these are On. Is this a *FOR SURE* way to tell if cookies are enabled on the client machine??? > > if (sizeof($HTTP_COOKIE_VARS) == 0) { > error_log("no cookies!!!"); > } > > > or > > > if (empty($HTTP_COOKIE_VARS["my_cookie_1"])) { > error_log("my_cookie_1 doesn't exist!"); > } > > > HTH. > -- > Hardy Merrill > Mission Critical Linux, Inc. > http://www.missioncriticallinux.com > > > > > Thanks - Karl > > > > > > -- > > PHP General Mailing List (http://www.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 trying to set a cookie and read it back. Okay....here is the scenario: User originates from STATIC Html page, Links to my PHP Cookie Test Page I set a cookie in my PHP Cookie Test Page Can I then check (safely) for cookies right away in my PHP Cookie Test Page without involving a 3rd page? Karl
Not without at least refreshing that page. You can't know if a cookie has set on the same page you set it on. ----- Original Message ----- From: "Karl J. Stubsjoen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 12:42 PM Subject: Re: [PHP] Test for Cookies > > By trying to set a cookie and read it back. > > Okay....here is the scenario: > > User originates from STATIC Html page, > Links to my PHP Cookie Test Page > I set a cookie in my PHP Cookie Test Page > Can I then check (safely) for cookies right away in my PHP Cookie Test Page > without involving a 3rd page? > > Karl > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Under PHP 4.0.4pl1 (for Windows) I can not start up old php_gd.dll from older PHP distribution. This is old GD library 3.0.12 that have GIF support. (Under 4.0.3pl1 everything was fine). Does anyone have idea about this problem Thanks in advance, Vladimir P.S. I installed and new ZendOptimizer for PHP. But I can not see that could be a problem?!?
Hello, I have this code in a php script, which takes all pixels from a PNG image and produces a second "image" with random numbers in HTML format this time. (an example can be found at http://www.cyprusnews.org/sub/prog2.php). Instead of getting ALL shades of red from the pallette, I get only 8-9 shades: those corresponding to values of red with R value 0,51,102,153,204,255. Anyone can explain that? Here's the code: $im = imagecreatefrompng("vac3.png"); $dimx = imagesx($im); $dimy = imagesy($im); for ($f=0; $f<$dimy; $f+=5) { for ($i=0; $i<$dimx; $i+=5) { $colsat = imagecolorat($im,$i,$f); $colss = imagecolorsforindex($im,$colsat); $r = dechex($colss[red]); $g = dechex($colss[green]); $b = dechex($colss[blue]); if ($colss[red] < 16) $r = "0" . $r; // assure that 13 becomes #0D and not D if ($colss[green] < 16) $g = "0" . $g; if ($colss[blue] < 16) $b = "0" . $b; $rndn = rand(0,9); echo "<font color=#".$r.$g.$b.">".$rndn."0"; } echo "<br>"; } ImageDestroy($im); thanks subbie
Everytime I send a post to [EMAIL PROTECTED] The message goes through but I also recieve back the following This is the Postfix program at host kgb.ijs.si. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please contact <[EMAIL PROTECTED]> If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program <[EMAIL PROTECTED]>: mail forwarding loop for [EMAIL PROTECTED] is this happening to anyone else?
I have successfully installed pdflib with PHP4.0.4pl1 and all the necessary components. However, I don't know how to output a generated pdf to the browser without writing it to disk first and then reading it in. Below are the examples that I use. This example tries to directly output the pdf to the browser and doesn't work. The browser says "An error has occured while trying to use this document." ------------ <? header( "Content-type: application/pdf" ); $pdf = PDF_open(); pdf_set_info_author($pdf, "Me"); PDF_set_info_title($pdf, "Test"); PDF_set_info_author($pdf, "Name of Author"); pdf_set_info_creator($pdf, "See Author"); pdf_set_info_subject($pdf, "Testing"); PDF_begin_page($pdf, 595, 842); PDF_add_outline($pdf, "Page 1"); pdf_set_font($pdf, "Times-Roman", 30, "winansi"); pdf_set_text_rendering($pdf, 1); PDF_show_xy($pdf, "Times Roman outlined", 50, 750); pdf_moveto($pdf, 50, 740); pdf_lineto($pdf, 330, 740); pdf_stroke($pdf); PDF_end_page($pdf); PDF_close($pdf); ?> ------------ However, the following script that writes the pdf to disk first and is then read in works fine: ------------ <? $fp = fopen("pdftesting.pdf", w); $pdf = PDF_open($fp); pdf_set_info_author($pdf, "Me"); PDF_set_info_title($pdf, "Test"); PDF_set_info_author($pdf, "Name of Author"); pdf_set_info_creator($pdf, "See Author"); pdf_set_info_subject($pdf, "Testing"); PDF_begin_page($pdf, 595, 842); PDF_add_outline($pdf, "Page 1"); pdf_set_font($pdf, "Times-Roman", 30, "winansi"); pdf_set_text_rendering($pdf, 1); PDF_show_xy($pdf, "Times Roman outlined", 50, 750); pdf_moveto($pdf, 50, 740); pdf_lineto($pdf, 330, 740); pdf_stroke($pdf); PDF_end_page($pdf); PDF_close($pdf); fclose($fp); header( "Content-type: application/pdf" ); $fp = fopen("pdftesting.pdf", "r"); fpassthru($fp); fclose($fp); ?> ------------ Any reason why I have to write the pdf to disk instead of just sending it to the browser? Am I missing an output function? Thanks. -- Dominic
A few things to try: 1. Use session variables that expire after a certain time. The remote host, your partner, has to contact your host every X hours to get a new session key and all communication is done for that period of time using that key in the URL. 2. Use difficult to guess user identifiers. ie. 32 char alpha/numeric word as in phplib. 3. Identify the remote partner with a similar key. 4. when someone registers on the remote site, have their site call your site with the user details. 5. Don't bother with registering users but every time a "new" user comes to your site, contact your partner site to verify who they are, and if valid create an account for the new user. The easiest way is to have the remote host register new users on your site when they register on their site, then they pass a partner identifier and user identifier to your site to access your services. Donncha. Kyle Jerviss wrote: > > Here is an idea I had, but will require that all the sites in question > maintain very accurate clock synchronization, but doesn't require any > "Boget, Chris" wrote: > > > > I've been charged with trying to find out how something > > like this can be done if it is at all in fact possible. The info > > I'm hoping to get is what would be involved and where I > > can find information on it. I'm not asking for code or > > examples unless you really want to provide them. :P > > > > Anyways, what we need to be able to do is the following:
Had another thought about this... Have someone register against the first site - have it create a quick key value, and store it locally. Pass that via GET or POST to one of YOUR sites. Have your server hit the first server with this key. The first server would authenticate the validity of the key, then mark it as used. If you try to check the key again, it's bad. Have this key on the first server only last a few seconds (10-20?) so as to prevent someone trying to hack against it. Just another quick thought about your issue... "Boget, Chris" wrote: > I've been charged with trying to find out how something > like this can be done if it is at all in fact possible. The info > I'm hoping to get is what would be involved and where I > can find information on it. I'm not asking for code or > examples unless you really want to provide them. :P > > Anyways, what we need to be able to do is the following: > > * Have a user be able to authenticate on a *trusted* partner > website that resides on a server external to our network. > > * Have that external website securely transmit information > (preferrably not on the URL :p) with regards to the > authentication information on that user; the auth info > will be the same on both servers. This would allow the > user streamlined access to the areas on our website that > would otherwise require the user to log in without forcing > them to do so. > > * The other aspect to the above that we also need to address is > when a user signs up for the first time on the trusted partner's > site, that signup information should be securely transmitted to > us when/if the user attempts to access our site so we could set > them up in the database and authenticate them by nature of the > above. > > Is something like this possible? What would be involved? Is > there something that is already built into Apache/PHP that > would make it easier? Someone suggested XML database transfer, > but I've never heard of XML being anything other than a markup > language much less capable of storing data? It was also suggested > that we use something like public key/private key but am not sure > how that would work... > > We are using: > > Apache 1.3.12 > PHP 4.0.3pl1 > PHP4 Session based (not HTTP basic) authentication using mySql > to store the ID/PW > > I realize the security implications of something like this and have > brought them up myself. However, it's something that is being > pushed and so I've got to look into it (and I don't even really know > where to start) so please don't say it's stupid because I already know. > :) Is something like this possible? What's involved? Where can I go > to learn more? > > Thanks! > > Chris
There is a LiveDate (YYYY-MM-DD) field in my table. 1. I want data from last 5 days up to now, and its order should be from latest; 2. I want data for next month. Any help would be appreciated.
Which database? Fang Li [[EMAIL PROTECTED]] wrote: > > There is a LiveDate (YYYY-MM-DD) field in my table. > 1. I want data from last 5 days up to now, and its order should be from > latest; > 2. I want data for next month. > > 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]
Hi all, I was wondering how I can display a date in this format 'DD/MM/YY' As when I do a select statement and display the date I get it in this format 'DD-MM-YYY 00:00:00' Which is kind of annoying. I am using mySQL and also PHP. Thanks in advance. Sam Rose
I'm the author of an opensource php auctioning system and have recently been receving alot of emails concerning the availibility of different languages. I was wondering what the best way to build a sort of language pack would be (one file for french, one for english, one for german, etc). Something like replacing one file containing the language specs & translations would translate the entire system. I'm just looking for recommendations before I start asking volunteers to translate the words. Thanks. _______________________________________________________ Send a cool gift with your E-Card http://www.bluemountain.com/giftcenter/