[PHP] include_path problem in executing program from root folder
Hello, One of my PHP programs called dailybatch.php3 includes a file in its parent directory. The link is include ../db_mysql.inc dailybatch.php3 is invoked from the crontab command or run from the command line in the root /www folder, gives an error indicating that ../db_mysql.inc not found. However, when you change to the folder where dailybatch.php3 is present and execute the program, there are no errors and the program executes. The include_path has . folder in it. What could possibly be the problem with executing the program from the /www folder? With Regards, Sharat _ The MSN mobile contest! Free talktime n smart phones! http://server1.msn.co.in/sp04/mobilecontest Register now to win! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hello, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I was originally thinking of having an invisible applet communicating to the server, but I am not sure how this is done. I am also considering XML and SOAP, but I am not sure about the following: 1. Where does the SOAP client reside - on the browser/html or on the server? 2. How do I communicate from my HTML page to the SOAP client? Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Java Applet to PHP Communication
Hello, I need to be able to communicate from a Java Applet to a PHP program on the server to enable Live Connect for data. This is what I intend to do: In my web application, a Java Script program will call a Java Applet which then calls the PHP program on the server. The PHP program works like a servlet and passes the result back to the Java applet which passes the information back to the JavaScript program. How can a Java applet work with a PHP program? Are there any special precautions / programming issues involved? Thanks in advance With Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Java Applet to PHP Communication
Thanks Justin, Do you have any leads on where I can get info on accessing XML data using SOAP from a Java Applet. I know how to parse XML data. Regards, Sharat Hegde Phone: 6575800 Ext 4610 Direct: 6566615 -Original Message- From: justin gruenberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2003 1:27 PM To: Sharat Hegde Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Java Applet to PHP Communication Sharat Hegde wrote: Hello, I need to be able to communicate from a Java Applet to a PHP program on the server to enable Live Connect for data. This is what I intend to do: In my web application, a Java Script program will call a Java Applet which then calls the PHP program on the server. The PHP program works like a servlet and passes the result back to the Java applet which passes the information back to the JavaScript program. How can a Java applet work with a PHP program? Are there any special precautions / programming issues involved? Thanks in advance With Regards, Sharat Not anything that you wouldn't have to pay attention to in passing stuff between applications in other instances. I'd use XML/SOAP to pass around the data. There are many reasons to do this, I wont list them here just because there are plenty of articles on the web advocating the use of XML. The added bonus is the buzzword factor. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP in crontab job
Hello, I am having a problem at my ISP relating to execution of PHP commands from the crontab command. My ISP told me to have a look at the following URL, but despite following these instructions, the crontab job is not being executed. http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ The crontab command line works from the shell prompt and I am able to execute the php command from the command line as well as the lynx command - no problems with that. Any ideas on how to get the crontab to execute the PHP commands? Regards, Sharat _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in crontab job
Hello John, Thanks for the help. I was able to solve this. Thanks Marek for your help too in giving the same solution. The problem was with the crontab command not having the full path to php. Silly that a command line on the shell script should work but crontab is unable to find the same path. Thanks again, Sharat From: John S. Huggins [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] PHP in crontab job Date: Fri, 11 Oct 2002 15:35:41 + (UTC) On Fri, 11 Oct 2002, Sharat Hegde wrote: -Hello, - -I am having a problem at my ISP relating to execution of PHP commands from -the crontab command. My ISP told me to have a look at the following URL, but -despite following these instructions, the crontab job is not being executed. -http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ - -The crontab command line works from the shell prompt and I am able to -execute the php command from the command line as well as the lynx command - -no problems with that. - -Any ideas on how to get the crontab to execute the PHP commands? Ensure you have specified the php program in the first line, I am sure you did this but here is how I do it. #!/usr/local/bin/php -q Make sure it is a fully specified pathname to the php executable. Crontab all too often does not have knowledge of your path environment so may get lost if you just say php. Make sure you really do have a php executable. This is what will compile if you do not specify any configuration directives during the ./configure process. Tell us how you do. - -Regards, -Sharat - - -_ -Join the worlds largest e-mail service with MSN Hotmail. -http://www.hotmail.com - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression Problem continues
Hello, I am still having problems with the regular expressions. Looks like there has been a change in the way they are handled between PHP3 and PHP4, since the code worked with PHP3 !! I need to search for all words having alphanumberic characters as well as _ (underscore) which are prefixed and suffixed with __ (2 underscores). The regular expression I am using is eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches) I am expecting the above code to return __WO_RD__ as the match, but it does not seem to work. Can someone help out. With Regards, Sharat _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression Problem continues
Rasmus, The code worked fine in PHP Version 3.x It does not work with PHP Version 4.1.1. That is where I have a problem. With Regards, Sharat From: Rasmus Lerdorf [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST) This code works fine: eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches); echo $Matches[1]; produces: WO_RD -Rasmus On Thu, 28 Mar 2002, Sharat Hegde wrote: Hello, I am still having problems with the regular expressions. Looks like there has been a change in the way they are handled between PHP3 and PHP4, since the code worked with PHP3 !! I need to search for all words having alphanumberic characters as well as _ (underscore) which are prefixed and suffixed with __ (2 underscores). The regular expression I am using is eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches) I am expecting the above code to return __WO_RD__ as the match, but it does not seem to work. Can someone help out. With Regards, Sharat _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- 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 _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression Problem continues
Yesthere may be something else going wrong. The source code of the test file I have is: ?php if (eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches)) print Match Found with . $Matches[1] . br; else print Match Not Foundbr; ? The source is on my server in a test directory at http://www.byronholidays.com/inikatest/testereg.php3 or http://www.byronholidays.com/inikatest/testereg.php To check the PHP version on the server, you can run http://www.byronholidays.com/inikatest/checkenv.php3 Regards, Sharat From: Miguel Cruz [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 12:51:44 -0600 (CST) Works for me in 4.1.1 (and 4.1.2) too. Are you sure there's not something else going on? Can you provide an unadulterated code sample pasted directly from your problem script? miguel On Thu, 28 Mar 2002, Sharat Hegde wrote: The code worked fine in PHP Version 3.x It does not work with PHP Version 4.1.1. That is where I have a problem. With Regards, Sharat From: Rasmus Lerdorf [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST) This code works fine: eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches); echo $Matches[1]; produces: WO_RD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting just the filename
Hello, Is there a simple way of getting just the filename from strings which give the filename along with the path. For example, I need test.txt from c:\myfiles\test.txt It should also work with the / character, in other words, give test.txt from /htdocs/myfiles/test.txt With Regards, Sharat _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression Problem continues
The files are hosted on a 3rd party hosted ISP. On my local machine it works fine. While I try and request for a recompile of the system, is there an alternate way out? By the way, what is the significance of the switch --with-regex=system Rasmus and Miguel, Thanks for your help. With Regards, Sharat From: Rasmus Lerdorf [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 11:40:41 -0800 (PST) In your configure flags you have: --with-regex=system Why did you do this? Recompile without that switch and see if things change. -Rasmus On Thu, 28 Mar 2002, Sharat Hegde wrote: Yesthere may be something else going wrong. The source code of the test file I have is: ?php if (eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches)) print Match Found with . $Matches[1] . br; else print Match Not Foundbr; ? The source is on my server in a test directory at http://www.byronholidays.com/inikatest/testereg.php3 or http://www.byronholidays.com/inikatest/testereg.php To check the PHP version on the server, you can run http://www.byronholidays.com/inikatest/checkenv.php3 Regards, Sharat From: Miguel Cruz [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 12:51:44 -0600 (CST) Works for me in 4.1.1 (and 4.1.2) too. Are you sure there's not something else going on? Can you provide an unadulterated code sample pasted directly from your problem script? miguel On Thu, 28 Mar 2002, Sharat Hegde wrote: The code worked fine in PHP Version 3.x It does not work with PHP Version 4.1.1. That is where I have a problem. With Regards, Sharat From: Rasmus Lerdorf [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST) This code works fine: eregi(__([a-z0-9_]+)__, Hello __WO_RD__ Test, $Matches); echo $Matches[1]; produces: WO_RD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression Problem
Hello, In PHP3, I am using code which using the regular expression capability of PHP. The code matches all occurences of string prefixed by __ (2 underscores) and having alphanumeric characters as well as _ (1 underscore) within it. The code is as follows: while (eregi(__([a-z0-9_]+)__, $ExpandedString, $Matches)) { } In PHP 4, the regular expression __([a-z0-9_]+)__ does not seem to work. I tried __([[:alnum:]_]+)__ also but that too did not work. Looks like the problem is with combining two ranges and a literal within the regular expression Any solution would be appreciated? With Regards, Sharat _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Upload Form
Hello, I found the solution to my problem here it is. Adding the following line in the HTML seems to make the PHP code work well with the Upload Form. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN Don't know why but, I guess this makes the document HTML compliant. Regards, Sharat -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 3:13 PM To: [EMAIL PROTECTED] Subject: [PHP] File Upload Form Hello, The PHP manual provides a method for File Upload. The sample code is as follows: FORM ENCTYPE=multipart/form-data ACTION=_URL_ METHOD=POST INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000 Send this file: INPUT NAME=userfile TYPE=file INPUT TYPE=submit VALUE=Send File /FORM While this works when this is part of an HTML page, it strangely does not work when it is part of a PHP3 file. I found this to be problem with my PHP page after some struggle. Any reasons why this does not work in a PHP3 file? Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] File Upload Form
Hello, The PHP manual provides a method for File Upload. The sample code is as follows: FORM ENCTYPE=multipart/form-data ACTION=_URL_ METHOD=POST INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000 Send this file: INPUT NAME=userfile TYPE=file INPUT TYPE=submit VALUE=Send File /FORM While this works when this is part of an HTML page, it strangely does not work when it is part of a PHP3 file. I found this to be problem with my PHP page after some struggle. Any reasons why this does not work in a PHP3 file? Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Save to Desktop
Hi Matt, Thanks. That was very useful and it worked like a gem! Three cheers to HTTP headers. Where do you get a simplified version of the HTTP Header documentation - The W3C specs do not look like interesting reading. Regards, Sharat Hegde Phone: 6560360 Ext 4680 -Original Message- From: Matt McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 2:25 PM To: Sharat Hegde Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Save to Desktop On Mon, Nov 12, 2001 at 11:14:04AM +0530, Sharat Hegde wrote: Hello, I need to capture the contents of a Form into a text file format and automatically allow the user to Save the file to his desktop. Here is what I am intending to do: * Capture the form contents and save to a temporary file. This works fine. * Provide some method of the user automatically downloading this. How do I get this download to happen? I want the screen which says Open File or Save to come up and then the user can basically save to his desktop. It's not even necessary to save the form data to a file on the server if you're just going to remove it after the user downloads the text file. The key to this is knowing the proper HTTP headers to send, to inform the browser that it should download a file. Then simply print the desired form data to stdout, and it'll be fed into the file that the user saves. For example: ? if ($action == 'Get Text File') { // Tell the browser to display a 'save file' dialog Header('Content-Type: application/octet-stream'); Header('Content-Disposition: attachment; filename=formdata.txt'); // Print the text to be sent as formdata.txt echo First text field: $firstfield\n; echo Second text field: $secondfield\n; exit; } ? form method=post action=?= $PHP_SELF ? First: input type=text name=firstfieldbr Seond: input type=text name=secondfieldbr input type=submit name=action value=Get Text File /form Here, the form takes in two text strings, and offers them to the browser as a file. Matt * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Save to Desktop
Hello, I need to capture the contents of a Form into a text file format and automatically allow the user to Save the file to his desktop. Here is what I am intending to do: * Capture the form contents and save to a temporary file. This works fine. * Provide some method of the user automatically downloading this. How do I get this download to happen? I want the screen which says Open File or Save to come up and then the user can basically save to his desktop. Can anyone help and suggest how do get the Form contents saved to the Desktop? Thanks for your help. With Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Parsing a CSV file
Hello, I am trying to parse a CSV (comma separated file) file to get the separate elements. The format of each line of the file is as follows: R001,23,2,5 Note that the 3rd field 2,5 is enclosed within quotes as it has commas within the field itself. This is a standard file created when an Excel file is saved as a CSV file. What I need after parsing this is an array with the elements being: Element 0 - R001 Element 1 - 23 Element 2 - 2,5 Standard split command gives 4 elements instead of 3. I know I can do this by some brute programming, but is there an elegant way out. Note that I am not using PHP 4.0 and hence PHP4 specific features are not available to me as yet! Regards, Sharat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Interfacing with Excel
Hello, I have a web site on a Unix environment running PHP 3.0 and MySQL. I need to convert data in an Excel format to a MySQL database format periodically based on the input feed received in Excel format. the conversion to MySQL is not a problem at all. What I need help is to read data from an Excel 2000 format. How do I retrieve data from Excel 2000? The data is basically a 2 columnar data with currency names and conversion values. Thanks in advance. Regards, Sharat Hegde Phone: 6560360 Ext 4680 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem with Excel
Hello, I have a web site on a Unix environment running PHP 3.0 and MySQL. I need to convert data in an Excel format to a MySQL database format periodically based on the input feed received in Excel format. the conversion to MySQL is not a problem at all. What I need help is to read data from an Excel 2000 format. How do I retrieve data from Excel 2000? The data is basically a 2 columnar data with currency names and conversion values. Thanks in advance. Regards, Sharat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Validation Email in PHP programs
Hello, I am trying to validate the email address in my PHP program using the ereg function. I have different combinations of regular expressions to get the chunks of the email substring before and after the @ symbol and the dot (.) character. However, this does not seem to work. Can anyone suggest a method using ereg or otherwise to validate the email address in a PHP program? Regards, Sharat Hegde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]