[PHP] PHP 4.4.3RC1 testing
Hello! I packed PHP 4.4.3RC1 today, which you can find here: http://downloads.php.net/derick/ Windows downloads can be found here: Please test it carefully, and report any bugs in the bug system, but only if you have a short reproducable test case. If everything goes well, we can release 4.4.3 somewhere in the middle of next week (around the 30th). If there are critical bugs found we will instead then release RC2. regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array name out of field value with data
Not so sure if I've tried to work this out before in this list. I'm trying to make an array name by a field/row value and assigning values to it. But I'm having some problems getting it to work. Is it possible to do this? And if, what am I doing wrong? Or is there any other way to do it? while($row=mysql_fetch_array($result)) { // Checking if variable/array is not declared if (!$$row[0]) { // Declaring an empty array by the value of sales person code $$row[0] = array(); // Current sales person code $code = $row[0]; // Putting the product name as a key and the price as a value in the array eval(\$code[\$row[1]] = \$row[2]\;); } } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getRow method of DB_Common class
Dear all, I am using getRow() method ob DB_Common class to get a single row from a table. As per document http://pear.php.net/manual/en/package.database.db.db-common.getrow.php this method return a single dimension array. But when I am using it, it returns a two dimension array. I don't know why... Please help me. -- Nirmalya - How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.
Re: [PHP] Array name out of field value with data
Jonas Rosling a écrit : Not so sure if I've tried to work this out before in this list. I'm trying to make an array name by a field/row value and assigning values to it. But I'm having some problems getting it to work. Is it possible to do this? And if, what am I doing wrong? Or is there any other way to do it? while($row=mysql_fetch_array($result)) { // Checking if variable/array is not declared if (!$$row[0]) { what do you want to check with the code above ? I don't think $$row[0] will give you anything good. as you're inside your while loop, $row should be declared, but the content of $row[0] depends on your request. you can check if $row[0] is set using count $row; but if you have an empty value in the first column, this will give you an empty string as result. try a print_r($row); after your while. // Declaring an empty array by the value of sales person code $$row[0] = array(); I still don't understand why you're using $$row above. // Current sales person code $code = $row[0]; // Putting the product name as a key and the price as a value in the array eval(\$code[\$row[1]] = \$row[2]\;); do you really want to erase the content of $code you just set above with the eval statement ? $my_array = array(); $my_array[$1] = $2; } } Thanks Could you please describe a bit more what you'd like to do/set, so we can give you a better help ? N F -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getRow method of DB_Common class
On 5/22/06, Nirmalya Lahiri [EMAIL PROTECTED] wrote: Dear all, I am using getRow() method ob DB_Common class to get a single row from a table. As per document http://pear.php.net/manual/en/package.database.db.db-common.getrow.php this method return a single dimension array. But when I am using it, it returns a two dimension array. I don't know why... Please help me. You should ask on the pear list - they know the code, we don't. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] Array name out of field value with data
-Ursprungligt meddelande- Från: nicolas figaro [mailto:[EMAIL PROTECTED] Skickat: den 22 maj 2006 11:50 Till: PHP List Ämne: Re: [PHP] Array name out of field value with data Jonas Rosling a écrit : Not so sure if I've tried to work this out before in this list. I'm trying to make an array name by a field/row value and assigning values to it. But I'm having some problems getting it to work. Is it possible to do this? And if, what am I doing wrong? Or is there any other way to do it? while($row=mysql_fetch_array($result)) { // Checking if variable/array is not declared if (!$$row[0]) { what do you want to check with the code above ? I don't think $$row[0] will give you anything good. as you're inside your while loop, $row should be declared, but the content of $row[0] depends on your request. you can check if $row[0] is set using count $row; but if you have an empty value in the first column, this will give you an empty string as result. try a print_r($row); after your while. // Declaring an empty array by the value of sales person code $$row[0] = array(); I still don't understand why you're using $$row above. // Current sales person code $code = $row[0]; // Putting the product name as a key and the price as a value in the array eval(\$code[\$row[1]] = \$row[2]\;); do you really want to erase the content of $code you just set above with the eval statement ? $my_array = array(); $my_array[$1] = $2; } } Thanks Could you please describe a bit more what you'd like to do/set, so we can give you a better help ? N F -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The thing is that I want to name an array by the value in $row[0], sales person code. Once the array is declared it should not be declared again. The field never contains an empty value. After that I want to push in $row[1] as a key with $row[2] as a value, all related to the array name/sales person code. So if an array is declared that is equal as the value in the first field it should input a key and value. For example the array AT can contain 10 collections of data. Array ( [Product 1] = 1500 [Product 2] = 3000 [Product 3] = 500 ) etc, Hope I have made it a bit more easier to understand now. // Jonas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookies https
I have a site that is using a shared ssl certificate. When running on the site, the host is of the form host.com. When running in ssl mode, the domain is of the form host.certhost.com. ping shows that both resolve to the same ip address. Is there a way to create a cookie in the unsecured area and have it available when going through the ssl certificate? tia ---Michael -- Fight software piracy! Don't pirate MS Office - that's theft. Instead, use ours - it's legal and free www.openoffice.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Group date with category
Anyone know any good why to group date in a recordset in any good way? As if you categorize it in columns. Like: Category 1 Row1 - DataData Row2 - DataData Row3 - DataData Category 2 Row1 - DataDate Row2 - DataData Row3 - DataData etc. Thanks in advance (as allways) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Group date with category
On 22/05/06, Jonas Rosling [EMAIL PROTECTED] wrote: Anyone know any good why to group date in a recordset in any good way? As if you categorize it in columns. Like: Category 1 Row1 - DataData Row2 - DataData Row3 - DataData Category 2 Row1 - DataDate Row2 - DataData Row3 - DataData etc. Thanks in advance (as allways) What do you mean? Is this html tables, or php arrays, or what? Please be more specific! -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css) look out for project karma, our new venture, coming soon!
Re: [PHP] Cookies https
Michael Satterwhite wrote: I have a site that is using a shared ssl certificate. When running on the site, the host is of the form host.com. When running in ssl mode, the domain is of the form host.certhost.com. ping shows that both resolve to the same ip address. Is there a way to create a cookie in the unsecured area and have it available when going through the ssl certificate? Short answer: No Long answer: N Seriously though, for security reasons you cannot set cookies from one domain for another domain. You'll need to come up with another way to pass a secure token or just leave them on the secure site. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert a .pl script to .php (willing to pay via paypal or CC)
Hi, I've pretty much given up trying to convert a perl script to php, I have come a long way with it though, but there are a few bugs that i have been unable to squash. I need an _exact_ copy of the perl script in php, unable to manage that. If you are good with PERL and PHP and would like to give me a helping hand converting this, please tell me and I will send you two files The original perl version and my tried_to_convert php version. Both files are not very big (around 13k on average) ***I understand your time is valuable so if you want either give me your paypal address or the address of your favourite charity and I'll make a payment there.*** Please note I am NOT a rich guy...unfortunatly :) Interested? Write back with your address and I'll send the files over. Cheers, Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookies https
On 5/22/06, Michael Satterwhite [EMAIL PROTECTED] wrote: I have a site that is using a shared ssl certificate. When running on the site, the host is of the form host.com. When running in ssl mode, the domain is of the form host.certhost.com. ping shows that both resolve to the same ip address. Is there a way to create a cookie in the unsecured area and have it available when going through the ssl certificate? Nope. They are different domains. If they were on the same basic domain, you could (see http://wp.netscape.com/newsref/std/cookie_spec.html specifically the domain section) but completely different domains isn't an option. PHP sessions would work though. Explicitly pass the session across and it should work (well, I think!). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] oops! flock() not work
flock() with LOCK_NB not work under , nor does fopen() with 'x' mode, my php is compiled as an apache module, and apache is running in prefork mpm. php version is 5.1.2 my code is ?php $haslock=0; if($lock=fopen('LOCK','w')){ if(flock($lock,LOCK_EX|LOCK_NB))$has_lock=1; } if($has_lock){ //do something which should always be only one process } ? or ?php $has_lock=0; $lock=fopen('LOCK','x'); if($lock)$has_lock=1; if(has_lock){ // do something } both of them wont work. however cli mode works well. any clue? TIA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: oops! flock() not work
BTW. what i want is if one http session cannot obtain the lock, then it fails IMMEDIATELY, On 5/22/06, n. g. [EMAIL PROTECTED] wrote: flock() with LOCK_NB not work under , nor does fopen() with 'x' mode, my php is compiled as an apache module, and apache is running in prefork mpm. php version is 5.1.2 my code is ?php $haslock=0; if($lock=fopen('LOCK','w')){ if(flock($lock,LOCK_EX|LOCK_NB))$has_lock=1; } if($has_lock){ //do something which should always be only one process } ? or ?php $has_lock=0; $lock=fopen('LOCK','x'); if($lock)$has_lock=1; if(has_lock){ // do something } both of them wont work. however cli mode works well. any clue? TIA. -- Tomorrow will be a good day :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Date() finding yesterday
The easiest way I found to do this is using mktime(). If you don't care about the time for the date you can use this... $yesterday = mktime(0,0,0,date(m),date(d)-1,date(Y)); This translates to yesterday morning after midnight. If you want the present time, only 24 hours before, use this... $yesterday = mktime(date(H),date(i),date(s),date(m),date(d)-1,date(Y)); To display the date use... date( m/d/Y, $yesterday ); Or you can put the mktime code in play of $yesterday in the above line of code. Good luck, Jef -Original Message- From: Scott Hurring [mailto:[EMAIL PROTECTED] Sent: Sunday, May 21, 2006 12:18 PM To: Rabin Vincent; php-general@lists.php.net Subject: Re: [PHP] Date() finding yesterday mktime also works: http://php.net/mktime: date(Y-m-d, mktime( ... )) On 5/21/06, Rabin Vincent [EMAIL PROTECTED] wrote: On 5/21/06, John Taylor-Johnston [EMAIL PROTECTED] wrote: I cannot seem to get this right. How can I produce yesterday? $today = date(Y-m-d); $yesterday = date(Y-m-) . date(d)-1; $yesterday = date(Y-m-d)-1; $yesterday = date(Y-m-.d-1); I've been looking at the manual :) ... Use php.net/strtotime: $yesterday = date('Y-m-d', strtotime('-1 day')); Rabin -- http://rab.in -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Scott Hurring [scott dot hurring dot lists at gmail dot com] http://hurring.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need Help Please
[snip] Although someone else has suggested you use JavaScript to set the focus on a particular form field, I urge you instead to use HTML tabindex property: pUser Name: input tabindex=1 type=text name=username /p br pPassword: input tabindex=2 type=password name=password /p br pinput tabindex=3 type=submit value=Login /p HTML 4.01 Specification 17 Forms 17.11 Giving focus to an element 17.11.1 Tabbing navigation http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1 Simplistic JavaScript solutions place focus on an input field after the page has completely loaded, often after the user has begun interacting with the form, causing irritating focus jumps in mid-input. [/snip] While tabindex is a neat thing to use it does not necessarily give focus to the first element of the form, it merely dictates the order in which form elements will be given focus when the tab key is pressed. The action may vary from browser to browser. Likely, when going to a form with tabindex defined, none of the elements will have focus until the tab key is pressed once, at which time the element with tabindex=1 will get focus. If you want to give focus to the first input element of a form you must still use a JavaScript widget to place the focus there after the entire page has loaded, tabindex will make sure that the cursor goes in the order you wish to go in after that. YMMV -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookies https
On 5/22/06, Michael Satterwhite [EMAIL PROTECTED] wrote: I have a site that is using a shared ssl certificate. When running on the site, the host is of the form host.com. When running in ssl mode, the domain is of the form host.certhost.com. ping shows that both resolve to the same ip address. Is there a way to create a cookie in the unsecured area and have it available when going through the ssl certificate? tia ---Michael -- Fight software piracy! Don't pirate MS Office - that's theft. Instead, use ours - it's legal and free www.openoffice.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If by cookie you mean your PHPSESSION cookie, this is sort-of possible. My work has a shared certificate for those whom don't wish to purchase their own. This only works if http and https servers are on the same machine. - on regular page (cart) make link to another regular page (checkout) that should become secure - save session id to db, fetch last returned id. - create ssl href with ?id=last returned id - load session from the DB using the key - delete session id from DB since it is now shared between domains - call session_regenerate_id ...becomes... http://www.example.com/cart.php http://www.example.com/checkout.php https://ssl.example.com/example/checkout.php I'm not really sure how important the whole hide the session id thing is considering I regenerate the ID. But better safe than sorry I guess. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] selecting current month from a database
$cur_month = date(m); while ($r = mysql_fetch_array($month_query)) { $v = $r[m_id]; $out = $r[months]; if( $cur_month = $v ) { echo(option selected=.$cur_month. value=.$v..$out./option) } } Jef -Original Message- From: Paul Novitski [mailto:[EMAIL PROTECTED] Sent: Sunday, May 21, 2006 2:55 AM To: php-general@lists.php.net Subject: Re: [PHP] selecting current month from a database At 11:45 PM 5/20/2006, Paul Goepfert wrote: I have a drop down menu where I have the months of year as menu items. I want to be able to have the current month be the selected month. I have tried using the date function as the way to set the current month as the selected value but it seems that every value entered in the select box is set to selected. Here is my code maybe someone can help me out $month_query = mysql_query(SELECT m_id, months FROM Month); while ($r = mysql_fetch_array($month_query)) { $v = $r[m_id]; $out = $r[months]; echo(option selected= . date(F) . value=$v$out/option\n); } Just incase you want to know m_id = 1..12 months = January..December How do I set only the current month to selected ? Paul, The syntax for pre-selected options is: HTML: option selected[1] XHTML: option selected=selected [2] Options that are not pre-selected simply omit the selected attribute altogether. Therefore you'll want code something like this: while ($r = mysql_fetch_array($month_query)) { $v = $r[m_id];// numeric month $out = $r[months];// verbal month // select option for current month if ($v == date(n)) { $selected = 'selected=selected'; }else{ $selected = ''; } echo option $selected value=$v$out/option\n; } Notes: - date(F) is the verbal month; date(n) is numeric [3]. Therefore you'll want to compare $v with date(n) or $out with date(F). - Adhering to XHTML syntax, I've put the attribute values in quotes. [2] - FYI, you can harmlessly include parentheses in the echo statement but echo is actually not a function and doesn't require parens [4]. Regards, Paul [1] W3C HTML 4.01 Specification 17 Forms 17.6.1 Pre-selected options http://www.w3.org/TR/html4/interact/forms.html#h-17.6.1 [2] XHTML(tm) 1.0 The Extensible HyperText Markup Language (Second Edition) 4. Differences with HTML 4 4.4. Attribute values must always be quoted http://www.w3.org/TR/xhtml1/#h-4.4 [3] PHP Manual VI. Function Reference CLI. String Functions echo http://php.net/echo [4] PHP Manual VI. Function Reference XXII. Date and Time Functions date http://php.net/date -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP - Clean and simple
I don't know if I'm explaining things in a difficult way or not. But I'm gonna try to explaine what I want very clean and simple. 1. I wan't to check if an array is decleard or not, refering to a value in a row/field ($row[0]) 2. If it's not decleard I declear it and assign it's name by the value from a row/field ($row[0]) - Further down I shell fill it with values like $arrayname[$row[2]] = $row[1] (arrayname based on $row[0]) 3. Else if it's decleard fill it with values like above. Hope someone understands me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP - Clean and simple
On 5/22/06, Jonas Rosling [EMAIL PROTECTED] wrote: I don't know if I'm explaining things in a difficult way or not. But I'm gonna try to explaine what I want very clean and simple. 1. I wan't to check if an array is decleard or not, refering to a value in a row/field ($row[0]) 2. If it's not decleard I declear it and assign it's name by the value from a row/field ($row[0]) - Further down I shell fill it with values like $arrayname[$row[2]] = $row[1] (arrayname based on $row[0]) 3. Else if it's decleard fill it with values like above. Hope someone understands me. And what code do you have so far? We're not going to write it for you. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HELP - Clean and simple
[snip] I don't know if I'm explaining things in a difficult way or not. But I'm gonna try to explaine what I want very clean and simple. 1. I wan't to check if an array is decleard or not, refering to a value in a row/field ($row[0]) 2. If it's not decleard I declear it and assign it's name by the value from a row/field ($row[0]) - Further down I shell fill it with values like $arrayname[$row[2]] = $row[1] (arrayname based on $row[0]) 3. Else if it's decleard fill it with values like above. [/snip] http://www.php.net/array http://www.php.net/is_array -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] HELP - Clean and simple
-Ursprungligt meddelande- Från: chris smith [mailto:[EMAIL PROTECTED] Skickat: den 22 maj 2006 15:49 Till: Jonas Rosling Kopia: PHP List Ämne: Re: [PHP] HELP - Clean and simple On 5/22/06, Jonas Rosling [EMAIL PROTECTED] wrote: I don't know if I'm explaining things in a difficult way or not. But I'm gonna try to explaine what I want very clean and simple. 1. I wan't to check if an array is decleard or not, refering to a value in a row/field ($row[0]) 2. If it's not decleard I declear it and assign it's name by the value from a row/field ($row[0]) - Further down I shell fill it with values like $arrayname[$row[2]] = $row[1] (arrayname based on $row[0]) 3. Else if it's decleard fill it with values like above. Hope someone understands me. And what code do you have so far? We're not going to write it for you. :-) Sorry! I've been digging with this for a while now so I don't think I have the best code left. But this is what I have for the moment: while($row=mysql_fetch_array($result)) { if (!$$row[0]) { $$row[0] = array(); $$row[0][$row[2]] = $row[1]; } else { $$row[0][$row[2]] = $row[1]; } } I've been trying with eval() a bit as well without any good result. // Jonas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP - Clean and simple
On 5/22/06, Jonas Rosling [EMAIL PROTECTED] wrote: :-) Sorry! I've been digging with this for a while now so I don't think I have the best code left. But this is what I have for the moment: while($row=mysql_fetch_array($result)) { if (!$$row[0]) { $$row[0] = array(); $$row[0][$row[2]] = $row[1]; } else { $$row[0][$row[2]] = $row[1]; } } I've been trying with eval() a bit as well without any good result. The above code will work properly if you surround the dynamic variable names by curly brackets: ${$row[0]}[$row[2]] = $row[1]; Rabin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Graphics generation.
Hi, Is there any free PHP class with which I can create lines and bars graphics ? For example, for represent temperature samples over time, population of a country over time, etc. Greegints. --- Carles Xavier Munyoz Baldó [EMAIL PROTECTED] http://www.unlimitedmail.net/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Graphics generation.
[snip] Is there any free PHP class with which I can create lines and bars graphics ? For example, for represent temperature samples over time, population of a country over time, etc. [/snip] http://www.aditus.nu/jpgraph/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] HELP - Clean and simple
-Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Rabin Vincent Skickat: den 22 maj 2006 16:26 Till: Jonas Rosling Kopia: PHP List Ämne: Re: [PHP] HELP - Clean and simple On 5/22/06, Jonas Rosling [EMAIL PROTECTED] wrote: :-) Sorry! I've been digging with this for a while now so I don't think I have the best code left. But this is what I have for the moment: while($row=mysql_fetch_array($result)) { if (!$$row[0]) { $$row[0] = array(); $$row[0][$row[2]] = $row[1]; } else { $$row[0][$row[2]] = $row[1]; } } I've been trying with eval() a bit as well without any good result. The above code will work properly if you surround the dynamic variable names by curly brackets: ${$row[0]}[$row[2]] = $row[1]; Rabin Thank you Rabin very much!!! It was just { } that was missing. Not so easy to know what to do to get some things to work when you're rather new at it. // Jonas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Security Concerns with Uploaded Images:
Am 2006-05-14 00:11:09, schrieb Nick Wilson: Hi all, are there any security concerns with uploaded images? My thought is that it wouldnt be too hard to have some kind of script masquerade as a gif file, and perhaps cause damage. I cant find anyway to check a file really is a gif/png/jpg (i assume the mimetype available in $_FILES could be spoofed). Use the unix command file to determiner what file you have. I have had the same problem... Many thanks! Greetings Michelle Konzack -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-cli and daemon
Thanks for the tips Chris. Am 2006-05-15 23:32:32, schrieb chris smith: 1) How to code a daemon? This would be a good place to start. http://www.php.net/pcntl Depending on your app you might need to look at shared memory, but the main area to check out would be the process functions. http://www.php.net/manual/en/ref.sem.php 2) How to use ssl-certs for the connection? The $USER must use an USB-Key with its one cert. There are ssl functions you can use: http://www.php.net/manual/en/ref.openssl.php -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] big downloads discuraged with php?
Hello, I have coded a webinterface to a (Debian) pbuilder (i386, amd64, m68k, powerpc, sparc, mips, hppa, ia64 and arm) which can check and backport Debian sources. Now I have some trouble, because some people have tried to let php5 download source tarballs of 30-400 MByte... This let my system smoking! Not that I have no bandwidth (SONET, Dual STM-4) or performance issues (32 CPU's 650MHz, 64 GB memory) but I want to ask you about security issues downloading such big files... Is it better, to span a shell with wget? Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sparse v1.01b released
A slight bugfix/new feature release of Sparse. I'm still looking for beta testers and for more ideas of where to spread the word! 8-) --Daniel -- Sparse - a new way to write MySQL-based programs with no actual programming. http://sparse-php.sourceforge.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file permission error
Hi, I am facing one problem in my project.I am uploading an image .its get storing in DB.i am storing images in /tmp folder as file.while i am retrieving a image its displaying file permission error.fopen() could not open socket.file permission error. A.suresh - Yahoo! India Answers Share what your know-how and wisdom Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now
Re: [PHP] file permission error
is it readable by nobody? On 5/22/06, suresh kumar [EMAIL PROTECTED] wrote: Hi, I am facing one problem in my project.I am uploading an image .its get storing in DB.i am storing images in /tmp folder as file.while i am retrieving a image its displaying file permission error.fopen() could not open socket.file permission error. A.suresh - Yahoo! India Answers Share what your know-how and wisdom Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file permission error
Your answer to your question can be found here http://www.php.net/manual/en/ref.filesystem.php suresh kumar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am facing one problem in my project.I am uploading an image .its get storing in DB.i am storing images in /tmp folder as file.while i am retrieving a image its displaying file permission error.fopen() could not open socket.file permission error. A.suresh - Yahoo! India Answers Share what your know-how and wisdom Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multiple BCC addresses with mail() function
Hi All I am trying to take a list of email addresses from my database and email them all in one email but not allow them to see individual email addresses. Im not sure of the best way to do it but im thinking that just having a large BCC: string made of the addresses. If anyone has dealt with this problem before any advice would be greatly appreciated! thanks for any advice in advance! Cheers Bob Send instant messages to your online friends http://uk.messenger.yahoo.com
[PHP] storing single and double quote in MySQL
Hi to all! After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? Thanks for any thoughts! -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
Looks good to me, just make sure you use: http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users. (you might want to check out: addslashes() to add the slashes before your DB insert, just to keep those things under your command) -Brad [EMAIL PROTECTED] wrote: Hi to all! After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? Thanks for any thoughts! -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Graphics generation.
At 4:39 PM +0200 5/22/06, Carles Xavier Munyoz Baldó wrote: Hi, Is there any free PHP class with which I can create lines and bars graphics ? For example, for represent temperature samples over time, population of a country over time, etc. Greegints. --- Carles Xavier Munyoz Baldó Try: http://www.weberdev.com/get_example-3867.html http://www.weberdev.com/get_example-401.html tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple BCC addresses with mail() function
At 5:24 PM +0100 5/22/06, bob pilly wrote: Hi All I am trying to take a list of email addresses from my database and email them all in one email but not allow them to see individual email addresses. Im not sure of the best way to do it but im thinking that just having a large BCC: string made of the addresses. If anyone has dealt with this problem before any advice would be greatly appreciated! thanks for any advice in advance! Cheers Bob Try: http://www.weberdev.com/Manuals/PHP/function.mail.html At the bottom, it has a Bcc example. and possibly the file at: http://www.weberdev.com/get_example-1557.html hth's tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
On 5/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi to all! After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? Thanks for any thoughts! -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Looks like you're having a problem with magic quotes. Look at the examples: http://us2.php.net/manual/en/function.get-magic-quotes-gpc.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
Brad Bonkoski wrote: Looks good to me, just make sure you use: http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users. (you might want to check out: addslashes() to add the slashes before your DB insert, just to keep those things under your command) -Brad No, no, no. Bad coder. Correct way is to escape the data being put into your db with mysql_real_escape_string(), and have magic_quotes OFF. There is no need to stripslashes() when retrieving the data (and you'll end up stripping slashes that are supposed to be in the data). htmlentities() is better used for displaying data (or passing it from one page to the next), pretty useless for db entries. Always, always, always... mysql_real_escape_string() Bare minimum. [EMAIL PROTECTED] wrote: Hi to all! After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? Thanks for any thoughts! -afan -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
Brad Bonkoski wrote: Looks good to me, just make sure you use: http://www.php.net/manual/en/function.stripslashes.php this is bad advice... if you have to dump that information back to the users. (you might want to check out: addslashes() to add the slashes before having to use stripslashes() and/or addslashes() when putting stuff into the DB and/or when outputting stuff coming from the database indicates that there is something (subtly?) wrong with the code in question. your DB insert, just to keep those things under your command) 1. make sure add_magic_quotes [or whatever it's called exactly] (and all it's siblings) are off. 2. use mysql_escape_string() or mysql_real_escape_string() [preferred] to escape data begin put into the DB 3. use something like htmlentities() when displaying stuff in the browser coming from the DB - this is dependent on what exactly you are displaying and in what context -you don't want to entitize HTML that is meant to be used as HTML (but then you would want to entitize the same HTML if you were displaying the HTML in a textarea for editing purposes... always beware of cross-site-scripting vulnerabilities, which comes down to: 1. clean validate your input 2. use correct escaping when outputting (e.g. outputting to the DB, outputting to the browser, etc) oh read all of phpsec.org - that site goes to great pains to explain the security issues inherent in [not] escaping/validating input/output. -Brad [EMAIL PROTECTED] wrote: Hi to all! After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? Thanks for any thoughts! -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] storing single and double quote in MySQL
On 22 May 2006 17:37, Brad Bonkoski wrote: Looks good to me, just make sure you use: http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users. (you might want to check out: addslashes() to add the slashes before your DB insert, just to keep those things under your command) -Brad Aaaarrrggghhh!! NO, NO, NO!!! If you need to stripslashes() the data coming out of your database, than you haven't put it in right. An addslashes(), or more correctly mysql_real_escape_string() as afan is doing, is simply to make sure that characters which need escaping to get put into the database right are in fact escaped. The escape characters themselves should NOT make it into the database. [EMAIL PROTECTED] wrote: Hi to all! After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? What are your magic_quotes_*() settings? It sounds like your data is getting escaped twice. 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 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP - Clean and simple
On 5/22/06, Jonas Rosling [EMAIL PROTECTED] wrote: while($row=mysql_fetch_array($result)) { if (!$$row[0]) { $$row[0] = array(); $$row[0][$row[2]] = $row[1]; } else { $$row[0][$row[2]] = $row[1]; } } IMO, unless you have a *really* good reason for doing things this way, putting values into an array is almost always better than using the $$ direct declaration. i.e. why not use? $vars[ $row[0] ][ $row[2] ] = $row[1]; -- Scott Hurring [scott dot hurring dot lists at gmail dot com] http://hurring.com/
RE: [PHP] selecting current month from a database
At 06:32 AM 5/22/2006, Jef Sullivan wrote: $cur_month = date(m); while ($r = mysql_fetch_array($month_query)) { $v = $r[m_id]; $out = $r[months]; if( $cur_month = $v ) { echo(option selected=.$cur_month. value=.$v..$out./option) } } You're definitely saving some server machine cycles there by calculating the current month just once. On the other hand, your code would output an option only when the data month matched the current month. I'm under the impression that the original poster wanted the user to be able to select from a list of different months. Therefore I'd echo the option tag with every iteration and include the selected attribute only when the month matched. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] selecting current month from a database
On 5/21/06, Paul Goepfert [EMAIL PROTECTED] wrote: Hi all, I know this might be trivial problem but I can't seem to figure it out. Here is my problem I have a drop down menu where I have the months of year as menu items. I want to be able to have the current month be the selected month. I have tried using the date function as the way to set the current month as the selected value but it seems that every value entered in the select box is set to selected. Here is my code maybe someone can help me out $month_query = mysql_query(SELECT m_id, months FROM Month); while ($r = mysql_fetch_array($month_query)) { $v = $r[m_id]; $out = $r[months]; echo(option selected= . date(F) . value=$v$out/option\n); } Just incase you want to know m_id = 1..12 months = January..December How do I set only the current month to selected ? Thanks, Paul I see Paul N. solved your selection problem. But I'm wondering why you need to store month names in a database. You could get them using date() and mktime() and avoid a db hit: foreach (range(1, 12) as $i) { echo date('F', mktime(0, 0, 0, $i)); } Rabin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] selecting current month from a database
On , [EMAIL PROTECTED] wrote: I see Paul N. solved your selection problem. But I'm wondering why you need to store month names in a database. You could get them using date() and mktime() and avoid a db hit: foreach (range(1, 12) as $i) { echo date('F', mktime(0, 0, 0, $i)); } That's the right general idea, but as written has some specific problems: (i) Using midnight when getting dates is not a good idea -- it can cause problems in some timezones on DST shift dates. I always use midday when I'm interested purely in the date. (ii) Omitting the day-of-month will give wrong answers on the 29th (non-leap years), 30th and 31st of any month. I leave the reason behind this as an exercise for the reader... ;) Therefore, I submit that a safer version of the above would be: foreach (range(1, 12) as $i): echo date('F', mktime(12, 0, 0, $i, 1)); endforeach; 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 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
On Mon, May 22, 2006 11:25 am, [EMAIL PROTECTED] wrote: After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2x2'4, or sky's blue, or cool stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\x2\'4\, and sky\'s blue, and \cool\ stuff. Is this correct way No. If you still see \' in your data after it's in MySQL, then you have done TWO escapes, and should have only done ONE. Your data is now corrupt. or correct way will be to convert quotes in html entities? If yes, means have to use htmlentities($Size, ENT_QUOTES)? You would need to use htmlentities ONLY when you send the data out to a web browser, and ONLY at the last second before it goes to the browser. Don't store the htmlentities() version in your data -- Keep the data clean, so that you can, for example, export it, search it, sort it, send it out as XML or RSS or whatever. Only the data actually going to the browser needs htmlentities() -- Calling htmlentities() anywhere else just introduces problems down the line, sooner or later. -- 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] storing single and double quote in MySQL
On Mon, May 22, 2006 11:37 am, Brad Bonkoski wrote: http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users. If you are using http://php.net/stripslashes on data coming out of your database, you are DEFINITELY doing something wrong acquiring that data. Stripslashes is correctly used ONLY when: 1. You have Magic Quotes on, and 2. You need to display/use the incoming data for something other than MySQL in the same script that does the INSERT Even then, you really ought to turn off Magic Quotes and migrate to http://php.net/mysql_real_escape_string -- 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] HELP - Clean and simple
http://php.net/isset On Mon, May 22, 2006 8:45 am, Jonas Rosling wrote: I don't know if I'm explaining things in a difficult way or not. But I'm gonna try to explaine what I want very clean and simple. 1. I wan't to check if an array is decleard or not, refering to a value in a row/field ($row[0]) 2. If it's not decleard I declear it and assign it's name by the value from a row/field ($row[0]) - Further down I shell fill it with values like $arrayname[$row[2]] = $row[1] (arrayname based on $row[0]) 3. Else if it's decleard fill it with values like above. Hope someone understands me. -- 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] oops! flock() not work
On Mon, May 22, 2006 7:11 am, n.g. wrote: flock() with LOCK_NB not work under , nor does fopen() with 'x' mode, my php is compiled as an apache module, and apache is running in prefork mpm. php version is 5.1.2 my code is ?php $haslock=0; if($lock=fopen('LOCK','w')){ This would work ONLY if the directory containing your PHP script on your website was world-writable. *THAT* would be particularly *BAD*!!! So you need to specify a php-writable (world-writable, in most cases) directory for your 'LOCK' file to live in, with something like: '/var/share/your_application_name/LOCK' if(flock($lock,LOCK_EX|LOCK_NB))$has_lock=1; } if($has_lock){ //do something which should always be only one process } ? or ?php $has_lock=0; $lock=fopen('LOCK','x'); if($lock)$has_lock=1; if(has_lock){ // do something } both of them wont work. however cli mode works well. any clue? TIA. -- 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] Group date with category
On Mon, May 22, 2006 6:53 am, Jonas Rosling wrote: Anyone know any good why to group date in a recordset in any good way? As if you categorize it in columns. Like: Category 1 Row1 - DataData Row2 - DataData Row3 - DataData Category 2 Row1 - DataDate Row2 - DataData Row3 - DataData $query = 'SELECT category, row, data FROM whatever ORDER BY category, row, data'; $info = @mysql_query($query, $connection) or trigger_error(mysql_error(), E_USER_NOTICE); $last_category = ''; while (list($category, $row, $data) = mysql_fetch_row($info)){ if ($last_category != $category){ echo $categorybr /\n; $last_category = $category; } echo $row - $databr /\n; } -- 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] storing single and double quote in MySQL
Richard Lynch wrote: On Mon, May 22, 2006 11:37 am, Brad Bonkoski wrote: http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users. If you are using http://php.net/stripslashes on data coming out of your database, you are DEFINITELY doing something wrong acquiring that data. Stripslashes is correctly used ONLY when: 1. You have Magic Quotes on, and 2. You need to display/use the incoming data for something other than MySQL in the same script that does the INSERT Even then, you really ought to turn off Magic Quotes and migrate to http://php.net/mysql_real_escape_string Thanks for your constructive criticism Sorry for the original bad advice. So, when the magic_quotes goes away in future version, with stripslashes() also go away? -Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple BCC addresses with mail() function
On Mon, May 22, 2006 11:24 am, bob pilly wrote: I am trying to take a list of email addresses from my database and email them all in one email but not allow them to see individual email addresses. Im not sure of the best way to do it but im thinking that just having a large BCC: string made of the addresses. If anyone has dealt with this problem before any advice would be greatly appreciated! Should work fine, up to a point, but... Your sendmail config may limit the number of Bcc: in one email. If any ONE of the email addresses is mal-formed, things can go very wrong, very fast, and it gets really hard to figure out who did or didn't get the email sent to them. Recipients and spam filters may flag the Bcc: as a higher probability of spam. So depending on how many emails you have to send, and how many Bcc:s you have and what resources you have available, you may need to tweak this plan after you do some testing... Or you may end up just sending out individual emails instead of using Bcc: -- 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] file permission error
On Mon, May 22, 2006 10:55 am, suresh kumar wrote: I am facing one problem in my project.I am uploading an image .its get storing in DB. This is your first problem :-) Unless you are the CIA using a custom builtin SQL function to compare images, what point is there in throwing this big blob in your DB? You can't do anything useful with it in there. i am storing images in /tmp folder as file. The file uploaded to PHP in /tmp will DISAPPEAR as soon as the script finishes. You need to use http://php.net/move_uploaded_file while i am retrieving a image its displaying file permission error.fopen() could not open socket.file permission error. -- 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] Cookies https
On Mon, May 22, 2006 6:49 am, Michael Satterwhite wrote: I have a site that is using a shared ssl certificate. When running on the site, the host is of the form host.com. When running in ssl mode, the domain is of the form host.certhost.com. ping shows that both resolve to the same ip address. Is there a way to create a cookie in the unsecured area and have it available when going through the ssl certificate? No. You'll have to transmit the Cookie through your web application interface in some fashion. -- 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] getRow method of DB_Common class
On Mon, May 22, 2006 4:37 am, Nirmalya Lahiri wrote: I am using getRow() method ob DB_Common class to get a single row from a table. As per document http://pear.php.net/manual/en/package.database.db.db-common.getrow.php this method return a single dimension array. But when I am using it, it returns a two dimension array. I don't know why... Please help me. You probably need to re-post to: [EMAIL PROTECTED] -- 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] Getting the right path output from $_SERVER
On Mon, May 22, 2006 12:12 am, Dave M G wrote: What I am trying to achieve is to output the path in which the current script is executing, without having the name of the file attached. I'm hoping to be able to do this without complicated code to truncate path names and whatnot. Either of these two variables do what I want, except that they include the name of the file: $_SERVER[PHP_SELF] $_SERVER[SCRIPT_NAME] For example, if create file called test.php and I echo the output of $_SERVER[PHP_SELF], I get: /web_sites/gutteridge.info/web/test.php But all I want is: /web_sites/gutteridge.info/web (It's important that the last forward slash not be there). I would have thought that an existing global variable would exist to do this, but I can't find it in the php manual: http://www.php.net/manual/en/reserved.variables.php $_SERVER[DOCUMENT_ROOT] provides a path without the file name, but it's not the path I need. In my case, the output is: /var/www $_SERVER[PATH_TRANSLATED] also provides a different path, and also attaches the file name: /var/www/web_sites/gutteridge.info/web/test.php The bottom line is, how can I get the same path as $_SERVER[PHP_SELF] or $_SERVER[SCRIPT_NAME], but without including the file name? Thank you for any advice. http://php.net/dirname -- 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] detect if file exist
On Sun, May 21, 2006 8:52 am, Alain Roger wrote: i have 1 folder, in this folder sometime a file can be sometimes not... 1. i would like to detect if the folder contains a file or not. only 1 file can be in this folder but i do not know the name of this file, and the extension should be xls. when this file exists, i want to display the contents of this file to my web site, how can i do it ? http://php.net/opendir 2. could you advise me on some good tutorial PHP+Excel ? http://google.com/ -- 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] Uploading Files
On Sun, May 21, 2006 3:52 am, P. Guethlein wrote: I'm at one of those frustration levels can't seem to get a script working that will post and upload a file to the server. Im working with the below. Can you help? ?php var_dump($_FILES); $numoffile = 1; $file_dir = d:/upload/; if ($_FILES['myfiles']) { print_r ($_FILES); for ($i=0;$i$numoffile;$i++) { if (trim($_FILES['myfiles']['name'][$i])!=) { $newfile = $file_dir.$_FILES['myfiles']['name'][$i]; move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile); $j++; } } } if (isset($j)$j0) print Your file(s) has been uploaded.br; echo ' form enctype=multipart/form-data action=__URL__ method=POST !-- MAX_FILE_SIZE must precede the file input field -- input type=hidden name=MAX_FILE_SIZE value=3 / !-- Name of input element determines name in $_FILES array -- Send this file: input name=myfiles type=file / input type=submit value=Send File / /form'; ? -- 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] selecting current month from a database
On Sun, May 21, 2006 1:45 am, Paul Goepfert wrote: I know this might be trivial problem but I can't seem to figure it out. Here is my problem I have a drop down menu where I have the months of year as menu items. I want to be able to have the current month be the selected month. I have tried using the date function as the way to set the current month as the selected value but it seems that every value entered in the select box is set to selected. Here is my code maybe someone can help me out $month_query = mysql_query(SELECT m_id, months FROM Month); while ($r = mysql_fetch_array($month_query)) { $v = $r[m_id]; $out = $r[months]; $selected = $v == date(F) ? ' selected=selected' : ''; // echo(option selected= . date(F) . value=$v$out/option\n); echo option $selected value=\$v\$out/option\n; } Just incase you want to know m_id = 1..12 months = January..December How do I set only the current month to selected ? Thanks, Paul -- 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] Captcha v1.0 (http://www.php.meezerk.com/index.php?page=captcha)
On Sat, May 20, 2006 5:06 pm, Beauford wrote: I am trying to get a program, Captcha v1.0, working and not having much luck. The program says I need PHP version 4.3.10 or later or PHP version 5 and GD Library version 2.0 or later with JPEG support. I know I have PHP 5, but not sure about the GD Library. I was reading on one page I was on that this is built in to PHP, but at this point I'm lost. When I try to compile the latest version on my Slackware box I get nothing but errors. http://php.net/phpinfo This function will tell you what you have installed. -- 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] Encryption Advice
On Sat, May 20, 2006 10:35 am, Lawrence Kennon wrote: --- Rory Browne [EMAIL PROTECTED] wrote: but does support Cardservice International. These guys give you a PHP library that you http://php.net/include which then provides functions you can call which you pass in the CC# and they give you back a success/failure code and a Transaction number. You never have to visit their URL or anything like that in the process. Or, even easier, install something like osCommerce or ZenCart of any of the zillion shopping carts and they'll have a plug-in for Cardservice International, and you don't have to do much more than install and configure the damn thing. -- 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] open_basedir
On Sat, May 20, 2006 3:43 am, Nanu Kalmanovitz wrote: Using Apache 2, MySQL ver. 4.0.15a, PHP 4.2.3 (NW6.5 sp1 - Netware \ Novell ). I'm developing PHP files with Dreamweaver8 (Adobe-Macromedia). Trying to view a file (quote_insert.php) in a browser, it displays at: http://www.kalmanovitz.co.il/DW8_PHP_MySQL_tutorial/admin/quote_insert.php the following warning \ error: Warning: open_basedir restriction in effect. File is in wrong directory in Applic:/HTDocs/DW8_PHP/admin/quote_insert.php on line 1 Fatal error: Failed opening required '../Connections/seasonAdmin.php' (include_path='.;sys:/php/includes') in Applic:/HTDocs/DW8_PHP/admin/quote_insert.php on line 1 while line 1 is: ?php require_once('../Connections/seasonAdmin.php'); ? If I'm changing the line 1 to: ?php require_once('Connections/seasonAdmin.php'); ? without the ../ characters and copy the quote_insert.php file to DW8_PHP folder it works OK. How can I solved the problem without removing the ../ and moving the file? Move the file into /php/includes where it belongs. :-) -- 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] PHP Notice: Undefined index
On Fri, May 19, 2006 6:08 pm, John Taylor-Johnston wrote: Any idea why this bit of code if(yes == $_POST['submitter']) { mysql_select_db($db,$myconnection); $sql = INSERT INTO `$db`.`$table` (name,email,comments,entrydate) values ('$name','$email','$comments','$entrydate'); mysql_query($sql) or die(print mysql_error()); } is provoking this message in my Apache error log? [Fri May 19 19:05:10 2006] [error] PHP Notice: Undefined index: submitter in /home/jtjohnston/domains/jtjohnston.ca/public_html/comments.php on line 29 Because $_POST['submitter'] is not set? Because your script assumes it IS set? Because sometimes your script is called to display the form, before $_POST['submitter'] has anything in it, and sometimes it's called after they hit submit and it has something in it? if (isset($_POST['submitter']) yes == $_POST['submitter']){ http://php.net/isset -- 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] safe_mode
Safe Mode is one of those things that Systems Administrators don't really want users turning on/off willy-nilly... So it can only get set in php.ini and maybe httpd.conf, almost-for-sure. Check the docs on what can be set where -- There's a nifty chart somewhere on http://php.net On Fri, May 19, 2006 5:25 pm, tedd wrote: Hi gang: Please excuse me for asking another dumb-ass question, but here goes. I'm finding that setting safe_mode to ON is more difficult than I first thought. In my phpinfo, safe_mode is set to OFF However, if I try to set it to ON in my .htaccess such as: php_value safe_mode 1 It doesn't work. If I set it in my code, such as: ini_set( 'safe_mode', '1' ); It still doesn't work. From what I've read about ini_set() , it's said that Just because you're able to set something doesn't mean it will work as expected. Is this one of those things that can't be changed? Or am I doing it wrong? Feel free to hammer me for not knowing. Thanks. tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- 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] safe_mode
On Sat, May 20, 2006 9:34 am, tedd wrote: 3. Place it in your working directory. NO! Place it in the directory where PHP expects it to be. http://php.net/phpinfo will tell you where that is. In recent Apache/PHP installs, there is an Apache directory to change that, but in older versions, it is hard-coded/compiled into the PHP binary. -- 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] Running two versions of PHP locally
On Fri, May 19, 2006 6:41 pm, John Hicks wrote: It looks like 'application/x-httpd-php' is the default type for php4. Does php5 have a different type? Is there a way to explicitly assign a new type to a module? It don't really matter what type it is if the functions within the two binaries are going to trample all over each other's data and function-name-space... If they don't co-exist, re-naming one of the application types doesn't matter... As soon as the Apache child process has both 4 5 loaded, it's gonna blow up. This is just going on MY assumption of why this is a hard problem to solve 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
Re: [PHP] storing single and double quote in MySQL
On Mon, May 22, 2006 3:05 pm, Brad Bonkoski wrote: So, when the magic_quotes goes away in future version, with stripslashes() also go away? Probably not right away... Some folks are bound to have a zillion records in their database that already got inserted with TWO calls to addslashes/Magic_Quotes/mysql_real_escape_string, and they'll want stripslashes to un-do the damage. -- 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] Upgrade problems PHP 5.1.4 (Windows)
Hi, I just upgraded to PHP 5.1.4 and now none of my sites will connect to MySQL. I keep getting the error: Fatal error: Call to undefined function mysql_connect() I enabled php_mysql.dll in php.ini as one article suggested, but still no go. Any suggestions? Thanks Beauford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Generating thumbnails from tiff images
Hi, I am looking for sample code/class that can generate a thumbnail (can be a png/jpeg) image from a tiff image. So far I've only found examples using png/jpg/gif as input. Any tips?
RE: [PHP] Generating thumbnails from tiff images
[snip] I am looking for sample code/class that can generate a thumbnail (can be a png/jpeg) image from a tiff image. So far I've only found examples using png/jpg/gif as input. Any tips? [/snip] http://www.imagemagick.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Generating thumbnails from tiff images
Hi Jay, I know the imagemagick tools. I use convert when I need to perform operations on images and gd is not available. I'd like an alternative without having to install any extra packages specially that in this case the scripts will be hosted in a win32 machine (windows xp). On 5/22/06, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] I am looking for sample code/class that can generate a thumbnail (can be a png/jpeg) image from a tiff image. So far I've only found examples using png/jpg/gif as input. Any tips? [/snip] http://www.imagemagick.org/
Re: [PHP] PHP Notice: Undefined index
Now I get it. Must be the version change? Richard Lynch a écrit: On Fri, May 19, 2006 6:08 pm, John Taylor-Johnston wrote: Any idea why this bit of code if(yes == $_POST['submitter']) { is provoking this message in my Apache error log? [Fri May 19 19:05:10 2006] [error] PHP Notice: Undefined index: submitter in /home/jtjohnston/domains/jtjohnston.ca/public_html/comments.php on line 29 Because $_POST['submitter'] is not set? Because your script assumes it IS set? Because sometimes your script is called to display the form, before $_POST['submitter'] has anything in it, and sometimes it's called after they hit submit and it has something in it? if (isset($_POST['submitter']) yes == $_POST['submitter']){ http://php.net/isset -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] safe_mode
At 3:46 PM -0500 5/22/06, Richard Lynch wrote: On Sat, May 20, 2006 9:34 am, tedd wrote: 3. Place it in your working directory. NO! Place it in the directory where PHP expects it to be. Not meaning to be argumentative, but I was simply repeating what was stated at: http://www.washington.edu/computing/web/publishing/php-ini.html Where it states: The Web server will look for this file in the following locations and in the following order: 1. The directory from which the PHP script was called 2. The root of your Web directory (typically public_html) 3. The Web server's default php.ini As such, PHP expects the php.ini file to be (first) working directory; (second) web directory; (third) default php.ini -- in that order. However, I was told that the above manner for php searching for the preferred php.ini file was for command-line and not for a shared host environment, as is my case. If you read the link, I hope you can appreciate why I said what I did -- for nowhere does the link say that this is only for command line. http://php.net/phpinfo will tell you where that is. I know where it is -- I'm able to read it. Thanks for your time and effort. tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Extensions Directory (PEAR/PECL)
Robert Samuel White wrote: Please let me know if this would be more appropriate to post in a PEAR or PECL forum. Today, I've been trying to install some extensions - in particular, the GD library and the ZIP library. I've finally managed to get it all working, but there was one issue that I'd like to clear up for future reference if possible. When I ran the command: pecl install zip-1.3.1 It intalled the zip.so file to: /usr/local/lib/php/extensions/no-debug-non-zts-20050922/zip.so The only way I could get zip support working was to put it here: /usr/local/php/ext Which is where my extensions directory is located. I've checked, and the extensions directory is set correctly in the php.ini file. Does anyone know where/how it would come up with this other path? Hello Robert, If you wish to receive the best advice for PEAR questions, ask on [EMAIL PROTECTED], and for PECL questions (questions that have to do with the internals of the extension, compilation problems, etc.) ask on [EMAIL PROTECTED] This problem is easily solved: pecl config-set ext_dir /usr/local/php/ext voila. No need to futz with php.ini or copy the extension (a bad idea - you have to remember that you did this when you decide to upgrade or uninstall) PEAR uses its own configuration file which is independent of php.ini. Why? You can use the same PEAR extensions in command-line code and for web applications. These often have completely different php.ini settings for obvious reasons (no need for apache-specific stuff inside the command-line php). Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Extensions Directory (PEAR/PECL)
Robert Samuel White wrote: Please let me know if this would be more appropriate to post in a PEAR or PECL forum. Today, I've been trying to install some extensions - in particular, the GD library and the ZIP library. I've finally managed to get it all working, but there was one issue that I'd like to clear up for future reference if possible. When I ran the command: pecl install zip-1.3.1 It intalled the zip.so file to: /usr/local/lib/php/extensions/no-debug-non-zts-20050922/zip.so The only way I could get zip support working was to put it here: /usr/local/php/ext Which is where my extensions directory is located. I've checked, and the extensions directory is set correctly in the php.ini file. Does anyone know where/how it would come up with this other path? Hello Robert, If you wish to receive the best advice for PEAR questions, ask on [EMAIL PROTECTED], and for PECL questions (questions that have to do with the internals of the extension, compilation problems, etc.) ask on [EMAIL PROTECTED] This problem is easily solved: pecl config-set ext_dir /usr/local/php/ext voila. No need to futz with php.ini or copy the extension (a bad idea - you have to remember that you did this when you decide to upgrade or uninstall) PEAR uses its own configuration file which is independent of php.ini. Why? You can use the same PEAR extensions in command-line code and for web applications. These often have completely different php.ini settings for obvious reasons (no need for apache-specific stuff inside the command-line php). Greg Greg, Thank you so much for that! I greatly appreciate your response! ~Samuel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Generating thumbnails from tiff images
[snip] I know the imagemagick tools. I use convert when I need to perform operations on images and gd is not available. I'd like an alternative without having to install any extra packages specially that in this case the scripts will be hosted in a win32 machine (windows xp). [/snip] Ah. Well. You could have saved me the effort by being more descriptive in your first post. 1. Doesn't want to use GD. Check. 2. Doesn't want to use Imagemagick. Check. 3. Doesn't want to install extra packages. Check. 4. SOL. Check. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade problems PHP 5.1.4 (Windows)
Beauford wrote: Hi, I just upgraded to PHP 5.1.4 and now none of my sites will connect to MySQL. I keep getting the error: Fatal error: Call to undefined function mysql_connect() I enabled php_mysql.dll in php.ini as one article suggested, but still no go. Firstly does the php_mysql.dll file exist in the php\extensions folder? Did you restart your webserver? I'm guessing the windows version of php has two different mysql dll's - if it does, did you enable php_mysql.dll or php_mysqli.dll ? mysqli.dll uses mysqli functions (http://www.php.net/mysqli) not the regular mysql functions. If it doesn't come with two dll's, then ignore that part ;) I'm too lazy to download it and check. Maybe this page would help.. http://www.php.net/manual/en/install.windows.manual.php -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] big downloads discuraged with php?
Michelle Konzack wrote: Hello, I have coded a webinterface to a (Debian) pbuilder (i386, amd64, m68k, powerpc, sparc, mips, hppa, ia64 and arm) which can check and backport Debian sources. Now I have some trouble, because some people have tried to let php5 download source tarballs of 30-400 MByte... This let my system smoking! How are you presenting the download? fpassthru for example reads the whole lot into memory and then spits it out. Using a loop like this: while(!feof($fp)) { echo fread($fp, $x); } will only read $x bytes and dump them. Not that I have no bandwidth (SONET, Dual STM-4) or performance issues (32 CPU's 650MHz, 64 GB memory) but I want to ask you about security issues downloading such big files... Same as with small files I assume ;) Is it better, to span a shell with wget? You can't push content to me - I have to come and get it. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Notice: Undefined index
Hi, Thanks. I see it, I get it, it makes sense. But it seems like overkill. So what version did this become necessary in? http://php.net/isset New server, new version. Or I had errors turned off on the old server. Thanks! John elseif ( (isset($_POST[number])) and (isset($_POST[submitter])) and (!isset($_POST[finalize])) and ($number) and (!$submitter)# and (!$finalize) ){ ? div class=special1h3Step 99: ?php echo $submitter; ?, You did not enter your name./h3 We are sorry. Please a href=?php echo $PHP_SELF; ?Start Again/a/div ?php } Richard Lynch wrote: is provoking [Fri May 19 19:05:10 2006] [error] PHP Notice: Undefined index: submitter in /home/jtjohnston/domains/jtjohnston.ca/public_html/comments.php on line 29 Because $_POST['submitter'] is not set? Because your script assumes it IS set? Because sometimes your script is called to display the form, before $_POST['submitter'] has anything in it, and sometimes it's called after they hit submit and it has something in it? if (isset($_POST['submitter']) yes == $_POST['submitter']){ http://php.net/isset -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ''' Cégep de Sherbrooke: ô¿ô http://www.cegepsherbrooke.qc.ca/languesmodernes/ - 819-569-2064
[PHP] Let's make a difference
I'm doing a little something for the mother earth, and I thought you might like to join me: http://friends.earthscreen.com/?r=UUF0GBMGMCdYB2cJAyMKi=gmail[EMAIL PROTECTED]p=2z=1tc=12 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade problems PHP 5.1.4 (Windows)
I've understood, it's Windows. If you added root php directory to Path environment variable it sometimes does not take effect until you restart Windows. (???May be it's cached somewhere?) And don't forget to change in php.ini Extension Directory to ./ext or where all extension dll's are placed. Tony. On 5/23/06, Beauford [EMAIL PROTECTED] wrote: Hi, I just upgraded to PHP 5.1.4 and now none of my sites will connect to MySQL. I keep getting the error: Fatal error: Call to undefined function mysql_connect() I enabled php_mysql.dll in php.ini as one article suggested, but still no go. Any suggestions? Thanks Beauford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Windows/Apache Shopping Cart Software
Anyone have any recommendations/Links to Shopping Cart Software that will run on Windows/Apache/PHP ? Thanks, -Pete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php