php-general Digest 20 Jul 2006 16:17:59 -0000 Issue 4249
php-general Digest 20 Jul 2006 16:17:59 - Issue 4249 Topics (messages 239604 through 239635): Re: ROZ pdf 239604 by: Chris Re: Open Source mailinglist? 239605 by: Paul Scott doubt - session file size 239606 by: suresh kumar 239607 by: Robert Cummings 239608 by: Chris 239634 by: Jochem Maas Re: session_start/session_write_close creates multiple sessioncookieheaders. How to fix this. 239609 by: Mathijs 239610 by: Mathijs Re: Return XML using PHP and Content-Type with UTF-8 breaks the UTF-8 239611 by: Mathijs 239612 by: Mathijs 239613 by: nicolas figaro search string 239614 by: weetat Re: Basic PHP knowledge test 239615 by: Finner, Doug 239618 by: Joe Wollard 239619 by: John Nichel 239620 by: John Nichel 239621 by: John Meyer 239624 by: Ray Hauge 239625 by: Jochem Maas 239626 by: Austin Denyer 239627 by: Robert Cummings Difference between 2 time entries 239616 by: Chris Grigor 239617 by: nicolas figaro 239622 by: Chris Grigor 239623 by: John Meyer Session breaks when form data submitted 239628 by: Jeffrey 239629 by: Ray Hauge headers and newline at end of script 239630 by: Martin Marques 239631 by: Jochem Maas 239632 by: John Nichel 239633 by: Robert Cummings Setting cookie on one domain for an other domain 239635 by: Peter Lauri 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: php-general@lists.php.net -- ---BeginMessage--- weetat wrote: Hi all, I am using EZpdf class to create pdf in mysql database . The Ezpdf class is open source tool for auto-creation of pdf in php , the link is http://sourceforge.net/projects/pdf-php I have the problem with tool , the pdf page is blank , eventhough have some data in my MySQL database . Ask on their forums. http://sourceforge.net/forum/?group_id=45168 We don't know the code so have no idea what's going on. -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- On Wed, 2006-07-19 at 17:03 -0500, Jay Blanchard wrote: I can't seem to find any place on the net where you can discuss Open Source-related questions in general??? [/snip] Don't Sourceforge and Freshmeat have lists? You could also join your local LUG, or a site like http://fsiu.uwc.ac.za which is focused on PHP, Free Software and capacity building in Africa. http://avoir.uwc.ac.za is similar, although tending more towards the capacity and skills building side of things. There are/should be mailing lists for most open projects that people really don't mind you lurking on. Choose one and have some fun. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm ---End Message--- ---BeginMessage--- Hi, I am having one doubt,i am using session variable for storing details.but i am afraid if there is around 1 users,wherether session will be able to store all the datas of 1 users,as i know abt session is that a temporary file will be created in /tmp directory with session id name,i dont know how much data that the session file will handle. A.suresh - Find out what India is talking about on Yahoo! Answers India. Send FREE SMS from New Yahoo! Messenger to Mobile: Download NOW!---End Message--- ---BeginMessage--- On Thu, 2006-07-20 at 01:03, suresh kumar wrote: Hi, I am having one doubt,i am using session variable for storing details. but i am afraid if there is around 1 users,wherether session will be able to store all the datas of 1 users,as i know abt session is that a temporary file will be created in /tmp directory with session id name,i dont know how much data that the session file will handle. See your php.ini for setting the path to where you want session files stored. I don't believe there's a limit to the size of your session files, that said, there IS a limit as to how much memory PHP is allowed to consume, and this obviously places an implicit limit on the size of the session files. 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
Re: [PHP] doubt - session file size
On Thu, 2006-07-20 at 01:03, suresh kumar wrote: Hi, I am having one doubt,i am using session variable for storing details. but i am afraid if there is around 1 users,wherether session will be able to store all the datas of 1 users,as i know abt session is that a temporary file will be created in /tmp directory with session id name,i dont know how much data that the session file will handle. See your php.ini for setting the path to where you want session files stored. I don't believe there's a limit to the size of your session files, that said, there IS a limit as to how much memory PHP is allowed to consume, and this obviously places an implicit limit on the size of the session files. 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] doubt - session file size
Robert Cummings wrote: On Thu, 2006-07-20 at 01:03, suresh kumar wrote: Hi, I am having one doubt,i am using session variable for storing details. but i am afraid if there is around 1 users,wherether session will be able to store all the datas of 1 users,as i know abt session is that a temporary file will be created in /tmp directory with session id name,i dont know how much data that the session file will handle. See your php.ini for setting the path to where you want session files stored. I don't believe there's a limit to the size of your session files, that said, there IS a limit as to how much memory PHP is allowed to consume, and this obviously places an implicit limit on the size of the session files. There could also be a limit on the number of files you can have per directory.. Maybe it's better to use your own custom session handler and store everything in a database. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_start/session_write_close creates multiple sessioncookieheaders. How to fix this.
Chris wrote: Mathijs wrote: Chris wrote: Mathijs wrote: Hello again, I Use session_write_close() so the page loads quicker because i use session on multiple place. This because session has protection for race conditions. Now it works very well and i don't have any problems at all. I only see that there are multiple session cookie headers set. I Personally think that one is enough :P. How can i make it so that it just sets just one and not set this header every time i call session_start or session_write_close. Because i don't know when the cookie is set. I think this will be an either/or situation. Either it only sends one session cookie header and you don't use session_write_close all over the place.. or, it sends multiple cookies and you do use session_write_close all over the place. The internals of php would set this behaviour, not something you can change without changing the C code. Hmmm... I find it kinda strange that it sets the same uniqueId with the same session name more then once. It would be logical to just have one.. And overwrite the previous session cookie. Any other thing would be an programmers fault in my opinion. Because you can't have more then one session id per session cookie name. Also, the browser won't send all the cookies back. This is just useless overhead. But it seems that i have to live with it (for now). I think ill report this as an bug to PHP. Doubt you'll get very far. I could open 10 tabs in firefox and I'll have the same session id in each one, but they'll all be on different pages doing different things. Even in IE, if I open a new page I'll get the same session id in both browser windows. That is a good thing. But the problem is that there are like 5 or 6 headers for one request. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0629-1, 07/19/2006 Tested on: 7/20/2006 8:56:33 AM avast! - copyright (c) 1988-2006 ALWIL Software. http://www.avast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Return XML using PHP and Content-Type with UTF-8 breaks the UTF-8
Ray Hauge wrote: On Wednesday 19 July 2006 09:27, Mathijs wrote: Hello there, I Have an problem with UTF-8 and XML. I Output perfect XML (according to IE, Opera and Firefox). I use the Content-Type header with text/xml; charset=utf-8. For some reason this breaks UTF-8 output. When i remove it it works. But i need the text/xml header. If i save an document as .xml with the same contents as UTF-8 it works. Is this a known problem? Thx in advanced. I would try just specifying UTF-8 in the XML header, and remove the charset from the content-type header, and just have the text/xml. ?xml version=1.0 encoding=utf-8? HTH I have tryed this. But this also breaks the UTF-8. When i put it back to text/html it works like it should :S. I Realy have no clue anymore. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0629-1, 07/19/2006 Tested on: 7/20/2006 8:57:39 AM avast! - copyright (c) 1988-2006 ALWIL Software. http://www.avast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Return XML using PHP and Content-Type with UTF-8 breaks the UTF-8
Mathijs a écrit : Hello there, I Have an problem with UTF-8 and XML. I Output perfect XML (according to IE, Opera and Firefox). I use the Content-Type header with text/xml; charset=utf-8. For some reason this breaks UTF-8 output. When i remove it it works. But i need the text/xml header. Hi, could you check which encoding your script is saved with ? I saw some strange things when printing some iso-8859 strings with a php script saved in utf-8. N F If i save an document as .xml with the same contents as UTF-8 it works. Is this a known problem? Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] search string
Hi all , I am using php4.3.2,MYSQL and RedHat I have a sql text as shown below: SELECT DISTINCT(tbl_chassis.serial_no),tbl_chassis.host_name,tbl_chassis.chasis_model,tbl_chassis.country,tbl_chassis.city,tbl_chassis.building, tbl_chassis.other,tbl_chassis.status,tbl_chassis.chasis_eos,tbl_chassis.chasis_eol,tbl_chassis.chasis_user_field_1,tbl_chassis.chasis_user_field_2,tbl_chassis.chasis_user_field_3 from tbl_chassis tbl_chassis,tbl_card tbl_card WHERE tbl_chassis.serial_no = tbl_card.serial_no AND tbl_chassis.chasis_model LIKE '%WS-C5500%' AND lower(country) = lower(trim('Malaysia')) ORDER BY country,city,building,other I need to extract the tbl_chassis.chasis_model LIKE '%WS-C5500%' and lower(country) = lower(trim('Malaysia')) and join them to new string. Anyone have any suggestion how to do this? Thanks -weetat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Basic PHP knowledge test
My advice, give the candidates problems and see how they solve them. Even if they don't finish, you get an idea of how they think. tedd I like this idea! Do you expect them to be able to work with code written by others? If so, hand them some of your existing code (good examples and not so good) and ask them to figure out what it does and recommend changes. I really really like the 'give them a problem and have them solve it' idea... Doug ___ This e-mail message has been sent by Kollsman, Inc. and is for the use of the intended recipients only. The message may contain privileged or confidential information. If you are not the intended recipient you are hereby notified that any use, distribution or copying of this communication is strictly prohibited, and you are requested to delete the e-mail and any attachments and notify the sender immediately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Difference between 2 time entries
Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between these 2 times?? I have looked at using the following but am not to sure function timeDiff($firstTime,$lastTime) { // convert to unix timestamps $firstTime=strtotime($firstTime); $lastTime=strtotime($lastTime); // perform subtraction to get the difference (in seconds) between times $timeDiff=$lastTime-$firstTime; // return the difference return $timeDiff; } //Usage : echo timeDiff($start,$finish); Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Difference between 2 time entries
Chris Grigor a écrit : Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between these 2 times?? IMHO, the best is to generate a timestamp using mktime for each date. you can the calculate the difference of timestamps and convert it back using date. $tm_start = mktime(substr($start,0,2),substr($start,3,2), substr($start,5,2)); $tm_finish = mktime(substr($finish,0,2),substr($finish,3,2), substr($finish,5,2)); $tm_diff = $tm_finish -tm_start; print date(H:i,$tm_diff); I don't know if date accepts negative timestamps, so be sure $finish is later than $start (you can also put the day in case $finish = 00:00:12 and $start =15:00:00). hope this'll help N F I have looked at using the following but am not to sure function timeDiff($firstTime,$lastTime) { // convert to unix timestamps $firstTime=strtotime($firstTime); $lastTime=strtotime($lastTime); // perform subtraction to get the difference (in seconds) between times $timeDiff=$lastTime-$firstTime; // return the difference return $timeDiff; } //Usage : echo timeDiff($start,$finish); Thanks Chris Nicolas Figaro http://www.sdv.fr [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] SDV plurimédia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP knowledge test
To refine that a bit, you may want to give them some code that has been intentionally broken (simple things for the entry level position, such as missing semicolons or curly braces etc) and watch to see how they go about discovering the parse errors. To me, it would be better to hire someone that can solve problems quickly, not someone who can simply tell you what a piece of code is doing. Just a thought though - good luck! -Joe On Jul 20, 2006, at 7:20 AM, Finner, Doug wrote: My advice, give the candidates problems and see how they solve them. Even if they don't finish, you get an idea of how they think. tedd I like this idea! Do you expect them to be able to work with code written by others? If so, hand them some of your existing code (good examples and not so good) and ask them to figure out what it does and recommend changes. I really really like the 'give them a problem and have them solve it' idea... Doug __ _ This e-mail message has been sent by Kollsman, Inc. and is for the use of the intended recipients only. The message may contain privileged or confidential information. If you are not the intended recipient you are hereby notified that any use, distribution or copying of this communication is strictly prohibited, and you are requested to delete the e-mail and any attachments and notify the sender immediately. -- 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] Basic PHP knowledge test
Please reply to the list. jekillen wrote: On Jul 19, 2006, at 8:31 AM, John Nichel wrote: We're looking to hire an entry level php programmer here, and I've been tasked with writing the test to evaluate the potential candidates. Being the lazy guy that I am, I naturally turned to Google to see if I could find some tests that I could use. After clicking thru many links, and finding mostly 'basic php tutorials', I've come here to ask you people to do my homework for me. ;) Does anyone have any links/resources for a basic php knowledge test? If not, I'll have to write one from scratch myself, and mess up the rest of my day of goofing off/sleeping. What does $_POST['x'] mean? What does $ in front of a string of chars without quotes mean? That does register globals mean? Is it possible to run php as a cgi script? When it is necessary to use 'var' in php code? If you can't answer these questions how are you going to know if someone is giving you the right answers? There are tons of basic to advance books on the commercial market about php. I've gone the distance and shelled out literally 1,000 of dollars buying books and hours learning the stuff. If you want answers to your questions spend a little time so you will know if someone has passed a test or not. I've spent the past 8+ years 'going the distance' in PHP (quite a bit longer when you count in things like Perl, PASCAL, COBOL, etc), and shelled out about $25 on one PHP book. The web is a far better, cheaper, and more up-to-date learning source. However, I'm a geek, not some college kid who writes up documents so that HR can have a pretty piece of paper saying this guy knows the difference between '==' and '==='. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP knowledge test
Finner, Doug wrote: My advice, give the candidates problems and see how they solve them. Even if they don't finish, you get an idea of how they think. tedd I like this idea! Do you expect them to be able to work with code written by others? If so, hand them some of your existing code (good examples and not so good) and ask them to figure out what it does and recommend changes. Most definitely. This position isn't going to really require the person to write their own apps. Most of the stuff he/she will be doing is maintaining code already in place. Plenty of it will be my code, but prior to me starting here three years ago, they used to just get people on a contract basis, and there's some pretty messed up code. They even contracted a job out to a couple of Russian programmers; code's pretty clean, but all the comments are in Russian. ;) I like the idea of giving them a piece of our existing code and getting them to do something with it...I'll just have to get HR to accept my word on how they did on it (they really want a question and answer sheet that they can 'grade'). I really really like the 'give them a problem and have them solve it' idea... Yeah, one of my earliest thoughts on this was to have them write something simple like connecting to a db, selecting multiple rows, parsing our the result, and displaying it in some fashion. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP knowledge test
John Nichel wrote: What does $_POST['x'] mean? What does $ in front of a string of chars without quotes mean? That does register globals mean? Is it possible to run php as a cgi script? When it is necessary to use 'var' in php code? I would probably agree that a problem would be better. Here's an idea, have one of your HR people take some existing code and do something to it to give it a bug, then have the guy fix it, and see how close he comes to what's there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Difference between 2 time entries
Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between these 2 times?? I have looked at using the following but am not to sure function timeDiff($firstTime,$lastTime) { // convert to unix timestamps $firstTime=strtotime($firstTime); $lastTime=strtotime($lastTime); // perform subtraction to get the difference (in seconds) between times $timeDiff=$lastTime-$firstTime; // return the difference return $timeDiff; } //Usage : echo timeDiff($start,$finish); Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Difference between 2 time entries
|Found this on the PHP web site, you can add the conversions as the first lines in the functions. function callDuration($dateTimeBegin,$dateTimeEnd) { $dif=$dateTimeEnd - $dateTimeBegin; $hours = floor($dif / 3600); $temp_remainder = $dif - ($hours * 3600); $minutes = floor($temp_remainder / 60); $temp_remainder = $temp_remainder - ($minutes * 60); $seconds = $temp_remainder; // leading zero's - not bothered about hours $min_lead=':'; if($minutes =9) $min_lead .= '0'; $sec_lead=':'; if($seconds =9) $sec_lead .= '0'; // difference/duration returned as Hours:Mins:Secs e.g. 01:29:32 return $hours.$min_lead.$minutes.$sec_lead.$seconds; } | Chris Grigor wrote: Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between these 2 times?? I have looked at using the following but am not to sure function timeDiff($firstTime,$lastTime) { // convert to unix timestamps $firstTime=strtotime($firstTime); $lastTime=strtotime($lastTime); // perform subtraction to get the difference (in seconds) between times $timeDiff=$lastTime-$firstTime; // return the difference return $timeDiff; } //Usage : echo timeDiff($start,$finish); Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP knowledge test
On Thursday 20 July 2006 07:23, John Nichel wrote: Yeah, one of my earliest thoughts on this was to have them write something simple like connecting to a db, selecting multiple rows, parsing our the result, and displaying it in some fashion. Don't forget making it secure. Here is one of my questions people can use if they like. Feel free to re-word it. I'm a programmer, not a writer ;) What change(s) would you make to the following code to make it more secure? $id = $_GET['id']; mysql_query(“DELETE FROM myTbl WHERE id = $id”); I like this question, because they have to know at least the fundamentals of PHP security. -- Ray Hauge Programmer/Systems Administrator American Student Loan Services www.americanstudentloan.com 1.800.575.1099 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP knowledge test
Ray Hauge wrote: On Thursday 20 July 2006 07:23, John Nichel wrote: Yeah, one of my earliest thoughts on this was to have them write something simple like connecting to a db, selecting multiple rows, parsing our the result, and displaying it in some fashion. Don't forget making it secure. Here is one of my questions people can use if they like. Feel free to re-word it. I'm a programmer, not a writer ;) What change(s) would you make to the following code to make it more secure? $id = $_GET['id']; mysql_query(“DELETE FROM myTbl WHERE id = $id”); /* // removed security flaw $id = $_GET['id']; mysql_query(“DELETE FROM myTbl WHERE id = $id”); //*/ ;-) I like this question, because they have to know at least the fundamentals of PHP security. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP knowledge test
Ray Hauge wrote: Don't forget making it secure. Here is one of my questions people can use if they like. Feel free to re-word it. I'm a programmer, not a writer ;) What change(s) would you make to the following code to make it more secure? $id = $_GET['id']; mysql_query(“DELETE FROM myTbl WHERE id = $id”); Believe it or not, I've lost count of how many times I've seen things like this in Real Life. SQL Injection waiting to happen... I like this question, because they have to know at least the fundamentals of PHP security. Agreed. One thing I would add is to make sure they're familiar with the PHP version you use. Regards, Austin. signature.asc Description: OpenPGP digital signature
Re: [PHP] Basic PHP knowledge test
On Thu, 2006-07-20 at 09:19, Jochem Maas wrote: Ray Hauge wrote: On Thursday 20 July 2006 07:23, John Nichel wrote: Yeah, one of my earliest thoughts on this was to have them write something simple like connecting to a db, selecting multiple rows, parsing our the result, and displaying it in some fashion. Don't forget making it secure. Here is one of my questions people can use if they like. Feel free to re-word it. I'm a programmer, not a writer ;) What change(s) would you make to the following code to make it more secure? $id = $_GET['id']; mysql_query(“DELETE FROM myTbl WHERE id = $id”); /* // removed security flaw $id = $_GET['id']; mysql_query(“DELETE FROM myTbl WHERE id = $id”); //*/ ;-) You removed a lot more than the security flaw. No job for U! 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
[PHP] Session breaks when form data submitted
We have a site which requires users log in. Once they do so a session is created (session_start), some data is saved as session data, particularly data which identifies the user, their privileges, etc. If the session ends, breaks, etc. The user must log in again. There are also forms on the site. When a user submits a form, data, both posted and session, is saved to a MySQL database. If a session breaks when a user submits data via the form, the result is that the user must log in again, the data is lost and the user unhappy. This happens rarely - but when it does, it can upset the user who has put effort into completing the form. Is there a simple yet secure way of preventing this problem - for example passing the session id with the form and resurrecting the session if it has broken? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session breaks when form data submitted
On Thursday 20 July 2006 09:09, Jeffrey wrote: We have a site which requires users log in. Once they do so a session is created (session_start), some data is saved as session data, particularly data which identifies the user, their privileges, etc. If the session ends, breaks, etc. The user must log in again. There are also forms on the site. When a user submits a form, data, both posted and session, is saved to a MySQL database. If a session breaks when a user submits data via the form, the result is that the user must log in again, the data is lost and the user unhappy. This happens rarely - but when it does, it can upset the user who has put effort into completing the form. Is there a simple yet secure way of preventing this problem - for example passing the session id with the form and resurrecting the session if it has broken? Thanks, Jeff To my knowledge, this particular behavior is by design. After the time limit for a session has been reached, then the garbage collection will usually clean it up. The only way to not break a session is to never clean up the session files, or set the timeout to a day or so. I wouldn't suggest sending the PHPSESSID via a form. That leads to people being able to hijack sessions from file='php.ini' ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440 /from HTH -- Ray Hauge Programmer/Systems Administrator American Student Loan Services www.americanstudentloan.com 1.800.575.1099 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] headers and newline at end of script
I'm looking for an opinion on programming style. Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This last one puts all the HTML away from the PHP code, which has made life much easier. Now, sometimes I warning messages like this one: PHP Warning: Cannot modify header information - headers already sent in I know what it means, so I just look for newlines at the end of my PHP scripts, especially after the closing ? and delete them. Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
Martin Marques wrote: I'm looking for an opinion on programming style. Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This last one puts all the HTML away from the PHP code, which has made life much easier. Now, sometimes I warning messages like this one: PHP Warning: Cannot modify header information - headers already sent in I know what it means, so I just look for newlines at the end of my PHP scripts, especially after the closing ? and delete them. Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? I never add the final closing '?' in any script for this very reason. whether it's bad practice or I don't know (can't be any worse than the flamewar on internals@lists.php.net though ;-) -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
Jochem Maas wrote: Martin Marques wrote: I'm looking for an opinion on programming style. Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This last one puts all the HTML away from the PHP code, which has made life much easier. Now, sometimes I warning messages like this one: PHP Warning: Cannot modify header information - headers already sent in I know what it means, so I just look for newlines at the end of my PHP scripts, especially after the closing ? and delete them. Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
On Thu, 2006-07-20 at 11:30, John Nichel wrote: Jochem Maas wrote: Martin Marques wrote: I'm looking for an opinion on programming style. Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This last one puts all the HTML away from the PHP code, which has made life much easier. Now, sometimes I warning messages like this one: PHP Warning: Cannot modify header information - headers already sent in I know what it means, so I just look for newlines at the end of my PHP scripts, especially after the closing ? and delete them. Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! Some of the best coders are slackers... because they find better ways to code to prevent having to write so much code :) But to answer the question... http://marc.theaimsgroup.com/?l=php-devm=106896286829744w=2 http://marc.theaimsgroup.com/?l=php-devm=106896382030183w=2 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] doubt - session file size
Chris wrote: Robert Cummings wrote: On Thu, 2006-07-20 at 01:03, suresh kumar wrote: Hi, I am having one doubt,i am using session variable for storing details. but i am afraid if there is around 1 users,wherether session will be able to store all the datas of 1 users,as i know abt session is that a temporary file will be created in /tmp directory with session id name,i dont know how much data that the session file will handle. See your php.ini for setting the path to where you want session files stored. I don't believe there's a limit to the size of your session files, that said, there IS a limit as to how much memory PHP is allowed to consume, and this obviously places an implicit limit on the size of the session files. There could also be a limit on the number of files you can have per directory.. maybe there could be a limit to the number of emails the OP is allowed to send without ever replying to anyone who offers a possible answer to his question. :-) Maybe it's better to use your own custom session handler and store everything in a database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Setting cookie on one domain for an other domain
Best group member, When a user does a specific action on domain1.com I want a cookie to be set so that domain1.com and domain2.com can reach it. Ok, after reading the manual for setcookie() I tried this: setcookie(thevariable, thevalue, time()+60*60*24*30, /, .domain1.com); setcookie(thevariable, thevalue, time()+60*60*24*30, /, .domain2.com); However, I can not detect the cookie at domain2.com. A solution would be to just make a redirect to the other domain where the cookie is set and then return. Question is: Can I not set a cookie at domain1.com to work at domain2.com? Best regards, Peter Lauri
[PHP] Re: headers and newline at end of script
Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Escape Chars for MS Exchange/Outlook
I am using Ubuntu 6.06 Linux with PHP 5.1.4. I am using the phpmailer class. I set the message body to be $msgbody = $msgbody.'\r\rDate: '.$_REQUEST['date'].'\rName: '.$_REQUEST['lname'].', '.$_REQUEST['fname'].'\rReferral: '.$_REQUEST['referral'].'\rTelephone: '.$_REQUEST['tele'].'\rLoan Officer: '.$_REQUEST['lo'].'\r'; Over in theWindows world, the email takes it literally and keeps it in the message instead of giving me the desired effect. This Lead came from an Info Call\r\rDate: 20060720\rName: \rReferral: Home Buyers Seminar\rTelephone: 1-123-4567\rLoan Officer: Dave Boxer\r How can I get the CR that I want so each item is on a separate line? TIA Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Difference between 2 time entries
At 1:51 PM +0200 7/20/06, nicolas figaro wrote: IMHO, the best is to generate a timestamp using mktime for each date. you can the calculate the difference of timestamps and convert it back using date. $tm_start = mktime(substr($start,0,2),substr($start,3,2), substr($start,5,2)); $tm_finish = mktime(substr($finish,0,2),substr($finish,3,2), substr($finish,5,2)); $tm_diff = $tm_finish -tm_start; print date(H:i,$tm_diff); I don't know if date accepts negative timestamps, so be sure $finish is later than $start (you can also put the day in case $finish = 00:00:12 and $start =15:00:00). hope this'll help N F NF: Not quite. Your: substr($start,5,2) should be: substr($start,6,2) Your: $tm_diff = $tm_finish -tm_start; Should be: $tm_diff = $tm_finish - $tm_start; And lastly, print date(H:i,$tm_diff); Doesn't print the hours and seconds that have elapsed. I thought that php had a function where you could send it a number of seconds and it would return the number of years, months, days, hours and seconds, but I couldn't find any. But, date() doesn't. 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] Difference between 2 time entries
At 12:41 PM +0200 7/20/06, Chris Grigor wrote: Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between these 2 times?? I have looked at using the following but am not to sure function timeDiff($firstTime,$lastTime) { // convert to unix timestamps $firstTime=strtotime($firstTime); $lastTime=strtotime($lastTime); // perform subtraction to get the difference (in seconds) between times $timeDiff=$lastTime-$firstTime; // return the difference return $timeDiff; } //Usage : echo timeDiff($start,$finish); Chris: You're about there, you have the seconds, just add this: $hours = floor($timeDiff/3600); $timeDiff = $timeDiff - ($hours * 3600); $minutes = floor($timeDiff/60); $timeDiff = $timeDiff - ($minutes * 60); $seconds = $timeDiff; echo($hours); echo(br/); echo($minutes); echo(br/); echo($seconds); I'm surprised that php doesn't have a function to do this -- but maybe I didn't RTFM enough. In any event, hth's 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] headers and newline at end of script
John Nichel wrote: Jochem Maas wrote: Martin Marques wrote: I'm looking for an opinion on programming style. Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This last one puts all the HTML away from the PHP code, which has made life much easier. Now, sometimes I warning messages like this one: PHP Warning: Cannot modify header information - headers already sent in I know what it means, so I just look for newlines at the end of my PHP scripts, especially after the closing ? and delete them. Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! no chance of me getting that code-bitch job you've been forced to write a 'test' for then? ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] doubt - session file size
At 5:58 PM +0200 7/20/06, Jochem Maas wrote: On Thu, 2006-07-20 at 01:03, suresh kumar wrote: Hi, maybe there could be a limit to the number of emails the OP is allowed to send without ever replying to anyone who offers a possible answer to his question. :-) I think you need to understand the cast system at work here -- he presents questions, it's our duty to serve. Maybe in our next life, we'll deserve a reply. :-) 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] Setting cookie on one domain for an other domain
AFAIK, this could be a security risk, so even if PHP would allow it (which it might - I don't know), there is a good chance most browsers would not. I certainly wouldn't count on being able to do so. You could however use something like AJAX to do an asynchronous request to domain2, which would be allowed to set the domain2 cookie by virtue of actually being domain2. jon Peter Lauri wrote: Best group member, When a user does a specific action on domain1.com I want a cookie to be set so that domain1.com and domain2.com can reach it. Ok, after reading the manual for setcookie() I tried this: setcookie(thevariable, thevalue, time()+60*60*24*30, /, .domain1.com); setcookie(thevariable, thevalue, time()+60*60*24*30, /, .domain2.com); However, I can not detect the cookie at domain2.com. A solution would be to just make a redirect to the other domain where the cookie is set and then return. Question is: Can I not set a cookie at domain1.com to work at domain2.com? Best regards, Peter Lauri -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting cookie on one domain for an other domain
However, I can not detect the cookie at domain2.com. You aren't going to be able to nor should you be able to. It's a security feature of the browsers. A solution would be to just make a redirect to the other domain where the cookie is set and then return. That would be one solution. Question is: Can I not set a cookie at domain1.com to work at domain2.com? No, you can't. You could, however, if you were trying to set it for a different sub-domain (eg. subdomain1.domain.com and subdomain2.domain.com). thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: headers and newline at end of script
Hi: So is the consensuses here to NOT close the ? tag? 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] Enterprise grade CMS+Ecomm
Hello, So we're getting ready to redo our website once again to integrate some modern changes and a shift in branding. I'm currently looking at all my options as far as software goes. The question I have to answer is Do I write everything by myself from scratch and spend 3-6 months doing it? Or do I spend that same amount of money on a prebuilt system and spend 1 month integrating our new branding? The answer doesn't even have to be specifically one way or the other. It could be a mixture of the two. Perhaps I use something like Drupal (which I have no experience with) for the CMS part and write my own ecommerce application. Or perhaps I write my own basic CMS and purchase an ecommerce application? I've seen X-Cart and at first glance it doesn't look terrible so far. At least the design templates look to be pretty flexible. I'm definitely not interested in osCommerce or derivatives thereof. Why? Because I've worked with osC in the past and I dislike it very much. As for a CMS, I just watched a video on Drupal 4.7 and it looks quite interesting. Opinions? I'm also currently looking at www.opensourcecms.com and have been to the Joomla, XOOPS, Xaraya, and Mambo websites also. Thanks, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) 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] Basic PHP knowledge test
Here's one companies quiz that they gave: With each question, please keep the code short and simple. Make notes on possible caveats and fixes rather than adding a lot of error-checking to your code. 1. Write a PHP script to remove duplicate lines from a file. Do not worry about efficiency. Ex. input: Tree Donut Fish Food Tree Tree Doctor Fish Food Ex. output: Tree Donut Fish Food Doctor 2. Write a PHP script that retrieves the Word of the Day from http://dictionary.com/. 3. Write a PHP web page script which redirects visitors to google.com if their IP address is not of the form 10.x.x.x nor 192.168.x.x. Users who do not get redirected should be shown a top secret message. 4. Write a PHP script which inserts the contents of a TAB-delimited text file into a MySQL table. You must create the table. The columns are named in the file. Here is the data format with some example data: idTABnameTABageTABemailTABactive 1TABBerthaTAB93TAB[EMAIL PROTECTED]TAB1 2TABSammyTAB40TAB[EMAIL PROTECTED]TAB1 3TABErinTAB15TAB[EMAIL PROTECTED]TAB0 4TABRupertTAB29TAB[EMAIL PROTECTED]TAB1 5. Write a PHP function to determine if two strings are close enough, such as to find misspelt words. o Extra letters are OK. close_enough( 'apartment', 'appartmeant' ); returns true o Missing letters are OK. close_enough( 'apartment', 'aprmnt' ); returns true o Substitutions are OK. close_enough( 'apartment', 'apardmint' ); returns true o Only allow up to 1 error per 3 letters in the correct word, rounding up. For example, a 10-letter word can have up to 4 errors. They can be anywhere in the word. -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 5:31 AM To: PHP Mailing Lists Subject: Re: [PHP] Basic PHP knowledge test Finner, Doug wrote: My advice, give the candidates problems and see how they solve them. Even if they don't finish, you get an idea of how they think. tedd I like this idea! Do you expect them to be able to work with code written by others? If so, hand them some of your existing code (good examples and not so good) and ask them to figure out what it does and recommend changes. Most definitely. This position isn't going to really require the person to write their own apps. Most of the stuff he/she will be doing is maintaining code already in place. Plenty of it will be my code, but prior to me starting here three years ago, they used to just get people on a contract basis, and there's some pretty messed up code. They even contracted a job out to a couple of Russian programmers; code's pretty clean, but all the comments are in Russian. ;) I like the idea of giving them a piece of our existing code and getting them to do something with it...I'll just have to get HR to accept my word on how they did on it (they really want a question and answer sheet that they can 'grade'). I really really like the 'give them a problem and have them solve it' idea... Yeah, one of my earliest thoughts on this was to have them write something simple like connecting to a db, selecting multiple rows, parsing our the result, and displaying it in some fashion. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Enterprise grade CMS+Ecomm
On Thu, 2006-07-20 at 09:30 -0700, Chris W. Parker wrote: As for a CMS, I just watched a video on Drupal 4.7 and it looks quite interesting. Opinions? How about having a look at http://avoir.uwc.ac.za/ ? Its Free, very easy to learn and has a very active user and developer community. Its built on a MVC design pattern, so its really easy to write adaptor classes that you can quickly and painlessly integrate OSCommerce or whatever else you may need in there. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PAYMENT TRANSACTION
How are you all? I hope some body can give me some references for internet payment. I made a kind of shopping cart in my project; even though I was doubt in making it caused I don't have any idea how to make internet transaction. But I just heard from a friend of mine that we can 'join' with special web site which handles payment transaction. I'll be pleasure if some body can give references about this issue which explains how to collaborate with them step by step. Thank you guys.. Best Regards BBC **o0o** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
On Thu, 20 Jul 2006 11:30:14 -0400, John Nichel [EMAIL PROTECTED] wrote: Jochem Maas wrote: I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! What the hell is a SLACKER??? -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) Why? ;-) -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] headers and newline at end of script
I'd explain but it'd be too much work. James Kilbride -Original Message- From: Martin Marques [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 2:32 PM To: John Nichel Cc: php-general@lists.php.net Subject: Re: [PHP] headers and newline at end of script On Thu, 20 Jul 2006 11:30:14 -0400, John Nichel [EMAIL PROTECTED] wrote: Jochem Maas wrote: I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! What the hell is a SLACKER??? -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- 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: headers and newline at end of script
On Thu, 2006-07-20 at 14:15, Martin Marques wrote: On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) Why? ;-) See links I posted in previous response :) 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] headers and newline at end of script
He never said he didn't want you to do his coding, simply that you were a slacker. Considering he's self proclaimed 'lazy' just means the two of you should get on great and you'll probably understand his code better. James Kilbride SNIPPAGE(Jochem Maas wrote:) no chance of me getting that code-bitch job you've been forced to write a 'test' for then? ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] headers and newline at end of script
On Thu, 2006-07-20 at 14:39, Kilbride, James P. wrote: He never said he didn't want you to do his coding, simply that you were a slacker. Considering he's self proclaimed 'lazy' just means the two of you should get on great and you'll probably understand his code better. Won't work because John needs to hire someone to do his work for him so he can better excel at slacking himself. Cheers, Rob. James Kilbride SNIPPAGE(Jochem Maas wrote:) no chance of me getting that code-bitch job you've been forced to write a 'test' for then? ;-) -- .. | 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] PAYMENT TRANSACTION
BBC wrote: How are you all? I hope some body can give me some references for internet payment. I made a kind of shopping cart in my project; even though I was doubt in making it caused I don't have any idea how to make internet transaction. But I just heard from a friend of mine that we can 'join' with special web site which handles payment transaction. I'll be pleasure if some body can give references about this issue which explains how to collaborate with them step by step. Thank you guys.. What kind of 'internet payment' were you looking for? Credit card? PayPal? For credit cards, I get the customer's info and then use cURL to stuff it down a secure connection to Authorize.net. Regards, Austin. signature.asc Description: OpenPGP digital signature
RE: [PHP] PAYMENT TRANSACTION
BBC wrote: How are you all? I hope some body can give me some references for internet payment. I made a kind of shopping cart in my project; even though I was doubt in making it caused I don't have any idea how to make internet transaction. But I just heard from a friend of mine that we can 'join' with special web site which handles payment transaction. I'll be pleasure if some body can give references about this issue which explains how to collaborate with them step by step. Thank you guys.. What kind of 'internet payment' were you looking for? Credit card? PayPal? For credit cards, I get the customer's info and then use cURL to stuff it down a secure connection to Authorize.net. My general rule of thumb: Never ever handle credit card details. Ever. Pass the customer off to a third party that does it as their primary service. (Paypal, etc.) Possible exception: If you are working for a huge corporation with deep pockets and high dollar lawyers, for when the credit card info gets compromised. If you must handle credit card info, never ever store it anywhere. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Escape Chars for MS Exchange/Outlook
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike wrote: I am using Ubuntu 6.06 Linux with PHP 5.1.4. I am using the phpmailer class. I set the message body to be $msgbody = $msgbody.'\r\rDate: '.$_REQUEST['date'].'\rName: '.$_REQUEST['lname'].', '.$_REQUEST['fname'].'\rReferral: '.$_REQUEST['referral'].'\rTelephone: '.$_REQUEST['tele'].'\rLoan Officer: '.$_REQUEST['lo'].'\r'; Over in theWindows world, the email takes it literally and keeps it in the message instead of giving me the desired effect. This Lead came from an Info Call\r\rDate: 20060720\rName: \rReferral: Home Buyers Seminar\rTelephone: 1-123-4567\rLoan Officer: Dave Boxer\r How can I get the CR that I want so each item is on a separate line? A line end should be marked with CRLF [\r\n] not just CR [\r]. - -Stut -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEv9VR2WdB7L+YMm4RAn6kAJwNZWQGybLFbc3AYRqZGlS1r18KqQCggJPg oDQAQ9j/ypT26Tu1Rkrjjds= =uzMO -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Enterprise grade CMS+Ecomm
-Original Message- The question I have to answer is Do I write everything by myself from scratch and spend 3-6 months doing it? Or do I spend that same amount of money on a prebuilt system and spend 1 month integrating our new branding? The answer to this question depends heavily on your needs. What kind of functionality do you need to get out of your website? If you are looking for a website that is similar to others in function, than I would definitely suggest looking at an existing CMS package. Even if you will need some custom functionality, it may be worth the time and effort to create your own module for an existing system. But again, that depends on the complexity of the system you need. The answer doesn't even have to be specifically one way or the other. It could be a mixture of the two. Perhaps I use something like Drupal (which I have no experience with) for the CMS part and write my own ecommerce application. Or perhaps I write my own basic CMS and purchase an ecommerce application? I would suggest that you take a look at the different CMS options as well as the community released modules / plugins. You may well find a CMS that has a module that will meet your needs, or be close enough that you could take the code and customize it to what you are looking for. As for a CMS, I just watched a video on Drupal 4.7 and it looks quite interesting. Opinions? I'm currently migrating from a Mambo site to Drupal. My main reason for doing so is the multi-site functionality. We have a few different websites that we maintain for different business goals, but we want them all to authenticate against the same database due to the fact that some of our users will need to use all of the sites. Using drupal it is very simple to setup several sites on one codebase, and telling them to all authenticate against the same database table is very easy. The other nice thing is that you can setup drupal to share the sessions table as well, so logging into one site logs you into all of the sites at once. Having said that, Drupal is a little more difficult to understand than some of the other CMS systems. At least it was for me, but that probably reflects more on me than on Drupal. ;) For a single site setup I would probably stick with Joomla, but that's just a preference. The bottom line is that there are lots of great CMS options, and the best way to choose one is to know exactly what you want from a CMS and compare them with that in mind. Good luck, Brady -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
Jochem Maas wrote: Martin Marques wrote: On Thu, 20 Jul 2006 11:30:14 -0400, John Nichel [EMAIL PROTECTED] wrote: Jochem Maas wrote: I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! What the hell is a SLACKER??? I'm a slacker. Which is why you aren't up for the job here. The slacker position belongs to me. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
Martin Marques wrote: On Thu, 20 Jul 2006 11:30:14 -0400, John Nichel [EMAIL PROTECTED] wrote: Jochem Maas wrote: I never add the final closing '?' in any script for this very reason. 'Cause you're a SLACKER!!! What the hell is a SLACKER??? I'm a slacker. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
As far as getting the header error resolved, try this: http://ca3.php.net/manual/en/function.ob-start.php HTH Steve Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 2006-07-20 at 14:15, Martin Marques wrote: On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) Why? ;-) See links I posted in previous response :) 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] Re: headers and newline at end of script
On Thu, 20 Jul 2006, Stephen Lake wrote: As far as getting the header error resolved, try this: http://ca3.php.net/manual/en/function.ob-start.php I'll stick with not closing my scripts, just like Rasmus said. :-) -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
Jochem Maas wrote: Robert Cummings wrote: On Thu, 2006-07-20 at 14:15, Martin Marques wrote: On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) Why? ;-) See links I posted in previous response :) I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) Cheers, Rob. I believe it's the opposite. I said it was bad practice. He disagreed, and used his links to back himself up. Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 2006-07-20 at 16:50, Jochem Maas wrote: Robert Cummings wrote: On Thu, 2006-07-20 at 14:15, Martin Marques wrote: On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) Why? ;-) See links I posted in previous response :) I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) The original question says Is it bad practice? Adam Zey said Yes. I said he is Wrong. Now granted, re-reading the original post, there are two questions, I presumed (quite possibly incorrectly) Adam Zey was answering the first. Generally when you have Y answers for X questions and Y X then the first Y questions are presumed answered. Just like when parsing CSV files and you run out of commas :) If we didn't have this basic presumption, then the universe would begin to tear apart -- trust me on that one ;) 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] Re: headers and newline at end of script
Robert Cummings wrote: On Thu, 2006-07-20 at 14:15, Martin Marques wrote: On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: Now, my question is: Is it a bad practice to NOT close the script with the PHP closing ?? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Wrong :) Why? ;-) See links I posted in previous response :) I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 20 Jul 2006, Adam Zey wrote: Jochem Maas wrote: Robert Cummings wrote: I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) I believe it's the opposite. I said it was bad practice. He disagreed, and used his links to back himself up. Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Explain yourself. register_globals can give you a big headache, but in which way is not closing the script like using register_globals? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 2006-07-20 at 16:53, Adam Zey wrote: Jochem Maas wrote: I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) I believe it's the opposite. I said it was bad practice. He disagreed, and used his links to back himself up. Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. That's a good point, but if your code is well separated from your content, then the opening PHP tag merely gives your code necessary context. Closing it is more adverse than no closing it since you may accidentally leave whitespace as the OP was finding. Thus omission of the closing tag leads to cleaner code and easier maintenance since you don't need to track down whitespace error (nor do you need to enable ob_start() to solve said issue). 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] Re: headers and newline at end of script
Adam Zey wrote: snip Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Ding ding ding Give that man a cigar. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
Martin Marques wrote: On Thu, 20 Jul 2006, Adam Zey wrote: Jochem Maas wrote: Robert Cummings wrote: I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) I believe it's the opposite. I said it was bad practice. He disagreed, and used his links to back himself up. Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Explain yourself. register_globals can give you a big headache, but in which way is not closing the script like using register_globals? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - In that they're both features, and I think it's bad style to use either one of them. Robert Cummings disagrees with me, which is fine. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Enterprise grade CMS+Ecomm
Brady Mitchell mailto:[EMAIL PROTECTED] on Thursday, July 20, 2006 12:25 PM said: The answer to this question depends heavily on your needs. What kind of functionality do you need to get out of your website? If you are looking for a website that is similar to others in function, than I would definitely suggest looking at an existing CMS package. [snip] The bottom line is that there are lots of great CMS options, and the best way to choose one is to know exactly what you want from a CMS and compare them with that in mind. Yeah I understand that it's a pretty open ended question, and thanks for the info about Drupal. We want to maintain 2 different sites as well and authenticating against the same table sounds nice. But as for recommendations, keeping in mind the difficulty in answering a question like mine, I am mostly just looking for things like what you've said: I use $cms because I like that it can do $feature. Thanks, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 2006-07-20 at 17:09, John Nichel wrote: Adam Zey wrote: snip Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Ding ding ding Give that man a cigar. Why would anyone wish cancer on somebody else? Seems mean to me. 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] Enterprise grade CMS+Ecomm
On Thursday 20 July 2006 11:30, Chris W. Parker wrote: The answer doesn't even have to be specifically one way or the other. It could be a mixture of the two. Perhaps I use something like Drupal (which I have no experience with) for the CMS part and write my own ecommerce application. Or perhaps I write my own basic CMS and purchase an ecommerce application? Drupal has its own ecommerce suite that is reasonably robust all on its own. Drupal's main advantage: Whatever you're trying to do, odds are you can already do it with some combination of existing modules. Drupal's main disadvantage: There's a metric fuckton of modules and just as many ways to combine them. The don't code, just configure option is not always easy to figure out because it's just so flexible. (Disclaimer: I am a Drupal developer, albeit a minor one.) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php