php-general Digest 18 May 2005 09:01:52 -0000 Issue 3461
php-general Digest 18 May 2005 09:01:52 - Issue 3461 Topics (messages 215411 through 215447): Re: PHP Applications? 215411 by: Greg Donald 215426 by: Manuel Lemos 215428 by: Danny Brow 215436 by: Chris Shiflett 215441 by: Richard Lynch hey dip shit 215412 by: Jason Motes 215418 by: Jason Motes 215420 by: John Nichel 215424 by: Ryan A 215425 by: Mary-Anne Nayler 215430 by: Ryan A Re: PHP Complex Data Structures 215413 by: Jason Barnett 215415 by: Jay Blanchard 215427 by: Matthew Weier O'Phinney 215445 by: zzapper Refresh (F5) adds another SQL record. 215414 by: Robert Meyer 215419 by: Jay Blanchard 215421 by: Marek Kilimajer 215423 by: Marcus Joyce 215433 by: Robert Meyer 215434 by: Robert Meyer 215440 by: Richard Lynch Re: why are session only working with cookies? 215416 by: Brian V Bonini Re: array, trouble updating 215417 by: Jason Wong 215432 by: mayo Mail function 215422 by: virtualsoftware.gmail.com 215439 by: Richard Lynch Curious bug and crash 215429 by: Dave Lists Re: array, trouble updating - SOLVED 215431 by: mayo libxml_set_streams_context 215435 by: Bill Hoffman 215437 by: Richard Lynch 215443 by: Bill Hoffman Re: Secure delivery 215438 by: lopopizarro.users.sourceforge.net Re: Blank page in browser 215442 by: Nayeem Unknown column 'peterspeters' in 'where clause' 215444 by: Mark Sargent 215446 by: Tom Rogers 215447 by: Mark Rees Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- On 5/17/05, Brent Baisley [EMAIL PROTECTED] wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Did you have a link for this 'compiler' ? All I see in the site menu is a link to the encoder. Sorry if I'm just not seeing it. -- Greg Donald Zend Certified Engineer http://destiney.com/ ---End Message--- ---BeginMessage--- Hello, on 05/17/2005 11:27 AM Brian Dunning said the following: My background is mostly with Lasso. One cool feature is the ability to make LassoApps - single file applications that are secure and can be sold distributed without providing access to the source. Does PHP offer any such capability? You may want to try this class that generates a PHP script that self installs packages with many application files. http://www.phpclasses.org/php2install Then you can use a PHP compiler like RoadSend to generate executable binaries to protect the code. http://www.roadsend.com/ -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html ---End Message--- ---BeginMessage--- On Tue, 2005-05-17 at 15:34 -0400, Brent Baisley wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Any free ones? ---End Message--- ---BeginMessage--- Danny Brow wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Any free ones? http://pecl.php.net/package/APC -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ ---End Message--- ---BeginMessage--- On Tue, May 17, 2005 1:50 pm, Greg Donald said: On 5/17/05, Brent Baisley [EMAIL PROTECTED] wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Did you have a link for this 'compiler' ? All I see in the site menu is a link to the encoder. Sorry if I'm just not seeing it. He probably meant the encoder. Zend has a lot of products, though, and there maybe might be one designed just to secure your PHP source... I kinda lost track lately, with all the options out there. Err, anyway, I just really wanted to say that virtually every Zend product has been so routinely mis-represented by what it does that the amount of mis-information out there is probably larger than the amount of correct info. Read Zend's website product descriptions first, and ignore forum/mailing list comments until you're clear on what the product does, and doesn't do. That will help you separate the
Re: [PHP] libxml_set_streams_context
On Tue, May 17, 2005 9:03 pm, Bill Hoffman said: I'm trying to use libxml_set_streams_context() to load a remote xml file via HTTP conditional GET with DOMDocument::load() by stuffing an 'If-Modified-Since: --- HTTP header into the stream, but no matter how I try it I always get an HTTP 200 response when I know the last- modified date is well before my if-modified date string. I've confirmed via curl -H on the command line that I can do it properly and get an HTTP 304 as expected, but I don't know what I'm not doing right with libxml_set_streams_context(). Here's my code: $opts = array('http'=array('method'=GET, 'header'=If-Modified- Since: Wed, 18 May 2005 23:55:29 GMT\r\n)); $context = stream_context_create($opts); libxml_set_streams_context($context); $doc-load('http://www.somewhere.com/somefile.xml'); echo $doc-saveXML(); Where is your error checking? I don't know much about that fancy new stream stuff, or the XML crap, but you've got zero (0) lines of code in there to do anything useful when the functions fail. If you ask the functions nicely, they almost always tell you EXACTLY what went wrong. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function
On Tue, May 17, 2005 3:53 pm, [EMAIL PROTECTED] said: I have a script which send emails using mail() function. I have 100 email addresses and i set up the script to send 1 email every 10 seconds. So, it will take 1000 seconds to send all 100 emails. My question is: If I stop the script after,let's say 12 seconds, it will send only 1 email or all 100?I mean it is possible that the server to cache all emails and send them if i stop the script? I must say that the script is run through a web browser. If you stop the script before PHP executes the instruction to send the email, then the email ain't gonna go out. Period. Your best bet would be to use PHP to QUEUE the emails up, and let your mail sending software (sendmail, qmail, elvenmail) worry about load and timing. You may also want to consider having the web-based application simply set a flag/indicator somewhere which tells PHP that it's time to queue up all 100 emails. Then the end user won't even have to wait for 100 emails to get queued up in line. They only have to wait for the flag to get set which should take, like, less than one second. There are also innumerable PHP mail classes out there to make sending email easier. http://phpclasses.org has some, I'm betting PEAR has some, and you could Google and find a thousand more. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
On Tue, May 17, 2005 2:24 pm, Robert Meyer said: Hello, Scenario: 1) User is presented a blank form. with an MD5 hash which is stored in the database as fresh 2) User fills in form. 3) User submits form. 4) Record is added to database. That particular MD5 has is marked as used 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? The used MD5 hash tells you they are re-submitting the exact same form. Now, if the real problem is that the user has a fresh new form, and fills in the same data again by hand, then there are only two possibilities: 1. In the real world, they actually NEED two of the same thing in the database, and your application should allow it. 2. In the real world, users are likely to lose track of where they are in their data entry, and you need to provide them the context to help avoid that. When you go back to 1) present a message like added blah blah blah at the top of the screen. Now they *KNOW* they just did blah blah blah, and can move on to blah blah bleh. Data entry is a sucky job. Make it nicer for them, eh? You STILL need to code for the dual entry, and do something intelligent when they mess up, but you can improve efficiency and decrease errors (where 2 not-quite-the-same-but-really-are-the-same entries pass your tests) if you make your application nicer to the user. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Secure delivery
Please authenticate the secure message. +++ Attachment: No Virus found +++ Bitdefender AntiVirus - www.bitdefender.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Applications?
On Tue, May 17, 2005 1:50 pm, Greg Donald said: On 5/17/05, Brent Baisley [EMAIL PROTECTED] wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Did you have a link for this 'compiler' ? All I see in the site menu is a link to the encoder. Sorry if I'm just not seeing it. He probably meant the encoder. Zend has a lot of products, though, and there maybe might be one designed just to secure your PHP source... I kinda lost track lately, with all the options out there. Err, anyway, I just really wanted to say that virtually every Zend product has been so routinely mis-represented by what it does that the amount of mis-information out there is probably larger than the amount of correct info. Read Zend's website product descriptions first, and ignore forum/mailing list comments until you're clear on what the product does, and doesn't do. That will help you separate the patent falsehoods from useful info, and winnow down your reading by a factor of 3. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Blank page in browser
Thanks Richard Lynch, I found same error in error_log file which I face on command prompt before then I install PHP 5.0 with --with-oci8=$ORACLE_HOME compilation so that problem solved. Now I'm facing same problem on Apache. So can you tell me where should I define the environment variables on Apache. Thanks, Regards, Nayeem. -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 17, 2005 10:51 PM To: Nayeem Cc: php-general@lists.php.net Subject: Re: [PHP] Blank page in browser On Tue, May 17, 2005 1:41 am, Nayeem said: I'm new to PHP programming and I just try to display small information from database on web page but its shows blank page. So my code is mention below and let me know what's wrong in it but when I execute same program on command prompt then its shows all result correctly with HTML Tags You logged in as you. The PHP user runs as somebody else. That other user does not have the same permissions/rights as you, and not the same environment variables ($PATH in shell) and not even the same shell. If you can 'su' to that other user and run it, you may find out why it fails. You should also check error logs as suggested, and use View Source in your browser to see if the blank page is really blank, or just buried inside an unfinished HTML tag. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On May 17, 2005, at 10:24 PM, Richard Lynch wrote: I don't know much about that fancy new stream stuff, or the XML crap, but you've got zero (0) lines of code in there to do anything useful when the functions fail. no functions fail. what I'm expecting is that with libxml_set_streams_context(), I've correctly sent an HTTP If-Modified-Since Request Header along with the HTTP GET in the DOMDocument::load() call. what I'm seeing is that somehow I haven't, since the the DOMDocument::load() call returns the file (with an HTTP 200 status in the response header) even though I know the file has not been modified since the If-Modified-Since date (confirmed by looking at the Last-Modified date in the response header). the fact that there is no failure, and no error message that I can examine or test is exactly why I'm scratching my head and asking if anyone who does know something about stream contexts can offer some pointers. I don't think I need any help with the XML crap, as you put it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unknown column 'peterspeters' in 'where clause'
Hi All, the below code generates this error, Unknown column 'peterspeters' in 'where clause' mysql_select_db(status, $db); $username = $_POST[username]; $password = $_POST[password]; $result = mysql_query(SELECT customer_id FROM Customers WHERE customer_username = $username AND customer_password = $password) or die (mysql_error()); $myrow = mysql_fetch_row($result); $customer_id = $myrow[0]; $_SESSION['customer_id'] = $customer_id; ? /head body ?php echo 'SQL Query: '.$result.'br'; echo CustomerID = $customer_id; ? Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Complex Data Structures
On 18 May 2005 01:28:07 -, wrote: * Zzapper [EMAIL PROTECTED]: I seem to remember that you access/use PHP data in the same/similar way to Perl data and that you can create complex data structures ie arrays of arrays, arrays of records etc. For once Google let me down so can any one point at any doc info. Did you try building any complex data structures? You could have whipped out something to test pretty quickly. The quick answer is, 'Yes'. The longer answer is: cut-and-past the following into a script and see what you get: $cds = array( 'element1' = array( 'string1', 'string2', 'string3' ), 'element2' = true, 'element3' = array( 'subelement1' = array( array(1, 2, 3), 2, 3 ) ) ); var_dump($cds); thx 4 various answers which also lead me to http://uk2.php.net/manual/en/language.types.array.php Example 11-11. Recursive and multi-dimensional arrays. I seem to remember from a previous life that you can operate directly on PHP data, I mean you don't have to use the PHP primitives. -- zzapper vim -c :%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg? http://www.rayninfo.co.uk/tips/ vim, zsh success tips -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unknown column 'peterspeters' in 'where clause'
Hi, Wednesday, May 18, 2005, 4:27:34 PM, you wrote: MS Hi All, MS the below code generates this error, MS Unknown column 'peterspeters' in 'where clause' MS mysql_select_db(status, $db); MS $username = $_POST[username]; MS $password = $_POST[password]; MS $result = mysql_query(SELECT customer_id FROM Customers WHERE MS customer_username = $username AND customer_password = $password) or die MS (mysql_error()); MS $myrow = mysql_fetch_row($result); MS $customer_id = $myrow[0]; MS $_SESSION['customer_id'] = $customer_id; ? MS /head MS body MS ?php MS echo 'SQL Query: '.$result.'br'; MS echo CustomerID = $customer_id; ? MS Cheers. MS Mark Sargent. You need to put the variables in single quotes, otherwise mysql treats it as a column name. You should also escape the strings to be safe if magic_quotes are turned off in php.ini A bit like this: mysql_select_db(status, $db); $username = mysql_escape_string($_POST[username]); $password = mysql_escape_string($_POST[password]); $result = mysql_query( SELECT customer_id FROM Customers WHERE customer_username = '$username' AND customer_password = '$password') or die (mysql_error()); $myrow = mysql_fetch_row($result); $customer_id = $myrow[0]; $_SESSION['customer_id'] = $customer_id; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unknown column 'peterspeters' in 'where clause'
If customer_username is a string (char, varchar, text etc.) then I guess it should be mysql_query(SELECT customer_id FROM Customers WHERE customer_username = \$username\ AND customer_password = \$password\) Prathap -- Original Message --- From: Mark Sargent [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wed, 18 May 2005 15:27:34 +0900 Subject: [PHP] Unknown column 'peterspeters' in 'where clause' Hi All, the below code generates this error, Unknown column 'peterspeters' in 'where clause' mysql_select_db(status, $db); $username = $_POST[username]; $password = $_POST[password]; $result = mysql_query(SELECT customer_id FROM Customers WHERE customer_username = $username AND customer_password = $password) or die (mysql_error()); $myrow = mysql_fetch_row($result); $customer_id = $myrow[0 ]; $_SESSION['customer_id'] = $customer_id; ? /head body ?php echo 'SQL Query: '.$result.'br'; echo CustomerID = $customer_id; ? Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End of Original Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unknown column 'peterspeters' in 'where clause'
hi Mark Unknown column 'peterspeters' in 'where clause' you're missing the quotes around (I guess) the password. you can kick yourself now :-p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unknown column 'peterspeters' in 'where clause'
I expect (indeed I sincerely hope) that customer_username AND customer_password columns are character datatypes. So it would be a good idea to put single quotes around the values you are trying to select from them. -Original Message- From: Mark Sargent [mailto:[EMAIL PROTECTED] Sent: 18 May 2005 07:28 To: php-general@lists.php.net Subject: [PHP] Unknown column 'peterspeters' in 'where clause' Hi All, the below code generates this error, Unknown column 'peterspeters' in 'where clause' mysql_select_db(status, $db); $username = $_POST[username]; $password = $_POST[password]; $result = mysql_query(SELECT customer_id FROM Customers WHERE customer_username = $username AND customer_password = $password) or die (mysql_error()); $myrow = mysql_fetch_row($result); $customer_id = $myrow[0]; $_SESSION['customer_id'] = $customer_id; ? /head body ?php echo 'SQL Query: '.$result.'br'; echo CustomerID = $customer_id; ? Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY ** CONFIDENTIALITY NOTICE: This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. GENERAL STATEMENT: Any statements made, or intentions expressed in this communication may not necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content herein may be held binding upon Gamma Global (UK) Ltd or any associated company unless confirmed by the issuance of a formal contractual document or Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com EOE ** ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] server taking long time to make graph
Hi I am making graph in PHP using JPGRAPH. I am not taking big data, my data is only 48 points. Through TOP command in linux, I found that httpd is taking lot of time to make the simple x-y graph. I found that the graph size is 47.75kb only. May pls suggest if any setting needs to be done in PHP / APACHE etc. to make it fast -- With Best Wishes Balwant Singh INDO ASIAN FUSEGEAR LTD. A-39, HOSIERY COMPLEX PHASE - II EXTN., NOIDA PH: +91 - 120 - 2568 472 / 093 -098 FAX: +91 - 120 - 2568 473 WEB : www.indoasian.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dwonloading a file
I need to write a cron job that retrieves a zipped XML file via FTP, unzips it, and then imports the XML into MySQL. I haven't done any of these three specific functions yet. Before I tear my hair out on each of these functions, can anyone point me to a simple example of any or all three? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Jakarta Tomcat and PHP
Hi, I hope this is the right place to ask... I am running Tomcat 5.5.7 (jdk 1.5) on Windows XP quite happily. I have MySQL set up and that all works fine too. But I would also like to be able to run PHP under Tomcat rather than having to install Apache to handle PHP file and forward JSP requests to Tomcat... I'll only be doing some small test pages in PHP but I really dont want to have to install another server. I read on the Tomcat Wiki site that it *is* possible to connect PHP and Tomcat, and I tried but got nowhere, I dont even get errors when opening .php files! I'd really appreciate it if someone could give me or point me in the direction of an idiots guide to getting PHP working with Tomcat. I've gone through every result from google to no avail :( Cheers, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Force a reload of the document after step (4), you may use javascript to reload this document, ie... After step (4) add this line... print scriptdocument.location.href='your-document-url';/script; Assey. On Tue, 17 May 2005, Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] Refresh (F5) adds another SQL record.
On Tue, 17 May 2005, Robert Meyer wrote: As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. PHP is a server-side programming language, the problem you are facing is a client-side problem. PHP thus would not be able to do browser refreshes! sorry! Unless of course you have a PHP enabled browser :-) Your browser caches the information sent from the form and so long as the page is not reloaded..., the variables are still set and submition of data may continue indefinately. Two options, You may use the php header() funtion for redirection, or Resort to a client-side reload using a scripting language like javascript..., document.location.href=''; Assey. Thanks for your input. Regards, Robert Marcus Joyce [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why dont you check that data isnt being duplicated? $query = SELECT auto_col FROM table where col1 = $var1 col2 = $var 3.; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo information already exists in database; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] directory listing from text file
Hello, I have a plain text file with the following direcory listing: \first \second \third \third\first \third\first\first \third\first\second \third\second \third\second\first \third\second\second \fourth How can I get directory tree from this and using Javascript or DHTML display such view: * first * second * third |---first ||---first ||---second |--(+)second * fourth I tried creating very interesting arrays, but don't know how exactly an array should be sorted Any ideas? Bye, Dreiph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Next time, Mukasa, try reading... Robert clearly states that he'd like a PHP function which TELLS him if the page has been refreshed or not (thus, resent). There are headers sent out that indicate this, and thus a function like refreshed() would be a shortcut to getting to know if it has. He doesn't ask to FORCE a refresh, or to even execute PHP in a browser (what? how did you get to this...??) Mukasa Assey Alfred wrote: On Tue, 17 May 2005, Robert Meyer wrote: As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. PHP is a server-side programming language, the problem you are facing is a client-side problem. PHP thus would not be able to do browser refreshes! sorry! Unless of course you have a PHP enabled browser :-) Your browser caches the information sent from the form and so long as the page is not reloaded..., the variables are still set and submition of data may continue indefinately. Two options, You may use the php header() funtion for redirection, or Resort to a client-side reload using a scripting language like javascript..., document.location.href=''; Assey. Thanks for your input. Regards, Robert Marcus Joyce [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why dont you check that data isnt being duplicated? $query = SELECT auto_col FROM table where col1 = $var1 col2 = $var 3.; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo information already exists in database; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] Dwonloading a file
Brian Dunning wrote: I need to write a cron job that retrieves a zipped XML file via FTP, unzips it, and then imports the XML into MySQL. I haven't done any of these three specific functions yet. Before I tear my hair out on each of these functions, can anyone point me to a simple example of any or all three? Download a file : use the 'wget' program if its available on your system. Since you mentioned cron, I assume you are working on linux/unix or similar. If wget is not available, try links/lynx. If those aren't available either, then you can use any of the HTTP classes, such as HTTP_Client (from pear) or my favorite snoopy.sf.net. If your PHP install is bundled with curl, you can also use the curl functions (http://www.php.net/curl) Unzip a file : http://www.php.net/manual/en/ref.zip.php (example is right there in the manual entry) XML: If you are on PHP5, then use simplexml, otherwise, use the regular xml functions. Plenty of examples and tutorials on the internet. Google is your friend. Import into MySQL : just use the mysql command line client if its available to you. mysql -u username -ppassword databasename file.sql If it is not, use the regular mysql functions to submit queries (mysql_connect, mysql_select_db, and mysql_query). Regards, Burhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Robert Meyer wrote: Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). Go really back to 1) - use redirect. After the record is added to the database, use something like: header('Location: http://yourserver.com/form.php'); exit; Does this work for all browsers? yes. All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? You should see a message from your browser that data is being reposted. I looked for such a message and the only thing I can find is as follows: 1) _SERVER['HTTP_ACCEPT'] and _ENV['HTTP_ACCEPT'] and change to */*, but I don't know if that is the case for all browsers, do you know? 2) _SERVER['REDIRECT_UNIQUE_ID'] and _ENV['REDIRECT_UNIQUE_ID'], _SERVER['REMOTE_PORT'] and _ENV['REMOTE_PORT'], _SERVER['UNIQUE_ID'] and _ENV['UNIQUE_ID'] change, but I don't think the values are predictable, especially between browsers. Do you know of a specific message to look for and is that message the same for all browsers? that's a message the user (using the browser) gets from the browser. Unless you use GET method, but you should really use POST method for forms that change state on the server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] directory listing from text file
Dreiph, If you're familiar with PEAR, take a look at this: http://pear.php.net/package/HTML_TreeMenu regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with using SPL to build a MySQL Iterator
Hello all I was trying to write an SPL Iterator for a MySQL result set but not having any luck. Specifically I'm not sure how to overload the key() and current/next() methods. Does anyone here have a working code sample that does this, or can offer some guidance on how to overload the 5 Iterator methods? Any assistance much appreciated! Thanks! __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Basic PHP/HTML code question
Hi, I have been trying to write or find a pre-written script of a combo-box which would allow one to select a category from one drop-down list, then be given related options within a secondary list before clicking a submit button. Is there anyone who knows where I can find this or an easy way to accomplish this in PHP? Sorry if this is a basic question but I have only begun learning coding PHP so some items are foreign at this point. Thanks for your understanding and any assistance. C.
[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] PHP Complex Data Structures
I find PHP arrays easier than Perl's data structures. Probably because PHP just has arrays, there really is no differentiation between arrays (Perl @) and hashes (Perl %). And PHP references arrays the same way as variables ($), which may or may not be confusing. You could probably look at PHP arrays as Perl hashes (name/value pairs). The functions are just about the same: push, pop, shift, unshift, etc. If you think of all PHP arrays as Perl hashes, you should grasp things pretty quick. On May 17, 2005, at 4:17 PM, zzapper wrote: Hi, I seem to remember that you access/use PHP data in the same/similar way to Perl data and that you can create complex data structures ie arrays of arrays, arrays of records etc. For once Google let me down so can any one point at any doc info. -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Sorry for that., i miss read that.. sorry, thought he wanted a php function to refresh the browser. Assey. On Wed, 18 May 2005, M. Sokolewicz wrote: Next time, Mukasa, try reading... Robert clearly states that he'd like a PHP function which TELLS him if the page has been refreshed or not (thus, resent). There are headers sent out that indicate this, and thus a function like refreshed() would be a shortcut to getting to know if it has. He doesn't ask to FORCE a refresh, or to even execute PHP in a browser (what? how did you get to this...??) Mukasa Assey Alfred wrote: On Tue, 17 May 2005, Robert Meyer wrote: As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. PHP is a server-side programming language, the problem you are facing is a client-side problem. PHP thus would not be able to do browser refreshes! sorry! Unless of course you have a PHP enabled browser :-) Your browser caches the information sent from the form and so long as the page is not reloaded..., the variables are still set and submition of data may continue indefinately. Two options, You may use the php header() funtion for redirection, or Resort to a client-side reload using a scripting language like javascript..., document.location.href=''; Assey. Thanks for your input. Regards, Robert Marcus Joyce [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why dont you check that data isnt being duplicated? $query = SELECT auto_col FROM table where col1 = $var1 col2 = $var 3.; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo information already exists in database; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
This list could really use an active moderator. Um no. You can't moderate what's already in peoples mailboxes, and if you're going to have all posts manually approved before delivery, then you're going to seriously affect the responsiveness of the list. Besides that post was harmless, was apologised for, and in the grand scheme of things isn't that big of a deal. Definatly not something to screw up the list with moderation over. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] server taking long time to make graph
Balwant Singh wrote: Hi I am making graph in PHP using JPGRAPH. I am not taking big data, my data is only 48 points. Through TOP command in linux, I found that httpd is taking lot of time to make the simple x-y graph. I found that the graph size is 47.75kb only. May pls suggest if any setting needs to be done in PHP / APACHE etc. to make it fast If you really want to make that script go fast then you might try contacting Johann directly. He has both public / commercial versions and I'm willing to bet that the commercial version is faster than the public one. That being said, the best way to improve performance is to cache the graph. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
John Nichel wrote: Jason Motes wrote: HAH This list could really use an active moderator. Did Mr. Nichel just volunteer for that task... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] From in mail() header problem.
Ave, I¹ve written a simple script to send a mail out in HTML format to the recipient. Everything is working fine... Except the ³From² header. The recipient receives the email from ³World Wide Web Server [EMAIL PROTECTED]² instead of what I have specified. Here¹s my code... FORM action=?php echo $PHP_SELF; ? method=post name=oneTEXTAREA name=desc cols=20 rows=5/TEXTAREAINPUT name=Submit type=submit value=Submit/FORM ? if($Submit) { $to = [EMAIL PROTECTED]; $subject = SOMETHING : File Upload Notification; $message = htmlhead/head body Hi, brbr You have recieved a new file in the Something File Manager, with the following details: brbr Name: Onebr Size: 94685 Bytesbr Description: $descbr Date: $now brbr Please visit bSOMETHING File Manager/a/b to login to your account and download the file.br This is an automated notification email. Please do not reply to this email. brbr Regards,br SOMETHINGbr /body/html ; $message = stripslashes($message); mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1; From: SOMETHING [EMAIL PROTECTED]; Reply-To: [EMAIL PROTECTED]; MIME-Version: 1.0; X-Mailer: PHP/' . phpversion()); echo It is done; } ? ... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO in the headers. Instead of the mail stating ³Something [EMAIL PROTECTED]² at the recipient¹s end, it is stating ³World Wide Web Server [EMAIL PROTECTED]² .. I have no clue why. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] Reprocessing text
I have a site that extracts HTML page code from a database and prints it to the page being generated. A user has requested that I allow this text to be dynamic. I can code process functions for the code that I pull from the database, but it would be so much better if I could simply get PHP to process the text for me. Does anyone know a way to cause this to happen? tia ---Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP/HTML code question
Since PHP is server-side, it's probably not the best option for doing what you're describing. It IS possible to use a javascript onchange event and use that to trigger a new page load which would change your second select box, but that's kind of slow and sloppy and should probably only be used when your select boxes have a LOT of data or can change a lot necessitating a database lookup on whatever you selected in the first box. It sounds like what you want to do would best be done in javascript totally. Use PHP to build the javascript code that has all the options and then use code like the stuff found in Example 1 on: http://www.mattkruse.com/javascript/dynamicoptionlist/ Technically this message is off topic and I'm sure someone will say something about it, but I hope people remember when they were starting out in PHP and weren't sure what it could and couldn't do and remember that asking questions like this is part of the learning process. Best of luck Carlos! -TG = = = Original message = = = Hi, I have been trying to write or find a pre-written script of a combo-box which would allow one to select a category from one drop-down list, then be given related options within a secondary list before clicking a submit button. Is there anyone who knows where I can find this or an easy way to accomplish this in PHP? Sorry if this is a basic question but I have only begun learning coding PHP so some items are foreign at this point. Thanks for your understanding and any assistance. C. ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RSS news feed (slightly 0T)
Hey, Can anyone suggest a few places where i can get some decent tech/programming/php news feeds? I presently have the PHP.net feed (but its not too good because the news does not change much in days) and I am using yahoo's feeds for software, digital music and internet. I was using slashdot, but the articles are generally really small, and its more of a forum based...but worst of all their feed is having problems and sometimes i get it (i cache the feed and update every 8 hours) sometimes i dont get it. To be fair, taking into consideration the above categories please try to refrain from posting your own feed unless you think it would really help me. Also cc the list your answer coz it would help if not everyone told me to check out site x :-), i'll reply to the list and you. Thanks in advance, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] version difference or server difference?
[snip] 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? [/snip] According to http://us3.php.net/ref.info max_input_time has been available since 4.3.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
Rory Browne wrote: This list could really use an active moderator. Um no. You can't moderate what's already in peoples mailboxes, and if you're going to have all posts manually approved before delivery, then you're going to seriously affect the responsiveness of the list. Besides that post was harmless, was apologised for, and in the grand scheme of things isn't that big of a deal. Definatly not something to screw up the list with moderation over. I didn't say anything about approval before delivery, and I really can't see how an active moderator would screw up the list. You mean having someone around who can remove email addresses subscribed to the list that generate bounces would be a bad thing? Someone that can remove email addresses that do nothing but generate auto responders? Someone who can remove addresses which send out those stupid, 'verify you are not spam' emails? Someone who can block spam? Sure, this post was harmless, but it's far from the only crap coming onto this list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: RSS news feed (slightly 0T)
* Ryan A [EMAIL PROTECTED]: Can anyone suggest a few places where i can get some decent tech/programming/php news feeds? http://planet-php.net/ Planet PHP is an aggregation of newsfeeds from PHP developers and programmers. Not everything will necessarily be programming or PHP oriented, but most of it will be. If nothing else, it will turn you towards other newsfeeds that might be of interest. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] directory listing from text file
Thank you Chris, but this is not I needed. Let me explain my situation. I have a big server with a lot of audio files, working within LAN, with Windows 2000 Pro on it. Let's call it as FileServer. Also I have another server with Apache2 and PHP installed, windows 2000 PRO too, let's say it is WebServer. Web Server is standalone with two NIC cards, firewall, etc. I don't want to make Fileserver be accessible form Internet. The problem is that PHP and/or Apache on WebServer does not understand mapped drives from a FileServer, so readdir() or opendir() is not working correctly, by the way, it looks like Windows dir command works a little bit faster than readdir(); It take me some time to play with simple Windows command line utility, to get directory listing on FileServer and deliver plain text file to a WebServer. Command line was the following: exec('cmd /c dir /b /s /d /a:d \\\FileServer\\audiofiles audiofiles.txt'); $hi = fopen(audiofiles.txt, r); $line = fread($hi,filesize(audiofiles.txt)); fclose($hi); $line=explode(\n, $line); At this point I've got FileServer directories [only directories, not files!] scanned into file audiofiles.txt and this file was written to a WebServer. So, I have plain text file with correct directory structure, including subdirectories. The problem is, that dir command in Windows command prompt scans directories in weird format - each directory in new line, eg: \first \second \second\first \second\second \third I immagine, to show directory tree, I need to make some like array in PHP, and I think, this should be a recursive function [could not find out how to write it]. So final variable should be array like this: $directories = Array('\\first', '\\second = Array('\\first', '\\second'), '\\third'); How?? Thanks, Bye, Dreiph Chris Ramsay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dreiph, If you're familiar with PEAR, take a look at this: http://pear.php.net/package/HTML_TreeMenu regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
Jason Barnett wrote: John Nichel wrote: Jason Motes wrote: HAH This list could really use an active moderator. Did Mr. Nichel just volunteer for that task... Hell, I'll do it...if there are no objections from the established list members (like that will happen ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with using SPL to build a MySQL Iterator
V Kam wrote: Hello all I was trying to write an SPL Iterator for a MySQL result set but not having any luck. Specifically I'm not sure how to overload the key() and current/next() methods. Does anyone here have a working code sample that does this, or can offer some guidance on how to overload the 5 Iterator methods? Any assistance much appreciated! Thanks! I just put all the code that retrieves the data in the next() function. current() and key() just return the variables that next populated. Don't know what else to say. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Basic PHP/HTML code question
* Carlos Palomino [EMAIL PROTECTED]: I have been trying to write or find a pre-written script of a combo-box which would allow one to select a category from one drop-down list, then be given related options within a secondary list before clicking a submit button. Is there anyone who knows where I can find this or an easy way to accomplish this in PHP? PHP can generate the data for the drop-downs, but to do what you want to do, you're going to need to use javascript (which operates at the client, i.e. browser, level). Google for javascript solutions to this, and I'm sure you'll have no problem finding something. Sorry if this is a basic question but I have only begun learning coding PHP so some items are foreign at this point. Thanks for your understanding and any assistance. The trick is learning what falls in the realm of PHP, what falls under the HTML/CSS umbrella, and what falls under the javascript umbrella. Rule of thumb: * If it's display related, it's HTML/CSS * If it has to happen before a request is made, it's Javascript * If it happens in response to a request, it's PHP Good luck! -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] From in mail() header problem.
Rahul S. Johari wrote: Ave, I¹ve written a simple script to send a mail out in HTML format to the recipient. Everything is working fine... Except the ³From² header. The recipient receives the email from ³World Wide Web Server [EMAIL PROTECTED]² instead of what I have specified. Here¹s my code... FORM action=?php echo $PHP_SELF; ? method=post name=oneTEXTAREA name=desc cols=20 rows=5/TEXTAREAINPUT name=Submit type=submit value=Submit/FORM ? if($Submit) { $to = [EMAIL PROTECTED]; $subject = SOMETHING : File Upload Notification; $message = htmlhead/head body Hi, brbr You have recieved a new file in the Something File Manager, with the following details: brbr Name: Onebr Size: 94685 Bytesbr Description: $descbr Date: $now brbr Please visit bSOMETHING File Manager/a/b to login to your account and download the file.br This is an automated notification email. Please do not reply to this email. brbr Regards,br SOMETHINGbr /body/html ; $message = stripslashes($message); mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1; From: SOMETHING [EMAIL PROTECTED]; Reply-To: [EMAIL PROTECTED]; MIME-Version: 1.0; X-Mailer: PHP/' . phpversion()); echo It is done; } ? Those should not be separated by semicolons (;) , you should use \r\n. So... mail($to,$subject,$message,Content-type: text/html\r\ncharset=iso-8859-1\r\nFrom: SOMETHING [EMAIL PROTECTED]\r\nReply-To: [EMAIL PROTECTED]: 1.0\r\nX-Mailer: PHP/ . phpversion()); echo It is done; ... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO in the headers. Instead of the mail stating ³Something [EMAIL PROTECTED]² at the recipient¹s end, it is stating ³World Wide Web Server [EMAIL PROTECTED]² .. I have no clue why. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] server taking long time to make graph
I am making graph in PHP using JPGRAPH. I am not taking big data, my data is only 48 points. Through TOP command in linux, I found that httpd is taking lot of time to make the simple x-y graph. I found that the graph size is 47.75kb only. May pls suggest if any setting needs to be done in PHP / APACHE etc. to make it fast I haven't used jpgraph much, but I seem to remember reading somewhere in its documentation that if you are anti-aliasing the graph it will take a lot longer to generate. Maybe that's it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic PHP/HTML code question
Carlos Palomino wrote: Hi, I have been trying to write or find a pre-written script of a combo-box which would allow one to select a category from one drop-down list, then be given related options within a secondary list before clicking a submit button. Is there anyone who knows where I can find this or an easy way to accomplish this in PHP? Sorry if this is a basic question but I have only begun learning coding PHP so some items are foreign at this point. Thanks for your understanding and any assistance. PHP executes on the server, so you have to send the form to the server. The easiest way I know of to do this is to add onChange=document.formname.submit(); to the select tag (obviously, change formname to the name of the form in question. When the form reloads, use the selected item in the first combo box to select the items to fill the second combo box. ---Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Applications?
Chris Shiflett wrote: Danny Brow wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Any free ones? http://pecl.php.net/package/APC APC won't work for me, segmentation faults all around =( suprisingly this doesn't occur the first time I load a page, only the second time ! grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Jakarta Tomcat and PHP
My guess would be looking for how to use PHP as a CGI in tomcat. So check out the manual for CGI stuff. grt, Evert Chris Holden wrote: Hi, I hope this is the right place to ask... I am running Tomcat 5.5.7 (jdk 1.5) on Windows XP quite happily. I have MySQL set up and that all works fine too. But I would also like to be able to run PHP under Tomcat rather than having to install Apache to handle PHP file and forward JSP requests to Tomcat... I'll only be doing some small test pages in PHP but I really dont want to have to install another server. I read on the Tomcat Wiki site that it *is* possible to connect PHP and Tomcat, and I tried but got nowhere, I dont even get errors when opening ..php files! I'd really appreciate it if someone could give me or point me in the direction of an idiots guide to getting PHP working with Tomcat. I've gone through every result from google to no avail :( Cheers, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Refresh (F5) adds another SQL record.
Hello to all that responded. Thanks very much for your help. I implemented and thoroughly tested the following: header(Location: .$_SERVER['PHP_SELF']); exit; And is works great for this particular need.. Regards, Robert Robert Meyer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] From in mail() header problem.
I¹ve written a simple script to send a mail out in HTML format to the recipient. Everything is working fine... Except the ³From² header. The recipient receives the email from ³World Wide Web Server [EMAIL PROTECTED]² instead of what I have specified. Here¹s my code... [snip] $message = stripslashes($message); mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1; From: SOMETHING [EMAIL PROTECTED]; Reply-To: [EMAIL PROTECTED]; MIME-Version: 1.0; X-Mailer: PHP/' . phpversion()); echo It is done; } ? ... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO in the headers. Instead of the mail stating ³Something [EMAIL PROTECTED]² at the recipient¹s end, it is stating ³World Wide Web Server [EMAIL PROTECTED]² .. I have no clue why. What happens if you do it like this: $headers = Content-type: text/html; charset=iso-8859-1\r\n; $headers .= From: SOMETHING [EMAIL PROTECTED]\r\n; $headers .= Reply-To: [EMAIL PROTECTED]; $headers .= MIME-Version: 1.0; X-Mailer: PHP/' . phpversion() . \r\n; mail($to,$subject,$message,$headers); From the manual: additional_headers (optional) String to be inserted at the end of the email header. This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with RFC 2822. Failing that, I'd check with the admin of your server. Maybe they are re-writing all outbound email with the *real* From header regardless of what you put in there. -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Responses in my email.
Hello, When I post a question here, I get an email for every response posted. I only want the response posted, not emailed to me. The other newsgroups I belong to don't send me an email. What are my options if any and how do I implement them? Regards, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
On Mon, 2005-05-16 at 22:10, Richard Lynch wrote: Let him fight with phpIniDir some other day. Something interesting maybe: http://gfx.gfx-design.com/session_test.php Hit your browsers refresh button. I would think SID is NOT supposed to change with every page refresh..?? ?php session_start(); header(Cache-control: private); $_SESSION['test'] = testing; echo 'pre'; print_r($_SESSION); echo \nSession Id: . session_id(); echo \n . strip_tags(SID); echo '/pre'; ? -- s/:-[(/]/:-)/g BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC Key Info: http://gfx-design.com/keys Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and PayPal
Hello, I am about ready to start my investigation into this matter, but thought I'd ask here first. Here is the scenario I would like to implement. 1) User wants to buy a key that allows them to do a particular task on my web site. 2) I do not want to release the key to the user until payment is received. Here is one way I would like it to work: 1) User fills out a form (user email address, etc.) then clicks the Buy Key button. 2) User, along with a link, unique ID (not Key), cost, and form data is sent to PayPal. 3) After PayPal receives full payment, PayPal sends user back to my site via the link and other data. 4) That link starts a script that confirms with PayPal that payment was made in full. 5) When confirmed, user is presented with key (can copy and paste) with option to have it emailed to them. Another way I would like it to work: 1) User fills out a form (user email address, etc.) then clicks Buy Key button. 2) User, along with a link, unique ID (not Key), cost, and from data is sent to PayPal. 3) After PayPal receives payment, PayPal sends user an email with same data sent to it. 4) When user receives email, user clicks link containing Unique ID. 5) That link starts a script that confirms with PayPal that payment was made in full. 6) When confirmed, user is presented with key (can copy and paste) with option to have it emailed to them. Thanks for your time. Regards, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RSS news feed (slightly 0T)
Can anyone suggest a few places where i can get some decent tech/programming/php news feeds? I don't know if they have RSS feeds on them or not, but I'd try... http://www.zend.com/ http://www.devshed.com/c/b/PHP/ http://www.phpbuilder.com/ And all or none of the sites listed here: http://www.php.net/links.php -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending a string with $_POST/$_GET
Ross wrote: I want to write a string to a variable and use $_POST or $_GET to retrieve it on another page. I keep gettting an undefined index errror. Can someone show me how this is done? Do I have to use session_start() ? or just use cookies: setcookie('myvarname', 'some value'); and in the other page: echo $_COOKIE['myvarname']; will output 'some value' regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Building array ?
HI All, I'm trying to build an array of user id's. This is the code I've written that does not work. while($row=mysql_fetch_array($result)){ // put user ID's into an array; $uidToAdmin .= array ($row[user_id]); // for debugging echo brUID $row[user_id]BR; echo BRAUID $uidToAdmin[0]; } So how can I continue adding to this array in the while loop? TIA -- Paul Nowosielski Webmaster CelebrityAccess.com 303.440.0666 ext:219 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
John Nichel wrote: Jason Barnett wrote: John Nichel wrote: Jason Motes wrote: HAH This list could really use an active moderator. Did Mr. Nichel just volunteer for that task... Hell, I'll do it...if there are no objections from the established list members (like that will happen ;) John has my vote for what it's worth :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
I didn't say anything about approval before delivery, and I really can't see how an active moderator would screw up the list. You mean having someone around who can remove email addresses subscribed to the list that generate bounces would be a bad thing? Fair enough. That just wasn't my idea of moderation. My idea of moderation would have been the prevention of something like this from coming on to the list, which would have meant pre-approval. Someone that can remove email addresses that do nothing but generate auto responders? Someone who can remove addresses which send out those stupid, 'verify you are not spam' emails? Someone who can block spam? Are you volunteering? Sure, this post was harmless, but it's far from the only crap coming onto this list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_open with variable fails
Hi, just did want to let this sink unanswered, but I see that 6 days means quite a lot of messages piled up. Should have answered earlier, but... Anyway, I think I had tried the \{ or '{-combinations as well and it didn't work - but I can't remember exactly and can't reproduce now, since I was working on a user's server there. But the way I finally solved this way to first create a string with the entire command and its arguments in it and then eval() the thing... Thanks Michael Richard Lynch [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] { } became special characters in PHP strings, at some point... You may or may not be able to change a php.ini setting to change that... I wouldn't have expected it to change from 4.3.10 to 4.3.11, but I don't really KNOW when it changed. I suck at tracking version numbers and small changes with them. Swiss cheese memory. Or, you should be able to always use \{ inside and it should work You could also change to '' instead of and {} would NOT be special inside ''. On Wed, May 11, 2005 1:05 am, Michael Baas said: Hi, I'm using imap_open and the script works fine on my server with 4.3.11. Now as user with 4.3.10 reported that the script does not work. He finally got it working by replacing my variable-names in the imap_open-command with strings containing exactly the same data (except for the leading slash before the { which I was using together with variables). The statement is @imap_open(\{$host}INBOX,$user,$pwd,OP_HALFOPEN); and host is 80.243.163.14/pop3. I know that /notls can also be appended, but as I said: it works fine when entering these directly into the command, just when using the string-parameter it fails. The error is: imap_open(): Couldn't open stream I've spent quite some time now googling around, searching various forums etc., but could not find a solution to this. Would appreciate your help very much! Thanks Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RSS news feed (slightly 0T)
Hey, Can anyone suggest a few places where i can get some decent tech/programming/php news feeds? I presently have the PHP.net feed (but its not too good because the news does not change much in days) and I am using yahoo's feeds for software, digital music and internet. I was using slashdot, but the articles are generally really small, and its more of a forum based...but worst of all their feed is having problems and sometimes i get it (i cache the feed and update every 8 hours) sometimes i dont get it. To be fair, taking into consideration the above categories please try to refrain from posting your own feed unless you think it would really help me. Also cc the list your answer coz it would help if not everyone told me to check out site x :-), i'll reply to the list and you. http://www.planet-php.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RSS news feed (slightly 0T)
Hey, Can anyone suggest a few places where i can get some decent tech/programming/php news feeds? I presently have the PHP.net feed (but its not too good because the news does not change much in days) and I am using yahoo's feeds for software, digital music and internet. I was using slashdot, but the articles are generally really small, and its more of a forum based...but worst of all their feed is having problems and sometimes i get it (i cache the feed and update every 8 hours) sometimes i dont get it. To be fair, taking into consideration the above categories please try to refrain from posting your own feed unless you think it would really help me. Also cc the list your answer coz it would help if not everyone told me to check out site x :-), i'll reply to the list and you. Er www.planet-php.net even :) Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Applications?
Evert | Rooftop wrote: Chris Shiflett wrote: Danny Brow wrote: Zend sells a compiler to speed up your PHP code. Since it's compiled, it also does not contain the source code in readable form. You should visit the Zend website. Any free ones? http://pecl.php.net/package/APC APC won't work for me, segmentation faults all around =( suprisingly this doesn't occur the first time I load a page, only the second time ! grt, Evert I can't say for sure, but I'm betting that APC doesn't support the version of PHP that you are trying to use. Specifically, I don't think it supports PHP5+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and PayPal
On Wednesday 18 May 2005 16:33, Robert Meyer wrote: Here is one way I would like it to work: 1) User fills out a form (user email address, etc.) then clicks the Buy Key button. 2) User, along with a link, unique ID (not Key), cost, and form data is sent to PayPal. Paypal document this in their developer SDK. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] From in mail() header problem. - Solved!
Ave, On 5/18/05 10:55 AM, Philip Hallstrom [EMAIL PROTECTED] wrote: What happens if you do it like this: $headers = Content-type: text/html; charset=iso-8859-1\r\n; $headers .= From: SOMETHING [EMAIL PROTECTED]\r\n; $headers .= Reply-To: [EMAIL PROTECTED]; $headers .= MIME-Version: 1.0; X-Mailer: PHP/' . phpversion() . \r\n; mail($to,$subject,$message,$headers); From the manual: additional_headers (optional) String to be inserted at the end of the email header. This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with RFC 2822. Believe it or faint, \r\n was the problem. I had actually tried it with the way it was in the Manual to begin with, with the $headers in separate lines, as you also suggested above, but it didn't work at all. And I know that we don't re-write headers for outbound mail from the server because a simple From: header without any additional headers works fine! I ignored the last part that you mentioned when I had first read it in the Manual.. But when you stated it in the response you sent, I did actually try it out... Instead of using \r\n .. I used \n alone, and it worked! I never had the problem of not receiving the email entirely at all though.. The recipient was definitely receiving the email being sent, contrary to what is suggested by the manual.. And in fact everything except the From: header was working fine. HTML format email with all the headers in tact were being received using \r\n. But using \n alone, the From: is also fixed now, and everything is working in order. Thanks a ton! Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Building array ?
Paul Nowosielski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] HI All, I'm trying to build an array of user id's. This is the code I've written that does not work. while($row=mysql_fetch_array($result)){ // put user ID's into an array; $uidToAdmin .= array ($row[user_id]); // for debugging echo brUID $row[user_id]BR; echo BRAUID $uidToAdmin[0]; } So how can I continue adding to this array in the while loop? while($row=mysql_fetch_array($result)){ // put user ID's into an array; $uidToAdmin[] .= $row[user_id]; } rush -- http://www.templatetamer.com/ http://www.folderscavenger.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
Brian V Bonini wrote: On Mon, 2005-05-16 at 22:10, Richard Lynch wrote: Let him fight with phpIniDir some other day. Something interesting maybe: http://gfx.gfx-design.com/session_test.php Hit your browsers refresh button. I would think SID is NOT supposed to change with every page refresh..?? Except that the SID is NOT in any POST / GET parameter. So since PHP doesn't recieve a SID on any refresh, it assumes that it is starting a new session each time. This is expected behavior. Try creating a POST form instead and see what happens when you submit that form. Refreshing the page without a SID anywhere won't do anything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hey dip shit
[snip] John has my vote for what it's worth :-) [/snip] So, you're voting John in as dip shit? I second that. :) You knew it wasn't going to be too long before I weighed in on this. Agree with not releasing every post (posts are taking a long time to show up NOW), but handling all that little admin work? Sure, someone really needs to do that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Building array ?
Paul Nowosielski wrote: HI All, I'm trying to build an array of user id's. This is the code I've written that does not work. while($row=mysql_fetch_array($result)){ thereisnothingwrongwithwhitespaceitcanhelplegebilityofyourcode:-) // put user ID's into an array; $uidToAdmin .= array ($row[user_id]); you are concatenating an array (which will be cast to a string) to a string - this won't do what you want. also putting '$row[user_id]' in double quotes is pointless, remember that if you don't put it in double quotes then you have to quote the array 'key' like so (or suffer an E_NOTICE): ? echo $row['user_id']; ? so to build up an (indexed) array (as opposed to associative): ?php $uidToAdmin = array(); while ($row = mysql_fetch_array($result)) { // put user ID's into an array; $uidToAdmin[] = $row['user_id']; } // DEBUG: // I'll assume you will run this via your browser // therefore a pre tag is used to make the output // readable echo 'pre'; var_dump( $uidToAdmin ); echo '/pre'; ? I would suggest you take (another?) look at the documentation on arrays, php arrays are really very very cool - knowing how to use them properly is a powerful weapon in your php arsenal. :-) have fun // for debugging echo brUID $row[user_id]BR; echo BRAUID $uidToAdmin[0]; } So how can I continue adding to this array in the while loop? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Building array ?
I'm trying to build an array of user id's. This is the code I've written that does not work. while($row=mysql_fetch_array($result)){ // put user ID's into an array; $uidToAdmin .= array ($row[user_id]); $uidToAdminArray[] = $row[user_id]; // for debugging echo brUID $row[user_id]BR; echo BRAUID $uidToAdmin[0]; } print_r($uidToAdminArray); So how can I continue adding to this array in the while loop? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sending a string with $_POST/$_GET
On Wed, 2005-05-18 at 11:53, Luis wrote: Ross wrote: I want to write a string to a variable and use $_POST or $_GET to retrieve it on another page. $string = 'this is a string'; echo 'a href=another_page.php?val=' . $string . 'Next page/a'; another_page.php: echo $_GET[val]; -- s/:-[(/]/:-)/g BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC Key Info: http://gfx-design.com/keys Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Building array ?
On Wed, 2005-05-18 at 12:00, Paul Nowosielski wrote: HI All, I'm trying to build an array of user id's. This is the code I've written that does not work. while($row=mysql_fetch_array($result)){ // put user ID's into an array; $uidToAdmin .= array ($row[user_id]); // for debugging echo brUID $row[user_id]BR; echo BRAUID $uidToAdmin[0]; } So how can I continue adding to this array in the while loop? $uidToAdmin[] = $row[user_id]; ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Display a database image from MSSQL database
Hi... I need to display some images that exists inside one MSSQL server in a BLOB datatype field, but my code don't work... My code: ? $arg = $_GET[codPessoa]; mssql_connect(server, web, web); $sql = SELECT Foto FROM Foto WHERE CodPessoa=$arg; $result = mssql_query($sql); $data = mssql_result($result, 0, Foto); $data = stripslashes($data); header(Content-type: image/gif); echo $data; exit; ? And I access this page sending in the URL the text: .../showimage.php?codPessoa=xxx. I receive a strange code like Fh54757eFg554257eFrgtth547d54e7t8h54j87j85fd54ss7f.. Accessing this page by IE nothing happens but when a I try to access in Mozilla Firefox I got an error saying that the image cointain errors and cannot be displayed... If i try to show inside an img TAG in other page like img src=patch/to/page / the code display a X error img, like if the image don't exist, but the code keep returning the strange code, so I believe that this is the image in a string format and something makes with the conversion for a real image format don't work very well. Sorry my bad english... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
mine too On 5/18/2005 6:05:46 PM, Jochem Maas ([EMAIL PROTECTED]) wrote: John Nichel wrote: Jason Barnett wrote: John Nichel wrote: Jason Motes wrote: HAH This list could really use an active moderator. Did Mr. Nichel just volunteer for that task... Hell, I'll do it...if there are no objections from the established list members (like that will happen ;) John has my vote for what it's worth :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 266.11.12 - Release Date: 5/17/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
Hell, I'll do it...if there are no objections from the established list members (like that will happen ;) John has my vote for what it's worth :) Ah why not? The man has a vision. /me seconds Jochams vote for John. -- 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] novice: char to varchar
Hi all, I try to do the following: CREATE TABLE IF NOT EXISTS Invoice( PKey INTEGER, Received DATETIME, Cost DECIMAL(10,2), FileName VARCHAR(50), RefNum CHAR(10), PRIMARY KEY (PKey) ) TYPE=MyISAM COMMENT='Invoice Data'; but it keep generating RefNum VARCHAR(10) instead of CHAR(10) I don't understand, please help (or point me to RTFM page) Tony Yau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
Jay Blanchard wrote: [snip] John has my vote for what it's worth :-) [/snip] So, you're voting John in as dip shit? I second that. :) Thanks professor. ;) You knew it wasn't going to be too long before I weighed in on this. Agree with not releasing every post (posts are taking a long time to show up NOW), but handling all that little admin work? Sure, someone really needs to do that. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
Please keep questions regarding PHP problems on the list instead of in my inbox. Thanks. Brian V Bonini wrote: On Wed, 2005-05-18 at 12:58, Jason Barnett wrote: Brian V Bonini wrote: On Mon, 2005-05-16 at 22:10, Richard Lynch wrote: Let him fight with phpIniDir some other day. Something interesting maybe: http://gfx.gfx-design.com/session_test.php Hit your browsers refresh button. I would think SID is NOT supposed to change with every page refresh..?? Except that the SID is NOT in any POST / GET parameter. So since PHP doesn't recieve a SID on any refresh, it assumes that it is starting a new session each time. This is expected behavior. Thanks for clarifying... Does not really have any bearing on my original problem, but... At least I know THAT is nothing to look at further... -B But it *does* have bearing on your original problem! If you *don't* use *cookies* then the only way to continue a session is by passing the SID through *POST* or *GET* parameters! That has been the whole point of the discussion about trans_sid! Simple as that! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pfpro PHP
I am getting this error when I try to run configure pfpro with PHP, any idea? mkdir: too few arguments Try `mkdir --help' for more information. configure: creating ./config.status config.status: creating config.h config.status: config.h is unchanged Sincerely, Rezk Mekhael Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Jakarta Tomcat and PHP
I don't know if you checked out www.php.net/java but it seems to be what you're looking for. On 5/18/05, Evert | Rooftop [EMAIL PROTECTED] wrote: My guess would be looking for how to use PHP as a CGI in tomcat. So check out the manual for CGI stuff. grt, Evert Chris Holden wrote: Hi, I hope this is the right place to ask... I am running Tomcat 5.5.7 (jdk 1.5) on Windows XP quite happily. I have MySQL set up and that all works fine too. But I would also like to be able to run PHP under Tomcat rather than having to install Apache to handle PHP file and forward JSP requests to Tomcat... I'll only be doing some small test pages in PHP but I really dont want to have to install another server. I read on the Tomcat Wiki site that it *is* possible to connect PHP and Tomcat, and I tried but got nowhere, I dont even get errors when opening ..php files! I'd really appreciate it if someone could give me or point me in the direction of an idiots guide to getting PHP working with Tomcat. I've gone through every result from google to no avail :( Cheers, Chris. -- 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] gather reply from POST
I received this useful bit of code for storing a page into a variable instead of loading it as an include. But how can I modify this to submit some parameters to a page and collect the returned page / HTML into a variable?? Jeremy -- ?php /** DocumentB.php */ $text = file_get_contents('DocumentA.php'); echo $text; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending a string with $_POST/$_GET
You don't set $_GET variables, like $_GET['name'] = whaever and expect to do something along the lines of echo $_GET['name'] in another page. To assign a value as a GET variable on another page, then you make the url of the other page whatever.php?name=value Then in whatever.php you can do something like ?php echo $_GET['name']; ? On 5/17/05, Ross [EMAIL PROTECTED] wrote: I want to write a string to a variable and use $_POST or $_GET to retrieve it on another page. I keep gettting an undefined index errror. Can someone show me how this is done? Do I have to use session_start() ? Have checked the documentation, can't find a really basic example. R. -- 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] novice: char to varchar
[snip] I try to do the following: CREATE TABLE IF NOT EXISTS Invoice( PKey INTEGER, Received DATETIME, Cost DECIMAL(10,2), FileName VARCHAR(50), RefNum CHAR(10), PRIMARY KEY (PKey) ) TYPE=MyISAM COMMENT='Invoice Data'; but it keep generating RefNum VARCHAR(10) instead of CHAR(10) I don't understand, please help (or point me to RTFM page) [/snip] http://www.mysql.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] novice: char to varchar
tony yau wrote: Hi all, I try to do the following: CREATE TABLE IF NOT EXISTS Invoice( PKey INTEGER, Received DATETIME, Cost DECIMAL(10,2), FileName VARCHAR(50), RefNum CHAR(10), PRIMARY KEY (PKey) ) TYPE=MyISAM COMMENT='Invoice Data'; but it keep generating RefNum VARCHAR(10) instead of CHAR(10) I don't understand, please help (or point me to RTFM page) How about the MySQL website, and/or a MySQL mailing list? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: novice: char to varchar
found the answer sorry about this Tony Yau [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I try to do the following: CREATE TABLE IF NOT EXISTS Invoice( PKey INTEGER, Received DATETIME, Cost DECIMAL(10,2), FileName VARCHAR(50), RefNum CHAR(10), PRIMARY KEY (PKey) ) TYPE=MyISAM COMMENT='Invoice Data'; but it keep generating RefNum VARCHAR(10) instead of CHAR(10) I don't understand, please help (or point me to RTFM page) Tony Yau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] novice: char to varchar
On Wed, May 18, 2005 11:15 am, tony yau said: Hi all, I try to do the following: CREATE TABLE IF NOT EXISTS Invoice( PKey INTEGER, Received DATETIME, Cost DECIMAL(10,2), FileName VARCHAR(50), RefNum CHAR(10), PRIMARY KEY (PKey) ) TYPE=MyISAM COMMENT='Invoice Data'; but it keep generating RefNum VARCHAR(10) instead of CHAR(10) I don't understand, please help (or point me to RTFM page) WILD GUESS!!! In *some* impelementations of SQL, the performance benefit of CHAR over VARCHAR is lost after the first VARCHAR column. In other words, it's making it VARCHAR because there is NO benefit to it being CHAR because there is a column earlier (FileName) that is already VARCHAR. Try moving the RefNum to be *before* the FileName column. If that fixes it, you're all set. I don't know if MySQL is such an implementation. I don't know if MySQL's VARCHAR and CHAR have any difference at all in MyISAM. I don't know... There's a lot I don't know. The above was all just guess-work based on other SQL implementations. http://mysql.com should document what's happening and why. Search for VARCHAR and CHAR there, and you should find it. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Display a database image from MSSQL database
On Wed, May 18, 2005 10:28 am, Alaor Barroso said: Hi... I need to display some images that exists inside one MSSQL server in a BLOB datatype field, but my code don't work... My code: ... contains NO error checking. That's bad. ? $arg = $_GET[codPessoa]; mssql_connect(server, web, web); $sql = SELECT Foto FROM Foto WHERE CodPessoa=$arg; $result = mssql_query($sql); $data = mssql_result($result, 0, Foto); $data = stripslashes($data); Nooo! If you are calling stripslashes() on data coming out of your databsae, you have almost for sure really screwed up much earlier in the process, by having both Magic Quotes on and calling addslashes() (or mysql_real_escape_string) or something similar. You would only do stripslashes() here if you've hacked php.ini to use Magic Quotes on data coming *OUT* of the database, which is really quite rare to do -- You'd want that only on a site where, what?, you were shlepping a bunch of stuff out of one database and into another??? header(Content-type: image/gif); echo $data; exit; ? And I access this page sending in the URL the text: .../showimage.php?codPessoa=xxx. I receive a strange code like Fh54757eFg554257eFrgtth547d54e7t8h54j87j85fd54ss7f.. Accessing this page by IE nothing happens but when a I try to access in Mozilla Firefox I got an error saying that the image cointain errors and cannot be displayed... If i try to show inside an img TAG in other page like img src=patch/to/page / the code display a X error img, like if the image don't exist, but the code keep returning the strange code, so I believe that this is the image in a string format and something makes with the conversion for a real image format don't work very well. Your stripslashes() corrupted the image, assuming it was valid in the first place. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image Verification - Problems in Safari, Mac OS X
Ave, A simple Image Verification script is working perfect in IE on Windows... But isn¹t working in Safari on Mac OS X! It displays a blank page instead of the image with the form. Here¹ s the Script: ? header(Content-Type: image/png); session_start(); $new_string; session_register('new_string'); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; HTML HEAD META http-equiv=Content-Type content=text/html; charset=iso-8859-1 TITLEVerification : IMSAFM/TITLE /HEAD BODY ?php $im = ImageCreate(200, 40); $white = ImageColorAllocate($im, 255, 255, 255); $black = ImageColorAllocate($im, 0, 0, 0); srand((double)microtime()*100); $string = md5(rand(0,)); $new_string = substr($string, 17, 5); ImageFill($im, 0, 0, $black); ImageString($im, 4, 96, 19, $new_string, $white); ImagePNG($im, verify.png); ImageDestroy($im); ? img src=verify.png width=200 height=40brbr Type the code you see in the image in the box below. (case sensitive) form action=verified.php method=post input name=random type=text value= input type=submit /form /BODY /HTML Any tips to make it work in Safari as well? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] RSS news feed (slightly 0T)
On Wed, May 18, 2005 6:26 am, Ryan A said: Can anyone suggest a few places where i can get some decent tech/programming/php news feeds? The New York PHP User Group seems to have a pretty hip PHP news feed on their home page, last time I checked. Figure out where they get their news, if you can... I keep meaning to do that on the Chicago PHP User Group site, but it hasn't happened yet... :-( -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Responses in my email.
This is primarly a mailing list. Not a news group. The whole idea of a mailing list is that you get every message mailed to you. If you don't want this then unsubscribe. You could always filter out any email sent to php-general, or containing the term [PHP] in the subject. On 5/18/05, Robert Meyer [EMAIL PROTECTED] wrote: Hello, When I post a question here, I get an email for every response posted. I only want the response posted, not emailed to me. The other newsgroups I belong to don't send me an email. What are my options if any and how do I implement them? Regards, Robert -- 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] Reprocessing text
On Wed, May 18, 2005 6:25 am, Michael Satterwhite said: I have a site that extracts HTML page code from a database and prints it to the page being generated. A user has requested that I allow this text to be dynamic. I can code process functions for the code that I pull from the database, but it would be so much better if I could simply get PHP to process the text for me. Does anyone know a way to cause this to happen? Yes, but... If you mean you want to allow your users to write PHP code in their HTML, and have your script execute that PHP code, then you want: http://php.net/eval But This would be incredibly dangerous unless you REALLY REALLY REALLY trust ALL your users. They could do some really nasty things with PHP if you let them. Tell us more about the data and the user and what you really want -- We might have a safer answer for you... One simple one might be to allow them to give you a URL where you will get the text, and then you get their current text, instead of whatever is in your databsae. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: gather reply from POST
Jeremy Reynolds wrote: I received this useful bit of code for storing a page into a variable instead of loading it as an include. But how can I modify this to submit some parameters to a page and collect the returned page / HTML into a variable?? Jeremy -- ?php /** DocumentB.php */ $text = file_get_contents('DocumentA.php'); echo $text; ? You'll probably want to use cURL for this task, although Rasmus' posttohost might also give you something useful. http://php.net/manual/en/ref.curl.php http://www.php-faq.com/postToHost.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and PayPal
Hi Robert I am just in implementing PayPal as one of the Payment providers on an order. I realize the PayPal documention is a bit too exhausive and is easy to lose track of what is important. I will introduce two items to you: IPN (Instant Payment Notification) You should have a script that handles callbacks from PayPal. The PayPal system itself calls the script whenever something important happened. The security is that you get all the data PayPal sent, send it back to a POST and retrieve the reply VERIFIED or FAILED. This script should create the keys and send emails to the customer with these keys. PDT (Payment Data Transfer) PDT is used by PayPal when the payment is completed and the PayPal system forwards the user back to your page. Use the PDT to look up in your database if you already received an IPN from PayPal regarding this order. PayPal alows you to check your system by the use of a Sandbox. They also have a forum where you can ask specific questions. With kind regards Andy Pieters Straight-A-Software -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] directory listing from text file
What I know about Windows mapped drives could fit in a matchbook with room for every Playmate's phone number... But the answer I always hear when people are trying to do what you are trying to do is Samba HTH On Wed, May 18, 2005 7:37 am, dreiph said: Thank you Chris, but this is not I needed. Let me explain my situation. I have a big server with a lot of audio files, working within LAN, with Windows 2000 Pro on it. Let's call it as FileServer. Also I have another server with Apache2 and PHP installed, windows 2000 PRO too, let's say it is WebServer. Web Server is standalone with two NIC cards, firewall, etc. I don't want to make Fileserver be accessible form Internet. The problem is that PHP and/or Apache on WebServer does not understand mapped drives from a FileServer, so readdir() or opendir() is not working correctly, by the way, it looks like Windows dir command works a little bit faster than readdir(); It take me some time to play with simple Windows command line utility, to get directory listing on FileServer and deliver plain text file to a WebServer. Command line was the following: exec('cmd /c dir /b /s /d /a:d \\\FileServer\\audiofiles audiofiles.txt'); $hi = fopen(audiofiles.txt, r); $line = fread($hi,filesize(audiofiles.txt)); fclose($hi); $line=explode(\n, $line); At this point I've got FileServer directories [only directories, not files!] scanned into file audiofiles.txt and this file was written to a WebServer. So, I have plain text file with correct directory structure, including subdirectories. The problem is, that dir command in Windows command prompt scans directories in weird format - each directory in new line, eg: \first \second \second\first \second\second \third I immagine, to show directory tree, I need to make some like array in PHP, and I think, this should be a recursive function [could not find out how to write it]. So final variable should be array like this: $directories = Array('\\first', '\\second = Array('\\first', '\\second'), '\\third'); How?? Thanks, Bye, Dreiph Chris Ramsay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dreiph, If you're familiar with PEAR, take a look at this: http://pear.php.net/package/HTML_TreeMenu regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tomcat and PHP
To the guy trying to use PHP with Tomcat... I thought of this after deleting all those posts, naturally. :-( In the distant past, when people said You can use PHP with XYZ web server I was able to successfully use PHP with those other web-servers by finding good documentation for installing Perl/cgi with them, and then just switching out things like C:\perl\perl.exe for C:\php\php.exe I can't promise this will work with Tomcat, but it's worth a shot. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Blank page in browser
On Tue, May 17, 2005 10:59 pm, Nayeem said: I found same error in error_log file which I face on command prompt before then I install PHP 5.0 with --with-oci8=$ORACLE_HOME compilation so that problem solved. Now I'm facing same problem on Apache. So can you tell me where should I define the environment variables on Apache. If http://php.net/SetEnv doesn't do it, I don't know where to start... http://php.net/oci8 I guess. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gather reply from POST
On Wed, May 18, 2005 11:55 am, Jeremy Reynolds said: I received this useful bit of code for storing a page into a variable instead of loading it as an include. But how can I modify this to submit some parameters to a page and collect the returned page / HTML into a variable?? Jeremy -- ?php /** DocumentB.php */ $text = file_get_contents('DocumentA.php'); echo $text; ? Try: ?php $foo = 1; $bar = 2; $text = file_get_contents(DocumentA.php?foo=$foobar=$bar); echo $text; ? If that doesn't work, go to http://php.net/curl -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On Tue, May 17, 2005 11:12 pm, Bill Hoffman said: On May 17, 2005, at 10:24 PM, Richard Lynch wrote: I don't know much about that fancy new stream stuff, or the XML crap, but you've got zero (0) lines of code in there to do anything useful when the functions fail. no functions fail. If none of them failed, your script would work :-) what I'm expecting is that with libxml_set_streams_context(), I've I'm betting most of these functions do *NOT* print an error message for you when they fail. *YOU* have check their return value to see if it's 'false' or -1 or 0 and, if so, *YOU* have to call another function to get the error message and error code. This is what I am suggesting is missing big-time in your code. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On May 18, 2005, at 1:20 PM, Richard Lynch wrote: *YOU* have check their return value to see if it's 'false' or -1 or 0 and, if so, *YOU* have to call another function to get the error message and error code. This is what I am suggesting is missing big-time in your code. Yes, you made your point in your first reply -- I'm clueless and don't know the first thing about basic defensive coding. Thanks for going out of your way -- twice -- to be so helpful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] novice: char to varchar
On Wed, May 18, 2005 11:15 am, tony yau said: Hi all, I try to do the following: CREATE TABLE IF NOT EXISTS Invoice( PKey INTEGER, Received DATETIME, Cost DECIMAL(10,2), FileName VARCHAR(50), RefNum CHAR(10), PRIMARY KEY (PKey) ) TYPE=MyISAM COMMENT='Invoice Data'; but it keep generating RefNum VARCHAR(10) instead of CHAR(10) I don't understand, please help (or point me to RTFM page) WILD GUESS!!! In *some* impelementations of SQL, the performance benefit of CHAR over VARCHAR is lost after the first VARCHAR column. That's exactly it... http://dev.mysql.com/doc/mysql/en/silent-column-changes.html If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than three characters are changed to VARCHAR columns. This doesn't affect how you use the columns in any way; in MySQL, VARCHAR is just a different way to store characters. MySQL performs this conversion because it saves space and makes table operations faster. See Chapter 14, MySQL Storage Engines and Table Types. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Responses in my email.
Rory Browne wrote: This is primarly a mailing list. Not a news group. The whole idea of a mailing list is that you get every message mailed to you. I use this solely as a news group. The news group seems to lag the email responses a little, but not too badly. For those that are interested I use Mozilla Thunderbird to connect to the news.php.net news server and overall I'm pretty happy about it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php