Re: [PHP] close session when browser is closed
So i would like to have it well done as following : 1. if user close the browser : session is destroyed and user is redirected to main HTTPS page (the login one) 2. if user close the TAB in which the web application worked, the session data (so cookies if i understood well) should be destroyed to avoid any possibile hacking. How should i do that ? for point 1, i was thinking to check is the $_SESSION['username'] data is set. this variable is set only after authentication of user. but for point 2 i have no idea. thanks, Alain On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: If you set the session timeout to 0, then it dies when the browser is quit. On Wed, March 21, 2007 12:37 pm, Alain Roger wrote: > Hi, > > I would like to know what is the best solution for my problem. > > When a user is connected to a https page and a session is open, if > user > close his browser, the session ID is still active in the browser > "history". > It means that next time when user will start his browser, the browser > will > re-use the same session ID and will work with php pages without any > problem. > > I was thinking to use cookie to solve this issue, but what should i do > when > user browser refuse cookies ? > > thanks a lot, > > -- > Alain > > Windows XP SP2 > PostgreSQL 8.1.4 > Apache 2.0.58 > PHP 5 > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5
Re: [PHP] close session when browser is closed
Your application/session will never get any information whether the user closes his browser or a tab! Even the lifetime of the session cookie is depending on which browser the user is on and if any other window is open. So the only solution would be polling some "watchdog.php" using a XMLHttpRequest and unsetting the $_SESSION['username'] at the next contact if a predefinded timeout is exceeded . Alain Roger wrote: > > So i would like to have it well done as following : > > 1. if user close the browser : session is destroyed and user is redirected > to main HTTPS page (the login one) > 2. if user close the TAB in which the web application worked, the session > data (so cookies if i understood well) should be destroyed to avoid any > possibile hacking. > > How should i do that ? > for point 1, i was thinking to check is the $_SESSION['username'] data is > set. this variable is set only after authentication of user. > but for point 2 i have no idea. > > thanks, > > Alain > > On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> >> If you set the session timeout to 0, then it dies when the browser is >> quit. >> >> On Wed, March 21, 2007 12:37 pm, Alain Roger wrote: >> > Hi, >> > >> > I would like to know what is the best solution for my problem. >> > >> > When a user is connected to a https page and a session is open, if >> > user >> > close his browser, the session ID is still active in the browser >> > "history". >> > It means that next time when user will start his browser, the browser >> > will >> > re-use the same session ID and will work with php pages without any >> > problem. >> > >> > I was thinking to use cookie to solve this issue, but what should i do >> > when >> > user browser refuse cookies ? >> > >> > thanks a lot, >> > >> > -- >> > Alain >> > >> > Windows XP SP2 >> > PostgreSQL 8.1.4 >> > Apache 2.0.58 >> > PHP 5 >> > >> >> >> -- >> Some people have a "gift" link here. >> Know what I want? >> I want you to buy a CD from some indie artist. >> http://cdbaby.com/browse/from/lynch >> Yeah, I get a buck. So? >> >> > > > -- > Alain > > Windows XP SP2 > PostgreSQL 8.1.4 > Apache 2.0.58 > PHP 5 > > -- View this message in context: http://www.nabble.com/close-session-when-browser-is-closed-tf3443138.html#a9648288 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance: While or For loop
On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, March 23, 2007 7:54 pm, Tijnema ! wrote: > On 3/24/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> Folks: >> >> How often do you use a loop of any kind in PHP with enough >> iterations >> that this is even significant? >> >> Write the code that makes sense. >> >> Optimize the biggest bottleneck until performance is acceptable. > > It was more likely to get an idea if there was a real difference or > not, and apparently there is not really a big difference. > > But well if you are going to create a script where 1000+ loops are, > you might get a few seconds faster script :) I believe we are seeing times for 1000 iterations around 4 seconds? Or was it 26 seconds? Whatever. That means that at 1000 iterations, you are "saving" how much time? .00026 seconds? .4 seconds? Puhleaze. Well, if you execute this script 1000 times, you would get a difference of 2.6 seconds? But if every microseconds counts for your script, then you should now about this. Tijnema -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about storing big5 codes into mysql-5.0.24a
On 3/24/07, Man-wai Chang <[EMAIL PROTECTED]> wrote: create table temp ( big5 char(2) ) character set big5 collate big5_bin; insert into temp ( big5 ) values ( 0x9f54 ); insert into temp ( big5 ) values ( 0x9f53 ); The 2nd query will report duplicated key. How should I fix the problem? What does this has to do with PHP? First of all I don't see any PHP code, and second this is an error in your SQL query, so you should be on the MySQL list. Tijnema -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.10) Linux 2.6.20.4 ^ ^ 15:46:01 up 2:58 1 user load average: 2.32 1.73 1.48 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trans id problem
Hello Luciano, > i have a big problem with form with method post. > the php correclty add the hidden session variables > but it seem that it does not arrive to the page. Having toggled session's use_trans_sid first time myself last week, take care to: * restart apache on the server side (you apparently did this, otherwise get wouldnt have worked) * reload the page on the browser side (after having disabled cookies), make sure the page is not cached (then it would be without PHPSESSID or with the wrong PHPSESSID) If then there is still a problem, you can check: * in the page containing the method=POST form there must be "" tags somewhere with the PHPSESSID in the form's HTML source * as a last resort for any network transfer, you also could use http://www.wireshark.org/ to look at what really goes over the wire HTH, -- Holger Blasum +49-174-7313590 (cell) GnuPG 1024D/ACDFC3B769DC1ED66B47 signature.asc Description: Digital signature
[PHP] Computing and calculating dates
This probably has been asked several times yet I can't find a satisfying solution. What's the simplest way to compute dates like local_formated_date + 7; // days local_formated_date > local_formated_first_day_next_month; local_formated_date > (current_date + 14) etc. Which functions are best suited for such calculations? O. Wyss -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong with this function please?
No sorry, both messages are the same. Didn't mean to post it twice. Sorry. Below is what prints out when I echo the message: $to [EMAIL PROTECTED] $subject Proposal Submission $headers From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path: 2HostMe Mailer Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type: multipart/related; boundary="d49718178131ebc038c576f007a40642" $msg --d49718178131ebc038c576f007a40642 Content-Type: image/gif; name="betaresource.gif" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="betaresource.gif" R0lGODlhWgAeAPcAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0BaeyU0RjpRbCw9 UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZSY3Si1BVzxVcUpn iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh9EaiBGbBs7XCFI byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYypQdSdKbSVGZiI3 TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk1ke0theEVXajA9 SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZhcvRSlTeSpUeh06 VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbDBUdUVqi0Riflt5 lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlTRjjDtvmTptljFb fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlUpaZ4aaq32PnniI loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvIKVpGx7hoqbqJGg q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZieobS6vbzFyLe/ wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3NydjY1cTEwo6Ojbe2 saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUydfPxOTc0ezm3uvl 3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP8ALABaAB4A QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx8/IkQA4hQolidP xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11qqhg+fOjbt5o8K4 KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5liafuVqF08zZw8OLO HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidxgcZSi5SUMcxxgL bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOpPsSMvTxwgtXKB0 0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCCI58DGNBtNs0EED D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQThRiG2kLLJGlOU I08psPABRSlcJpGDDIGUE48YeDOKyMEGKL30sgREr9RSCy+paDJIMHK6QkwhpyDjSSClmNLJ H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/m8AE6n4BBAzz3+ gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT38DPBLJ6ims8+xbRQKhJHIAFGPfWA Ew44JdzjaTT67CMBA07YcUkj0khyCQKgIAIIMNSE8wQdulRTTSc77LAGGejckMMNGJwyzzW/YJBM NeFcwQO94YSiyCJn6HCNGzC4MUMy16DjhQIco0MBCi0cgk4BBUTwTQS/fBNOMsC40w06T9DyDTrg HHCNy78MUkghdkySxyST9EHJHXZUQgceeMix9CSWNPXIGWSIQUMMNNAgQwwyaB3DBRdggAE2GFxQ Axlo94DHJDv8kEPYd2ygQQYZyJ1BAwukFAJICCz/gdMCgjwQxR9eTDABC6C4IkosVKDwwOOPpGKM PfZYyY0odswRxxBFzKGmHJUP8kOHXMtggw0+AEJ5Oea0w4wljMQu+yIMOaJKKrjXGcJMxADiiQoF YBGFBho08GgTTQw+RSed/PTE8380QYVSXAgSQQR+cCINVKeMk84tSHRhTjdeLCNPMLpwdc01KHCT jCnbmLMNBlOwsw4OMFzzTjJAmBKPMIFohjyAAQpzsENO7LAEM+SxjWCIIx7AMIUBiwEL1plCFPFo RzvYEQxlqMMdwFhGNrpQDm6YIhjpQIcUTGCCVvBCGvDABSsocQ16fIEe+GjBEeAAhzDAgVtbqAAF /+BxjiNsoR74qMAW6JGPOhBCXEqwgFu8UAYzjKENZWCFLz5DD1jMox5bKAELvjgBt1QBBZDxwiGa pQQktIAe9SjBB5TwgWq4AwwO8AAD9ugBCFiiFZrQBCZYgQpUHOENdUikIQhxBDWooQIOIEQKHpkC D7zgkph8Aa40KRszlKEMKMgCEo7Thi1sgTlHYEAKJHACLVhhFlqQwCiGAQElOAACEMhWtpSQgC0M gBAkIMEJHGAICayAAR5wAgSgZolg2OISk4BGITQXByNU8w5DMMIQ0oABHsgAHHqYAQqiYYFihMEC 6KwNBnSgAzH8AA1zYEUcgAAN6sGgDEPIRALCU/8CFKAgAlgAxy2+8AVwgAAEGZgCIAJhigY0AAQN iEALJJCF0XwCCygoQQmIMDRpXKIS9tFFfvhAjFz4BxKQmAYjErEIioWiFNhARAyeYTZP/OICN7AG DawRhAqdIRFomwYiEFGKWCCiCHywhgKssYEGqOABWRhAN4IRDGB0QwRXxSoFxkEMUSxOF7/o0R0P QIABFOATRJiEHJIwjXSkIxmVAMUv8MAfO1xjGtvoxSoWwYYeoDAd2pjCBarxjGTYABjYGIcKMKAN dHQjFGc4AxvoMA0+7EAIGACGNbLBggZIAwRyQ0EDntANt6YDGEzIBTnIEQw/6IIc45hAMtyxDHf/ TOEc4SAHIlJUAEuo4hXAdUUoksC0PRQhDkIoQhGIwFwfrOEHO4jBDWIQgxzowAYZCIQnABEKTshB bXiwA9PmMLRLQGIJmJCEJSyxiSlMwQsu8QLwsFAAKjwAeU1YQBOe0BMo/KETsIDCArgAi2LIogCC kIUgECyJVhijHGJqB1/2YIQgDEEI8MkDHuxhjljsoAg6oK7pTqc6MdkvLytVRCJit66IaCIVBVmF JjoxBU8ENxZYiEUgsEA8Dezixxpowh82gRP8NuGgKBCEIEJJBUFoghPCYEcuWBGLdJBDD5QIRjko J44/MCMee4GHF+QB4cqFIgaAaB0N0mAKd1RD/7LA2LI9xLEKRyyDdaxrBSDiAeESEsMUrPNEBe1x QQjrohwE1IY82CEPZRQAEZUzhzoaaqlV8MIYe3HrO3zRBmXI4xZmKMQ6yDGEdNSDCzAYQwdsw4Kz WOAT6ljHzt7xDi6YgRryKMQOQqGObZCiHcJYMTFawY52nAIWx2DHNk6RQQWb40qm2MspClGAJf2C JrkARjycEYhCvIMeXuBCBFwojHVMGRXfcAcF0vGVenyRHmNwyygqQAJ3xBod6XiHC1rgjnpMoIZf uCJV2vLFemiAHO7AC1fd6s9bLMkXS1IyWljAAiTeIQGHcIsC9pmAbywJiZ4ygCFG4cLaBgMWvv8Q lwGikY9o8PAI/VADtw5RAV+k4xsVaEGnXmAIfvADVxS4BwXGAI16/KIMbaAENHzxCVSkoVOf+IYN hwENekDjAPSgBwW2hY8DHMLnekACEvAxDzAowQreOMU78nECPQpAAutpxSqO0Sx96IMCVkBkC/xR LlC9wFqfMkQ/9NEPAfjDHy+Yhd0xKQB+9GMMXoAGqfYRDS6USx/+GIYblNCPyVOAEFYQQKkOYPeS 2T1bSCCBN8SVDwqcQAJ2t7s/VpDMS1gCE5e4BCtm2IY3wKEOvh8DHN6gBjio4Q1hCEMFXLCbTWpy +cu/YhuAQP0gtEH6ylmOGdoAHSdoIQXDWEH/CqowjBOc4AMOQIISeMlLDpigBO7nwhas4AAnJDM6 J4DEQTSxPnD4Yg53cAeUQAlY5gYGqAfbNwNmcAj6AA39YAViIRa9AQcWMAM3kAY7YAR3EAdokAYW 8AXR4A3RoBxloAfrpwROcAIlYEqCAAYiGA0H0AEKIAjMMwImsg
Re: [PHP] Random Unique ID
IIRC, the OP wanted to generate a unique key precisely to keep from revealing the record ID to the end user... what about taking the auto_increment value (easy to generate, assured to be unique) adding its MD5 hash to another column in the table, then using that as the "published" ID? The only disadvantage I see is that the MD5 hash isn't very human-friendly, so using it for an account or member number, or something like that the user might have to write down or read to a customer service rep on the phone, might be difficult. -Jim On Fri, March 23, 2007 9:35 pm, Richard Lynch wrote: > Use auto_increment. > > It's not random, but you should never show it to the end user anyway, > so who cares? > > Another option is to use http://php.net/uniqid and you can create a > UNIQUE INDEX on the column and simply check mysql_errno() to see if > it's 1023 (or is it 2023?) when you insert to see if you had a > collision. > > On Wed, March 21, 2007 12:18 pm, [EMAIL PROTECTED] wrote: >> Hello, >> >> I want to add a random unique ID to a Mysql table. Collisions >> are unlikely but possible so to handle those cases I'd like to >> regenerate the random ID until there is no collision and only >> then add my row. Any suggestions for a newbie as to the right >> way to go about doing this? >> >> Best, >> >> Craig >> >> -- >> - Virtual Phonecards - Instant Pin by Email - >> - Large Selection - Great Rates- >> - http://speedypin.com/?aff=743&co_branded=1 - >> -- >> >> >> ** >> ** >> * Craig Spencer * >> * [EMAIL PROTECTED]* >> ** >> ** >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/browse/from/lynch > Yeah, I get a buck. So? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random Unique ID
On Sat, 2007-03-24 at 08:24 -0400, Jim McIntyre wrote: > IIRC, the OP wanted to generate a unique key precisely to keep from > revealing the record ID to the end user... what about taking the > auto_increment value (easy to generate, assured to be unique) adding its > MD5 hash to another column in the table, then using that as the > "published" ID? > > The only disadvantage I see is that the MD5 hash isn't very > human-friendly, so using it for an account or member number, or something > like that the user might have to write down or read to a customer service > rep on the phone, might be difficult. It's more likely that he wants the unique ID so that he can serve up a document or image such that other documents or images can't be retrieved just by incrementing the ID in the URL. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance: While or For loop
Hi, I'm using so much FOR loops in my code, after seeing discussion I try to test. My findigs it was giving %2 to %10 percent performance boost. So ? My recent template addon to this code cost me around %5 to %10 percent of total page process.. I think It was nice trade off. Thank you guys. Just changing two chars. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance: While or For loop
At 7:47 PM -0500 3/23/07, Richard Lynch wrote: Folks: How often do you use a loop of any kind in PHP with enough iterations that this is even significant? Write the code that makes sense. Optimize the biggest bottleneck until performance is acceptable. Absolutely -- the time we take discussing these types of concerns probably cost more cycles than the sum total of all the "optimized" savings in the lifetime of all the computers on earth. The time you spend trying to make something faster in those terms clearly cost more time in development and maintenance. It's a trade-off that's not worth it. Q: Do they teach this stuff in college now or are the teachers still only measuring performance in myopic terms of saving memory and time? Not a criticism, just a question. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong with this function please?
phpmailer.sourceforge.net - a mailing class for php that does everything you need, there are other alternatives - definitely beats fiddling with all the required headers yourself. save yourself a big headache. :-) Robin Wilson wrote: > Hello > > I'm trying to do a function that emails users and sends an attachment. > But I think something is in the wrong order or something as when I send > it Exchange discards it. > > This is the function which I have put together from various sources: > > I would really appreciate any help as I have been up half the night and > got nowhere! > Thanks > Robin > > function sendMail($to, $toName, $from, $fromName, $subject, $message, > $uploadfile, $fileName, $fileType, $fileSize) { > $eol="\r\n"; > $mime_boundary=md5(time()); > > # Common Headers > $headers .= 'From: '. $fromName .' <'. $from .'>'.$eol; > $headers .= 'Reply-To: '. $toName .' <'. $to .'>'.$eol; > $headers .= 'Return-Path: '. $fromName.' <'. $from .'>'.$eol;// > these two to set reply address > $headers .= "Message-ID: > <".$mime_boundary."@".$_SERVER['SERVER_NAME'].">".$eol; > $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two > to help avoid spam-filters > > # Boundry for marking the split & Multitype Headers > $headers .= 'MIME-Version: 1.0'.$eol; > $headers .= "Content-Type: multipart/related; > boundary=\"".$mime_boundary."\"".$eol; > > $msg = " "; > > if ($uploadfile != "") { > # File for Attachment > $file_name = substr($uploadfile, (strrpos($uploadfile, "/")+1)); > > $handle=fopen($uploadfile, 'rb'); > $f_contents=fread($handle, $fileSize); > $f_contents=chunk_split(base64_encode($f_contents));//Encode > The Data For Transition using base64_encode(); > fclose($handle); > > # Attachment > $msg .= "--".$mime_boundary.$eol; > $msg .= "Content-Type: ".$fileType."; name=\"".$file_name."\"".$eol; > $msg .= "Content-Transfer-Encoding: base64".$eol; > $msg .= "Content-Disposition: attachment; > filename=\"".$file_name."\"".$eol.$eol; // !! This line needs TWO end of > lines !! IMPORTANT !! > $msg .= $f_contents.$eol.$eol; > } > > # Setup for text OR html > $msg .= "Content-Type: multipart/alternative".$eol; > > # Text Version > $msg .= "--".$mime_boundary.$eol; > $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol; > $msg .= "Content-Transfer-Encoding: 8bit".$eol; > $msg .= strip_tags(str_replace("", "\n", $message)).$eol.$eol; > > # HTML Version > $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol; > $msg .= "Content-Transfer-Encoding: 8bit".$eol; > $msg .= $message.$eol.$eol; > > # Finished > $msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's > for better security. see Injection. > > > // Mail it > mail($to, $subject, $msg, $headers); > } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about storing big5 codes into mysql-5.0.24a
Tijnema ! wrote: > On 3/24/07, Man-wai Chang <[EMAIL PROTECTED]> wrote: >> >> create table temp ( big5 char(2) ) character set big5 collate big5_bin; >> insert into temp ( big5 ) values ( 0x9f54 ); >> insert into temp ( big5 ) values ( 0x9f53 ); >> >> The 2nd query will report duplicated key. How should I fix the problem? > > What does this has to do with PHP? > First of all I don't see any PHP code, and second this is an error in > your SQL query, so you should be on the MySQL list. and thirdly why not use unicode??? > > Tijnema >> >> -- >> .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org >> / v \ Simplicity is Beauty! May the Force and Farce be with you! >> /( _ )\ (Ubuntu 6.10) Linux 2.6.20.4 >> ^ ^ 15:46:01 up 2:58 1 user load average: 2.32 1.73 1.48 >> news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Computing and calculating dates
Otto Wyss wrote: > This probably has been asked several times yet I can't find a > satisfying solution. What's the simplest way to compute dates like > > local_formated_date + 7; // days > local_formated_date > local_formated_first_day_next_month; > local_formated_date > (current_date + 14) > > etc. Which functions are best suited for such calculations? > > O. Wyss > www.php.net/strtotime is probably a good start. Travis Doherty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preview string with strlen PHP (help)
2007. 03. 23, péntek keltezéssel 17.30-kor Dwayne Heronimo ezt írta: > YES this works thank nemeth: your welcome but please call me Zoltán ;) (my first name is Zoltán. in Hungary we write names the opposite order than anywhere else ;) so that's why my mailbox is set to display 'Németh Zoltán' but I sign my mails as 'Zoltán Németh' showing that my first name is Zoltán and last name is Németh :) ) greets Zoltán Németh Zoltán: You see, people are looking at your email address and making the assumption that your first name is Nemeth. Now, you have a choice: a) don't change you email and continue receiving email thinking Nemeth is your first name; b) or change your email address. As us USA types are told, we all have to adapt to global conventions. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to control if it is a date
Hi, user can enter a string with following format dd.mm.. Application should transform it to postgresql timestamp date. however, i would like to be sure that what user typed is a real and valid date. how can i do that ? i was thinking to use date(string format, strtotime(string_entered_by_user)); but it does not ensure me that it is a valid date... thx. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5
Re: [PHP] how to control if it is a date
On 3/24/07, Alain Roger <[EMAIL PROTECTED]> wrote: Hi, user can enter a string with following format dd.mm.. Application should transform it to postgresql timestamp date. however, i would like to be sure that what user typed is a real and valid date. how can i do that ? With checkdate i think : http://php.net/checkdate Brice Favre i was thinking to use date(string format, strtotime(string_entered_by_user)); but it does not ensure me that it is a valid date... thx. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5
Re: [PHP] how to control if it is a date
thanks i did not know it. On 3/24/07, Brice <[EMAIL PROTECTED]> wrote: On 3/24/07, Alain Roger <[EMAIL PROTECTED]> wrote: > > Hi, > > user can enter a string with following format dd.mm.. > Application should transform it to postgresql timestamp date. > > however, i would like to be sure that what user typed is a real and > valid > date. > how can i do that ? With checkdate i think : http://php.net/checkdate Brice Favre i was thinking to use date(string format, > strtotime(string_entered_by_user)); but it does not ensure me that it is > a > valid date... > > thx. > > -- > Alain > > Windows XP SP2 > PostgreSQL 8.1.4 > Apache 2.0.58 > PHP 5 > -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5
Re: [PHP] Name Capitalization
At 3/23/2007 07:27 PM, Richard Lynch wrote: > In this case, the OP has an existing list of names he wants to > de-capitalize, not an ongoing stream of new names from people who > might be trained. The solution remains: Hire a human. The computer will never get accurate enough. The exception might be if you are dealing with MILLIONS of names, where a filter would pay off. You'd still need human review and a validation process that involved human oversight to a significant percentage. I do not think the OP has millions of names. Richard, If you'd take the time to read this thread, you'll see that many of us have pointed out the impossibility of correcting name capitalization 100%. You'll also see that the OP has indicated that even an imperfect solution with capitalization errors would be better in his situation than the current all-caps condition of the list, and that therefore a software solution would be helpful. There is usually more than one solution to a given problem. In this case, as in many others, there appears to be an inverse relation between cost and error rate. Depending on goals and budgets, one may choose a higher error rate and a lesser cost over a smaller error rate at a higher cost. In this particular case, it's my opinion that even human operators would not be able to reduce the error rate to zero unless one could afford to pay them to contact some of the people individually to find out how they spell their names. There simply are no rules that apply across the board, whether applied by machine or flesh. Anything but personal interviews is just informed guesswork. Regards, Paul __ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trans id problem
>* restart apache on the server side restarting the server is not neccessary if php_values/flags are changed via .htaccess >* in the page containing the method=POST form there must >be "" tags somewhere with the PHPSESSID in the >form's HTML source php does this automagically, you can see the SID on the "action" page like so: echo SID, 'POST-'; print_R($_POST); echo 'SESSION-'; print_R($_SESSION); -- View this message in context: http://www.nabble.com/trans-id-problem-tf3447048.html#a9652240 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Computing and calculating dates
In case you're doing so only for database update/check, then you can use mysql's built-in date_add function. In case you really want it in PHP, then here's a link simultating: http://news.hping.org/comp.lang.php.archive/10638.html -- itoctopus - http://www.itoctopus.com "Travis Doherty" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Otto Wyss wrote: > > > This probably has been asked several times yet I can't find a > > satisfying solution. What's the simplest way to compute dates like > > > > local_formated_date + 7; // days > > local_formated_date > local_formated_first_day_next_month; > > local_formated_date > (current_date + 14) > > > > etc. Which functions are best suited for such calculations? > > > > O. Wyss > > > www.php.net/strtotime is probably a good start. > > Travis Doherty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Luhn algorithm
Here's the Luhn algorithm in PHP. The Luhn algorithm is mainly used to check if a credit/debit card number is valid or not. Please tell me if there's a bug somewhere, I've tested the thing heavily and it's working like a charm. /* [EMAIL PROTECTED] check_luhn [EMAIL PROTECTED] This function checks if a card number follows the Luhn algorithm [EMAIL PROTECTED] string $strCreditCardNumber The card number (maybe AMEX, Diner's Club, Discover, JCB, Maestro, MasterCard, Solo, Switch, Visa, and Visa Electron) [EMAIL PROTECTED] boolean TRUE if the card follows the Luhn algorith, false if not [EMAIL PROTECTED] check_lun('4123456789012345') */ function check_luhn($strCardNumber){ //first convert the credit card number to an array of digits $arrCardDigits = array(); for ($i = 0; $i < strlen($strCardNumber); $i++) $arrCardDigits[$i] = (int)$strCardNumber[$i]; //now start the algorithm $sum = 0; $alt = false; for($i = count($arrCardDigits) - 1; $i >= 0; $i--){ if($alt){ $arrCardDigits[$i] *= 2; if($arrCardDigits[$i] > 9) $arrCardDigits[$i] -= 9; } $sum += $arrCardDigits[$i]; $alt = !$alt; } return $sum % 10 == 0; } -- itoctopus - http://www.itoctopus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Book Suggestion for ZCE
Sams - Zend Php Certification Study Guide for the certification. An excellent book on PHP is PHP5 Power Programming (by Prentice Hall). -- itoctopus - http://www.itoctopus.com ""Danial Rahmanzadeh"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hey dudes, > i want to know that which books are good to read before ZCE exam. > I have read php 5 and php 4 study guides and php 4 practice tests. I have > also read php|architect's guide to php security and bought a 10 slot sample > exam. What else do you suggest? > cheers, > Danial > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance: While or For loop
On Sat, 2007-03-24 at 10:21 -0400, tedd wrote: > At 7:47 PM -0500 3/23/07, Richard Lynch wrote: > >Folks: > > > >How often do you use a loop of any kind in PHP with enough iterations > >that this is even significant? > > > >Write the code that makes sense. > > > >Optimize the biggest bottleneck until performance is acceptable. > > Absolutely -- the time we take discussing these types of concerns > probably cost more cycles than the sum total of all the "optimized" > savings in the lifetime of all the computers on earth. I highly doubt it. Computers run a lot these days. There are times when squeezing that last nanosecond makes a difference and the devotion to finding how to squeeze it out is well worth it. Admittedly they may be few and far between, but they do exist. > The time you spend trying to make something faster in those terms > clearly cost more time in development and maintenance. It's a > trade-off that's not worth it. The time you spend can be large, but here we all know now how to speed things up, if we just apply the principles that are easy to apply in all the code we write, then such things will already be optimal and so in hindsight we will already be reaping the rewards without any extra effort. > Q: Do they teach this stuff in college now or are the teachers still > only measuring performance in myopic terms of saving memory and time? > Not a criticism, just a question. They generally teach algorithmic analysis that improves the algorithm's order of magnitude in contrast to teaching constant multiplicative gains. However, that's not to say writing efficient code isn't a good thing. If I have an algorithm that runs in X time, I'm sure if X is 2 years and I can shrink it to x/2 then nobody will quibble about the constant gain since it happens to be 1 year of savings. Now depending on the calculations you're doing, shaving off a nanosecond can indeed have a large enough impact to make it worth your time. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance: While or For loop
At 2:24 PM -0400 3/24/07, Robert Cummings wrote: On Sat, 2007-03-24 at 10:21 -0400, tedd wrote: At 7:47 PM -0500 3/23/07, Richard Lynch wrote: >Folks: > >How often do you use a loop of any kind in PHP with enough iterations >that this is even significant? > >Write the code that makes sense. > >Optimize the biggest bottleneck until performance is acceptable. Absolutely -- the time we take discussing these types of concerns probably cost more cycles than the sum total of all the "optimized" savings in the lifetime of all the computers on earth. I highly doubt it. Computers run a lot these days. There are times when squeezing that last nanosecond makes a difference and the devotion to finding how to squeeze it out is well worth it. Admittedly they may be few and far between, but they do exist. And, I highly doubt that the difference is worth considering -- and it's becoming less of a consideration each day. Remember, we were talking about the differences between a "for" vs "while" loop. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performance: While or For loop
On Sat, 2007-03-24 at 14:38 -0400, tedd wrote: > At 2:24 PM -0400 3/24/07, Robert Cummings wrote: > >On Sat, 2007-03-24 at 10:21 -0400, tedd wrote: > >> At 7:47 PM -0500 3/23/07, Richard Lynch wrote: > >> >Folks: > >> > > >> >How often do you use a loop of any kind in PHP with enough iterations > >> >that this is even significant? > >> > > >> >Write the code that makes sense. > >> > > >> >Optimize the biggest bottleneck until performance is acceptable. > >> > >> Absolutely -- the time we take discussing these types of concerns > >> probably cost more cycles than the sum total of all the "optimized" > >> savings in the lifetime of all the computers on earth. > > > >I highly doubt it. Computers run a lot these days. There are times when > >squeezing that last nanosecond makes a difference and the devotion to > >finding how to squeeze it out is well worth it. Admittedly they may be > >few and far between, but they do exist. > > And, I highly doubt that the difference is worth considering -- and > it's becoming less of a consideration each day. > > Remember, we were talking about the differences between a "for" vs > "while" loop. Ahh, but it was the pre-increment versus post-increment that made the difference. every bit counts, it's the same problem as energy savings. If you only do it in one place you don't really see a savings, if you do it everywhere, it begins to have an impact. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What is wrong with this function please?
> > No sorry, both messages are the same. > Didn't mean to post it twice. Sorry. > > Below is what prints out when I echo the message: > > $to > [EMAIL PROTECTED] > > $subject > Proposal Submission > > $headers > From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path: > 2HostMe Mailer > Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type: > multipart/related; boundary="d49718178131ebc038c576f007a40642" Are these all on the same lines just because of echo? Or are they on their own lines? Like this: From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path: 2HostMe Mailer Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type: multipart/related; boundary="d49718178131ebc038c576f007a40642" From: should have a from email address, same with reply-to and return-path > > $msg > --d49718178131ebc038c576f007a40642 Content-Type: image/gif; > name="betaresource.gif" Content-Transfer-Encoding: base64 > Content-Disposition: attachment; filename="betaresource.gif" Same with these, are there any line returns? > R0lGODlhWgAeAPcAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0 > BaeyU0RjpRbCw9 > UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZS > Y3Si1BVzxVcUpn > iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh > 9EaiBGbBs7XCFI > byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYy > pQdSdKbSVGZiI3 > TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk > 1ke0theEVXajA9 > SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZh > cvRSlTeSpUeh06 > VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbD > BUdUVqi0Riflt5 > lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlT > RjjDtvmTptljFb > fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlU > paZ4aaq32PnniI > loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvI > KVpGx7hoqbqJGg > q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZ > ieobS6vbzFyLe/ > wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3Nyd > jY1cTEwo6Ojbe2 > saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUyd > fPxOTc0ezm3uvl > 3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP > 8ALABaAB4A > QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx > 8/IkQA4hQolidP > xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11q > qhg+fOjbt5o8K4 > KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5lia > fuVqF08zZw8OLO > HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidx > gcZSi5SUMcxxgL > bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOp > PsSMvTxwgtXKB0 > 0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCC > I58DGNBtNs0EED > D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQ > ThRiG2kLLJGlOU > I08psPABRSlcJpGDDIGUE48YeDOKyMEGKL30sgREr9RSCy+paDJIMHK6Qk > whpyDjSSClmNLJ > H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/ > m8AE6n4BBAzz3+ > gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT38DPBLJ6ims8+xb > RQKhJHIAFGPfWA > Ew44JdzjaTT67CMBA07YcUkj0khyCQKgIAIIMNSE8wQdulRTTSc77LAGGejckM > MNGJwyzzW/YJBM > NeFcwQO94YSiyCJn6HCNGzC4MUMy16DjhQIco0MBCi0cgk4BBUTwTQS/fBNOMs > C40w06T9DyDTrg > HHCNy78MUkghdkySxyST9EHJHXZUQgceeMix9CSWNPXIGWSIQUMMNNAgQwwyaB > 3DBRdggAE2GFxQ > Axlo94DHJDv8kEPYd2ygQQYZyJ1BAwukFAJICCz/gdMCgjwQxR9eTDABC6C4Ik > osVKDwwOOPpGKM > PfZYyY0odswRxxBFzKGmHJUP8kOHXMtggw0+AEJ5Oea0w4wljMQu+yIMOaJKKr > jXGcJMxADiiQoF > YBGFBho08GgTTQw+RSed/PTE8380QYVSXAgSQQR+cCINVKeMk84tSHRhTjdeLC > NPMLpwdc01KHCT > jCnbmLMNBlOwsw4OMFzzTjJAmBKPMIFohjyAAQpzsENO7LAEM+SxjWCIIx7AMI > UBiwEL1plCFPFo > RzvYEQxlqMMdwFhGNrpQDm6YIhjpQIcUTGCCVvBCGvDABSsocQ16fIEe+GjBEe > AAhzDAgVtbqAAF > /+BxjiNsoR74qMAW6JGPOhBCXEqwgFu8UAYzjKENZWCFLz5DD1jMox5bKAELvj > gBt1QBBZDxwiGa > pQQktIAe9SjBB5TwgWq4AwwO8AAD9ugBCFiiFZrQBCZYgQpUHOENdUikIQhxBD > WooQIOIEQKHpkC > D7zgkph8Aa40KRszlKEMKMgCEo7Thi1sgTlHYEAKJHACLVhhFlqQwCiGAQElOA > ACEMhWtpSQgC0M > gBAkIMEJHGAICayAAR5wAgSgZolg2OISk4BGITQXByNU8w5DMMIQ0oABHsgAHH > qYAQqiYYFihMEC > 6KwNBnSgAzH8AA1zYEUcgAAN6sGgDEPIRALCU/8CFKAgAlgAxy2+8AVwgAAEGZ > gCIAJhigY0AAQN > iEALJJCF0XwCCygoQQmIMDRpXKIS9tFFfvhAjFz4BxKQmAYjErEIioWiFNhARA > yeYTZP/OICN7AG > DawRhAqdIRFomwYiEFGKWCCiCHywhgKssYEGqOABWRhAN4IRDGB0QwRXxSoFxk > EMUSxOF7/o0R0P > QIABFOATRJiEHJIwjXSkIxmVAMUv8MAfO1xjGtvoxSoWwYYeoDAd2pjCBarxjG > TYABjYGIcKMKAN > dHQjFGc4AxvoMA0+7EAIGACGNbLBggZIAwRyQ0EDntANt6YDGEzIBTnIEQw/6I > Ic45hAMtyxDHf/ > TOEc4SAHIlJUAEuo4hXAdUUoksC0PRQhDkIoQhGIwFwfrOEHO4jBDWIQgxzowA > YZCIQnABEKTshB > bXiwA9PmMLRLQGIJmJCEJSyxiSlMwQsu8QLwsFAAKjwAeU1YQBOe0BMo/KETsI > DCArgAi2LIogCC > kIUgECyJVhijHGJqB1/2YIQgDEEI8MkDHuxhjljsoAg6oK7pTqc6MdkvLytVRC > Jit66IaCIVBVmF > JjoxBU8ENxZYiEUgsEA8Dezixxpowh82gRP8NuGgKBCEIEJJBUFoghPCYEcuWB > GLdJBDD5QIRjko > J44/MCMee4GHF+QB4cqFIgaAaB0N0mAKd1RD/7LA2LI9xLEKRyyDdaxrBSDiAe > ESEsMUrPNEBe1x > QQjrohwE1IY82CEPZRQAEZUzhzoaaqlV8MIYe3HrO3zRBmXI4xZmKMQ6yDGEdN > SDCzAYQwdsw4Kz > WOAT6ljHzt7xDi6YgRryKMQOQqGObZCiHcJYMTFawY5
Re: [PHP] Computing and calculating dates
Travis Doherty wrote: Otto Wyss wrote: local_formated_date + 7; // days local_formated_date > local_formated_first_day_next_month; local_formated_date > (current_date + 14) etc. Which functions are best suited for such calculations? O. Wyss www.php.net/strtotime is probably a good start. Thanks, strtotime isn't able to parse a european formatted date (dd.mm.). How do I get the timestamp of such a date? O. Wyss -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] �G�b�`�Èl�È��W��
â [NANA]ããããã¡ãã»ã¼ã¸ã1éå±ãã¦ãã¾ãâ http://hame-taosi.org/free/as00101/faeataia01/ NANAã ããâªä»ãã大å¦ã®æ¥ä¼ã¿ãªãã§æ¯æ¥ãä¼ã¿ã£ãï¼ æã°ã£ããã¦ããæ»ãããããããéãã§ããâ å¹´ä¸ã®åªãã人ã¨ãã©ã¤ãã¨ãã§ãããããªï¼ å½¼æ°ãããªãããããã£ã±ãéããããã¼ã⪠ãè¿äºå¾ ã£ã¦ãããâ http://hame-taosi.org/free/as00101/faeataia01/ ãã¡ããã©ãã http://hame-taosi.org/free/as00101/jayauana01/ [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is pecl.php.net down?
Since about 7 hours now i can't get on the pecl.php.net pages. The site doesn't seem to be available. Does somebody know why? Thanks, Martin J'utilise la version gratuite de SPAMfighter pour utilisateurs privés. 42980 e-mails spam ont été bloqués jusqu'à maintenant. Les utilisateurs payant n'ont pas ce message dans leurs e-mails. Essayez SPAMfighter gratuitement maintenant! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: is pecl.php.net down?
martin wrote: > Since about 7 hours now i can't get on the pecl.php.net pages. The site > doesn't seem to be available. > > Does somebody know why? Hi Martin, The entire machine that runs pear.php.net and pecl.php.net was down for a very long time. It has recently come back up online, you should be able to use the website fully now. Thanks, Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: is pecl.php.net down?
thanks Greg, it's back running Martin "Gregory Beaver" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > martin wrote: >> Since about 7 hours now i can't get on the pecl.php.net pages. The site >> doesn't seem to be available. >> >> Does somebody know why? > > Hi Martin, > > The entire machine that runs pear.php.net and pecl.php.net was down for > a very long time. It has recently come back up online, you should be > able to use the website fully now. > > Thanks, > Greg J'utilise la version gratuite de SPAMfighter pour utilisateurs privés. 42980 e-mails spam ont été bloqués jusqu'à maintenant. Les utilisateurs payant n'ont pas ce message dans leurs e-mails. Essayez SPAMfighter gratuitement maintenant! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Computing and calculating dates
Change it to the format strtotime needs? Not hard Or mktime(0, 0, 0, date("m", $date), date("d", $date)+7, date("Y", $date)); for +7 days... Same with + 14 days Strtotime is usefull, you can just put first day next month and it just works... Lol... Then you could explode that back into mktime, or just into a string. There are many ways to do what your asking :) Jake > -Original Message- > From: Otto Wyss [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 24, 2007 4:37 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Computing and calculating dates > > Travis Doherty wrote: > > Otto Wyss wrote: > >> local_formated_date + 7; // days > >> local_formated_date > local_formated_first_day_next_month; > >> local_formated_date > (current_date + 14) > >> > >> etc. Which functions are best suited for such calculations? > >> > >> O. Wyss > >> > > www.php.net/strtotime is probably a good start. > > > Thanks, strtotime isn't able to parse a european formatted date > (dd.mm.). How do I get the timestamp of such a date? > > O. Wyss > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 3:27 PM > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Question
Hi All I am having a bit of trouble with PHP arrays and would appreciate some help. I currently have the following piece of code $count=count($data->legs->leg); $k=0; while($k < $count) { $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg[$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; $k++; } This works fine extracting the leg attributes from the legs array and putting the data into a new legrow array delimited by $VM. I can do a print_r($legrow); and I get the rows displayed correctly. I can also access any row by using $legrow[n] where n is the key number. What I want to do is to find a way of indexing the array using the legId as the key if possible. In other words I want to extract the row where the legId has a particular value where I do not know the row key. I have been thinking that this might be possible with an associative array but my attempts to do this have not worked. What I have tried is as follows $count=count($data->legs->leg); $k=0; while($k < $count) { $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; $k++; } My thinking is that the $data->legs->leg[$k]['legId'] is the legId and I might use that as a key. This however does not work. I would appreciate some guidance on how I might get this to work. Regards Richard Luckhurst -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] My own "captcha" from 2 years ago......
Well, I've been creating my own... Since like two years ago... Lol.. But this is the KNOWN name now. Anyways... How can I get the info from the image creation script back to my main script? Sessions DO NOT WORK! They give me the previous entry instead of the current.. Which obviously won't work... This was on the back burner for a long time, but my boss said . Oh wow.. That looks cool... And I told him I had started it a long time ago.. But never finished it cause he told me to work on something else... Anyways... U can see what I mean http://nittanytravel.com:8080/ The numbers surrounding the images displayed are session values created in the image scripts...which as you will see are the previous value It may be a simple fix.. But once again... I'm tired... And had one too many long island iced teas tonight to think about this. And yes... My boss works me even on saturdays after happy hour :( Thanks, Jake -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
$legrow["$data->legs->leg[$k]['legId']"] ?? See if that works... Jake > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 24, 2007 11:27 PM > To: php-general@lists.php.net > Subject: [PHP] Array Question > > Hi All > > I am having a bit of trouble with PHP arrays and would > appreciate some help. > > I currently have the following piece of code > > $count=count($data->legs->leg); > $k=0; > while($k < $count) > { > > $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg > [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> > legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V > M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' > ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil > es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ > $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg > s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > > $k++; > } > > This works fine extracting the leg attributes from the legs array and > putting the data into a new legrow array delimited by $VM. > > I can do a print_r($legrow); and I get the rows displayed > correctly. I can > also access any row by using $legrow[n] where n is the key number. > > What I want to do is to find a way of indexing the array > using the legId > as the key if possible. In other words I want to extract the > row where the > legId has a particular value where I do not know the row key. > > I have been thinking that this might be possible with an > associative array > but my attempts to do this have not worked. > > What I have tried is as follows > > $count=count($data->legs->leg); > $k=0; > while($k < $count) > { > > $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ > 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- > >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da > ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM > .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. > $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' > meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le > g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > > $k++; > } > > My thinking is that the $data->legs->leg[$k]['legId'] is the > legId and I > might use that as a key. This however does not work. > > I would appreciate some guidance on how I might get this to work. > > Regards > > Richard Luckhurst > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 3:27 PM > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: My own "captcha" from 2 years ago......
Hey Jake, I checked the thing, and I tell you I did lots and lots of captchas in my life and they mainly rely on the session. Is it possible for you to post the script so that me (or anyone else for that matter) fix it for you? Take care, -- itoctopus - http://www.itoctopus.com ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well, I've been creating my own... Since like two years ago... Lol.. But > this is the KNOWN name now. Anyways... How can I get the info from the > image creation script back to my main script? Sessions DO NOT WORK! They > give me the previous entry instead of the current.. Which obviously won't > work... This was on the back burner for a long time, but my boss said . > Oh wow.. That looks cool... And I told him I had started it a long time > ago.. But never finished it cause he told me to work on something else... > Anyways... U can see what I mean http://nittanytravel.com:8080/ > > The numbers surrounding the images displayed are session values created in > the image scripts...which as you will see are the previous value It may > be a simple fix.. But once again... I'm tired... And had one too many long > island iced teas tonight to think about this. And yes... My boss works > me even on saturdays after happy hour :( > > > Thanks, > Jake > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 > 3:27 PM > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
What if you put $temp = $data->legs->leg[$k]['legId']; And then put that into $legrow[$temp]; Do you have anything in $temp? Jake > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 24, 2007 11:27 PM > To: php-general@lists.php.net > Subject: [PHP] Array Question > > Hi All > > I am having a bit of trouble with PHP arrays and would > appreciate some help. > > I currently have the following piece of code > > $count=count($data->legs->leg); > $k=0; > while($k < $count) > { > > $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg > [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> > legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V > M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' > ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil > es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ > $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg > s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > > $k++; > } > > This works fine extracting the leg attributes from the legs array and > putting the data into a new legrow array delimited by $VM. > > I can do a print_r($legrow); and I get the rows displayed > correctly. I can > also access any row by using $legrow[n] where n is the key number. > > What I want to do is to find a way of indexing the array > using the legId > as the key if possible. In other words I want to extract the > row where the > legId has a particular value where I do not know the row key. > > I have been thinking that this might be possible with an > associative array > but my attempts to do this have not worked. > > What I have tried is as follows > > $count=count($data->legs->leg); > $k=0; > while($k < $count) > { > > $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ > 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- > >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da > ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM > .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. > $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' > meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le > g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > > $k++; > } > > My thinking is that the $data->legs->leg[$k]['legId'] is the > legId and I > might use that as a key. This however does not work. > > I would appreciate some guidance on how I might get this to work. > > Regards > > Richard Luckhurst > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 3:27 PM > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
Hi Jake Thanks for the answer. That is what I had in my example that did not work. I had tried that and then wondered how I might access that key. I have tried $legrow["number"]; where number is a value I know to be one of the legId's. Is this correct? Regards Richard > $legrow["$data->legs->leg[$k]['legId']"] > > ?? See if that works... > > Jake > > > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Saturday, March 24, 2007 11:27 PM >> To: php-general@lists.php.net >> Subject: [PHP] Array Question >> >> Hi All >> >> I am having a bit of trouble with PHP arrays and would >> appreciate some help. >> >> I currently have the following piece of code >> >> $count=count($data->legs->leg); >> $k=0; >> while($k < $count) >>{ >> >> $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg >> [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> >> legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V >> M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' >> ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil >> es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ >> $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg >> s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; >> >> $k++; >> } >> >> This works fine extracting the leg attributes from the legs array and >> putting the data into a new legrow array delimited by $VM. >> >> I can do a print_r($legrow); and I get the rows displayed >> correctly. I can >> also access any row by using $legrow[n] where n is the key number. >> >> What I want to do is to find a way of indexing the array >> using the legId >> as the key if possible. In other words I want to extract the >> row where the >> legId has a particular value where I do not know the row key. >> >> I have been thinking that this might be possible with an >> associative array >> but my attempts to do this have not worked. >> >> What I have tried is as follows >> >> $count=count($data->legs->leg); >> $k=0; >> while($k < $count) >>{ >> >> $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ >> 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- >> >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da >> ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM >> .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. >> $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' >> meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le >> g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; >> >> $k++; >> } >> >> My thinking is that the $data->legs->leg[$k]['legId'] is the >> legId and I >> might use that as a key. This however does not work. >> >> I would appreciate some guidance on how I might get this to work. >> >> Regards >> >> Richard Luckhurst >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> -- >> No virus found in this incoming message. >> Checked by AVG Free Edition. >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release >> Date: 3/23/2007 3:27 PM >> >> > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 > 3:27 PM > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
Hi Jake I tried that and got the same result. Regards Richard > What if you put $temp = $data->legs->leg[$k]['legId']; > And then put that into $legrow[$temp]; > > Do you have anything in $temp? > > Jake > > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Saturday, March 24, 2007 11:27 PM >> To: php-general@lists.php.net >> Subject: [PHP] Array Question >> >> Hi All >> >> I am having a bit of trouble with PHP arrays and would >> appreciate some help. >> >> I currently have the following piece of code >> >> $count=count($data->legs->leg); >> $k=0; >> while($k < $count) >>{ >> >> $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg >> [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> >> legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V >> M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' >> ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil >> es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ >> $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg >> s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; >> >> $k++; >> } >> >> This works fine extracting the leg attributes from the legs array and >> putting the data into a new legrow array delimited by $VM. >> >> I can do a print_r($legrow); and I get the rows displayed >> correctly. I can >> also access any row by using $legrow[n] where n is the key number. >> >> What I want to do is to find a way of indexing the array >> using the legId >> as the key if possible. In other words I want to extract the >> row where the >> legId has a particular value where I do not know the row key. >> >> I have been thinking that this might be possible with an >> associative array >> but my attempts to do this have not worked. >> >> What I have tried is as follows >> >> $count=count($data->legs->leg); >> $k=0; >> while($k < $count) >>{ >> >> $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ >> 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- >> >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da >> ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM >> .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. >> $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' >> meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le >> g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; >> >> $k++; >> } >> >> My thinking is that the $data->legs->leg[$k]['legId'] is the >> legId and I >> might use that as a key. This however does not work. >> >> I would appreciate some guidance on how I might get this to work. >> >> Regards >> >> Richard Luckhurst >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> -- >> No virus found in this incoming message. >> Checked by AVG Free Edition. >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release >> Date: 3/23/2007 3:27 PM >> >> > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 > 3:27 PM > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: My own "captcha" from 2 years ago......
Sorry.. Was playing around with dates and how long I've been sitting here watching this generate random numbers. Lol .. The only lines referring to the "captcha" are the img lines... As you can tell... Calling the next script... Should I do it this way? I'm pretty sure that is the problem, cause the session variable is being created and set in that second script which is called Session[security_code] is created in rnum1.php, and session[code] is created in rnum2.php... Which I didn't include here... But is the same concept only bigger. Index.php "; $after = $_SESSION['security_code']; if (!isset($_SESSION['start_time'])) { $_SESSION['start_time'] = time(); } else { $_SESSION['current_time'] = time(); } $running_time = mktime(date("H", $_SESSION['current_time'])-date("H", $_SESSION['start_time']), date("i", $_SESSION['current_time'])-date("i", $_SESSION['start_time']), date("s", $_SESSION['current_time'])-date("s", $_SESSION['start_time']), date("m", $_SESSION['start_time']), date("d", $_SESSION['start_time']), date("Y", $_SESSION['start_time'])); echo 'Before: ' . $before . 'After: ' . $after . 'Time: ' . date("H:i:s m-d-Y", $running_time) . '' . $_SESSION['code']; ?> Rnum1.php > -Original Message- > From: itoctopus [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 25, 2007 12:49 AM > To: php-general@lists.php.net > Subject: [PHP] Re: My own "captcha" from 2 years ago.. > > Hey Jake, > I checked the thing, and I tell you I did lots and lots of > captchas in my > life and they mainly rely on the session. > Is it possible for you to post the script so that me (or > anyone else for > that matter) fix it for you? > > Take care, > > -- > itoctopus - http://www.itoctopus.com > ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Well, I've been creating my own... Since like two years > ago... Lol.. But > > this is the KNOWN name now. Anyways... How can I get > the info from the > > image creation script back to my main script? Sessions DO > NOT WORK! They > > give me the previous entry instead of the current.. Which > obviously won't > > work... This was on the back burner for a long time, but my > boss said > . > > Oh wow.. That looks cool... And I told him I had started it > a long time > > ago.. But never finished it cause he told me to work on > something else... > > Anyways... U can see what I mean http://nittanytravel.com:8080/ > > > > The numbers surrounding the images displayed are session > values created in > > the image scripts...which as you will see are the previous > value It > may > > be a simple fix.. But once again... I'm tired... And had > one too many long > > island iced teas tonight to think about this. And > yes... My boss works > > me even on saturdays after happy hour :( > > > > > > Thanks, > > Jake > > > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 > > 3:27 PM > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 3:27 PM > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
What is the result your getting? Jake > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 24, 2007 11:57 PM > To: Jake McHenry > Cc: php-general@lists.php.net > Subject: RE: [PHP] Array Question > > Hi Jake > > I tried that and got the same result. > > Regards > > Richard > > > What if you put $temp = $data->legs->leg[$k]['legId']; > > And then put that into $legrow[$temp]; > > > > Do you have anything in $temp? > > > > Jake > > > > > >> -Original Message- > >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> Sent: Saturday, March 24, 2007 11:27 PM > >> To: php-general@lists.php.net > >> Subject: [PHP] Array Question > >> > >> Hi All > >> > >> I am having a bit of trouble with PHP arrays and would > >> appreciate some help. > >> > >> I currently have the following piece of code > >> > >>$count=count($data->legs->leg); > >>$k=0; > >>while($k < $count) > >> { > >> > >> $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg > >> [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> > >> legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V > >> M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' > >> ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil > >> es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ > >> $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg > >> s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > >> > >>$k++; > >>} > >> > >> This works fine extracting the leg attributes from the > legs array and > >> putting the data into a new legrow array delimited by $VM. > >> > >> I can do a print_r($legrow); and I get the rows displayed > >> correctly. I can > >> also access any row by using $legrow[n] where n is the key number. > >> > >> What I want to do is to find a way of indexing the array > >> using the legId > >> as the key if possible. In other words I want to extract the > >> row where the > >> legId has a particular value where I do not know the row key. > >> > >> I have been thinking that this might be possible with an > >> associative array > >> but my attempts to do this have not worked. > >> > >> What I have tried is as follows > >> > >> $count=count($data->legs->leg); > >>$k=0; > >>while($k < $count) > >> { > >> > >> $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ > >> 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- > >> >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da > >> ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM > >> .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. > >> $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' > >> meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le > >> g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > >> > >>$k++; > >>} > >> > >> My thinking is that the $data->legs->leg[$k]['legId'] is the > >> legId and I > >> might use that as a key. This however does not work. > >> > >> I would appreciate some guidance on how I might get this to work. > >> > >> Regards > >> > >> Richard Luckhurst > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> -- > >> No virus found in this incoming message. > >> Checked by AVG Free Edition. > >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > >> Date: 3/23/2007 3:27 PM > >> > >> > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 > > 3:27 PM > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > Date: 3/23/2007 3:27 PM > > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 3:27 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
Hi Jake I am getting nothing at all. Regards Richard > What is the result your getting? > > Jake > > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Saturday, March 24, 2007 11:57 PM >> To: Jake McHenry >> Cc: php-general@lists.php.net >> Subject: RE: [PHP] Array Question >> >> Hi Jake >> >> I tried that and got the same result. >> >> Regards >> >> Richard >> >> > What if you put $temp = $data->legs->leg[$k]['legId']; >> > And then put that into $legrow[$temp]; >> > >> > Do you have anything in $temp? >> > >> > Jake >> > >> > >> >> -Original Message- >> >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> >> Sent: Saturday, March 24, 2007 11:27 PM >> >> To: php-general@lists.php.net >> >> Subject: [PHP] Array Question >> >> >> >> Hi All >> >> >> >> I am having a bit of trouble with PHP arrays and would >> >> appreciate some help. >> >> >> >> I currently have the following piece of code >> >> >> >> $count=count($data->legs->leg); >> >> $k=0; >> >> while($k < $count) >> >> { >> >> >> >> $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg >> >> [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> >> >> legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V >> >> M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' >> >> ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil >> >> es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ >> >> $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg >> >> s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; >> >> >> >> $k++; >> >> } >> >> >> >> This works fine extracting the leg attributes from the >> legs array and >> >> putting the data into a new legrow array delimited by $VM. >> >> >> >> I can do a print_r($legrow); and I get the rows displayed >> >> correctly. I can >> >> also access any row by using $legrow[n] where n is the key number. >> >> >> >> What I want to do is to find a way of indexing the array >> >> using the legId >> >> as the key if possible. In other words I want to extract the >> >> row where the >> >> legId has a particular value where I do not know the row key. >> >> >> >> I have been thinking that this might be possible with an >> >> associative array >> >> but my attempts to do this have not worked. >> >> >> >> What I have tried is as follows >> >> >> >> $count=count($data->legs->leg); >> >> $k=0; >> >> while($k < $count) >> >> { >> >> >> >> $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ >> >> 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- >> >> >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da >> >> ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM >> >> .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. >> >> $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' >> >> meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le >> >> g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; >> >> >> >> $k++; >> >> } >> >> >> >> My thinking is that the $data->legs->leg[$k]['legId'] is the >> >> legId and I >> >> might use that as a key. This however does not work. >> >> >> >> I would appreciate some guidance on how I might get this to work. >> >> >> >> Regards >> >> >> >> Richard Luckhurst >> >> >> >> -- >> >> PHP General Mailing List (http://www.php.net/) >> >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >> -- >> >> No virus found in this incoming message. >> >> Checked by AVG Free Edition. >> >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release >> >> Date: 3/23/2007 3:27 PM >> >> >> >> >> > >> > -- >> > No virus found in this outgoing message. >> > Checked by AVG Free Edition. >> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release >> Date: 3/23/2007 >> > 3:27 PM >> > >> > >> > -- >> > PHP General Mailing List (http://www.php.net/) >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> >> -- >> No virus found in this incoming message. >> Checked by AVG Free Edition. >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release >> Date: 3/23/2007 3:27 PM >> >> > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007 > 3:27 PM > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
Like I said.. I'm half crocked... So I'm trying my best here... Give me some time... >> > What if you put $temp = $data->legs->leg[$k]['legId']; Does $temp have anything in it? Jake > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 25, 2007 12:09 AM > To: Jake McHenry > Cc: php-general@lists.php.net > Subject: RE: [PHP] Array Question > > Hi Jake > > I am getting nothing at all. > > Regards > > Richard > > > What is the result your getting? > > > > Jake > > > > > >> -Original Message- > >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> Sent: Saturday, March 24, 2007 11:57 PM > >> To: Jake McHenry > >> Cc: php-general@lists.php.net > >> Subject: RE: [PHP] Array Question > >> > >> Hi Jake > >> > >> I tried that and got the same result. > >> > >> Regards > >> > >> Richard > >> > >> > What if you put $temp = $data->legs->leg[$k]['legId']; > >> > And then put that into $legrow[$temp]; > >> > > >> > Do you have anything in $temp? > >> > > >> > Jake > >> > > >> > > >> >> -Original Message- > >> >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > >> >> Sent: Saturday, March 24, 2007 11:27 PM > >> >> To: php-general@lists.php.net > >> >> Subject: [PHP] Array Question > >> >> > >> >> Hi All > >> >> > >> >> I am having a bit of trouble with PHP arrays and would > >> >> appreciate some help. > >> >> > >> >> I currently have the following piece of code > >> >> > >> >> $count=count($data->legs->leg); > >> >> $k=0; > >> >> while($k < $count) > >> >> { > >> >> > >> >> $legrow[$k]=$data->legs->leg[$k]['legId'].$VM.$data->legs->leg > >> >> [$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data-> > >> >> legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$V > >> >> M.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo' > >> >> ].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['mil > >> >> es'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[ > >> >> $k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->leg > >> >> s->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > >> >> > >> >> $k++; > >> >> } > >> >> > >> >> This works fine extracting the leg attributes from the > >> legs array and > >> >> putting the data into a new legrow array delimited by $VM. > >> >> > >> >> I can do a print_r($legrow); and I get the rows displayed > >> >> correctly. I can > >> >> also access any row by using $legrow[n] where n is the > key number. > >> >> > >> >> What I want to do is to find a way of indexing the array > >> >> using the legId > >> >> as the key if possible. In other words I want to extract the > >> >> row where the > >> >> legId has a particular value where I do not know the row key. > >> >> > >> >> I have been thinking that this might be possible with an > >> >> associative array > >> >> but my attempts to do this have not worked. > >> >> > >> >> What I have tried is as follows > >> >> > >> >> $count=count($data->legs->leg); > >> >> $k=0; > >> >> while($k < $count) > >> >> { > >> >> > >> >> $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k][ > >> >> 'depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs- > >> >> >leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$da > >> >> ta->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM > >> >> .$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles']. > >> >> $VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k][' > >> >> meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->le > >> >> g[$k]['stops'].$VM.$data->legs->leg[$k]['eticket']; > >> >> > >> >> $k++; > >> >> } > >> >> > >> >> My thinking is that the $data->legs->leg[$k]['legId'] is the > >> >> legId and I > >> >> might use that as a key. This however does not work. > >> >> > >> >> I would appreciate some guidance on how I might get > this to work. > >> >> > >> >> Regards > >> >> > >> >> Richard Luckhurst > >> >> > >> >> -- > >> >> PHP General Mailing List (http://www.php.net/) > >> >> To unsubscribe, visit: http://www.php.net/unsub.php > >> >> > >> >> -- > >> >> No virus found in this incoming message. > >> >> Checked by AVG Free Edition. > >> >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > >> >> Date: 3/23/2007 3:27 PM > >> >> > >> >> > >> > > >> > -- > >> > No virus found in this outgoing message. > >> > Checked by AVG Free Edition. > >> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > >> Date: 3/23/2007 > >> > 3:27 PM > >> > > >> > > >> > -- > >> > PHP General Mailing List (http://www.php.net/) > >> > To unsubscribe, visit: http://www.php.net/unsub.php > >> > > >> > >> -- > >> No virus found in this incoming message. > >> Checked by AVG Free Edition. > >> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release > >> Date: 3/23/2007 3:27 PM > >> > >> > > > > -- > > No virus
[PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a
>> create table temp ( big5 char(2) ) character set big5 collate big5_bin; >> insert into temp ( big5 ) values ( 0x9f54 ); >> insert into temp ( big5 ) values ( 0x9f53 ); >> The 2nd query will report duplicated key. How should I fix the problem? > What does this has to do with PHP? > First of all I don't see any PHP code, and second this is an error in > your SQL query, so you should be on the MySQL list. I used mysqli_query() to send the SQL. How could I make it work? -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.10) Linux 2.6.20.4 ^ ^ 14:43:01 up 1 day 1:55 0 users load average: 1.01 1.02 1.00 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php