RE: [PHP] Online Form Creation
>My apologies if you took my comments as being rude. The point here is that if >you want advice, then we need to see what is causing you problems. Giving us >an outline of what you want isn't giving us anything other than "This is what >I want" -- with an implied "Do it". Hi Tedd, I apologize as well Tedd. Reading back over my email it was not worded the best. I appreciate the assistance and promise to be more through when posting. This is part of the growing pains for me as a newbie. Best, Chris -Original Message- From: Tedd Sperling [mailto:tedd.sperl...@gmail.com] Sent: Thursday, December 22, 2011 1:43 PM To: PHP-General List Cc: Christopher Lee Subject: Re: [PHP] Online Form Creation On Dec 22, 2011, at 11:22 AM, Christopher Lee wrote: > Tedd, > > I appreciate your reply to my post. In no way do I expect anyone to code for > me. If that were the case I would hire someone. I have posted to this list > numerous times and, if I am not mistaken, the list is designed to ask for > suggestions, which I did. Being rude does not help anyone. > > I understand how to program radio buttons in a form that record 'instances' > of a response. I just was not sure how to set-up a similar matrix to allow > the user to enter a numerical value. > > I will follow your suggestion and submit my work. > > Best, > > Christopher Christopher: My apologies if you took my comments as being rude. The point here is that if you want advice, then we need to see what is causing you problems. Giving us an outline of what you want isn't giving us anything other than "This is what I want" -- with an implied "Do it". My advice, the first step will be to create a form with elements like these: http://rebel.lcc.edu/sperlt/citw229/examples/postform/index.php http://rebel.lcc.edu/sperlt/citw229/examples/stickyradio/ http://rebel.lcc.edu/sperlt/citw229/examples/stickycheckbox/ http://rebel.lcc.edu/sperlt/citw229/examples/stickymultselect/ and then get it to work for you. If it fails, present it, and we'll comment. Cheers, tedd PS: Everything you need for this first step is provided above. The next step will be cleaning the data and placing it into the database. _ t...@sperling.com http://sperling.com This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Online Form Creation
>Now, if you need help with writing the PHP that handles the data, then great! >This is the right place to ask! But we need to see code you attempted, in >order to know your level of understanding, and so be able to guide better. Hi Godiva, I appreciate all the great comments/suggestions from everyone. I probably could have worded my initial email a little better. Thank you to Tedd as well. Best, Christopher -Original Message- From: Govinda [mailto:govinda.webdnat...@gmail.com] Sent: Thursday, December 22, 2011 12:15 PM To: Christopher Lee Cc: PHP-General List Subject: Re: [PHP] Online Form Creation > I understand how to program radio buttons in a form that record 'instances' > of a response. I just was not sure how to set-up a similar matrix to allow > the user to enter a numerical value. Christopher, Maybe Tedd was a little curt, but the language you used just made it seem like you had not done enough HTML work to really be able to sort out the difference between HTML problems (missing pieces in your understanding), and PHP problems. HTML forms are totally independent of what you DO with the data that gets submitted when the user clicks the form's submit button. HTML lets you lay out the form to look however you want.. (you can use HTML's ... to achieve the visual layout you want). PHP is needed to HANDLE the data (receive it from the submitting form and save it to a db). When you say, "You will see that the forms are in a matrix format", and, "...[you] are not sure how to set-up a similar matrix..." it sounds like an HTML problem. If you do need help with HTML layout, then practice, Google, and consulting an HTML list will be your best bet. Now, if you need help with writing the PHP that handles the data, then great! This is the right place to ask! But we need to see code you attempted, in order to know your level of understanding, and so be able to guide better. > I will follow your suggestion and submit my work. -Govinda This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Online Form Creation
On Dec 21, 2011, at 2:14 AM, Tedd Sperling wrote: >I don't see a problem here. > >1. Figure out how to create a HTML form (Investigate HTML tables). >2. Then write a PHP that will scrub the data and submit it to MySQL. > >The length and layout of the forms are of no significance. > >This is basic html/php -- try creating something and submit your work for our >review. If you want us to write the >code for you, please look elsewhere. Tedd, I appreciate your reply to my post. In no way do I expect anyone to code for me. If that were the case I would hire someone. I have posted to this list numerous times and, if I am not mistaken, the list is designed to ask for suggestions, which I did. Being rude does not help anyone. I understand how to program radio buttons in a form that record 'instances' of a response. I just was not sure how to set-up a similar matrix to allow the user to enter a numerical value. I will follow your suggestion and submit my work. Best, Christopher -Original Message- From: Tedd Sperling [mailto:tedd.sperl...@gmail.com] Sent: Wednesday, December 21, 2011 12:05 PM To: PHP-General List Cc: Christopher Lee Subject: Re: [PHP] Online Form Creation On Dec 21, 2011, at 2:14 AM, Christopher Lee wrote: > Hello All, > > I have two forms (see attached) that I would like to recreate and enable the > user to complete the form online. The data would be collected in a MySQL DB. > > http://ucensys.com/activities.pdf > > http://ucensys.com/guidelines.pdf > > You will see that the forms are in a matrix format. I am having trouble > figuring out the best way to create the form and ensure the data is collected > properly in the DB. Any suggestions would be greatly appreciated. > > Best, > > Christopher I don't see a problem here. 1. Figure out how to create a HTML form (Investigate HTML tables). 2. Then write a PHP that will scrub the data and submit it to MySQL. The length and layout of the forms are of no significance. This is basic html/php -- try creating something and submit your work for our review. If you want us to write the code for you, please look elsewhere. Cheers, tedd _ t...@sperling.com http://sperling.com This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Online Form Creation
Hello All, I have two forms (see attached) that I would like to recreate and enable the user to complete the form online. The data would be collected in a MySQL DB. http://ucensys.com/activities.pdf http://ucensys.com/guidelines.pdf You will see that the forms are in a matrix format. I am having trouble figuring out the best way to create the form and ensure the data is collected properly in the DB. Any suggestions would be greatly appreciated. Best, Christopher This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
[PHP] PHP based online survey tool
Hello All, I am looking to develop an online survey for a non-profit. The user should be able to complete the survey and see the results in the form of a visualization (i.e. pie chart) upon completion. I found this tool (http://www.iscripts.com/survey/) but not sure how good it is. Does anyone have any suggestions for PHP based online survey tools? Any suggestions would be greatly appreciated. Thank you all in advance. Best, Christopher This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
RE: [PHP] RSS Feed
Hello Matijn, Thank you for the response and the link. I had not tried Google but, instead, reached out to the list first. Thought I would get people who have developed similar tools with success..:-) I will certainly reference the link and give this try. Best, Christopher -Original Message- From: Matijn Woudt [mailto:tijn...@gmail.com] Sent: Tuesday, November 15, 2011 4:38 PM To: Christopher Lee Cc: php-general@lists.php.net Subject: Re: [PHP] RSS Feed Hi, Have you tried google? I tried and top hit was this one: http://stackoverflow.com/questions/1501394/writing-an-rss-feed-to-mysql-using-php I guess that's all you need. Matijn On Tue, Nov 15, 2011 at 9:30 PM, Christopher Lee wrote: > Hello All, > > I am interested in importing RSS Feed content into a MySQL database and > displaying the aggregated content on a website. I am thinking of developing > the website within a CMS type framework (i.e. Drupal). If anyone can refer me > to any resources in this area then that would be great. I hope that I have > adequately explained my needs. Thank you all in advance for your help. > > Best, > > Christopher > This message is for the designated recipient only and may contain privileged, > proprietary, or otherwise private information. If you have received it in > error, please notify the sender immediately and delete the original. Any > other use of the email by you is prohibited. > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
[PHP] RSS Feed
Hello All, I am interested in importing RSS Feed content into a MySQL database and displaying the aggregated content on a website. I am thinking of developing the website within a CMS type framework (i.e. Drupal). If anyone can refer me to any resources in this area then that would be great. I hope that I have adequately explained my needs. Thank you all in advance for your help. Best, Christopher This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
RE: [PHP] Friday Distraction
-Original Message- From: Govinda [mailto:govinda.webdnat...@gmail.com] Sent: Friday, October 21, 2011 4:31 PM To: Tedd Sperling Cc: PHP General Subject: Re: [PHP] Friday Distraction > Not meaning to be ignorant, but why? > > What's the point here? > > I have grandkids and about a dozen other species of relatives/friends trying > to get me to do stuff (i.e., like/friend/post/reply/accept) on FaceBook et > al, but I don't see the point. It looks like a total waste of time. Why > should I care if someone post something on their FaceBook account? I would > rather spend my time programming, teaching programming, and reading about > programming. > > Maybe I'm just getting too old for this stuff. > > Cheers, > > tedd First, I hope that I am posting my response to Tedd correctly (no top posts..). Second, I totally agree with Tedd and I am only 36...:-) Best, Christopher Tedd, Your naturalness is always endearing, even when you play grumpy. ;-) It may seem like overly zealous waste of technology.. but look at it from another angle - It's just plain ole (ancient) human need for social interaction... piped through the latest tools. The girls anyway certainly love FaceBook, et al., for the same reasons they ever loved the chance to compare social notes. I did not use the takethislollipop.com app, so I don't know either what is its point (I hesitate like others said they do, to let apps grab all my FB data), but here I was just commenting on FB and social apps in general. >From a programmer's perspective, I would say that selling things is just as >boring as aimless socializing. WHAT ARE YOU programming anyway? ;-) We >programmers just keep track of other peoples' details... and once the novelty >of solving problems (for solving sake) wears off, then it seems to me that >programming, as such, is no more interesting, in the end, than the stuff the >code serves. What does truly uplifting/evolutionary code look like anyway? -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] book quest
I agree with Daniel. I would be willing to contribute to that type of collaborative initiative. Best, Christopher Lee -Original Message- From: paras...@gmail.com [mailto:paras...@gmail.com] On Behalf Of Daniel Brown Sent: Wednesday, September 28, 2011 7:24 PM To: Andy McKenzie Cc: php-general@lists.php.net Subject: Re: [PHP] book quest On Wed, Sep 28, 2011 at 19:13, Andy McKenzie wrote: > > I agree with Bastien -- I've had great luck with the PHP books. > "Beginning PHP4" has a permanent place on my shelf, even though PHP4 > is outdated. "Beginning PHP5.3" hasn't quite supplanted it as a > concept book, but is my go-to for "here's a way to solve this > particular problem using a new version of PHP" book. I'm still waiting for the day when folks on this list get together and say, "let's put all of our notes together, as beginners and intermediates, and put together a book for the newcomers, from the newcomers, by the newcomers, who can relate to them without the taint of overexperience." If properly presented, it would not only be easy to shop to publishers, but it could also be one of the first truly collaborative publications to exist on biological remnants. -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP frameworks
Hello, I am new to PHP and wanted to ask a question which I think is related to this discussion thread. What are you referring to when using the term "PHP Framework?" I downloaded Eclipse-JEE with PHP Development Tools. Would this development environment constitute a PHP Framework? Best, Christopher From: Laruence [larue...@baidu.com] Sent: Sunday, July 24, 2011 11:19 PM To: Floyd Resler Cc: PHP Subject: Re: [PHP] PHP frameworks Hi: if you have high performance need, you can considering Yaf( a PHP framework which is build in PHP extension) http://pecl.php.net/package/Yaf thanks Best regards 惠新宸 Xinchen Hui http://www.laruence.com/ On 2011/7/22 20:38, Floyd Resler wrote: > On Jul 22, 2011, at 8:33 AM, Richard Quadling wrote: > >> On 22 July 2011 13:26, Floyd Resler wrote: >>> On Jul 21, 2011, at 11:41 PM, Micky Hulse wrote: >>> On Thu, Jul 21, 2011 at 6:44 PM, Shawn McKenzie wrote: > A la CakePHP. Will automagically build controllers and views for the > admin of your tables/models if you wish. Oooh, interesting! I will check out CakePHP! Thanks for tip! :) >>> I actually use my own framework. I needed a very light weight, flexible >>> framework. I designed it from the ground up to be very flexible and to use >>> AJAX and jQuery on the client side. If you'd be interested in check it >>> out, just let me know and I'll give you a link to the source code. >>> >>> Take care, >>> Floyd >> >> http://www.brandonsavage.net/why-every-developer-should-write-their-own-framework/ >> > Good article! I knew there was a reason why I never released mine but just > offer it up on occasion to someone who might find it useful! :) > > Take care, > Floyd > > > > -- > 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 This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] best ways to recruit volunteers for a PHP framework
I would definitely be interested in working on/developing the user manual for the project. You have my interest. Best, Christopher From: jean-baptiste verrey [jeanbaptiste.ver...@gmail.com] Sent: Tuesday, June 28, 2011 4:24 PM To: php-general@lists.php.net Subject: [PHP] best ways to recruit volunteers for a PHP framework Hi everybody, I have developed an ORM framework in PHP for the last 2 years and it's becoming a more professional and nice solution so before doing a new complete revamp I am going to look for volunteer developers to do a real good version. But I am wondering what would be the best and clearest way to present the project in order to get some people interested in it ? I was thinking about - showing the previous versions - showing use cases - showing unit testing (I'm doing test driven development) - a short user manual (the project doesn't have any user manual yet!) Thanks in advance! This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help using phpadmin
im using windows. On Mon, Jul 19, 2010 at 12:23 PM, Isaac Lee wrote: > thanks carlos, > > but where would i enter that command? > > and i tried editing the php.ini file but that didn't accomplish anything. > > isaac > > On Mon, Jul 19, 2010 at 1:29 AM, Carlos Sura wrote: >> Hello Isaac Lee. >> >> Are you running on Linux or Windows? >> >> You might try: >> mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’yourpassword’); >> >> Then restart your service -if needed- >> >> If not... Try to edit config.inc.php file. >> >> Regards, >> >> Carlos Sura >> >> -Original Message- >> From: Isaac Lee [mailto:rhinecant...@gmail.com] >> Sent: domingo, 18 de julio de 2010 10:34 p.m. >> Cc: php-general@lists.php.net >> Subject: [PHP] help using phpadmin >> >> this is the second time that i have made an account and set the >> password. then when i try to reaccess phpadmin, it shows this message: >> >> Error >> >> MySQL said: >> >> #1045 - Access denied for user 'root'@'localhost' (using password: NO) >> >> >> What am supposed to do so that my regain access to phpadmin? edit the >> php.ini file? >> >> isaac >> >> -- >> 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] help using phpadmin
thanks carlos, but where would i enter that command? and i tried editing the php.ini file but that didn't accomplish anything. isaac On Mon, Jul 19, 2010 at 1:29 AM, Carlos Sura wrote: > Hello Isaac Lee. > > Are you running on Linux or Windows? > > You might try: > mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’yourpassword’); > > Then restart your service -if needed- > > If not... Try to edit config.inc.php file. > > Regards, > > Carlos Sura > > -Original Message- > From: Isaac Lee [mailto:rhinecant...@gmail.com] > Sent: domingo, 18 de julio de 2010 10:34 p.m. > Cc: php-general@lists.php.net > Subject: [PHP] help using phpadmin > > this is the second time that i have made an account and set the > password. then when i try to reaccess phpadmin, it shows this message: > > Error > > MySQL said: > > #1045 - Access denied for user 'root'@'localhost' (using password: NO) > > > What am supposed to do so that my regain access to phpadmin? edit the > php.ini file? > > isaac > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help using phpadmin
this is the second time that i have made an account and set the password. then when i try to reaccess phpadmin, it shows this message: Error MySQL said: #1045 - Access denied for user 'root'@'localhost' (using password: NO) What am supposed to do so that my regain access to phpadmin? edit the php.ini file? isaac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_FILE array being truncated
> Check out max_file_uploads which was added in PHP 5.2.12 and defaults to > 20. Yes that was the problem, I set max_file_uploads higher and it works now. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_FILE array being truncated
p.general, I have a form with 75 or so file input controls: Usually when I submit the form, I only upload two or so files. So in the post request, it sends the two files along with the other blank 73 fields. This has been working fine on my live and test servers so far. However as of the past few days only the first 20 file fields are recieved on the live server. I saw this by dumping the $_FILES array. This does not happen on the test server. I can see all 75 file fields been sent across in the POST header in wireshark, but but only the first 20 appear in the $_FILES array. Has anyone come across this problem of the $_FILE array being truncated? I don't recall changing anything on the live server. Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL insert () values (),(),(); how to get auto_increments properly?
On Sat, Feb 13, 2010 at 7:41 PM, Jochem Maas wrote: > Op 2/13/10 11:36 AM, Eric Lee schreef: > > > > > > On Sat, Feb 13, 2010 at 6:55 PM, Jochem Maas > <mailto:joc...@iamjochem.com>> wrote: > > > > Op 2/13/10 10:08 AM, Lester Caine schreef: > > > Rene Veerman wrote: > > >> Hi. > > >> > > >> I'm looking for the most efficient way to insert several records > and > > >> retrieve the auto_increment values for the inserted rows, while > > >> avoiding crippling concurrency problems caused by multiple php > > threads > > >> doing this on the same table at potentially the same time. > > > > > >> Any clues are greatly appreciated.. > > >> I'm looking for the most sql server independent way to do this. > > > > > > Rene > > > The 'correct' way of doing this is to use a 'sequence' which is > > > something introduced in newer versions of the SQL standard. > > > Firebird(Interbase) has had 'generators' since the early days (20+ > > > years) and these provide a unique number which can then be > > inserted into > > > the table. > > > > > > ADOdb emulates sequences in MySQL by creating a separate table for > the > > > insert value, so you can get the next value and work with it, > without > > > any worries. The only 'problem' is in situations were an insert is > > > rolled back, a number is lost, but that is ACTUALLY the correct > > result, > > > since there is no way of knowing that a previous insert WILL > > commit when > > > several people are adding records in parallel. > > > > this is all true and correct ... > > > > but that doesn't answer the problem. how do you get the IDs of all > > the records > > that we're actually inserted in a multi-insert statement, even if > > you generate the > > IDs beforehand you have to check them to see if any one of the set > > INSERT VALUEs failed. > > > > @Rene: > > > > I don't think there is a really simple way of doing this in a RDBMS > > agnostic > > way, each RDBMS has it's own implementation - although many are > > alike ... and MySQL is > > pretty much the odd one out in that respect. > > > > it might require a reevaluation of the problem, to either determine > > that inserting > > several records at once is not actually important in terms of > > performance (this would depend > > on how critical the speed is to you and exactly how many records > > you're likely to be inserting > > in a given run) and whether you can rework the logic to do away with > > the requirement to > > get at the id's of the newly inserted records ... possibly by > > indentifying a unique > > indentifier in the data that you already have. > > > > one way to get round the issue might be to use a generated GUID and > > have an extra field which > > you populate with that value for all records inserted with a single > > query, as such it could > > function as kind of transaction indentifier which you could use to > > retrieve the newly > > inserted id's with one extra query: > > > >$sql = "SELECT id FROM foo WHERE insert_id = '{$insertGUID}'"; > > > > ... just an idea. > > > > > > > > > > > > > Hi > > > > I would like to learn more correct way from both of you. > > May I ask what is a sequences ? > > it an RDBMS feature that offers a race-condition free method of > retrieving a new unique identifier for a record you wish to enter, > the firebird RDBMS that Lester mentions refers to this as 'generators'. > > to learn more I would suggest STW: > >http://lmgtfy.com/?q=sql+sequence > > Jochem Thanks, Regards, Eric > > > > > > Thanks ! > > > > > > Regards, > > Eric > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >
Re: [PHP] SQL insert () values (),(),(); how to get auto_increments properly?
On Sat, Feb 13, 2010 at 6:55 PM, Jochem Maas wrote: > Op 2/13/10 10:08 AM, Lester Caine schreef: > > Rene Veerman wrote: > >> Hi. > >> > >> I'm looking for the most efficient way to insert several records and > >> retrieve the auto_increment values for the inserted rows, while > >> avoiding crippling concurrency problems caused by multiple php threads > >> doing this on the same table at potentially the same time. > > > >> Any clues are greatly appreciated.. > >> I'm looking for the most sql server independent way to do this. > > > > Rene > > The 'correct' way of doing this is to use a 'sequence' which is > > something introduced in newer versions of the SQL standard. > > Firebird(Interbase) has had 'generators' since the early days (20+ > > years) and these provide a unique number which can then be inserted into > > the table. > > > > ADOdb emulates sequences in MySQL by creating a separate table for the > > insert value, so you can get the next value and work with it, without > > any worries. The only 'problem' is in situations were an insert is > > rolled back, a number is lost, but that is ACTUALLY the correct result, > > since there is no way of knowing that a previous insert WILL commit when > > several people are adding records in parallel. > > this is all true and correct ... > > but that doesn't answer the problem. how do you get the IDs of all the > records > that we're actually inserted in a multi-insert statement, even if you > generate the > IDs beforehand you have to check them to see if any one of the set INSERT > VALUEs failed. > > @Rene: > > I don't think there is a really simple way of doing this in a RDBMS > agnostic > way, each RDBMS has it's own implementation - although many are alike ... > and MySQL is > pretty much the odd one out in that respect. > > it might require a reevaluation of the problem, to either determine that > inserting > several records at once is not actually important in terms of performance > (this would depend > on how critical the speed is to you and exactly how many records you're > likely to be inserting > in a given run) and whether you can rework the logic to do away with the > requirement to > get at the id's of the newly inserted records ... possibly by indentifying > a unique > indentifier in the data that you already have. > > one way to get round the issue might be to use a generated GUID and have an > extra field which > you populate with that value for all records inserted with a single query, > as such it could > function as kind of transaction indentifier which you could use to retrieve > the newly > inserted id's with one extra query: > >$sql = "SELECT id FROM foo WHERE insert_id = '{$insertGUID}'"; > > ... just an idea. > > > > > > Hi I would like to learn more correct way from both of you. May I ask what is a sequences ? Thanks ! Regards, Eric > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] SQL insert () values (),(),(); how to get auto_increments properly?
On Sat, Feb 13, 2010 at 2:07 PM, Rene Veerman wrote: > Hi. > > I'm looking for the most efficient way to insert several records and > retrieve the auto_increment values for the inserted rows, while > avoiding crippling concurrency problems caused by multiple php threads > doing this on the same table at potentially the same time. > > I'm using mysql atm, so i thought "stored procedures!".. > But alas, mysql docs are very basic. > > I got the gist of how to setup a stored proc, but how to retrieve a > list of auto_increment ids still eludes me; last_insert_id() only > returns for the last row i believe. > So building an INSERT (...) VALUES (...),(...) at the php end, is > probably not the way to go then. > > But the mysql docs don't show how to pass an array to a stored > procedure, so i can't just have the stored proc loop over an array, > insert per row, retrieve last_insert_id() into temp table, and return > the temp table contents for a list of auto_increment ids for inserted > rows. > > Any clues are greatly appreciated.. > I'm looking for the most sql server independent way to do this. > > Rene I have not been worked with mysql multi-insert before. But just did a simple test on my mysql 5.0 copy. I assume that you are using MyISAM table and will lock its read, writel when inserting data. When multi-insert was done, and did a select last_insert_id(). I saw that only the first inserted id was returned. Please take a look the following steps: mysql> select * from temp; Empty set (0.00 sec) mysql> insert into temp (firstname, price) values ('dd', 10), ('cc', 3), ('bb', 99); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select last_insert_id(); +--+ | last_insert_id() | +--+ |1 | +--+ 1 row in set (0.00 sec) mysql> insert into temp (firstname, price) values ('dd', 10), ('cc', 3), ('bb', 99); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select last_insert_id(); +--+ | last_insert_id() | +--+ |4 | +--+ 1 row in set (0.00 sec) So, let's say three records was inserted, and the first inserted id was 1. You get id from 1 to 3. ! This will not work on transaction-based insert ! Just a thought and tested on mysql but not on php. Regards, Eric > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] How to secure this
On Sat, Feb 13, 2010 at 7:33 AM, Ryan Sun wrote: > In that case, referer is for authentication, and id is for authorization, I > think > > On Fri, Feb 12, 2010 at 6:23 PM, Ashley Sheridan > wrote: > > > On Fri, 2010-02-12 at 18:25 -0500, Ryan Sun wrote: > > > > authenticate by remote domain name or remote ip > > > > $_SERVER['HTTP_REFERER'] > > > > then your clients will not have to put their username/password in clear > texthttp://www.mydomain.com?h=300&w=250 > > and you will just check if you have their domain on your list > > > > I'm not sure if there is better one but > > " 'HTTP_REFERER' > > The address of the page (if any) which referred the user agent to > > the current page. This is set by the user agent. Not all user agents > > will set this, and some provide the ability to modify HTTP_REFERER as > > a feature. In short, it cannot really be trusted. " > > > > > > On Fri, Feb 12, 2010 at 4:26 PM, Robert Cummings > wrote: > > > Ashley Sheridan wrote: > > >> > > >> On Fri, 2010-02-12 at 16:12 -0500, Robert Cummings wrote: > > >> > > >>> John Allsopp wrote: > > > > Hi everyone > > > > There may be blinding bits of total ignorance in this so don't > ignore > > the obvious. > > > > This is a security question, but a sentence of background: I'm > writing > > software for a mapping/location website and I want to be able to > provide > > something others can plug into their website that would display > their map. > > > > So I'm providing a URL like > > http://www.mydomain.com?h=300&w=250&username=name&password=password > > > > The idea is they can define their own height and width and it plugs > in > > as an iframe. > > > > That takes the username and password and throws it over web services > to > > get back the data from which we can create the map. > > > > My question (and it might be the wrong question) is how can I not > give > > away the password to all and sundry yet still provide a > self-contained URL? > How about RESTful like checking ? It is much like what Rob said already. but join all params by order and md5 it altogether Regards, Eric, > > >>> > > >>> MD5() (or SHA()) hash the information and supply that along with the > > >>> settings. Then you know it was generated by your site. So you can do > the > > >>> following: > > >>> > > >>> > >>> > > >>> $height = 300; > > >>> $width = 250; > > >>> $username = 'username'; > > >>> $key = md5( "SECRET_SALT-$heigh-$width-$username" ); > > >>> > > >>> $url = > > >>> " > http://www.mydomain.com?h=$height&w=$width&username=$username&key=$key";; > > >>> > > >>> ?> > > >>> > > >>> Then when you get this URL via the iframe, you re-compute the > expected > > >>> key and then compare it against the given key. Since only you know > the > > >>> SECRET_SALT value then nobody should be able to forge the key. > > >>> > > >>> Cheers, > > >>> Rob. > > >>> -- > > >>> http://www.interjinn.com > > >>> Application and Templating Framework for PHP > > >>> > > >> > > >> > > >> What about requiring them to sign in the first time to use your > service, > > >> and then give them a unique id which i tied to their details. You > could > > >> then get them to pass across this id in the url. You could link their > > >> account maybe to some sorts of limits with regards to what they can > > >> access maybe? > > > > > > Presumably they ARE logged in when you create this URL for them... > otherwise > > > someone else could generate it :) > > > > > > Cheers, > > > Rob. > > > -- > > > http://www.interjinn.com > > > Application and Templating Framework for PHP > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > I think Google does both the referrer check coupled with an id passed in > > the URL. At least, this is what it did the last time I embedded one of > their > > maps. > > > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > >
Re: [PHP] syntax error in class
2010/2/11 Jim Lucas > Dasn wrote: > >> I got the syntax error. Why? >> > > only constant literal is allowed. You can think that it is static complie but not on runtime . Regards, Eric, > Read the first paragraph on the following page. > > http://us3.php.net/manual/en/language.oop5.properties.php > > [quote] > ... This declaration may include an initialization, but this > initialization must be a constant value--that is, it must be able to be > evaluated at compile time and must not depend on run-time information in > order to be evaluated. > [/quote] > > Basically, anything that requires the concatenation of string parts or > usage of variables is not allowed. > > -- > Jim Lucas > > "Some men are born to greatness, some achieve greatness, > and some have greatness thrust upon them." > > Twelfth Night, Act II, Scene V >by William Shakespeare > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] stream_select() not working on regular files?
On Thu, Feb 4, 2010 at 9:20 AM, Dennis J. wrote: > On 02/04/2010 02:03 AM, Ashley Sheridan wrote: > >> On Thu, 2010-02-04 at 01:41 +0100, Dennis J. wrote: >> >>> Hi, >>> I'm trying to implement something similar to"tail -f" in php but I'm >>> running into a problem. >>> The issue occurs when I've reached the end of the file. From here I >>> basically have to loop until new lines get appended to the file but I >>> would >>> like to respond immediately when then happens. There are three options >>> that >>> I can see: >>> >>> 1. Busy-loop >>> pro: I can process new lines immediately >>> contra: Excessivley CPU intensive => not a real option >>> >>> 2. add a sleep(1) to the loop >>> pro: No longer kills the CPU >>> contra: I might get a 1 second delay until I can process new lines >>> >>> 3. stream_select(array($fh),null,null,1) >>> pro: sleeps for one second but returns earlier if new data arrives >>> contra: doesn't seem to work in files? >>> >>> Method 3 is the preferable one but doesn't seem to work: >>> >>> $fh = fopen("testfile","r"); >>> $r = array($fh); >>> while( ($n = stream_select($r,$w=null,$e=null,1)) == 1 ) { >>> echo fgets($fh); >>> } >>> >>> This program will loop forever because stream_select() will always return >>> 1 >>> even at the end of the file. >>> >>> Is there any other way to accomplish this? >>> >>> Regards, >>>Dennis >>> >>> >> I thought that once it reached the end of the file, it will return a 0 >> indicating no new activity? >> > > That's what I thought too but apparently that is not the case. > > > Although, surely you want the loop to continue forever, so that new >> entries added to the end of the file are shown as soon as they appear. >> > > Yes the loop is supposed to continue forever in the final version. In fact > I what I'm trying to get at is a "tail -F" which means I will repeatedly > reopen the file to check if it has been replaced by a new one. I just > simplified the problem above to get rid of all the additional complexity and > concentrate on the specific problem I have. > > My expectation was that once the end of the file is reached (i.e. fgets() > has consumed all lines) stream_select() should wait for 1 second (in the > above example) and if nothing happens with the file in that second it should > return 0. But that doesn't happen. > > > Dennis I have just been bulit a simple test script. It works for me with a feof call if the stream was at end of file. But I'am not sure that is that what you want ! Regards, > Dennis > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] File Upload
On Sat, Jan 30, 2010 at 7:27 PM, Ali Reza Sajedi wrote: > Hello, > > When uploading a file the variable $_FILES['userfile']['tmp_name'] is not > set and when debugging I get the following error although /tmp folder exists > and the permissions are set to 777: > > $_FILES['userfile']['error'] = 6 > > which says > > UPLOAD_ERR_NO_TMP_DIR > Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP > 5.0.3. > > Has anyone encountered such a problem or has a clue as to what the cause > could be? > > It might be the upload_tmp_dir no pointing to the right dir ! What is the current of it ? Regards, Eric, Thank you. > > Kind regards > > Ali > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Re: how do I use php://memory?
On Sat, Jan 30, 2010 at 9:00 AM, Shawn McKenzie wrote: > Mari Masuda wrote: > > > Has anyone ever successfully used php://memory before? If so, what > > can I do to use it in my code? Thank you. > > No, but I was intrigued to try it, so I tested this: > > $text = 'Some text.'; > file_put_contents('php://memory', $text); > echo file_get_contents('php://memory'); > > And it returned nothing. The docs suck on this and it apparently > doesn't work. I see others use it with fopen(), but there is no mention > of which file functions it works with and which it doesn't. > > Shawn I did a sample test from the manual with fopen like this, console output F:\wc\trunk>php -f m.php line 1 Regards, Eric, -- > Thanks! > -Shawn > http://www.spidean.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] exception throw from __autoload could not be catched on php 5.3.1
Hi all and thanks for Ryan, I apologize ! ! I have missed out the small class_exists call before it. Thanks. Regards, Eric, 2010/1/29 Ryan > 于 2010-1-29 13:19, Ashley Sheridan 写道: > > On Fri, 2010-01-29 at 13:02 +0800, Eric Lee wrote: > > > > > >> Hi php-dev pros, > >> > >> I got an issue about catching exception throw from __autoload on php > 5.3.1. > >> > >> The manual state that exception throw from __autoload could be catched > with > >> try.. catch statement same as the normal flow. > >> > >> But I'can archive that even I have copied the same sample code from the > >> manual. > >> > >> Here are the code segment. > >> > >> [[[ > >> function __autoload($name) { > >> echo "Want to load $name.\n"; > >> throw new Exception("Unable to load $name."); > >> } > >> > >> try { > >> $obj = new NonLoadableClass(); > >> } catch (Exception $e) { > >> echo $e->getMessage(), "\n"; > >> } > >> > >> ]]] > >> > >> Are there anyone experienced this or not ? > >> > >> Thanks in advance ! > >> > >> Regards, > >> Eric, > >> > > > > Sorry, ignore that, I see you're running 5.3.1, which should be fine for > > running the example. I do notice that you've got [[[ and ]]] in-place of > > , was that intentional? > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > > > > Do you have any other autoload implamentaions? try testing that code > segment in a single php file and dump phpinfo() to make sure you are on > php 5.3.1 >
Re: [PHP] exception throw from __autoload could not be catched on php 5.3.1
On Fri, Jan 29, 2010 at 1:19 PM, Ashley Sheridan wrote: > On Fri, 2010-01-29 at 13:02 +0800, Eric Lee wrote: > > Hi php-dev pros, > > I got an issue about catching exception throw from __autoload on php 5.3.1. > > The manual state that exception throw from __autoload could be catched with > try.. catch statement same as the normal flow. > > But I'can archive that even I have copied the same sample code from the > manual. > > Here are the code segment. > > [[[ > function __autoload($name) { > echo "Want to load $name.\n"; > throw new Exception("Unable to load $name."); > } > > try { > $obj = new NonLoadableClass(); > } catch (Exception $e) { > echo $e->getMessage(), "\n"; > } > > ]]] > > Are there anyone experienced this or not ? > > Thanks in advance ! > > Regards, > Eric, > > > Sorry, ignore that, I see you're running 5.3.1, which should be fine for > running the example. I do notice that you've got [[[ and ]]] in-place of > , was that intentional? > Sorry for that ! I'am too lazy !! And that's just for easy looking the code. I actually use this, getMessage(), "\n"; } ?> Regards, Eric, > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > >
[PHP] exception throw from __autoload could not be catched on php 5.3.1
Hi php-dev pros, I got an issue about catching exception throw from __autoload on php 5.3.1. The manual state that exception throw from __autoload could be catched with try.. catch statement same as the normal flow. But I'can archive that even I have copied the same sample code from the manual. Here are the code segment. [[[ function __autoload($name) { echo "Want to load $name.\n"; throw new Exception("Unable to load $name."); } try { $obj = new NonLoadableClass(); } catch (Exception $e) { echo $e->getMessage(), "\n"; } ]]] Are there anyone experienced this or not ? Thanks in advance ! Regards, Eric,
Re: [PHP] Pointers For Newbies, Reminders For Oldies
On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan wrote: > On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote: > > > "... should be obvious - but are often overlooked - points within coding > > practice that can cause the programmer to develop bad habits and bad > > code." - Dan Brown > > > > Tip #1: > > > > Don't use count() in loops unless there are very few items to count and > > performance doesn't matter, or the number will vary over the loop. That > > is, don't do this: > > > > for ($i = 0; $i < count($items); $i++) > > > > Instead, do this: > > > > $number = count($items); > > for ($i = 0; $i < $number; $i++) > > > > Reason: when you use the count() call at the top of the loop, it will > > re-evaluate the number of items each time it's called, which usually > > isn't necessary and adds time. Instead, work out the number of items > > before going into the loop and simply refer to that for the number of > > items in controlling the loop. > > > > Paul > > > > -- > > Paul M. Foster > > > > > What about using the right type of quotation marks for output: > > I use double quotes(") if I expect to output variables within the > string, and single quotes when it's just a simple string. > > It's only a general rule of thumb and shouldn't be adhered to > absolutely, but I remember a thread a while back that showed the speed > differences between the two because of the extra parsing PHP does on > double quoted strings. > > That should be on the stackoverflow.com It compare the string parsing with or without variables embeded and the important of comma operator when ` echo ` data use echo 'something', 'other' but not echo 'something' . 'other' Eric, > Thanks, > Ash > http://www.ashleysheridan.co.uk > > >
Re: [PHP] Reliable way to identify Ogg types?
Hi Micheal, One of way for this should be by checking the header of the file with its OggS magic number. You may take a look at this page to see if it could help ! http://en.wikipedia.org/wiki/Ogg But I'am confused that the mime type should be enough what type of data its coming ! Are there are any more things you need to concern ? Thanks, Regards, Eric, On Wed, Jan 27, 2010 at 11:23 AM, Michael A. Peters wrote: > When I use fileinfo on an uploaded Ogg file, the mime it returns is > Application/Ogg which is almost useless. > > Is there a reliable php way, preferably without needing to execute shell > commands, to positively identify a file as Ogg Theora or Ogg Vorbis? > > Thanks for suggestions. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Magic Methods not working
On Wed, Jan 27, 2010 at 11:04 AM, Paul M Foster wrote: > I have a class which instantiates other classes, and has a magic method > like this: > > function _get($classname) > { >return $this->instantiate($classname); > } > > Obviously, the class also has an instantiate method which does what it > says. > > Here's the problem: When I call the instantiate method, it works fine, > like this: > > $db = $sc->instantiate('database'); > > But when I do the following, it *doesn't* work: > > $db = $sc->database; > > In fact it does not call the instantiate() method; I've placed a print > statement in the instantiate() method which fires at then end of the > routine. That statement doesn't fire with the above code. > > The docs on magic methods are pretty slim, so I'm not sure what it is > I'm missing. Can someone enlighten me? > > Paul > > Paul, I seem that you should missed the required underscore " _ " It should the __get() but not _get(). Shall this help ? And here is a quick test !! [ [ [ class test { public $varname = 1000; public function __get($name) { return $this->init($name); } public function init($name) { return new test(); } } $t = new test(); $db = $t->database; if (is_object($db)) { echo $db->varname; } ] ] ] Regards, Eric, -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?
Hi, all I'am doubted about installing a local mail server for just low volume mailing. May I ask all yours professional what do you think about it ? Thanks in advanced. Regards, Eric, > -- > Jim Lucas > NOC Manager > 541-323-9113 > BendTel, Inc. > http://www.bendtel.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?
On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann wrote: > Hi all. > > I'm currently using the phpmailer class from phpmailer.worxware.com to > send datatbase -populated emails to clients. > > At the moment I'm runninng PHP on Windows and using the built-in sendmail > equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by > prior logging into a POP account. > > The number of emails sent is very small. Each one is only sent after a user > fills out a form and presses send. > > But there is a noticable lag of about 5 or sometimes 10 seconds after > pressing "send" before the user sees the "Mail sent" page. I presume the > reason for the lag is the time spent logging on and off a remote POP, then > SMTP server, transferring the data etc. > > It would be better if this happened in the background - that is, the user > could get on with doing his next task while the emails sat in a queue in the > backgorund, being lined up and sent without PHP waiting for the process to > finish. > > Can anybody recommend a good way of doing this? Is Mercury Mail going to > help me here? > > HI Angus, +1 I agree on what Paul already said . As in fact you were just to sent out low volume mails. Create a table and queue all pending mails in that then use windows scheduled tasks to perform the actual work if that is not a real-time mail. One thing to note, php on windows does't support specify username and password. But only hostname / IP Address and port only. I can not help much but just few more suggesions. Hope these help Eric, Regards,
Re: [PHP] Upload file on IE8
On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp wrote: > Good Day, > > > > I’m having an issue with IE8, when I go to load a file the > program is not filling the $_FILES['user_file']['type'] . > > When I display “echo "Start".$_FILES['pix']['type']."End";” > in IE8 I get “StartEnd” with nothing in between. I expected “image/pjpeg". > > > > On FireFox I get “image/jpeg". > > > > Any suggestions? > > Thanks, > > /Ernie > > > > I remember a setting from some elsewhere IE 8 was disable set file path > location > by default from the options dialog. Did you enabled this already ? If not, > you may give it a shoot to see than ! > > Hope this help > > > Eric, > Regards, > > > > > >
Re: [PHP] Foreign Characters Break in MySQL
Hi, all, I'am not able test it out now. Did you tried to change the collation to utf8_bin from utf8_general_ci ? Eric, Regards, On 1/22/10, Ryan Park wrote: > > Forgot to reply all. > > You can see that it's in the middle of the sql statement. > It looks fine here but some how it breaks during the query. > > mysql_connect("localhost", "adminID", "password") or die(mysql_error()); > echo "Connected to MySQL"; > > mysql_select_db("databasename") or die(mysql_error()); > echo "Connected to Database"; > > $sql = "INSERT INTO xe_modules (module_srl, module, module_category_srl, > layout_srl, menu_srl, site_srl, mid, skin, browser_title, description, > is_default, content, open_rss, header_text, footer_text, regdate) VALUES > ('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', '자유게시판 ', '', > 'N', '', 'Y', '', '', UNIX_TIMESTAMP());"; > > mysql_query($sql) or die(mysql_error()); > > mysql_close(); > ?> > > On 1/21/2010 5:19 PM, Jim Lucas wrote: > >> Ryan Park wrote: >> >> >>> Hello I'm currently trying to use PHP to insert foreign characters into >>> one of the mysql database tables.mysql_query() worked seamlessly, but when I >>> check the inserted data on phpMyAdmin it shows the foreign characters in >>> broken letters, like this ì‹œíŒ<- jibberish...The foreign characters show >>> fine when I'm typing it out on my editor to code PHP, but it gets broken >>> into unrecognizable symbols when put into mysql database columns. >>> I tried to create the same thing this time through phpMyAdmin console and >>> it worked great, the foreign characters showed correctly as they should.The >>> column that I'm trying to put the foreign characters into is set as >>> utf8_general_ci.I wish to use PHP to insert the data into the database >>> because I'll be inserting massive amounts of them at once, so I just can't >>> continue with this problem at hand. >>> I'll greatly appreciate any help, thank you. >>> >>> _ >>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. >>> http://clk.atdmt.com/GBL/go/196390709/direct/01/ >>> >>> >> How about showing a little of the insert code. ie: how you are gathering >> the >> data, how you are preping the data, and the actual insert statement. >> >> >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] SMTP Local development to Send email in PHP; Windows Platform/ XP with no IIS
Hi, As I know that php did't setting user name and password. So, just install any smtp server with authenticaton set to "no authentication" Much list IIS smtp server. Eric, Regards, On 1/16/10, Andy Shellam wrote: > > Hi, > > > > > Also http://www.softstack.com/freesmtp.html which vikash mentioned works > > through outlook settings. > > > > Anyways the below will help- > > > > http://php.net/manual/en/ref.mail.php > > > > http://glob.com.au/sendmail/ > > > Personally, I always found hMailServer to be perfectly reliable as a relay > on Windows - just install it and SMTP to localhost - nothing more, nothing > less. > > Andy
Re: [PHP] not able to use mysql server
On 12/30/09, Jignesh Thummar wrote: > > It is problem with mysql client, it's not able to connect with mysql > server. > Either mysql server is not running or windows firewall is blocking to the > access of port 3306. Try to disable firewall. > > -Jignesh > > On Wed, Dec 30, 2009 at 11:41 AM, Sudhakar > wrote: > > > hi > > > > i am using windows vista and installed wamp server, initially i installed > > wamp and accessed phpmyadmin and while setting a password for the root i > > did > > a mistake and could not access phpmyadmin and also renamed some php files > > so > > i uninstalled wamp server and re installed > > > > now the problem i am facing is when i click on mysql.exe located at > > D:\wamp\bin\mysql\mysql5.1.36\bin i am getting the following error > > error 2003 cant connect to Mysql server on localhost 10061 > > > > in config.inc.php located at d:\wamp\apps\phpmyadmin3.2.0.1 i have the > > following > > $cfg['Servers'][$i]['host'] = 'localhost'; > > $cfg['Servers'][$i]['port'] = '3306'; > > $cfg['Servers'][$i]['auth_type'] = 'config'; > > $cfg['Servers'][$i]['user'] = 'root'; > > $cfg['Servers'][$i]['password'] = 'root'; > > $cfg['Servers'][$i]['AllowNoPassword'] = true; > > > > along with others. > > > > when i type http://localhost i am able to see the welcome screen of wamp > > and > > can click on phpinfo but when i click on phpmyadmin it takes a while to > > load > > and a blank screen appears > > > > also i have stopped all services and restarted all services from the > > wampserver icon in the system tray, normally the colors change from red > to > > yellow to white, the color is at yellow and does not change to white > > > > how do i solve the error error 2003 cant connect to Mysql server on > > localhost 10061 so that i can use phpmyadmin > > > > please advice. > > > > thanks. > > > Are there any error entries of mysql server on the event viewer ? Also, what is the starting state of mysql server on the services console ? You can found all tool on administrative folder on the start menu.
Re: [PHP] MySQL Increment/Decrement
Ben It seems that you can just update the column with a update query like this, update table set field = field + 1 where some condition This might be the thing you need. Eric On 12/29/09, Ben Miller wrote: > > I hope this isn't a bone-head question - Is there a MySQL query that will > increment/decrement the value in an integer column with a single query - in > other words, I don't have to run a SELECT query to get the value, > add/subtract to/from the value, and then run an UPDATE query to store the > new value? > > > > Thanks in advance. > > > > Ben > >
Re: [PHP] Textarea to road a text file
Yes, I just want to edit a file in the textarea! thank you. ""Jay Blanchard"" wrote in message news:31454d514ff9a949b1fdfe294d5d1d80080...@ygex01wal.onecall.local... [snip] . .. " . $contents . ""; ?> [/snip] Try http://us3.php.net/manual/en/function.file-get-contents.php " . $contents . ""; ?> I am unsure what you want to do here, display the menu in the textarea? Or do you want to be able to edit menu.php in the textarea? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea to road a text file
Thank you, Jay Blanchard and Andrew Ballard!!! Could you explain what was my fault concerned about this case? Thanks in advance! My codes were . .. " . $contents . ""; ?> ""Jay Blanchard"" wrote in message news:31454d514ff9a949b1fdfe294d5d1d80080...@ygex01wal.onecall.local... [snip]I want to use Textarea as the text-file viewer and editor of my homepage. But Textarea doesn't work exactly as i intended. In sometimes, TextArea doesn't show up and moreover the some parts of the file are displayed(rendered) in browser without TextArea![/snip] Not enough information to complete yourrequest? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Textarea to road a text file
I want to use Textarea as the text-file viewer and editor of my homepage. But Textarea doesn't work exactly as i intended. In sometimes, TextArea doesn't show up and moreover the some parts of the file are displayed(rendered) in browser without TextArea! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse_ini_file problem [SOLVED]
Hi Jim, Cheers for the reply. I had to swap the quotes around to get it running on the windows command line. This from the 5.3.0 machine that does not parse: C:\wamp\www\digishop\install\lang>C:\wamp\bin\php\php5.3.0\php -r "print_r(parse_ini_file('1-ISO-8859-1.ini.php'));" PHP Warning: parse error in 1-ISO-8859-1.ini.php on line 1 in Command line code on line 1 Warning: parse error in 1-ISO-8859-1.ini.php on line 1 in Command line code on line 1 This is from the 5.2.5 machine that parses properly: C:\wamp\www\digishop\install\lang>C:\wamp\bin\php\php5.2.5\php -r "print_r(parse_ini_file('"1-ISO-8859-1.ini.php'));" Array ( [btn_step_complete] => Ok, I Have Completed This Step [btn_next] => Next [btn_cancel] => Cancel ... . . The php warning displayed is exac php -v on the 5.3.0 machine: C:\wamp\www\digishop\install\lang>C:\wamp\bin\php\php5.3.0\php -v PHP 5.3.0 (cli) (built: Jun 29 2009 21:25:23) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies php -v on the 5.3.0 machine: C:\wamp\www\digishop\install\lang>C:\wamp\bin\php\php5.2.5\php -v PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies So I checked the changelog from 5.2.5 to 5.3.0: o Added 3rd optional parameter to parse_ini_file() to specify the scanning mode of INI_SCANNER_NORMAL or INI_SCANNER_RAW. In raw mode option values and section values are treated as-is. * Added parse_ini_string() function. (grange at lemonde dot fr, Arnaud) * Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno) * Fixed bug #45384 (parse_ini_file will result in parse error with no trailing newline). (Arnaud) * Fixed bug #44842 (parse_ini_file keys that start/end with underscore). (Arnaud) * Fixed bug #44575 (parse_ini_file comment # line problems). (Arnaud) * Fixed bug #45956 (parse_ini_file() does not return false with syntax errors in parsed file). (Jani) So I installed PHP 5.2.5 and it worked. Thanks to everyone for their help! Richard Lee Jim Lucas wrote: Richard H Lee wrote: Hi all, I think I'm having a problem with parse_ini_file in php. I am using wamp on two machines. I'm installing a Digishop e-commerce package. The blah.ini.php file starts with [SOMETITLE] some_setting="Ok, I Have Completed This Step" another_setting="Next" .. .. .. On one machine which uses php 5.2.5 it parses the file fine and installs properly But on another machine which use 5.3.0 i get the error Warning: parse error in blah.ini.php on line 1 in myparser.php on line 81 On the 5.3.0 if I remove the it works fine. But it still does not install the sofware properly. I get the feeling php on the 5.3.0 marchine is parsing the file differently to the 5.2.5. I doubt anything has changed between the versions. I also compared the phpinfos between the two setups but could not see anything outstanding. Have any of you guys seen this behaviour before? Cheers, Richard I would write a little line to your cli like this php -r 'print_r(parse_ini_file("/path/to/your/ini.file.php"));' see if the output is different. If it is, then you know that the two versions are doing something different. If you find that the output is different and you have more questions please provide the output from "php -v" from both machines and we might be able to help further. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse_ini_file problem
Hi all, I think I'm having a problem with parse_ini_file in php. I am using wamp on two machines. I'm installing a Digishop e-commerce package. The blah.ini.php file starts with [SOMETITLE] some_setting="Ok, I Have Completed This Step" another_setting="Next" .. .. .. On one machine which uses php 5.2.5 it parses the file fine and installs properly But on another machine which use 5.3.0 i get the error Warning: parse error in blah.ini.php on line 1 in myparser.php on line 81 On the 5.3.0 if I remove the it works fine. But it still does not install the sofware properly. I get the feeling php on the 5.3.0 marchine is parsing the file differently to the 5.2.5. I doubt anything has changed between the versions. I also compared the phpinfos between the two setups but could not see anything outstanding. Have any of you guys seen this behaviour before? Cheers, Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can't set expect.timeout
Dear Rob, The default value of expect.timeout is 10 (minutes), which is what I would get if I don't do any ini_set(). I could set the value to 0 but not to any values. What do you mean by "inaccessible at runtime"? I could set another related parameter expect.logfile to, say, "/tmp/tmp" (as reported by phpinfo()). This problem looks like a bug to me. I will be most grateful if someone can try out the test program on their site. Thanks in advance! Clement Robert Cummings wrote: On Tue, 2009-03-03 at 14:49 -0500, Clement Yui-Wah Lee wrote: Dear friends, I am still hoping to get an answer to this question (see below). Kindly please see if you can run the test on your site. Any insight is very much welcome! Clement Clement Yui-Wah Lee wrote: Hi, Apparently I can't set the value for expect.timeout to any values other than 0 (the default is 10). Can someone try the following script and see if you see the same problem as me? My php is 5.1.6, php-expect is 0.2.4, the platform is a Redhat Enterprise Linux 5.3 Test method: 1. Drop the following script onto your php server machine (use a different ini_set() line in each successive test). 2. Use a browser to execute the script and see what phpinfo() would return the value for expect.timeout (and expect.logfile) Are you sure this isn't just the default value before you attempted an ini_set()? It may be that expect.timeout is not accessible at runtime. Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can't set expect.timeout
Dear friends, I am still hoping to get an answer to this question (see below). Kindly please see if you can run the test on your site. Any insight is very much welcome! Clement Clement Yui-Wah Lee wrote: Hi, Apparently I can't set the value for expect.timeout to any values other than 0 (the default is 10). Can someone try the following script and see if you see the same problem as me? My php is 5.1.6, php-expect is 0.2.4, the platform is a Redhat Enterprise Linux 5.3 Test method: 1. Drop the following script onto your php server machine (use a different ini_set() line in each successive test). 2. Use a browser to execute the script and see what phpinfo() would return the value for expect.timeout (and expect.logfile) Thanks! Clement -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't set expect.timeout
Ash, Thanks for your answer. I am quite sure that I do have the needed permission to effect the change. As you can tell from my test script, I was able to set timeout to 0 (zero), and I could also set logfile to "/tmp/tmp". I just could not set timeout to any values other than 0 or the default value of 10. I was testing on a local machine. Thanks! Clement Ashley Sheridan wrote: On Wed, 2009-02-25 at 18:08 -0500, Clement Yui-Wah Lee wrote: Hi, Apparently I can't set the value for expect.timeout to any values other than 0 (the default is 10). Can someone try the following script and see if you see the same problem as me? My php is 5.1.6, php-expect is 0.2.4, the platform is a Redhat Enterprise Linux 5.3 Test method: 1. Drop the following script onto your php server machine (use a different ini_set() line in each successive test). 2. Use a browser to execute the script and see what phpinfo() would return the value for expect.timeout (and expect.logfile) Thanks! Clement Do you have permissions to change this ini setting? Some hosting companies disallow certain variables to be set through ini_set and only allow them to be done via .htaccess, and some go even further by disallowing certain ones to be changed at all. Have you tried it on a different hosting (i.e. on your local machine) ? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't set expect.timeout
Hi, Apparently I can't set the value for expect.timeout to any values other than 0 (the default is 10). Can someone try the following script and see if you see the same problem as me? My php is 5.1.6, php-expect is 0.2.4, the platform is a Redhat Enterprise Linux 5.3 Test method: 1. Drop the following script onto your php server machine (use a different ini_set() line in each successive test). 2. Use a browser to execute the script and see what phpinfo() would return the value for expect.timeout (and expect.logfile) Thanks! Clement -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OS X 10.5.2
First let me say thank you for your help, I do appreciate you taking the time to read my post. I did come across the entropy.ch forum while searching on google but (and I could be wrong here so sorry in advance) it seems that this would lead to me having multiple versions of php and or apache. Also I don't really want to be reliant on someone else for my stack. I would prefer to get the bundled install working or learn how to build my own. I have been trying to get the pdo_mysql driver from pear and have had some success but still no banana ! I have installed pear and linked to the mysql_config file but I get errors, I will post the output and hope one of you guys can see what I'm missing. And thanks again in advance. lee. ; ) Macintosh:pear lperry65$ sudo /usr/lib/php/pear/bin/pecl install pdo_mysql downloading PDO_MYSQL-1.0.2.tgz ... Starting to download PDO_MYSQL-1.0.2.tgz (14,778 bytes) .done: 14,778 bytes downloading PDO-1.0.3.tgz ... Starting to download PDO-1.0.3.tgz (52,613 bytes) ...done: 52,613 bytes 12 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 building in /var/tmp/pear-build-root/PDO-1.0.3 running: /usr/lib/php/pear/temp/PDO/configure checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc and cc understand -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... i686-apple-darwin9.2.2 checking host system type... i686-apple-darwin9.2.2 checking target system type... i686-apple-darwin9.2.2 checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/ main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/ php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib/php/extensions/no- debug-non-zts-20060613 checking for PHP installed headers prefix... /usr/include/php checking for re2c... no configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers. checking for gawk... no checking for nawk... no checking for awk... awk checking if awk is broken... no checking whether to enable PDO support... yes, shared checking for ld used by gcc... /usr/libexec/gcc/i686-apple- darwin9/4.0.1/ld checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -p checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking the maximum length of command line arguments... 196608 checking command to parse /usr/bin/nm -p output from gcc object... rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory checking if gcc static flag works... rm: conftest.dSYM: is a directory yes checking if gcc supports -fno-rtti -fno-exceptions... rm: conftest.dSYM: is a directory no checking for gcc option to produce PIC... -fno-common checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a directory yes checking if gcc supports -c -o file.o... rm: conftest.dSYM: is a directory yes checking whether the gcc linker (/usr/libexec/gcc/i686-apple- darwin9/4.0.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin9.2.2 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool suppo
[PHP] OS X 10.5.2
Hi, I need pdo_msql and GD2 extension support in my php environment, but as I am sure you are aware the default build that comes with leopard on the mac is lacking these extensions. what I need is a way to either install them or if I really have to compile php with these included. I have never had to do this as I have been using windows until recently. If I need to install php from source it seems I will also have to compile apache, will this replace the versions of php and apache that are bundled with os x 10.5.2. I'm looking for a clean solution to this problem I don't want multiple versions etc. I have spent over 10 hours on google looking for a solution to this before emailing you and so far there does not seem to be a clear and consistent way to resolve this. I work as a php developer and just got the MacBook Pro thinking it would be nicer to work with, what a nightmare. Kind Regards, Lee. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opening a big file
Daniel Brown wrote: On Sun, Apr 6, 2008 at 10:36 PM, Richard Lee <[EMAIL PROTECTED]> wrote: I am trying to open a big file and go through line by line while limiting the resource on the system. What is the best way to do it? Does below read the entire file and store them in memory(not good if that's the case).. open(SOURCE, "/tmp/file") || die "not there: $!\n"; while () { ## do something } Was there a reason this was sent to the PHP list as well? Maybe just a typo? def a typo.. sorry about that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] opening a big file
I am trying to open a big file and go through line by line while limiting the resource on the system. What is the best way to do it? Does below read the entire file and store them in memory(not good if that's the case).. open(SOURCE, "/tmp/file") || die "not there: $!\n"; while () { ## do something } sometime ago I saw somewhere it had something like below which look like it was reading them and going through line by line without storing them all in memory. I just cannot remember the syntax exactly. open(SOURCE, " /tmp/file |") || die "not there: $!\n"; while (<>) { ## do something } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with install php 5.2.3 on apache 2.2.4 in windows xp sp2
system: windows xp sp 2 apache: apache_2.2.4-win32-x86-no_ssl PHP: php-5.2.3-win32-installer.msi i try to install php on my computer so that i can finish my homework, but after download these files nightmare begins. Install apache with default settings, install php with default settings. Restart apache server .While I modify index.html add , open 127.0.0.1 , apache server default page pops up with no change. Creat a new file named as phpinfo.php, modify httpd.conf , add line AddType application/x-httpd-php .php then restart apache. open broswer key in address 127.0.0.1/phpinfo.php ,it show me nothing. is there anyone can help ? PS. I have reinstall my windows system, nothing change.( Now I am using Appserv to finish my homewhere.) one thing, after install php 5.2.3 on apache server, when I stop apache server ,windows system show my two error message.
[PHP] Installation problem
Hi, I am trying to install a package using SSH because my Web-based PEAR is not working. So, I type in "pear install Date." But, it only says Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Non-recoverable failure in name resolution in RPC.php on line 464 Warning: fsockopen(): unable to connect to pear.php.net:80 in RPC.php on line 464 xml_rpc_client: Connection to RPC server pear.php.net failed What do I do? Thanks
[PHP] Re: Problem extending mysqli - "No database connected"
Actually, the post by hans at lintoo dot dk (22-Mar-2005 11:33) @ http://theserverpages.com/php/manual/en/ref.mysqli.php show why. Weird. On 6/29/07, Lee PHP <[EMAIL PROTECTED]> wrote: Hi, I have a class that extends msyqli that AFAIK can connect to the database, but gives me an error when I try and query it. Here's my class: -- BEGIN DATABASE CLASS -- require_once('Configuration.php'); require_once('RSFSException.php'); class Database extends mysqli { private $strUrl = "DEV"; private $strUser; private $strPass; private $strHost; private $intPort; private $strName; private static $INSTANCE; private static $CONFIG; private function __construct() { $this->CONFIG = Configuration::getInstance(); $this->establishConnectionSettings(); $this->connect($this->getHost(), $this->getUser(), $this->getPass(), $this->getName); if (mysqli_connect_errno()) { throw new RSFSException("Connect exception:\n ". mysqli_connect_error(), -1); } } public static function getInstance($url = null) { // Set the URL if one is provided. if (isset($url)) { $this->setUrl($url); } // Instantiate the Singleton if not already instantiated. if(empty(self::$INSTANCE)) { self::$INSTANCE = new Database(); } return self::$INSTANCE; } public function establishConnectionSettings() { // DEVELOPMENT (default) database settings. if ($this->getUrl() == "DEV") { $this->setUser($this->CONFIG->getProperty("rsfsTestDbUser")); $this->setPass($this->CONFIG->getProperty("rsfsTestDbPass")); $this->setHost($this->CONFIG->getProperty("rsfsTestDbHost")); $this->setPort($this->CONFIG->getProperty("rsfsTestDbPort")); $this->setName($this->CONFIG->getProperty("rsfsTestDbName")); } // PRODUCTION database settings. else if ($this->getUrl() == "PROD") { $this->setUser($this->CONFIG->getProperty("rsfsDbUser")); $this->setPass($this->CONFIG->getProperty("rsfsDbPass")); $this->setHost($this->CONFIG->getProperty("rsfsDbHost")); $this->setPort($this->CONFIG->getProperty("rsfsDbPort")); $this->setName($this->CONFIG->getProperty("rsfsDbName")); } else { // Throw an exception. } } public function query($sql) { $result = parent::query($sql); if(mysqli_error($this)){ throw new RSFSException(mysqli_error($this), mysqli_errno($this)); } return $result; } public function valueExists($table, $column, $value, $caseInsensitive = false) { if (!$caseInsensitive) { $sql = "SELECT * FROM $table WHERE $column = $value"; } else { $sql = "SELECT * FROM $table " . "WHERE upper($column) = ($value)"; } $result = $this->query($sql); echo "Result: $result\n"; $count = $result->num_rows; if ($count > 0) { return true; } else { return false; } } public function valuesExist($table, $columns, $values) { // Placeholder. } public function procedureQuery($name, $params) { return $this->query("call $name($params)"); } /** Return the URL. */ public function getUrl() { return $this->strUrl; } . . . /** Set the database URL. */ public function setName($url) { $this->strUrl = $$url; } } -- END DATABASE CLASS -- To test it, I'm doing the following: -- BEGIN -- echo "Attempting to establish connection.\n"; $CONN = Database::getInstance(); if ($CONN->ping()) { printf ("Our connection is ok!\n"); }
[PHP] Problem extending mysqli - "No database connected"
connection is ok!\n"); } else { printf ("Danger, Will Robinson!!!\n"); } echo "Attempting to test query() method.\n"; if ($result = $CONN->query("SELECT * FROM country")) { echo "In result set\n"; while( $row = mysqli_fetch_assoc($result) ){ printf("%s (%s)\n", $row['cnt_code'], $row['cnt_name']); } } -- END -- Which outputs the following: Attempting to establish connection. localhost:rsfs:rsfs:rsfs Our connection is ok! Attempting to test query() method. Fatal error: Uncaught RSFSException: [1046]: No database selected thrown in /home/lee/Development/rsfs/php/classes/core/Database.php on line 84 I've tried removing the query method from my class, but even Mysqli's query() isn't working. Can anyone help me identify the problem? Thanks! Lee PS: I posted a similar question a few weeks ago - I though I had it working when I saw that it was connecting. Now that I'm ready to actually use it, I see that it just can't query... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OO Problem / Using Singleton Pattern / Extending mysqli
Hi guys, For the life of me I can't figure this out. I have two classes as follows: 1. Config.php (based on the Singleton pattern; gets/sets properties). 2. Database.php (also based on the Singleton pattern; extends mysqli). -- BEGIN CLASS CONFIG -- $line) { if (ereg("^#", $line) || ereg("^[[:space:]]", $line)) { // Ignore the comments and blank lines. } else { // Get properties from the file. $tokens = explode("=", $line); self::$INSTANCE->setProperty(trim($tokens[0]), trim($tokens[1])); } } } return self::$INSTANCE; } /** Set a property. */ public function setProperty($key, $val) { $this->properties[$key] = $val; } /** Get a property. */ public function getProperty($key) { return $this->properties[$key]; } } ?> -- END CLASS CONFIG -- -- BEGIN CLASS DATABASE -- . * * Extends PHP's MySQLi. */ require_once("Config.php"); class Database extends mysqli { private static $CONFIG; private static $INSTANCE; public function __construct() { } public static function getConnection() { if(empty(self::$INSTANCE)) { self::$CONFIG = Config::getInstance(); // ERROR HERE self::$INSTANCE = new Database(); } return self::$INSTANCE; } } ?> -- END CLASS DATABASE -- Now, in one of my unit tests, I call `$CONN = Database::getConnection()` and receive an error message, "Fatal error: Call to undefined method Config::getinstance() in C:\xampp\htdocs\rsfs\php\classes\core\Database.php on line 23". Can anyone tell me why the Database class can't see the Config class? If it's any use, here's my unit test that's breaking: -- BEGIN UNIT TESTS -- . * * Test class for Database class. */ require_once('../../external/SimpleTest/unit_tester.php'); require_once('../../external/SimpleTest/reporter.php'); require_once('../../classes/sys/Database.php'); class DatabaseTest extends UnitTestCase { private static $CONN; public function testConstructor() { $CONN = Database::getConnection(); } } $test = &new DatabaseTest(); $test->run(new HtmlReporter()); ?> -- END UNIT TESTS -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mysqli insert / OO Design Problem - Call to a member function bind_param() on a non-object in...
Hi there, I'm new to OO-PHP and have encountered a problem that I just can't figure out. I have a class called DBAccess that extends mysqli. In a nutshell, it looks like this: class DBAccess extends mysqli { private static $instance; private static $preferences; /** Create an instance of DBAccess. */ private function __construct($host, $port, $user, $pass, $name) { self::$instance = parent::__construct($host, $user, $pass, $name); } /** Populate and/or return an instance of DBAccess. */ public function getInstance() { if (empty(self::$instance)) { $preferences = Preferences::getInstance(); // Let's set the database defaults if not previously set. if (self::$host == null) { DBAccess::setHost($preferences->getProperty("TestDbHost")); } if (self::$port == null) { DBAccess::setPort($preferences->getProperty("TestDbPort")); } if (self::$user == null) { DBAccess::setUser($preferences->getProperty("TestDbUser")); } if (self::$pass == null) { DBAccess::setPass($preferences->getProperty("TestDbPass")); } if (self::$name == null) { DBAccess::setName($preferences->getProperty("TestDbName")); } self::$instance = new DBAccess(self::$host, self::$port, self::$user, self::$pass, self::$name); return self::$instance; } } . . . } I also have a class, call it MyClass, that tries to connect using DBAccess and insert a record. It can connect to the database, but encounter a problem (Call to a member function bind_param() on a non-object) when I try to insert a record. Here's the MyClass class (some of the complexity removed): class MyClass { private static $conn; private static $preferences; /** Create an instance of ContactInformation. */ public function __construct() { self::$conn = DBAccess::getInstance(); self::$preferences = Preferences::getInstance(); } /** Populate instance. */ public function set($args) { // Calls to $this->set; } /** Insert record. */ public function insert() { $sql = "INSERT INTO table (" . "field_1, " . "field_2, " . "field_3) " . "?, " . "?, " . "?)"; echo "Server version: " . self::$conn->server_info; $stmt = self::$conn->prepare($sql); $stmt->bind_param('s', $this->getField1(), $this->getField2(), $this->getField3()); $stmt->execute(); $stmt->close(); } } If I execute the following code: $conn = DBAccess::getInstance(); $someClass = new Class(); $someClass->set(insert(); I see the following output: Server version: 5.0.21-Debian_3ubuntu1-log Fatal error: Call to a member function bind_param() on a non-object in C:\blah\blah\blah The fact that the server version is correctly displayed, suggests that it is connecting. Why is it having issues with the $stmt? Anyone know? The smallprint: The DBAccess class looks a little funky - I'm playing around with the Singleton Design Pattern, and plan to refine it once I get the kinks (like this) worked out. Thanks in advance for any thoughts. - Leee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I connect a remote server from phpmyadmin?
Hello, I have PhpMyAdmin 2.6.3 , MySQL 4.1.13 running in my Windows 2000. I installed them using Apache friends XAMPP, so I didn¡¯t do any configuration myself. Currently if I go to http://127.0.0.1/phpmyadmin, then it automatically shows my local MySQL db and tables. Now I need to connect remote server(it has MySQL) and do some DB Admin of that server. How can I connect to that server from phpmyadmin? I¡¯ve been trying to find if there any kind of connect panel in phpmyadmin, but no fruit yet. I really appreciate you guys help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can I call .html file as a form action instead of .php?
Hello, Some guy told me that I can call the .html file as a form action instead of ..php file. So he said I could do something like this, echo "Edit"; instead echo "Edit"; editStaff.html and editStaff.php have the same content, only the file name is different. But if I do the former way(call editStaff.html as a form action), it doesn't work. It calls some files but looks horrible. So the advice of the guy was wrong, or did I do something wrong? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using SAML in PHP
Hi, I believe SOAP can be used inside of PHP. Can I use SAML in SOAP, which is in PHP? If yes, where can I find docs/info for that? If no, is there a SAML mailing list that I can join to get help on SAML? Thanks, Joe Sell on Yahoo! Auctions no fees. Bid on great items. http://auctions.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file function
I see. Now I know how it works. Thank you, all, for your great help. Joe --- Burhan Khalid <[EMAIL PROTECTED]> wrote: > Joseph Lee wrote: > > Hi, > > > > I tried file() in the following lines: > > > > >$authFile = file("/tmp/authenticate.txt"); > >print "authFile = $authFile"; > > ?> > > > > However, it only gave me > > authFile = Array > > > > What's wrong with this file function? I tried > single > > quotes, but got the same answer, too. > > Nothing. You need to read the documentation. What > you probably wanted was: > > print "authFile = ".implode("",$authFile); > > or file_get_contents(). > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > __ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file function
Hi, I tried file() in the following lines: However, it only gave me authFile = Array What's wrong with this file function? I tried single quotes, but got the same answer, too. Thanks, Joe Sell on Yahoo! Auctions no fees. Bid on great items. http://auctions.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] version difference or server difference?
Why does a Win2K installation of PHP honor max_input_time and a FreeBSD machine does not? I am running version 5.0.0b2-dev on the windows machine and version 4.3.10 on the BSD machine would the version difference cause this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: I have some upload questions.
"James E Hicks III" <[EMAIL PROTECTED]> ???:[EMAIL PROTECTED] > Lee Chen wrote: > > >Thanks > >I check the phpinfo, and my safe_mode is off. > >This is my phpinfo > >http://homepage.ntu.edu.tw/~b91401010/phpinfo().htm > >It is just a copy, not on the server.(so it's html file, not a php file) > > > >Thanks. > > > > > Looks like you need to check this in your php.ini file. Could be your > problem! > > max_input_time integer > > This sets the maximum time in seconds a script is allowed to receive > input data, like POST, GET and file uploads. > > > > James Hicks Thanks for your anwsering. I still have some questions that if I put the same php file on the OTHER server whose settings are like this: http://homepage.ntu.edu.tw/~b91401010/phpinfo()1.htm With the samemax_input_time value "60" , I can upload a file of 30MB successfully and I'm very sure that the duration of uploading files was exceeding "5 minutes"without seeing any message like :Fatal error: Maximum execution time of 0 seconds exceeded in justtest.php on line 2 I don't know what's the difference between the two servers about some settings. With almost the same settings, but it made different results. I'm confused. Please help me solve this problem. Did I have some settings wrong? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] contract help wanted
Hello, I'm a contract worker - mostly I do system administration and consulting, but I also do a lot of system development and programming. Sometimes I have too much work to do as it can be more than me and my associates can comfortably handle. On regular occassion I have some PHP (web application, generally) development work come my way that I would like to outsource (subcontract). If you are interested in regular-to-occassional PHP (involving MySQL database backends and Javascript in-browser niceties) development work and are capable of working via e-mail, working with a deadline, can either track time-used or can quote on a per-project basis, and can handle a variety of different projects each requiring anywhere from 5 to 20 hours of work, then please contact me off-list, preferrably with a resume. Thanks. Lee Howard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: I have some upload questions.
btw, even if I set max_execution_time = 0in the php.ini, I still CAN'T upload a file of 30MB. and it still shows the same message: Fatal error: Maximum execution time of 0 seconds exceeded in justtest.php on line 2 I just don't understand how it can exceed a max execution time of "0". Anything wrong? THANKS. "Marek Kilimajer" <[EMAIL PROTECTED]> ???:[EMAIL PROTECTED] > Lee Chen wrote: > > Thanks for all of your helping. > > > > I think now maybe it's not the serve's problem because I CAN post forms and > > even I can upload some smaller size files. > > Then the following is my problem: > > > > This is the script of " justtest.php" : > > > > justtest.php > > > if (is_uploaded_file($_FILES["upload"]['tmp_name'])) > > { > > $full_path = "D:/xxx/xxx.pdf"; > > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path"); > > } > > ?> > > > > > > > > > > > > > > I can upload a file of size 7KB, but when I want to upload a file of 20 or > > 30MB, it says : > > Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php > > on line 2 > > > > That means it took too long time to upload? > > But when I add some function to this script something like this: > > > > > set_time_limit(0); > > if (is_uploaded_file($_FILES["upload"]['tmp_name'])) > > { > > $full_path = "D:/xxx/xxx.pdf"; > > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path") ; > > } > > set_time_limit(0); > > ?> > > > > > > > > > > > > I add "two" set_time_limit(0)but when I want to upload a file of 20or > > 30MB, it still shows: > > Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php > > on line 2 > > Is safe_mode on? set_time_limit() has no effect when PHP is running in > safe mode. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: I have some upload questions.
Thanks I check the phpinfo, and my safe_mode is off. This is my phpinfo http://homepage.ntu.edu.tw/~b91401010/phpinfo().htm It is just a copy, not on the server.(so it's html file, not a php file) Thanks. - Original Message - From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "Lee Chen" <[EMAIL PROTECTED]> Cc: Sent: Monday, May 16, 2005 11:26 PM Subject: Re: [PHP] Re: I have some upload questions. > Lee Chen wrote: > > Thanks for all of your helping. > > > > I think now maybe it's not the serve's problem because I CAN post forms and > > even I can upload some smaller size files. > > Then the following is my problem: > > > > This is the script of " justtest.php" : > > > > justtest.php > > > if (is_uploaded_file($_FILES["upload"]['tmp_name'])) > > { > > $full_path = "D:/xxx/xxx.pdf"; > > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path"); > > } > > ?> > > > > > > > > > > > > > > I can upload a file of size 7KB, but when I want to upload a file of 20 or > > 30MB, it says : > > Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php > > on line 2 > > > > That means it took too long time to upload? > > But when I add some function to this script something like this: > > > > > set_time_limit(0); > > if (is_uploaded_file($_FILES["upload"]['tmp_name'])) > > { > > $full_path = "D:/xxx/xxx.pdf"; > > move_uploaded_file($_FILES["upload"]['tmp_name'], "$full_path") ; > > } > > set_time_limit(0); > > ?> > > > > > > > > > > > > I add "two" set_time_limit(0)but when I want to upload a file of 20or > > 30MB, it still shows: > > Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php > > on line 2 > > Is safe_mode on? set_time_limit() has no effect when PHP is running in > safe mode. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I have some upload questions.
Thanks for all of your helping. I think now maybe it's not the serve's problem because I CAN post forms and even I can upload some smaller size files. Then the following is my problem: This is the script of " justtest.php" : justtest.php I can upload a file of size 7KB, but when I want to upload a file of 20 or 30MB, it says : Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php on line 2 That means it took too long time to upload? But when I add some function to this script something like this: I add "two" set_time_limit(0)but when I want to upload a file of 20or 30MB, it still shows: Fatal error: Maximum execution time of 30 seconds exceeded in justtest.php on line 2 the same line? So the POST action didn't complete? I don't understand. (AND I can upload a file of 7KB successfully without any problems) The following is some settings in the php.ini: post_max_size 200M upload_max_filesize 200M memory_limit 200M max_execution_time 30 max_input_time 60 And is there anything I should set? BTW, if I put this php file on OTHER server whose settings like this: post_max_size 100M upload_max_filesize 100M memory_limit 8M max_execution_time 30 max_input_time 60 It can work well, no matter the filesize is 30MB or 7KB. So I just wonder what I should do to solve this problem. (now I think it's not the hub's fault) Thanks. "Lee Chen" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] > If the server uses hub ( to make more computer connect online), can' I > upload files > to that server?? > > I face a problem like this , and I think that's the hub causing this > problem. > Did it? > > or if I can do something to solve this problem? > > (btw I am the administrator of that server. I can do anything on that > server) > > Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I have some upload questions.
If the server uses hub ( to make more computer connect online), can' I upload files to that server?? I face a problem like this , and I think that's the hub causing this problem. Did it? or if I can do something to solve this problem? (btw I am the administrator of that server. I can do anything on that server) Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Knowledgebase/Troubleshooter
Thanks Pete, I've already spent about 45 minutes trying to find a project which does this, to no avail... On Thu, 14 Oct 2004, pete M wrote: goto sourceforge.net there's tons of stuff there.. No need to reinvent the wheel ;-))) pete Lee Standen wrote: Hi Guys, I was wondering if anyone knows of a project for creating a troubleshooting wizard, much like in the Microsoft help. I've managed to make something which kind of works myself, but the problem is writing an interface to add/remove/add/manage the questions and steps. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Knowledgebase/Troubleshooter
Hi Guys, I was wondering if anyone knows of a project for creating a troubleshooting wizard, much like in the Microsoft help. I've managed to make something which kind of works myself, but the problem is writing an interface to add/remove/add/manage the questions and steps. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem install pws and php
i am a beginner for php programming, my OS is win98 while my webserver is PWS, all is in the same machine,when i try to run my internet explorer( type in http://localhost/phpinfo.php), phpinfo.php cannot be display. i try to reinstall pws and php follow the instrustruction but its still same problem. i hope yours can help me to show whats wrong, thanks for your help - Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now
[PHP] text indexers
hello! anybody here who knows text based indexers? e.g. lucene(java based) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hello list
Do you guys know of any php based text indexers? similar to lucene? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session variables as array
Hello... Is there any example that I can look at that does a session variable as an array? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question on PDF upload
Hi all, I believe many of you know this already. But, for someone who's this problem, I'd like to let u know something about file upload. When u'd like to upload something by POST, if it fails, I will probably to go edit php.ini's max_file_size value, but if it still fails, then? Thanks for Raditha Dissanayake who gave out this link: http://www.radinks.com/upload/config.php And, if your apache's (Oh, I am using Apache only) and u've got this error message in your error_log: Requested content-length of 615950 is larger than configured limit of 524288 Then u may read this: http://www.faqts.com/knowledge_base/view.phtml/aid/8176 Well, just editing or removing the line "LimitRequestBody", I made it work. It may only for my case, but hope this helps a few people. Finally, may I ask a question? In my case, all of the PDFs that generated from MS Word + Acrobat can be upload with the content-length=512KB, but the PDFs generated from PageMaker, its content-length is greater than 512KB, why the content-lengths are different? Sorry for my poor english. Thanks for your help. Jeffrey > Hi, > > I am sorry about that I didn't mention about the file size of that pdf. > It's less than 1MB and I have checked my php.ini that it allows > post_max_size = 8M. So, in my little knowledge, I think it's alright. > > Thanks for your help. > > Jeffrey > > - Original Message - > From: "Raditha Dissanayake" <[EMAIL PROTECTED]> > To: "Jeffrey Lee" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Thursday, March 11, 2004 6:06 PM > Subject: Re: [PHP] Question on PDF upload > > > > ifIf you can view the file in your reader (before uploading) , the most > > likely that you have exceeded the upload limit or something related to > > that. hope you find the artilce at > > http://www.radinks.com/upload/config.php usefull in configuring your php > > to handle large uploads. > > > > All the baest > > > > Jeffrey Lee wrote: > > > > >Hi all, > > > > > >I am new to this newsgroup, hello all! > > > > > >I've written a script for my collueages to upload PDF file to the web > server > > >(apache 2.0.40). I do it via a http form submit. > > > > > >Here's the form tag of it > > > > >method="POST" onSubmit="return chkFields();"> > > > > > > > > >All files (PDF, xls) are able to be uploaded properly. And these can be > > >viewed in browser. For one PDF file, it cannot be uploaded. When I've > > >clicked submit, it should submit to upload.php, but for this particular > pdf, > > >the browser displays "The Page Cannot Be Found". I am sure that > upload.php > > >is there as when I upload another file, it's working properly, even for > > >other pdf. > > > > > >I would like to ask is it possible that something in that pdf's header > > >corrupted? But, I can view that file in my acroread and if I use FTP to > > >upload that file, then I can view the file in browser also. Oh, please > > >help. > > > > > >Cheers, > > > > > >Jeffrey > > > > > > > > > > > > > > > -- > > Raditha Dissanayake. > > --- > > http://www.radinks.com/upload/ > > Drag and Drop Upload thousands of files and folders in a single > > transfer. (HTTP or FTP) > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [Q] PHP code embedded in html files - What happens?
Hi Michael, In my understanding, web server will involve php interpreter when the file extension is specify. Say, if a web server is configured to involve php interpreter when the extension is php, then when the request file is php, the php file's content will be interpreted. So, I think your web server is configured like this. I believe it's normal behaviour in your case. Please correct me if I've made anything wrong, thanks. Cheers, Jeffrey "Michael T. Peterson" <[EMAIL PROTECTED]> ¦b¶l¥ó news:[EMAIL PROTECTED] ¤¤¼¶¼g... > When the following file, tmp.htm, is executed no output is produced. > > > > Test > > > > echo 'hello world'; > ?> > > > > However, when the name of the file is changed to tmp.php the expected > output, 'hello world', is obtained. Is this the correct behavior? More > specifically, is the php script not executed? > > Cheers, > > Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web based php development tool
Anybody here who could recommend a web based php dev tool for editing php sources online? Thanks! I'm having a hard time finding a nice one. Thanks in advance guys! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question on PDF upload
Hi, I am sorry about that I didn't mention about the file size of that pdf. It's less than 1MB and I have checked my php.ini that it allows post_max_size = 8M. So, in my little knowledge, I think it's alright. Thanks for your help. Jeffrey - Original Message - From: "Raditha Dissanayake" <[EMAIL PROTECTED]> To: "Jeffrey Lee" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, March 11, 2004 6:06 PM Subject: Re: [PHP] Question on PDF upload > ifIf you can view the file in your reader (before uploading) , the most > likely that you have exceeded the upload limit or something related to > that. hope you find the artilce at > http://www.radinks.com/upload/config.php usefull in configuring your php > to handle large uploads. > > All the baest > > Jeffrey Lee wrote: > > >Hi all, > > > >I am new to this newsgroup, hello all! > > > >I've written a script for my collueages to upload PDF file to the web server > >(apache 2.0.40). I do it via a http form submit. > > > >Here's the form tag of it > > >method="POST" onSubmit="return chkFields();"> > > > > > >All files (PDF, xls) are able to be uploaded properly. And these can be > >viewed in browser. For one PDF file, it cannot be uploaded. When I've > >clicked submit, it should submit to upload.php, but for this particular pdf, > >the browser displays "The Page Cannot Be Found". I am sure that upload.php > >is there as when I upload another file, it's working properly, even for > >other pdf. > > > >I would like to ask is it possible that something in that pdf's header > >corrupted? But, I can view that file in my acroread and if I use FTP to > >upload that file, then I can view the file in browser also. Oh, please > >help. > > > >Cheers, > > > >Jeffrey > > > > > > > > > -- > Raditha Dissanayake. > --- > http://www.radinks.com/upload/ > Drag and Drop Upload thousands of files and folders in a single > transfer. (HTTP or FTP) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question on PDF upload
Hi all, I am new to this newsgroup, hello all! I've written a script for my collueages to upload PDF file to the web server (apache 2.0.40). I do it via a http form submit. Here's the form tag of it All files (PDF, xls) are able to be uploaded properly. And these can be viewed in browser. For one PDF file, it cannot be uploaded. When I've clicked submit, it should submit to upload.php, but for this particular pdf, the browser displays "The Page Cannot Be Found". I am sure that upload.php is there as when I upload another file, it's working properly, even for other pdf. I would like to ask is it possible that something in that pdf's header corrupted? But, I can view that file in my acroread and if I use FTP to upload that file, then I can view the file in browser also. Oh, please help. Cheers, Jeffrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serious PHP5b4 speed issues
Thank you for your comments. So that we have a page to compare between PHP4 and PHP5, I have taken the home page of php.net. I have a local copy 'php.local' and re-ran the tests on the first page (ab running on 'php.local') ab http://php.loca/ -n1000 -c10 Again, the results are alarming - PHP5 seems to be about 50% slower :-( Below are the results. >> Results with PHP5 module loaded << Concurrency Level: 10 Time taken for tests: 113.320 seconds Complete requests: 1000 Failed requests:0 Broken pipe errors: 0 Total transferred: 26031972 bytes HTML transferred: 25689608 bytes Requests per second:8.82 [#/sec] (mean) Time per request: 1133.20 [ms] (mean) Time per request: 113.32 [ms] (mean, across all concurrent requests) Transfer rate: 229.72 [Kbytes/sec] received >> Results with PHP4 module loaded << Document Path: / Document Length:25651 bytes Concurrency Level: 10 Time taken for tests: 64.971 seconds Complete requests: 1000 Failed requests:0 Broken pipe errors: 0 Total transferred: 26056665 bytes HTML transferred: 25710578 bytes Requests per second:15.39 [#/sec] (mean) Time per request: 649.71 [ms] (mean) Time per request: 64.97 [ms] (mean, across all concurrent requests) Transfer rate: 401.05 [Kbytes/sec] received --- Raditha Dissanayake <[EMAIL PROTECTED]> wrote: > Hi, > > I am a guy who doesn't believe in 'requests per > second' and 'number of > concurrent users' stats so please ignore the rest of > this message if you > wish: > > The problem here could be that while it's possible > to improve the speed > of execution it's not possible to do so for the full > set of functions or > features available in a particular language. There > will be areas where > there is huge boost in speed and there may be areas > where there is slow > down and it's quite possible that you have hit one > of them. > > Secondly it's quite possible that the optimization > techniques used with > one version may be counter productive with another > version. > If you better describe the functionality of your > pages i think you will > be more likely to recieve a better answer (from me > or someone better > qualified). > > best regards. > > > > Andrew Lee Paul wrote: > > >Hello all > > > >I have recently installed PHP 5.0 Beta 4 on my > >development server and am very concerned with > >performance. I have read everywhere, that PHP5 > offers > >increased performance. However, in my tests, the > >requests per second have decreased dramatically: > > > >PHP5: Requests per second:4.23 [#/sec] (mean) > >PHP4: Requests per second:23.08 [#/sec] (mean) > > > >Full test results are below. > > > >The environment and the requested page are > identical > >in both tests (using ab). The tests were run on > >Apache/1.3.28. > > > >Has anyone else experienced similar behavior? Or > can > >anyone suggest what is happening... > > > >Thank you in advance. > > > >Andrew > > > > > > > > > > > > > >>>Results with PHP5 module loaded << > >>> > >>> > > > > > > > >Concurrency Level: 10 > >Time taken for tests: 236.372 seconds > >Complete requests: 1000 > >Failed requests:0 > >Broken pipe errors: 0 > >Total transferred: 12732000 bytes > >HTML transferred: 12514000 bytes > >Requests per second:4.23 [#/sec] (mean) > >Time per request: 2363.72 [ms] (mean) > >Time per request: 236.37 [ms] (mean, across > all > >concurrent requests) > >Transfer rate: 53.86 [Kbytes/sec] received > > > > > > > > > > > > > > > >>>Results with PHP4 module loaded << > >>> > >>> > > > > > > > >Concurrency Level: 10 > >Time taken for tests: 43.328 seconds > >Complete requests: 1000 > >Failed requests:0 > >Broken pipe errors: 0 > >Total transferred: 12728000 bytes > >HTML transferred: 12514000 bytes > >Requests per second:23.08 [#/sec] (mean) > >Time per request: 433.28 [ms] (mean) > >Time per request: 43.33 [ms] (mean, across > all > >concurrent requests) > >Transfer rate: 293.76 [Kbytes/sec] > received > > > > > > > > > > > >__ > >Do you Yahoo!? > >Yahoo! Mail SpamGuard - Read only the mail you > want. > >http://antispam.yahoo.com/tools > > > > > > > > > -- > Raditha Dissanayake. > > http://www.radinks.com/sftp/ | > http://www.raditha.com/megaupload > Lean and mean Secure FTP applet with | Mega Upload - > PHP file uploader > Graphical User Inteface. Just 150 KB | with progress > bar. > __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serious PHP5b4 speed issues
Hello all I have recently installed PHP 5.0 Beta 4 on my development server and am very concerned with performance. I have read everywhere, that PHP5 offers increased performance. However, in my tests, the requests per second have decreased dramatically: PHP5: Requests per second:4.23 [#/sec] (mean) PHP4: Requests per second:23.08 [#/sec] (mean) Full test results are below. The environment and the requested page are identical in both tests (using ab). The tests were run on Apache/1.3.28. Has anyone else experienced similar behavior? Or can anyone suggest what is happening... Thank you in advance. Andrew >> Results with PHP5 module loaded << Concurrency Level: 10 Time taken for tests: 236.372 seconds Complete requests: 1000 Failed requests:0 Broken pipe errors: 0 Total transferred: 12732000 bytes HTML transferred: 12514000 bytes Requests per second:4.23 [#/sec] (mean) Time per request: 2363.72 [ms] (mean) Time per request: 236.37 [ms] (mean, across all concurrent requests) Transfer rate: 53.86 [Kbytes/sec] received >> Results with PHP4 module loaded << Concurrency Level: 10 Time taken for tests: 43.328 seconds Complete requests: 1000 Failed requests:0 Broken pipe errors: 0 Total transferred: 12728000 bytes HTML transferred: 12514000 bytes Requests per second:23.08 [#/sec] (mean) Time per request: 433.28 [ms] (mean) Time per request: 43.33 [ms] (mean, across all concurrent requests) Transfer rate: 293.76 [Kbytes/sec] received __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache per directory setting
Dear Umesh, I already restart Apache, but it didn't work. OT question: Do Apache's Directory Directive, use relative path or absolute path for matching? Beside, I am using PHP Version 4.2.3 Regards, Chris Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache per directory setting
>You need to use: > > php_value register_globals 1 I tried, but still fail, phpinfo still show register_globals OffOff Regards, Chris Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache per directory setting
Hi, Is it possible to set PHP flag at Apache ver 1.3.x per directory? e.g. DocumentRoot /home/www/apps/htdocs ServerName localhost php_flag register_globals on I tried but fail to turn on Register Globals settings (Default is off). Any Hints? Regards, Chris Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Optional Vars in Functions
On Fri, Jan 02, 2004 at 01:20:50PM -0800, Chris wrote: : Jason Williard asked: : > : > Is there a way to make a variable of a function optional? : : http://www.php.net/functions More specifically: http://www.php.net/manual/en/functions.arguments.php e.g. function puke ($stuff = "hairball") { echo "puking ".$stuff."\n"; return; } puke("beer"); // echoes "puking beer" puke(); // echoes "puking hairball" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [posibleOT] Forcing entering te site thru index.php
On Mon, Dec 22, 2003 at 01:09:37AM +0100, Andreas Magnusson wrote: : : You can use the Referer header found in $_SERVER['HTTP_REFERER'] to check : from which page the user comes from. Unfortunately, HTTP_REFERER is not guaranteed to exist. In fact, several Windoze firewall software actively block this information from being sent to the web server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [posibleOT] Forcing entering te site thru index.php
On Sun, Dec 21, 2003 at 04:11:36PM -0300, Fernando M. Maresca wrote: : On Sun, Dec 21, 2003 at 01:03:43PM -0600, Eugene Lee wrote: : > On Sun, Dec 21, 2003 at 03:57:24PM -0300, Fernando M. Maresca wrote: : > : : > : Well, i'm trying to avoid access to the site for the middle. Say : > : there is a initial page with a form and other pages that depends : > : on this. Is there a way to force users access the site thru the : > : initial form page, regardless of the url? : > : Something like this: : > : lynx http://mysite/forma2.php/ : > : produce the browser to redirect to : > : http://mysite/index.php/ : > : : > : Of course, the forma2.php must be served if its accesed after : > : index.php. : > : > There are several ways to do this. The most obvious is with cookies. : > Set up your index.php to initially create a cookie that authorizes a : > user to look in the site. On the rest of your PHP pages, check that : > this authorization cookie exists. If not, redirect to index.php. : : Thanks for the response. : No, this way don't do it: once the cookie is set up in the client's : browser, there is no way for me to prevent the client to type the url : pointing to another page, and the cookie will be valid on that page. : What i'm trying to do is to force the client to travel pages in the : order expected, forbidding him/her to access a page out of sequence, : wich take him to an error message (because, for example, for abscense : of POST data or something). : So i'm stuck. Not really. It depends on how you use your cookie. The cookie could be some unique ID to some session-based system (whether you use PHP session functions or not) that keeps a track of where the user is. So let's say the user did the right thing, went to index.php, got a cookie, and went to the next page (let's say forma1.php). Your session system notes that the user is currently on forma1.php. But the same user gets distracted, does not go through the form normally, leaves for a few hours, and then tries to return but jump directly to forma2.php. Your session system realizes that he's not supposed to be there, and kicks him out to whereever you want him. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [posibleOT] Forcing entering te site thru index.php
On Sun, Dec 21, 2003 at 03:57:24PM -0300, Fernando M. Maresca wrote: : : Well, i'm trying to avoid access to the site for the middle. Say there : is a initial page with a form and other pages that depends on this. Is : there a way to force users access the site thru the initial form page, : regardless of the url? : Something like this: : lynx http://mysite/forma2.php/ : produce the browser to redirect to : http://mysite/index.php/ : : Of course, the forma2.php must be served if its accesed after index.php. There are several ways to do this. The most obvious is with cookies. Set up your index.php to initially create a cookie that authorizes a user to look in the site. On the rest of your PHP pages, check that this authorization cookie exists. If not, redirect to index.php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions simply don't work
I'm getting this message all the the time I try to start a session with session_start. Cannot send session cookie - headers already sent It's the first line of code in the file. I'm even getting the error with a single session_start() function on its own in a file. It fails on Apache on my intranet and IIS after being uploaded to a web server. The browser is set to recieve cookies. All the books say it should work. Has anybody any ideas? I've wasted a whole day on this joker! Ken Lee. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php special permissions
On Thu, Dec 18, 2003 at 12:52:14PM +, Mat Harris wrote: : On Thu, Dec 18, 2003 at 06:42:37 -0600, Eugene Lee wrote: : > On Thu, Dec 18, 2003 at 12:24:21PM +, Mat Harris wrote: : > : : > : I am building a web interface to the vacation autoresponder program : > : on linux. : > : : > : I let users login, edit their message and enable the autoresponder. : > : : > : The last step (enabling) is where the fun begins because php is run : > : as apache on my box, and each users' .vacation.msg and .forward are : > : not owned by apache. : > : : > : So you say, ok lets make apache run as group 'vacation' and also : > : change the ownership on .vacation.msg and .forward. : > : : > : Well this makes sendmail cry out because it doesn't like having : > : group-writable .forward files. : > : > DontBlameSendmail : > : > http://www.sendmail.org/tips/DontBlameSendmail.html : : Thanks for the reply but I have already tried the DontBlameSendmail options. : : Either the flags are ignored or I am using the wrong combination : (there are several flags I believe). If there is a good sequence for : those options then I would love to know. There are several more options listed in the URL. Two of them: GroupWritableForwardFile GroupWritableForwardFileSafe might look like they could address your specific issues. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php special permissions
On Thu, Dec 18, 2003 at 12:24:21PM +, Mat Harris wrote: : : I am building a web interface to the vacation autoresponder program : on linux. : : I let users login, edit their message and enable the autoresponder. : : The last step (enabling) is where the fun begins because php is run : as apache on my box, and each users' .vacation.msg and .forward are : not owned by apache. : : So you say, ok lets make apache run as group 'vacation' and also : change the ownership on .vacation.msg and .forward. : : Well this makes sendmail cry out because it doesn't like having : group-writable .forward files. DontBlameSendmail http://www.sendmail.org/tips/DontBlameSendmail.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Update issue - more then likely simple problem
On Thu, Dec 18, 2003 at 01:39:57PM +1100, Eric Holmstrom wrote: > > What im trying to do is read the information from a field in a table called > PARTNO. Then add RU to the front of whatever is in the PARTNO field. > > So far i have this. > > //connect details rarara > //query > $query= "SELECT PARTNO FROM russell2 "; Didn't you say the table was called "PARTNO", not "russell2"? > // make a query to get old stuff from DB col > $oldstuff = mysql_query($query, $conn) or die(mysql_error()); > while ($new = mysql_fetch_array($oldstuff)){ > $final = $new['PARTNO']; > //new infomation i want to add infront of PARTNO data > $newstuff = 'RU'; > //Combining the two resluts together > $results = $newstuff.$final; > // just use this to check it was going through properly > print_r($results); > } > > The problem i have to get it to update. If i add this (see below) inside the > while statement it continually loops, and outside it doesnt work. > > $update = "UPDATE rocket SET PARTNO = '$results''"; > mysql_query($update); > > I know the answer is simple but i seem to be stuck on it. I don't think you can just update a row that you just fetched within the same query. If you do this in PHP, you should split the update into a separate loop. Of course, it would be faster and more efficient to have MySQL do it for you: UPDATE rocket SET PARTNO = CONCAT('RU',PARTNO) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Opening large file problem - fopen
On Tue, Dec 16, 2003 at 01:30:14PM +0100, Kim Steinhaug wrote: : : I found out that what the script accually does is choke on "\n\n", : empty lines. I havnt found a way to solve this with the script, : : What I do now is use TextPad and just replace all occurencies : of "\n\n" with "\n-\n" or something and it works all nice. But this : is a bad way of doing it, since the script still doesnt accually work... You have two options: 1) massage your data beforehand so that your script works properly 2) buffer your input lines so that you process them only after you have read a complete "entry", since one entry may span multiple lines in your error_log. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Round() behaviour issue
On Tue, Dec 16, 2003 at 11:13:25AM +, Scott McDaid wrote: : : Hi there. I've been looking at the behaviour of the round functionality in : PHP. We're currently still using v4.2.3, (but the documentation seems to : suggest it's the same for versions after this). : : Doing the following rounds always rounds *up* to the nearest whole number. : i.e. : : 0.5 => 1 : 1.5 => 2 : 2.5 => 3 : 3.5 => 4 Any non-zero fractional component that gets rounded to the next whole number is done with ceil(). : In earlier PHP docs, it stated that halves would be rounded to the nearest : even number. : i.e. : : 3.5 => 4 : 4.5 => 4 I recall seeing those docs and getting very confused, especially with your listed example. Personally, I think the current behavior for round() is mathematically correct; i.e. any number whose fractional component is greater-than or equal-to 1/2 is rounded up to the next whole number, otherwise it's rounded down. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email problem
On Mon, Dec 15, 2003 at 12:58:17PM -0800, Naveen Glore wrote: : : thanks for the quick response. I have the same permissions as yours. : My email server is working fine, i use sendmail MTA and outlook MUA. I : am able to send emails and view my received emails in outlook through : my server. But I am having problem when i use mail() function in php : code. Email is never delievered. Hmmm, what about the permission and ownship of Sendmail itself? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email problem
On Mon, Dec 15, 2003 at 12:05:54PM -0800, Naveen Glore wrote: : : I have freebsd server with apache, PHP and mysql. i wrote a simple PHP : program using mail(). The mail() function returns true without any : error. but the problem is the email is never delivered. I viewed the : log file for mail(/var/log/maillog) and i saw the following error: : : Server sendmail[351]:NOQUEUE:SYSERR(www):can not chdir(/var/spool/clientmqueue/): Permission denied. It's a Sendmail issue. Make sure that directory has the right permission and ownership settings. Mine looks like this: drwxrwx--- 2 smmsp smmsp68 11 Dec 07:17 /var/spool/clientmqueue -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg is failing on this simple test
On Fri, Dec 12, 2003 at 07:54:16PM -0800, Manuel Ochoa wrote: : : Why is this test failing? : : $data = "A Simple test."; : If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) { : echo "Valid text"; : } : else { : echo "Not valid text"; : } You can't use the character class "\s" within a range. And you need to escape a few special characters. The working version should be: $data = 'A Simple test.'; #if (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) if (ereg("^[a-zA-Z0-9[:space:]\.\-_']+$", $data)) { echo "Valid text\n"; } else { echo "Not valid text\n"; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] enable_trans_sid problem
On Fri, Dec 12, 2003 at 09:49:29AM -0500, Ewald Geschwinde wrote: : : I have the following problem : : I have htmlcode like this: : : : : and with this feature : it's printed out like this: : : : : : The problem is the /> at the end. : : Has anyone seen this before? : What can I do against it? It's an XHTML thing. Does it cause problems for you? Like what? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Evaluating a page in a different order
On Wed, Dec 03, 2003 at 11:42:09AM -, [EMAIL PROTECTED] wrote: : : I have a php page class that i use as a template for my website. Every : page in my website creates an instance of the class and passes values : like title and meta tag keywords. The class includes the layout from : different files e.g. title.lay contains the title and logo. : : In the top right hand corner of my page i have a login status, which : displays if the user is logged in or not. This is included as : loginstatus.lay by the class. : : If the page performs a php scripting function, it is included in the : main content area. This main content area comes after the : loginstatus.lay, so is evaluated afterwards. While this answer functioned, it was obviously fundamentally flawed... : My problem is when creating a logout page. The loginstatus is : displayed as logged in, but the main content area logouts out the : user. At last, the fundamental flaw is ultimately expressed. :-) : The reason i designed the class and page layout like this is because i : wanted to seperate the design and code as much as possible. As a : temporary solution i have added some code to loginstatus.lay, but this : is edging towards including code in the layout files which i dont : want. MVC-ish patterns are good. The problem you've encountered is that code in your main content area may do something that changes the output of entire page (or in your case the top portion of the page). You need to modify your app to first evaluate all code, let it reach its next state, and *then* generate the correct templated output based on the new state. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file uploads
On Mon, Dec 01, 2003 at 02:00:34PM +, Jon Bennett wrote: : : Hi Chris, : : I think you're referring to this: : : $_FILES["image"]["tmp_name"] : : In my class I pass this as a reference: : : $aArgs['Image'] = $_FILES["image"]; : : Then, $aImage in my storeBigImage() method is passed the : $aArgs['Image'] when it's called: : : $this->storeBigImage($productID, $aArgs['Image']); : : All the image details are there because otherwise functions like : getimagesize would fail, it just won't save the resized or, if the : dimensions of the uploaded image aren't bigger than my max width and : height, original image, and I really have no idea why!! In your storeBigImage() method, what do you get if you do: print_r($aArgs); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php