[PHP] executing php scripts via cron
Hi there, I am trying to run a php script via cron. Problem is, that it does not work if I include the whole path in crontab Currently it looks like: 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php /dev/null Most likeley because the webserver root for the project is: /home/www/project/ So if I go into this dir and execute: php app_cron/follow_up_new_members.php it workes. But not with the full path. What do I have to enter into crontab? It obviosly does not work with the full path, but how to change into the directory via cron first? Thank you for any help, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Select box
Hi all For the likes of me I cant seem to figure out how to have a select drop down box , and have it so, that when I click the submit button, the page displays the correct content (which is what it does) but at the same time I need the select box to be at the option of the query. Below is part of my code. If someone could help, it would be most appreciated. select name=uname ?php $sqlu=SELECT id,user,name FROM users ORDER BY user ASC; $name_result = mysql_query($sqlu); while($rowu=mysql_fetch_array($name_result)){ echooption value=\$rowu[user]\$rowu[user]/option\n; } ? /select -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using returned references directly?
Jeff Schmidt wrote: Hello, Say I have object A, with method getObjectB(), which returns a reference to object2. Is there a way to do something like $A-getObjectB()-methodFromObjectB(); Don't know if this would work, but you could give it it a try : call_user_func(array(get_class($A-getObjectB()), 'methodFromObjectB')); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] executing php scripts via cron
I am trying to run a php script via cron. Problem is, that it does not work if I include the whole path in crontab Currently it looks like: 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php /dev/null Most likeley because the webserver root for the project is: /home/www/project/ So if I go into this dir and execute: php app_cron/follow_up_new_members.php it workes. But not with the full path. What do I have to enter into crontab? It obviosly does not work with the full path, but how to change into the directory via cron first? It is probably because the cron daemon cannot find the php binary in its path try it like this... 0 6 * * * /full/path/to/php/binary/php /home/www/project/app_cron/follow_up_new_members.php /dev/null hth rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verisign pfpro
Boulytchev, Vasiliy wrote: Ladies and Gents, I am trying to install Pay Flow Pro on my server, and am running into weird problems. I follow instructions from Verisign, and still cant get the thing to function. I get the error below: Fatal error: Call to undefined function: pfpro_init() Have you restarted Apache after compiling in the PayflowPro extensions as per the directions at http://www.php.net/pfpro ? This error means that the extensions have not compiled in properly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] executing php scripts via cron
Merlin, 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php /dev/ null That looks right to me, have you tried executing the command with the full path? I have a couple of php scripts running as cron jobs and web scripts... Also try php -q scriptname -q is for quiet which suppresses the html headers -- Thank You, Clifford W. Hansen Operations Support Developer Aspivia (Pty) Ltd. +27 (0) 11 259-1150 (Switchboard) +27 (0) 11 259-1019 (Fax) +27 (0) 83 761-0240 (Mobile) [EMAIL PROTECTED] (EMail) http://chansen.aspivia.com (Web) We have seen strange things today! Luke 5:26 This message contains information intended for the perusal, and/or use (if so stated), of the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon the information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone and return and/or destroy the original message. The views or representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie] Simple stats from mysql table data
Vans Hallden wrote: Please try to endure my ignorance. I'm new to PHP4 and out to perform just a single isolated task with it. :) I would like to form some simple statistics from specific column data in a mysql database and display those stats on a webpage. I have collected a few demographics from certain respondents. These are sex, age, and usage of our service (individual/company). The responses are store in a mysql 3 database. Basically, I would like to show: total headcounts and percentages for 'male' and 'female' respondents (database column 'sex') Here is one way: $allheads = mysql_num_rows(mysql_query(SELECT sex FROM table)); $allmales = mysql_num_rows(mysql_query(SELECT sex FROM table WHERE sex = 'male')); $allfemales = mysql_num_rows(mysql_query(SELECT sex FROM table WHERE sex = 'female')); $avg_male = ($allmales / $allheads) * 100; $avg_female = ($allfemales / $allheads) * 100; (probably not the best) average ages for male/female respondents (database column 'age') SELECT AVG(age) FROM tablename WHERE sex = 'male'; SELECT AVG(age) FROM tablename WHERE sex = 'female'; usage percentages for male/female respondents (database column 'usage') What is usage? I would very much appreciate if someone could point me to eg. code examples helping me to accomplish this task. Unless someone wants to just give away their utmost expertise and send me working code, which would leave me absolutely speechless from respect and gratefulness. =) Yeah, yeah yeah ... your welcome :P -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] using returned references directly?
On 17 May 2004 22:26, Jeff Schmidt wrote: Hello, Say I have object A, with method getObjectB(), which returns a reference to object2. Is there a way to do something like $A-getObjectB()-methodFromObjectB(); ?? When I try that, I get a parse error? Is this simply not possible with PHP, or is the syntax just a little different? I mean, I could: $b = $A-getObjectB(); $b-methodFromObjectB(); That's how you have to do it in PHP 4. In PHP 5, you will be able to use the collapsed version -- it's one of the OO improvements. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get class name in static function (PHP 4.2.3)
Torsten Roehr wrote: Hi, does anyone know a way of how to get the name of the class within a static function? I can't use __CLASS__ as my PHP version is 4.2.3 and I can't upgrade. My code (simplified): class Base { function Factory() { $classname = ???; return new $classname; } } class Event extends Base { } // This should make $event an object of class Event $event = Event::Factory(); Have you tried get_class($this) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select box
On 18 May 2004 09:06, Brent Clark wrote: Hi all For the likes of me I cant seem to figure out how to have a select drop down box , and have it so, that when I click the submit button, the page displays the correct content (which is what it does) but at the same time I need the select box to be at the option of the query. Below is part of my code. If someone could help, it would be most appreciated. select name=uname ?php $sqlu=SELECT id,user,name FROM users ORDER BY user ASC; $name_result = mysql_query($sqlu); while($rowu=mysql_fetch_array($name_result)){ echooption value=\$rowu[user]\$rowu[user]/option\n; } /select Assuming that this form submits to itself, so $_POST['uname'] will be set to the selected value: $selected = @$_POST['uname']; while($rowu=mysql_fetch_array($name_result)){ echo option value=\$rowu[user]\; if ($selected==$rowu['user']) echo ' selected'; echo $rowu[user]/option\n; } Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_post and array question
Thanks for help Daniel Clark. I know i must use isset function but that was not the issue. But thanks anyway:) Curt Zirzow thanks for your reply also. But that has nothing to do with reference. If you use reference or not.. it still would not result in an error (hee... I want an error :P) I guess somehow PHP does something to the function argument if it does not exist: Creating it and give it the NULL value. But this should at least give us a warning because it could result in unwanted code! But i dunno know this for sure. Could anybody help me on this? Amon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Best readers, //PHP version: 4.3.6 I have question concerning the following issue: I have a HTML input element of the type check. input type=checkbox name=test_arr[] let assum this checkbox is unchecked. The checkbox is part of a form. Now we gonna submit this form (post) and gonna catch the POST variable test_arr like this: $arr_test = $_POST[test_arr]; This will result in a novice error Undefined index: Of course because test_arr does not exist. It's unchecked. Now we gonna do the following: We immediately put the $_POST[test_arr] into a function and then we assign $_POST[test_arr] to $arr_test like this: functionX($_POST[test_arr]) $arr_test = $_POST[test_arr]; Knowing that $_POST[test_arr]) does not exist.. this code will not result in a error. Is this a bug,error,etc? Should this not also produce a novice error? Thanks for reading, Amon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get class name in static function (PHP 4.2.3)
[EMAIL PROTECTED] wrote: Burhan Khalid [EMAIL PROTECTED] schrieb am 18.05.2004, 10:48:29: Torsten Roehr wrote: Hi, does anyone know a way of how to get the name of the class within a static function? I can't use __CLASS__ as my PHP version is 4.2.3 and I can't upgrade. My code (simplified): class Base { function Factory() { $classname = ???; return new $classname; } } class Event extends Base { } // This should make $event an object of class Event $event = Event::Factory(); Have you tried get_class($this) ? Hi Burhan, the problem is that in a static class/method there is no $this. Any other ideas? Yeah, I just realized that as I hit send. I have another idea though. Get all the classes with get_declared_classes(), then loop through the resulting array with is_callable() and see which class has the function that you are in? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail command with PHP 4.3.4-1.1 and Fedora Core 1
Hello all, I have updated an old system to Fedora 1 and php php-4.3.4-1.1. However the mail comand does not work anymore. The php.ini of the original system did not have anything special. Sendmail is not being run locally in this machine. What might be causing it? Thanks in advance, C.F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie] Simple stats from mysql table data
Here is one way: (probably not the best) I was able to get almost everything working with your help. Thanks!!! :) average ages for male/female respondents (database column 'age') SELECT AVG(age) FROM tablename WHERE sex = 'male'; SELECT AVG(age) FROM tablename WHERE sex = 'female'; I have one small problem remaining. With this code: $male_average_age = mysql_query(SELECT AVG(age) FROM my_database WHERE sex = 'M'); ..I get a strange Resource id#10 output. I can't figure out why. What am I missing? -- -- Hans Vallden [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_post and array question
Thanks for help Daniel Clark. I know i must use isset function but that was not the issue. But thanks anyway:) Curt Zirzow thanks for your reply also. But that has nothing to do with reference. If you use reference or not.. it still would not result in an error (hee... I want an error :P) Matt Matijevich thanks for your reply as well :) My function is already declared something like this: function testX($testArr) { $arr_test = $testArr; return $arr_test; } Even if you send a reference parameter ($testArr).. the outcome will not result in an error. I guess somehow PHP does something to the function argument if it does not exist: creating it and give it the NULL value. But this should at least give us a warning because it could result in unwanted code! But i dunno know this for sure. Could anybody help me on this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] between date
Hi all I have a table whereby I use the php date() and time() function. I retrieve the data etc, no problem. but I now need to perform a query of between dates. Is there a function or method to perform this. Kind Regards and thank you in advance Brent Clark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] between date
Hi Sorry, I should have copied and pasted the table structure before, sending the mail. (Sorry for the scewness) Kind Regards Brent Clark ++---+++++ | id | user | ref_id | stage | files_captured | time | ++---+++++ | 7 | admin | 13 | Capture Batch | 19 | 1084876173 | | 6 | admin | 12 | Read Batch | 19 | 1084874313 | | 5 | admin | 10 | Read Batch | 19 | 1084873823 | | 8 | admin | 14 | Archive| 0 | 1084877521 | | 9 | admin | 15 | Archive| 1 | 1084877659 | | 10 | admin | 16 | Archive|702 | 1084877710 | ++---+++++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] between date
[snip] I have a table whereby I use the php date() and time() function. I retrieve the data etc, no problem. but I now need to perform a query of between dates. Is there a function or method to perform this. [/snip] Use SQL 'BETWEEN' i.e. SELECT items FROM table WHERE date BETWEEN this date AND that date It is inclusive -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Caching and IMS Headers
Hi, I was reading this post here: http://www.cre8asiteforums.com/viewtopic.php?t=9801 No, not my site ;-) I think it sounds like there are some mistaken views in there, anyone that knows about If-Modified-Since headers, PHP and Caching could shed a little conclusive light on the subject? Many thx! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and Caching and IMS Headers
On 18 May 2004 13:58, Nick Wilson wrote: Hi, I was reading this post here: http://www.cre8asiteforums.com/viewtopic.php?t=9801 No, not my site ;-) I think it sounds like there are some mistaken views in there, anyone that knows about If-Modified-Since headers, PHP and Caching could shed a little conclusive light on the subject? From my own experience, I can confirm that ILoveJackDaniels is definitive in that thread. What he describes is exactly how I do it. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-WIN] i need help
If the format is consistantly the same, try this: $somedata = [i:aslkdfj]; $insidedata = substr($somedata,3,strlen($somedata)-4); -TG -Original Message- From: Student [mailto:[EMAIL PROTECTED] Sent: Monday, May 17, 2004 11:42 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-WIN] i need help Hi i was hoping if someone can help; I want to trim the following text [i:abcdef] but the inside text is different at time eg abcdef, bcdefg, etc etc how can i trim [i:(some text here)] so that i can replace them with nothing. eg these are to be trimmed. [i:abcdef] [i:bcdefg] [i:xyzab] [i:priftds] how can i trim them.. thanks -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie] Simple stats from mysql table data
Vans Hallden wrote: Here is one way: (probably not the best) I was able to get almost everything working with your help. Thanks!!! :) average ages for male/female respondents (database column 'age') SELECT AVG(age) FROM tablename WHERE sex = 'male'; SELECT AVG(age) FROM tablename WHERE sex = 'female'; I have one small problem remaining. With this code: $male_average_age = mysql_query(SELECT AVG(age) FROM my_database WHERE sex = 'M'); ..I get a strange Resource id#10 output. I can't figure out why. What am I missing? You need to fetch the results. http://www.php.net/mysql_fetch_assoc for example. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can anyone identify this CM system?
[For those of us who like detective novels:] My organization has asked me to consult on a web site which was written by one of our field offices. Unfortunately, there's no one around anymore who was part of the original program. The kicker is that it's all in Russian. It's at http://www.fzr.ru. It's titled Health Russia 2020 and concerns HIV/AIDS in Russia. Can identify the content management system in use? It seems php based, and I wondered if anyone can identify it from the query strings it uses. I'm hoping that it's a common CM system, with documentation in English, but it could have been custom written. I'm told that they had nine programmers working on it for a significant period of time. Thanks for looking at it, and your thoughts. -Kevin Zembower -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] i need help
Assuming you are doing just one string at a time: ? $str = [i:abcdef]; #[i:bcdefg] #[i:xyzab] #[i:priftds] $regex = /(\[i:)(\w+)(\])/i; preg_match($regex, $str, $matches); print $str;//original string print substr($matches[2], 1, 3);//trimmed string ? Gryffyn, Trevor wrote: If the format is consistantly the same, try this: $somedata = [i:aslkdfj]; $insidedata = substr($somedata,3,strlen($somedata)-4); -TG -Original Message- From: Student [mailto:[EMAIL PROTECTED] Sent: Monday, May 17, 2004 11:42 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-WIN] i need help Hi i was hoping if someone can help; I want to trim the following text [i:abcdef] but the inside text is different at time eg abcdef, bcdefg, etc etc how can i trim [i:(some text here)] so that i can replace them with nothing. eg these are to be trimmed. [i:abcdef] [i:bcdefg] [i:xyzab] [i:priftds] how can i trim them.. thanks -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: $_post and array question
* Thus wrote Amon ([EMAIL PROTECTED]): Curt Zirzow thanks for your reply also. But that has nothing to do with reference. If you use reference or not.. it still would not result in an error (hee... I want an error :P) function foo($v) {} foo($asdf['qwer']); PHP Notice: Undefined variable: asdf in - on line 3 function foo2($v) {} foo2($asdf2['qwer2']); /* No notice */ I dont see how you say it doesn't have to do with references. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] executing PHP via cron
How about just using cron to call wget, and wget the URL of your page? Shawn ** This e-mail and any files transmitted with it may contain confidential information and is intended solely for use by the individual to whom it is addressed. If you received this e-mail in error, please notify the sender, do not disclose its contents to others and delete it from your system. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] executing PHP via cron
[EMAIL PROTECTED] wrote: How about just using cron to call wget, and wget the URL of your page? It depends. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can anyone identify this CM system?
[snip] My organization has asked me to consult on a web site which was written by one of our field offices. Unfortunately, there's no one around anymore who was part of the original program. The kicker is that it's all in Russian. It's at http://www.fzr.ru. It's titled Health Russia 2020 and concerns HIV/AIDS in Russia. Can identify the content management system in use? It seems php based, and I wondered if anyone can identify it from the query strings it uses. I'm hoping that it's a common CM system, with documentation in English, but it could have been custom written. I'm told that they had nine programmers working on it for a significant period of time. [/snip] Well, if we could actually see the query strings we might be able to go somewhere with this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can anyone identify this CM system?
By clicking pretty much at random (since I don't speak Russian), I see strings like these: http://www.fzr.ru/index.php?ae=4ah=3 http://www.fzr.ru/index.php?ae=6ah=3 http://www.fzr.ru/index.php?ae=1554 http://www.fzr.ru/ll.php?i=23f=1ae=49l=http%3A%2F%2Fwww.fzr.ru%2Findex.php%3Fae%3D6%26ah%3D3 I was referring to the 'ae=' and 'ah=' strings, wondering if they were characteristic of a particular CM system. Thanks for your thoughts and clarifications. -Kevin Jay Blanchard [EMAIL PROTECTED] 05/18/04 10:31AM [snip] My organization has asked me to consult on a web site which was written by one of our field offices. Unfortunately, there's no one around anymore who was part of the original program. The kicker is that it's all in Russian. It's at http://www.fzr.ru. It's titled Health Russia 2020 and concerns HIV/AIDS in Russia. Can identify the content management system in use? It seems php based, and I wondered if anyone can identify it from the query strings it uses. I'm hoping that it's a common CM system, with documentation in English, but it could have been custom written. I'm told that they had nine programmers working on it for a significant period of time. [/snip] Well, if we could actually see the query strings we might be able to go somewhere with this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML problem
Hi, I know that this is not an xml list but maybe you could help me. I'm looking for a good tutorial in xml or a list with most of the xml tags. I've googled for it but i can't find anything. Could someone send me a link to that kind of tutorial? Thanks for your reply !!! Stefan
RE: [PHP] Can anyone identify this CM system?
[snip] By clicking pretty much at random (since I don't speak Russian), I see strings like these: http://www.fzr.ru/index.php?ae=4ah=3 http://www.fzr.ru/index.php?ae=6ah=3 http://www.fzr.ru/index.php?ae=1554 http://www.fzr.ru/ll.php?i=23f=1ae=49l=http%3A%2F%2Fwww.fzr.ru%2Finde x.php%3Fae%3D6%26ah%3D3 [/snip] That looks pretty vague, especially if the query strings were manipulated so that Russian's could understand them. You have no access to the code? How about the CMS interface? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can anyone identify this CM system?
have you already had a look through this: http://www.opensourcecms.com/ ? it lists many open source cms wtih screenshots etc... J -Original Message- From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED] Sent: 18 May 2004 14:40 To: [EMAIL PROTECTED] Subject: [PHP] Can anyone identify this CM system? [For those of us who like detective novels:] My organization has asked me to consult on a web site which was written by one of our field offices. Unfortunately, there's no one around anymore who was part of the original program. The kicker is that it's all in Russian. It's at http://www.fzr.ru. It's titled Health Russia 2020 and concerns HIV/AIDS in Russia. Can identify the content management system in use? It seems php based, and I wondered if anyone can identify it from the query strings it uses. I'm hoping that it's a common CM system, with documentation in English, but it could have been custom written. I'm told that they had nine programmers working on it for a significant period of time. Thanks for looking at it, and your thoughts. -Kevin Zembower -- 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] XML problem
Try the one at http://www.w3schools.com/ Phpu wrote: Hi, I know that this is not an xml list but maybe you could help me. I'm looking for a good tutorial in xml or a list with most of the xml tags. I've googled for it but i can't find anything. Could someone send me a link to that kind of tutorial? -- Miguel J. Jiménez ISOTROL, S.A. (Área de Internet) Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA) mjjimenez AT isotrol DOT com --- http://www.isotrol.com TLFNO. 955036800 ext. 111 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can anyone identify this CM system?
Yeah, I thought it was a long-shot. I'm actually meeting with the coordinator in 10 minutes, and one of the things I'm asking for is shell access to the host. I have no idea what Linux or Unix (God help me if it's NT) on a Russian host looks like. Thanks for your thoughts, Jay. -Kevin Jay Blanchard [EMAIL PROTECTED] 05/18/04 10:48AM [snip] By clicking pretty much at random (since I don't speak Russian), I see strings like these: http://www.fzr.ru/index.php?ae=4ah=3 http://www.fzr.ru/index.php?ae=6ah=3 http://www.fzr.ru/index.php?ae=1554 http://www.fzr.ru/ll.php?i=23f=1ae=49l=http%3A%2F%2Fwww.fzr.ru%2Finde x.php%3Fae%3D6%26ah%3D3 [/snip] That looks pretty vague, especially if the query strings were manipulated so that Russian's could understand them. You have no access to the code? How about the CMS interface? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can anyone identify this CM system?
No, I didn't know about that site. Thank you, Jim. -Kevin James Tusini [EMAIL PROTECTED] 05/18/04 10:48AM have you already had a look through this: http://www.opensourcecms.com/ ? it lists many open source cms wtih screenshots etc... J -Original Message- From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED] Sent: 18 May 2004 14:40 To: [EMAIL PROTECTED] Subject: [PHP] Can anyone identify this CM system? [For those of us who like detective novels:] My organization has asked me to consult on a web site which was written by one of our field offices. Unfortunately, there's no one around anymore who was part of the original program. The kicker is that it's all in Russian. It's at http://www.fzr.ru. It's titled Health Russia 2020 and concerns HIV/AIDS in Russia. Can identify the content management system in use? It seems php based, and I wondered if anyone can identify it from the query strings it uses. I'm hoping that it's a common CM system, with documentation in English, but it could have been custom written. I'm told that they had nine programmers working on it for a significant period of time. Thanks for looking at it, and your thoughts. -Kevin Zembower -- 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] XML problem
Hi, I know that this is not an xml list but maybe you could help me. 'm looking for a good tutorial in xml or a list with most of the xml tags. I've googled for it but i can't find anything. Could someone send me a link to that kind of tutorial? http://www.zend.com/zend/tut/index.php Kind Regards Brent Clark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can anyone identify this CM system?
The server returned the following response headers: HTTP/1.1 200 OK Date: Tue, 18 May 2004 13:15:39 GMT Server: Apache/1.3.12 (Unix) (Black Cat/Linux) PHP/4.3.4 Cache-Control: max-age=604800 Expires: Tue, 25 May 2004 13:15:39 GMT Last-Modified: Thu, 13 Nov 2003 15:36:52 GMT ETag: c154c-1d09-3fb3a514 Accept-Ranges: bytes Content-Length: 7433 Connection: close Content-Type: text/html; charset=windows-1251 Age: 6403 Query complete. - zerof
[PHP] Domain Name Lookup Scripts
Can anyone suggest any good (free) domain name lookup scripts written in php? Thanks, Ryan
Re: [PHP] Domain Name Lookup Scripts
On Tue, 2004-05-18 at 11:09, Ryan Schefke wrote: Can anyone suggest any good (free) domain name lookup scripts written in php? This is short, far from perfect, but I use it to look for availability and you might be able to adapt it - it also checks for a verisign hit which is usually that stupid thing they did a while back where NXDOMAINs were overriden and returned as advertising spam: #!/usr/bin/php -qC ? if( !isset( $GLOBALS['argv'][1] ) ) { echo 'Please supply a domain name!'.\n; exit(); } $domain = trim( $GLOBALS['argv'][1] ); $extensions = array ( 'com', 'org', 'net', 'biz', 'ca ', ); foreach( $extensions as $ext ) { $cdomain = $domain.'.'.$ext; $output = `host $cdomain`; if( eregi( '64\.94\.110\.11', $output ) || eregi( 'NXDOMAIN', $output ) ) { echo $cdomain.' -- free'.\n; } else { echo $cdomain.' -- taken'.\n; } } Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML problem
I'm looking for a good tutorial in xml or a list with most of the xml tags. I've googled for it but i can't find anything. Could someone send me a link to that kind of tutorial? There are no xml tags as such; XML defines a grammar but not a vocabulary. The actual tags used depend on the specific application in question, e.g. XHTML defines one set of tags, SOAP another. You can define your own, if you want. A lot of parsers, like the xml_parse functions in PHP, can handle arbitrary XML input as long as it's well-formed, that is, follows the syntax rules properly. Most of the syntax is described here: http://www.w3schools.com/xml/xml_syntax.asp - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression
Why isn't my regex working? From everything that I've read, it should be... script language=php $string = [joebob]; if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) { print_r( $aMatches ); } else { echo 'No match was found' . \n\n; } /script Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regular Expression
Chris Boget mailto:[EMAIL PROTECTED] on Tuesday, May 18, 2004 9:55 AM said: Why isn't my regex working? From everything that I've read, it should be... $string = [joebob]; if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) { \s Matches any whitespace character; this is equivalent to the class [ \t\n\r\f\v]. [1] hth, chris. [1] http://www.amk.ca/python/howto/regex/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression
Chris Boget wrote: Why isn't my regex working? From everything that I've read, it should be... script language=php $string = [joebob]; if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) { print_r( $aMatches ); } else { echo 'No match was found' . \n\n; } /script Chris your regex is matching one or more whitespace characters between [ and ]. i think you wanted \S and not \s. see: http://www.php.net/manual/en/pcre.pattern.syntax.php Ryan Briones -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie] Simple stats from mysql table data
Vans Hallden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here is one way: (probably not the best) I was able to get almost everything working with your help. Thanks!!! :) average ages for male/female respondents (database column 'age') SELECT AVG(age) FROM tablename WHERE sex = 'male'; SELECT AVG(age) FROM tablename WHERE sex = 'female'; I have one small problem remaining. With this code: $male_average_age = mysql_query(SELECT AVG(age) FROM my_database WHERE sex = 'M'); ..I get a strange Resource id#10 output. I can't figure out why. What am I missing? mysql_query() is returning a result resource handle. You have to use mysql_fetch_row or a similar function to access the result set: $result = mysql_query(SELECT AVG(age) as avgAge FROM my_database WHERE sex = 'M'); // get the first row of the result as an associative array $row = mysql_fetch_assoc($result); $male_average_age = $row['avgAge']; Take a look here: http://de2.php.net/manual/en/function.mysql-fetch-assoc.php Regards, Torsten -- -- Hans Vallden [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] between date
Jay Blanchard [EMAIL PROTECTED] wrote in message ews:[EMAIL PROTECTED] [snip] I have a table whereby I use the php date() and time() function. I retrieve the data etc, no problem. but I now need to perform a query of between dates. Is there a function or method to perform this. [/snip] Use SQL 'BETWEEN' i.e. SELECT items FROM table WHERE date BETWEEN this date AND that date It is inclusive I think working with = and = works as well and may be more portable: SELECT items FROM table WHERE date = start AND date = end Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Verisign pfpro
I think its working now, I get this error, does this have to do with verisign? Could not process transaction! User authentication failed (1) Is it the test account that is not assigned properly? THANKS!!! Vasiliy Boulytchev Colorado Information Technologies, Inc. http://www.coinfotech.com -Original Message- From: Burhan Khalid [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 18, 2004 2:26 AM To: Boulytchev, Vasiliy; [EMAIL PROTECTED] Subject: Re: [PHP] Verisign pfpro Boulytchev, Vasiliy wrote: Ladies and Gents, I am trying to install Pay Flow Pro on my server, and am running into weird problems. I follow instructions from Verisign, and still cant get the thing to function. I get the error below: Fatal error: Call to undefined function: pfpro_init() Have you restarted Apache after compiling in the PayflowPro extensions as per the directions at http://www.php.net/pfpro ? This error means that the extensions have not compiled in properly. smime.p7s Description: S/MIME cryptographic signature
[PHP] Problem - Turckmmcache, Apache2 and SuSE 9.1
Hi, I have compiled and installed (precisely following instruction) turck-mmcache 2.4.6 for Apache2-2.0.49-23/php4-4.3.4-43.3 on SuSE 9.1. Unfortunately, I cannot start Apapche2 anymore, I am getting this error message: /usr/sbin/httpd2-prefork: error while loading shared libraries: /usr/lib/php/extensions/mmcache.so: undefined symbol: php_session_register_module [Tue May 18 22:11:01 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2) [Tue May 18 22:11:01 2004] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] [Tue May 18 22:11:01 2004] [notice] Digest: generating secret for digest authentication ... [Tue May 18 22:11:01 2004] [notice] Digest: done /usr/sbin/httpd2-prefork: error while loading shared libraries: /usr/lib/php/extensions/mmcache.so: undefined symbol: php_session_register_module Anyone have an idea how to fix this? Thanks in advance Andrei - Here is what I have added to php.ini at the bottom: extension=mmcache.so mmcache.shm_size=16 mmcache.cache_dir=/tmp/mmcache mmcache.enable=1 mmcache.optimizer=1 mmcache.check_mtime=1 mmcache.debug=0 mmcache.filter= mmcache.shm_max=0 mmcache.shm_ttl=0 mmcache.shm_prune_period=0 mmcache.shm_only=0 mmcache.compress=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDFLib pdf_get_pdi_value
I am trying to do some PDF templating work with PHP/PDFLib. I have a template file created and I am able to use all of the php functions for pdf's but I am having a slight problem: here is part of my code $pdi_file = $_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).'/block_test.pdf'; $pdf = PDF_new(); pdf_open_file($pdf); $src_doc = pdf_open_pdi($pdf,$pdi_file,'', 0); $src_page = pdf_open_pdi_page($pdf,$src_doc,1,''); $src_width = pdf_get_pdi_value($pdf,'width' ,$src_doc,$src_page,0); $src_height = pdf_get_pdi_value($pdf,'height',$src_doc,$src_page,0); everything works great until I get to here: $src_width = pdf_get_pdi_value($pdf,'width' ,$src_doc,$src_page,0); I get a fatal php error: Fatal error: PDFlib error [1118] PDF_get_pdi_value: Handle parameter 'page' has bad value 0 in /var/www/html/active/www.midstatedistributing.com/html/developers/test.php on line 11 From the user comments on php.net, it says the forth paremeter of pdf_get_pdi_value needs to be a valid PDF page handle. I cant seem to find a way to get a page handle into a variable. Has anyone had any experience with this? I am having troubles finding stuff on the web. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using Cygwin tar.exe on Windows
I have a little application I have built that will create a tar.gz archive of a group of files and directories. It works flawlessly on FreeBSD, OSX and Debian Linux. I want it to work for Windows, but I am having some trouble. I am simply using an exec call to the tar application: exec('/path/to/tar -czf /path/to/myarchive.tar.gz file1 file2 dir1'); I have Cygwin installed on my Windows box (WINNT), and it includes a tar binary located in: C:\cygwin\bin\. When I use this command: exec('C:\cygwin\bin\tar.exe -czf C:\path\to\myarchive.tar.gz C:\path\to\file1 C:\path\to\file2'); I get nothing - as in the exec returns NULL and no archive is created. I have confirmed this by providing the second parameter to exec() and dumping it - it's always NULL. I have two questions: 1. Why doesn't this work? 2. Is there a better/easier way to create a tar (or ZIP) archive on Windows (through PHP)? I will happily implement something else for those who must run inferior OS's. Thanks, -brian muldown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDFLib pdf_get_pdi_value
I figured out what was wrong. If you are interested in my solution here it is: I did some searching in the PDFLIB documentation and I needed to set this at the top of my script to show some errors pdf_set_parameter($pdf, 'pdiwarning', 'true'); then, to fix the problem I needed to add this parameter. pdf_set_parameter($pdf, 'compatibility','1.5'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple Update from one form
Hi I have a current application where I am listing a table of order details, where a fulfillment company can enter the tracking number and the cost of the shipment. At present, I have up to 40 orders displayed, and when they click on the update¹ button, the code executes as if ((isset($tracking1)) (isset($kb_ship1))){ $update=mysql_query(UPDATE orders SET tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1',$link); } And this continues as tracking 2... tracking40. I would like to implement something like foreach ($_POST[ref]){ $update=mysql_query(UPDATE orders SET tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref',$link); } Instead, but I¹m not so sure how I can do this, given that form variables cannot be named the same etc. I¹m sure that there¹s a better way that the way in which I¹m doing it at the moment, so any input would be appreciated. Thanks Enda --
Re: [PHP] loosing memory
Well last weak I experienced the same problems... after a while my server turned into a zombie while the server was swapping his ass off... 2 apache treads at 10% each and the kswapd process 80% cpu and also all my memory had been taken by apache... afer doing a apache 2 reload 350 Meg of physical memory and 400 of swap was released... on a server with 1 website :-( I'm not sure what to do about the problem, maybe as said here limit the maximum memory per apache child, but that is not the solution in meantime I reset my apache server at night. If your boat leaks you can use buckets to remove the water but you might consider to put a plug in it greetings, Raymond Merlin wrote: Hi there, I am running the newest php 4.x branch on a suse 9.0 apache 1.3x system Hardware: 1G ram It apears to me that the system anyhow has a memory leak. While running top on linux it shows the free memory declining steadily. After about 48h the system starts to swap. Restarting apache gracefully brings it back to about 140 MB free ram, thats all. Is there a way to show all memory in use and therefore make it easy to identify the problem? I realised that some scripts have missed the imagedestroy function, but after I added this, the system still eats the memory. Thank you for any hint on that. Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple Update from one form
Its OK guys, Got something else myself. Here¹s the solution... Any suggestions appreciated... / // UPDATE PART / $i=1; //while ($ordersinfo[$i]) while ($i $total) { $session = $ordersinfo[$i][session]; $tracking = $ordersinfo[$i][tracking]; $kb_ship = $ordersinfo[$i][kb_ship]; $update = mysql_query(UPDATE products_orders SET tracking='$tracking', kb_ship='$kb_ship' WHERE session='$session') or die (mysql_error()); $i++; } / // MAIN PART / ... td align=\default\ width=\100\input type=text name=\ordersinfo[$i][tracking]\ value=\ . $roworders[tracking] . \ size=25/td ... Regards Enda -- On 18/05/2004 23:20, Enda Nagle - Lists [EMAIL PROTECTED] wrote: Hi I have a current application where I am listing a table of order details, where a fulfillment company can enter the tracking number and the cost of the shipment. At present, I have up to 40 orders displayed, and when they click on the update¹ button, the code executes as if ((isset($tracking1)) (isset($kb_ship1))){ $update=mysql_query(UPDATE orders SET tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1',$link); } And this continues as tracking 2... tracking40. I would like to implement something like foreach ($_POST[ref]){ $update=mysql_query(UPDATE orders SET tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref',$link); } Instead, but I¹m not so sure how I can do this, given that form variables cannot be named the same etc. I¹m sure that there¹s a better way that the way in which I¹m doing it at the moment, so any input would be appreciated. Thanks Enda --
[PHP] How to use pcntl_fork()?
I'm working with PHP-GTK to create a GUI application. This GUI application opens a socket to a gaming server to send/receive data to display to the user. So far, this is working well, but the problem is that it can only receive data after I make a function call to send data. Here's my program logic so far: I have the following functions: enter_key() send() receive() output() When the user enters text into the text input field, they click their Enter key. This calls the enter_key() function. When this function is called, it gets the text from the input field and passes it along to send(), which sends it to the socket. Then enter_key() calls receive(), which receives data from the socket. The receive() function calls the output() function, which displays the received data to the user in a GTK widget. So far, the program can only receive data from the socket when a call has been made to receive(), and I am explicitly calling receive() after the user clicks the Enter key. This means that data the game is transmitting is not being received until the user enters something. This is not preferable. What I would like to do is to have a sort of listener that listens on the socket and contantly receives data. It has been suggested that I use pcntl_fork() to do this, but I have looked at the manual and user-contributed notes for this, and I can't quite grasp how it's supposed to look in my code. So far, I've done something along these lines at the very end of my script: $pid = pcntl_fork(); if ($pid == -1) { die(could not fork); } elseif ($pid) { exit(0); } else { while (1) { receive(); } } I'm not sure this is working, though. It does not seem to be receiving from the socket unless I send. Ultimately, I want to remove all calls to receive() from my main program and let the listener take control of that, but I can't even tell if the above code is working, or if I'm even grasping how to make it work. Any help or pointers is greatly appreciated. -- Regards, Ben Ramsey http://benramsey.com --- http://www.phpcommunity.org/ Open Source, Open Community Visit for more information or to join the movement. --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple Update from one form
At 07:56 PM 5/18/2004, Enda Nagle - Lists wrote: Its OK guys, Got something else myself. Here¹s the solution... Any suggestions appreciated... / // UPDATE PART / $i=1; //while ($ordersinfo[$i]) while ($i $total) { $session = $ordersinfo[$i][session]; $tracking = $ordersinfo[$i][tracking]; $kb_ship = $ordersinfo[$i][kb_ship]; $update = mysql_query(UPDATE products_orders SET tracking='$tracking', kb_ship='$kb_ship' WHERE session='$session') or die (mysql_error()); $i++; } / // MAIN PART / ... td align=\default\ width=\100\input type=text name=\ordersinfo[$i][tracking]\ value=\ . $roworders[tracking] . \ size=25/td ... Regards Enda -- On 18/05/2004 23:20, Enda Nagle - Lists [EMAIL PROTECTED] wrote: Hi I have a current application where I am listing a table of order details, where a fulfillment company can enter the tracking number and the cost of the shipment. At present, I have up to 40 orders displayed, and when they click on the update¹ button, the code executes as if ((isset($tracking1)) (isset($kb_ship1))){ $update=mysql_query(UPDATE orders SET tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1',$link); } And this continues as tracking 2... tracking40. I would like to implement something like foreach ($_POST[ref]){ $update=mysql_query(UPDATE orders SET tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref',$link); } Instead, but I¹m not so sure how I can do this, given that form variables cannot be named the same etc. I¹m sure that there¹s a better way that the way in which I¹m doing it at the moment, so any input would be appreciated. Thanks Enda -- Enda, This is close to your situation, but I only needed a one dimensional array for a bulk delete. So the form part has this line: print( 'input type=checkbox name=chkdelete[] value=' . $myrow['sub_key'] . ''); There's no need for a subscript in the form - there are presently a potential of 963 elements in this array. When we check for bulk delete it's never contiguous, we skip down the list, so array is v. sparse. And the processing part uses this loop: foreach ($chkdelete as $value){ $sql = delete from subscriber where sub_key = '$value'; $result = mysql_query($sql); } This way I'm in no danger of hitting a missing subscript as I might if I used $chkdelete[ $i ], incrementing $i HTH - Miles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple Update from one form
Hi Miles, Thanks for the reply. I see what you¹re doing there and had looked at the foreach() functionality, but am I right in saying that I still need to use the multidimensional array since there are three variables in each line? (id, tracking, kb_ship)? Enda -- On 19/05/2004 00:58, Miles Thompson [EMAIL PROTECTED] wrote: At 07:56 PM 5/18/2004, Enda Nagle - Lists wrote: Its OK guys, Got something else myself. Here¹s the solution... Any suggestions appreciated... / // UPDATE PART / $i=1; //while ($ordersinfo[$i]) while ($i $total) { $session = $ordersinfo[$i][session]; $tracking = $ordersinfo[$i][tracking]; $kb_ship = $ordersinfo[$i][kb_ship]; $update = mysql_query(UPDATE products_orders SET tracking='$tracking', kb_ship='$kb_ship' WHERE session='$session') or die (mysql_error()); $i++; } / // MAIN PART / ... td align=\default\ width=\100\input type=text name=\ordersinfo[$i][tracking]\ value=\ . $roworders[tracking] . \ size=25/td ... Regards Enda -- On 18/05/2004 23:20, Enda Nagle - Lists [EMAIL PROTECTED] wrote: Hi I have a current application where I am listing a table of order details, where a fulfillment company can enter the tracking number and the cost of the shipment. At present, I have up to 40 orders displayed, and when they click on the update¹ button, the code executes as if ((isset($tracking1)) (isset($kb_ship1))){ $update=mysql_query(UPDATE orders SET tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1',$link); } And this continues as tracking 2... tracking40. I would like to implement something like foreach ($_POST[ref]){ $update=mysql_query(UPDATE orders SET tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref',$link); } Instead, but I¹m not so sure how I can do this, given that form variables cannot be named the same etc. I¹m sure that there¹s a better way that the way in which I¹m doing it at the moment, so any input would be appreciated. Thanks Enda -- Enda, This is close to your situation, but I only needed a one dimensional array for a bulk delete. So the form part has this line: print( 'input type=checkbox name=chkdelete[] value=' . $myrow['sub_key'] . ''); There's no need for a subscript in the form - there are presently a potential of 963 elements in this array. When we check for bulk delete it's never contiguous, we skip down the list, so array is v. sparse. And the processing part uses this loop: foreach ($chkdelete as $value){ $sql = delete from subscriber where sub_key = '$value'; $result = mysql_query($sql); } This way I'm in no danger of hitting a missing subscript as I might if I used $chkdelete[ $i ], incrementing $i HTH - Miles
Re: [PHP] Multiple Update from one form
Enda Yes, you need the multi-dimensional array as you want to keep the data for the same line together. Miles At 09:03 PM 5/18/2004, Enda Nagle - Lists wrote: Hi Miles, Thanks for the reply. I see what you're doing there and had looked at the foreach() functionality, but am I right in saying that I still need to use the multidimensional array since there are three variables in each line? (id, tracking, kb_ship)? Enda -- On 19/05/2004 00:58, Miles Thompson [EMAIL PROTECTED] wrote: At 07:56 PM 5/18/2004, Enda Nagle - Lists wrote: Its OK guys, Got something else myself. Here's the solution... Any suggestions appreciated... / // UPDATE PART / $i=1; //while ($ordersinfo[$i]) while ($i $total) { $session = $ordersinfo[$i][session]; $tracking = $ordersinfo[$i][tracking]; $kb_ship = $ordersinfo[$i][kb_ship]; $update = mysql_query(UPDATE products_orders SET tracking='$tracking', kb_ship='$kb_ship' WHERE session='$session') or die (mysql_error()); $i++; } / // MAIN PART / ... td align=\default\ width=\100\input type=text name=\ordersinfo[$i][tracking]\ value=\ . $roworders[tracking] . \ size=25/td ... Regards Enda -- On 18/05/2004 23:20, Enda Nagle - Lists [EMAIL PROTECTED] wrote: Hi I have a current application where I am listing a table of order details, where a fulfillment company can enter the tracking number and the cost of the shipment. At present, I have up to 40 orders displayed, and when they click on the 'update' button, the code executes as if ((isset($tracking1)) (isset($kb_ship1))){ $update=mysql_query(UPDATE orders SET tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1',$link); } And this continues as tracking 2... tracking40. I would like to implement something like foreach ($_POST[ref]){ $update=mysql_query(UPDATE orders SET tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref',$link); } Instead, but I'm not so sure how I can do this, given that form variables cannot be named the same etc. I'm sure that there's a better way that the way in which I'm doing it at the moment, so any input would be appreciated. Thanks Enda -- Enda, This is close to your situation, but I only needed a one dimensional array for a bulk delete. So the form part has this line: print( 'input type=checkbox name=chkdelete[] value=' . $myrow['sub_key'] . ''); There's no need for a subscript in the form - there are presently a potential of 963 elements in this array. When we check for bulk delete it's never contiguous, we skip down the list, so array is v. sparse. And the processing part uses this loop: foreach ($chkdelete as $value){ $sql = delete from subscriber where sub_key = '$value'; $result = mysql_query($sql); } This way I'm in no danger of hitting a missing subscript as I might if I used $chkdelete[ $i ], incrementing $i HTH - Miles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why i could not use DB.php?
hi I want to use the DB.php to access mysql database, so I add the following line to my file: require_once 'DB.php'; but I get the following error info: Warning: main(DB.php): failed to open stream: No such file or directory in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 Fatal error: main(): Failed opening required 'DB.php' (include_path='.;d:\php\PEAR') in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 what happened? i am convinced that the DB.php exists under the directory 'd:\php\PEAR'. David Oilfield China Lottery Online Co. Ltd. Email:[EMAIL PROTECTED] Mobile:13521805655 Phone:010-83557528-263
Re: [PHP] why i could not use DB.php?
David wrote: hi I want to use the DB.php to access mysql database, so I add the following line to my file: require_once 'DB.php'; Is my file the file referenced in the error message below? Namely, D:\Apache2\htdocs\dunj\test\member\connectDatabase.php. I'm guessing the message No such file or directory probably came from the operating system. Naively, I would say it means you're wrong about the existence of d:\php\PEAR\DB.php, but I suppose it's possible that the OS might give the same message if the webserver didn't have permissions to read d:\ or d:\php or d:\php\PEAR, etc. Good luck. Travis but I get the following error info: Warning: main(DB.php): failed to open stream: No such file or directory in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 Fatal error: main(): Failed opening required 'DB.php' (include_path='.;d:\php\PEAR') in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 what happened? i am convinced that the DB.php exists under the directory 'd:\php\PEAR'. David Oilfield China Lottery Online Co. Ltd. Email:[EMAIL PROTECTED] Mobile:13521805655 Phone:010-83557528-263 -- Travis Low mailto:[EMAIL PROTECTED] http://www.dawnstar.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] why i could not use DB.php?
I had a similar error before before. I think php was thinking that the path was '.;d:\php\PEAR' and not two seperate paths (??) What's the include_path line in you php.ini look like? Could there be something to do with that? Martin David wrote: hi I want to use the DB.php to access mysql database, so I add the following line to my file: require_once 'DB.php'; Is my file the file referenced in the error message below? Namely, D:\Apache2\htdocs\dunj\test\member\connectDatabase.php. I'm guessing the message No such file or directory probably came from the operating system. Naively, I would say it means you're wrong about the existence of d:\php\PEAR\DB.php, but I suppose it's possible that the OS might give the same message if the webserver didn't have permissions to read d:\ or d:\php or d:\php\PEAR, etc. Good luck. Travis but I get the following error info: Warning: main(DB.php): failed to open stream: No such file or directory in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 Fatal error: main(): Failed opening required 'DB.php' (include_path='.;d:\php\PEAR') in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 what happened? i am convinced that the DB.php exists under the directory 'd:\php\PEAR'. David Oilfield China Lottery Online Co. Ltd. Email:[EMAIL PROTECTED] Mobile:13521805655 Phone:010-83557528-263 -- Travis Low mailto:[EMAIL PROTECTED] http://www.dawnstar.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from NOD32 1.617 (20040206) __ This message was checked by NOD32 for Exchange e-mail monitor. http://www.nod32.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [newbie] Can PHP be a security risk if it's just connecting to MySQL?
John, If that text is not properly validated and escaped, you could be open to SQL Injection attacks ... you could be open to Cross Site Scripting attacks After reading your response, I looked the web to determine what you meant by properly validated and escaped. From what I understand, properly validated means that you restrict the entry as much as possible down to what would be the length and form of input you expect. For instance, ensuring that email addresses have an @ mark, no spaces, a valid TLD and are limited in length and that sort of thing. I'm less clear on what properly escaped means. I thought escaping was a matter of putting slashes before special characters, so that their presence doesn't confuse the SQL queries one might run. Is it possible that if one has taken at least that much precaution that a user could still enter malicious script held in a TEXT column? I'm not totally sure I have the concepts right, but in any case, would anyone be willing to explain a little further what one would do to ensure proper validation and escaping of text input from users in order to increase security? -- Yoroshiku! Dave G [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail command with PHP 4.3.4-1.1 and Fedora Core 1
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote in news:[EMAIL PROTECTED]: Hello all, I have updated an old system to Fedora 1 and php php-4.3.4-1.1. However the mail comand does not work anymore. The php.ini of the original system did not have anything special. Sendmail is not being run locally in this machine. What might be causing it? Thanks in advance, C.F. The problem is that sendmail, or other mail app, is not installed on the local machine. Sendmail, or equivalent, must be installed before compiling php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php