php-general Digest 12 Jul 2007 13:29:17 -0000 Issue 4899
php-general Digest 12 Jul 2007 13:29:17 - Issue 4899 Topics (messages 258664 through 258688): Re: PHP list as a blog 258664 by: Robert Cummings Re: Checking Post Data against DB Data 258665 by: Chris getting the next element of an associative array 258666 by: Olav Mørkrid 258667 by: Man-wai Chang 258668 by: Chris 258669 by: Jim Lucas 258670 by: Olav Mørkrid 258671 by: Chris 258672 by: Olav Mørkrid Array Push question 258673 by: John Comerford 258674 by: dev.lenss.nl 258676 by: Stut 258677 by: dev.lenss.nl 258678 by: Zoltán Németh 258679 by: Stut 258681 by: M. Sokolewicz 258684 by: Stut Re: Array Question 258675 by: Stut Re: PHP Brain Teasers 258680 by: Jay Blanchard Single Quote in String functions 258682 by: Sancar Saran 258683 by: M. Sokolewicz 258685 by: Stut 258687 by: Sancar Saran 258688 by: Sancar Saran need a form for connecting to paypal payment pro. 258686 by: Ross Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Wed, 2007-07-11 at 17:51 -0500, Richard Lynch wrote: On Wed, June 13, 2007 3:04 pm, Robert Cummings wrote: But you might not. It depends on what you decide to include() instead of redirecting. I guess in the included source you could code aorund not having the correct URL parameters and default to something sensible, but that still doesn't address the content/request mismatch. Bought a house, and I've been away from the list, so I'm resurrecting this only to point out... As far as I'm concerned, if it requires a login to see X, and you ask for X and aren't logged in, seeing the login page with the URL X *IS* the perfectly valid answer for what you should see. If I needed Google to index my content that requires a login, then I don't need a login because that's just a plain silly setup... Google's gonna have a bunch of pages that users can't see unless they login? Then it's not a login; It's a scam to collect a bunch of user data. :-) :-) :-) PS And I could just look at the Google User Agent and not require login for that, which anybody could forge, but so what? They'll get the same damn info by knowing what to search for in Google anyway, if I'm giving Google the content without a login. I guess what you're suggesting is a lot like using a relative URL in a redirect... it works, it saves some time, but it's not quite right ;) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... ---End Message--- ---BeginMessage--- kvigor wrote: OK Chris, I understand that we're checking checking the form data and escaping it, but can explain what's going on in the WHERE clause and 1=1 tad bit more. Instead of looking at all records in your original attempt (which will work fine for 10 records), you limit what you are looking at (which works a lot better for 50,000 records). The 1=1 is something that the database will remove internally but basically it stops an invalid query: select * from table where a='b' and c='d' and That's why I said you can either remove the last and: select * from table where a='b' and c='d' or add 1=1: select * from table where a='b' and c='d' and 1=1 They work out the same. -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); then we have a current index into the array: $index = yellow; $current = $array[$index]; now: how do i get the key of the next array element (in this case green)? $next = ? ---End Message--- ---BeginMessage--- let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); now: how do i get the key of the next array element (in this case green)? $next = ? Why not define your array with number index as well in the first place? -- .~. Might. Courage. Vision. Sincerity. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Fedora Core 4) Linux 2.6.17-1.2142_FC4 ^ ^ 14:26:01 up 160 days 22:10 2 users load average: 0.00 0.02 0.00 ---End Message--- ---BeginMessage--- Olav Mørkrid wrote: let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); then we have a current
[PHP] Re: getting the next element of an associative array
let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); now: how do i get the key of the next array element (in this case green)? $next = ? Why not define your array with number index as well in the first place? -- .~. Might. Courage. Vision. Sincerity. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Fedora Core 4) Linux 2.6.17-1.2142_FC4 ^ ^ 14:26:01 up 160 days 22:10 2 users load average: 0.00 0.02 0.00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting the next element of an associative array
Olav Mørkrid wrote: let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); then we have a current index into the array: $index = yellow; $current = $array[$index]; now: how do i get the key of the next array element (in this case green)? $next = ? Funnily enough: $next = next($array); http://www.php.net/manual/en/function.next.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] getting the next element of an associative array
Olav Mørkrid wrote: let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); then we have a current index into the array: $index = yellow; $current = $array[$index]; now: how do i get the key of the next array element (in this case green)? $next = ? Give this a shot ?php function array_next($ar, $curr) { $capture = false; $next = ''; foreach ( $ar AS $k = $v ) { if ( $capture ) { return array($k = $v); } if ( $k == $curr ) { $capture = true; } } return $next; } $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); print_r( array_next($array, 'yellow') ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting the next element of an associative array
chris for your suggestion to work, the internal array pointer of $array would first have to be set to point to the current element ($index). but how do you do this? this may seem like childs play, but i actually can't find any documented php function for this. it would be something like: array_set_internal_pointer($array, $index); On 12/07/07, Chris [EMAIL PROTECTED] wrote: Olav Mørkrid wrote: let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); then we have a current index into the array: $index = yellow; $current = $array[$index]; now: how do i get the key of the next array element (in this case green)? $next = ? Funnily enough: $next = next($array); http://www.php.net/manual/en/function.next.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] getting the next element of an associative array
Olav Mørkrid wrote: chris for your suggestion to work, the internal array pointer of $array would first have to be set to point to the current element ($index). but how do you do this? this may seem like childs play, but i actually can't find any documented php function for this. it would be something like: My apologies - I misread your post. I just thought you wanted the next record, not the next key. Jim's function looked pretty easy and simple :) On 12/07/07, Chris [EMAIL PROTECTED] wrote: Olav Mørkrid wrote: let's say we have the following associative array: $array = array( red = ferrari, yellow = volkswagen, green = mercedes, blue = volvo ); then we have a current index into the array: $index = yellow; $current = $array[$index]; now: how do i get the key of the next array element (in this case green)? $next = ? Funnily enough: $next = next($array); http://www.php.net/manual/en/function.next.php -- Postgresql php tutorials http://www.designmagick.com/ -- 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] getting the next element of an associative array
yep, a for loop is the fallback i use now. any reason why there isn't a built-in function for this? any plans for it in future versions of php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Push question
Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. TIA, JC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford [EMAIL PROTECTED] wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. TIA, JC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This code looks weird... $currenRow will be numeric. So why would you do $currentRow['test']? Anyway if you just wanna add an element to the end of the array use array_push http://nl3.php.net/manual/en/function.array-push.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Question
Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to say that the intent is not all that clear, really, and I'd be leery of this feature, personally. I wouldn't be leery at all. It's been around for a very long time and it's documented: http://www.php.net/manual/en/language.types.array.php#language.types.array.casting As soon as I hit send I knew that would be mis-interpreted... Leery is the wrong word. Sorry. It just seems a bit to clever to me... I suspect I'd skim this code a hundred times and not realize what it was doing. But maybe that's just me. :-) I would have to agree. I'm a big fan of self-documenting code, and this one requires a little bit more knowledge of the intricacies of PHP than I would expect from your 'average' developer. If performance is going to be an issue (and in terms of cycles I can't see this saving much), buy faster/more hardware - it's far cheaper than developer time!! -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. 1) The code above will produce a $currentRow of -1 which is probably not what you want. 2) If you actually mean that you have an array that contains items and you want the last one, used end (http://php.net/end). 3) I'm not really sure what the context is, but this is a very odd way of working with arrays. Either you already know the key or you don't. If you're just trying to append to the array you can do that with the following syntax... $Rows[] = array('test' = 'this is a test'); -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford [EMAIL PROTECTED] wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. TIA, JC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Seems my eyes are to tired today. Didn't read the code very good. But the answer still stays the same :) $Rows = array(); array_push($Rows, array('test' = 'this is a test')); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. 1) The code above will produce a $currentRow of -1 which is probably not what you want. Maybe you didn't notice the [] in the first line of the OP's code? I think this code should produce 0 for $currentRow, not -1. greets Zoltán Németh 2) If you actually mean that you have an array that contains items and you want the last one, used end (http://php.net/end). 3) I'm not really sure what the context is, but this is a very odd way of working with arrays. Either you already know the key or you don't. If you're just trying to append to the array you can do that with the following syntax... $Rows[] = array('test' = 'this is a test'); -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
Zoltán Németh wrote: 2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. 1) The code above will produce a $currentRow of -1 which is probably not what you want. Maybe you didn't notice the [] in the first line of the OP's code? I think this code should produce 0 for $currentRow, not -1. Indeed, my bad. In that case the OP is better off creating the item in a temporary variable and then adding it to the array. $row = array(); $row['test'] = 'this is a test'; $Rows[] = $row; -Stut -- http://stut.net/ 2) If you actually mean that you have an array that contains items and you want the last one, used end (http://php.net/end). 3) I'm not really sure what the context is, but this is a very odd way of working with arrays. Either you already know the key or you don't. If you're just trying to append to the array you can do that with the following syntax... $Rows[] = array('test' = 'this is a test'); -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Brain Teasers
[snip] Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by the riverside. [mumble] let the spinning wheel slide. Only later did I realize I broke the cardinal rule of Name That Tune and have NO IDEA what the song title is nor who wrote/sang it... [/snip] Spinning Wheel - Blood, Sweat Tears -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
Stut wrote: Zoltán Németh wrote: 2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. 1) The code above will produce a $currentRow of -1 which is probably not what you want. Maybe you didn't notice the [] in the first line of the OP's code? I think this code should produce 0 for $currentRow, not -1. Indeed, my bad. In that case the OP is better off creating the item in a temporary variable and then adding it to the array. $row = array(); $row['test'] = 'this is a test'; $Rows[] = $row; -Stut what's wrong with skipping the temporary variable and just doing $Rows[] = array('test'='this is a test'); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Single Quote in String functions
Hi, I cannot do any operation wiht single quote like explode(',$strContent); Did I miss someting ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Single Quote in String functions
Sancar Saran wrote: Hi, I cannot do any operation wiht single quote like explode(',$strContent); Did I miss someting ? Regards Sancar what do you mean by 'cannot do' ? If I do: ?php $string = part1 ' part2; print_r(explode(', $string)); it will return Array( [0] = part1 [1] = part2 ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Single Quote in String functions
Sancar Saran wrote: I cannot do any operation wiht single quote like explode(',$strContent); Did I miss someting ? In what way can't? What happens / doesn't happen? -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need a form for connecting to paypal payment pro.
Hi, I need a secure form. I have one here http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no algorithm check on the CC number. Also I need to make the form secure. Can someone point me to an example or tutorial. Many thanks, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Single Quote in String functions
On Thursday 12 July 2007 15:11:28 Stut wrote: Sancar Saran wrote: I cannot do any operation wiht single quote like explode(',$strContent); Did I miss someting ? In what way can't? What happens / doesn't happen? -Stut -- http://stut.net/ Hi, Problem was $strng = 'cInputI' style='width:146px;'; $arrExplode = explode(',$string); $arrExplode contins [array][1] * 0=[string]['cInputI' style='width:146px;'] And not only explode for example I canot trim first ' Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
M. Sokolewicz wrote: Stut wrote: Zoltán Németh wrote: 2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; Specifically I am wonder if I can avoid having to use 'count'. 1) The code above will produce a $currentRow of -1 which is probably not what you want. Maybe you didn't notice the [] in the first line of the OP's code? I think this code should produce 0 for $currentRow, not -1. Indeed, my bad. In that case the OP is better off creating the item in a temporary variable and then adding it to the array. $row = array(); $row['test'] = 'this is a test'; $Rows[] = $row; -Stut what's wrong with skipping the temporary variable and just doing $Rows[] = array('test'='this is a test'); ? Nothing, unless you're building a complex element. I was assuming that the OP had simplified their code down to the minimum required to illustrate the problem. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Question
On Thu, 2007-07-12 at 09:58 +0100, Stut wrote: Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to say that the intent is not all that clear, really, and I'd be leery of this feature, personally. I wouldn't be leery at all. It's been around for a very long time and it's documented: http://www.php.net/manual/en/language.types.array.php#language.types.array.casting As soon as I hit send I knew that would be mis-interpreted... Leery is the wrong word. Sorry. It just seems a bit to clever to me... I suspect I'd skim this code a hundred times and not realize what it was doing. But maybe that's just me. :-) I would have to agree. I'm a big fan of self-documenting code, and this one requires a little bit more knowledge of the intricacies of PHP than I would expect from your 'average' developer. Hmmm, I thought using an explicit cast was very self explanatory -- especially when the name of the cast is array. Maybe I'm alone in that thought. I mean if you convert a scalar to an array what do you expect to get? An array with the scalar. *shrug* I can't see how it would be anything else. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Single Quote in String functions
On Thursday 12 July 2007 15:11:28 Stut wrote: Sancar Saran wrote: I cannot do any operation wiht single quote like explode(',$strContent); Did I miss someting ? Omg, It's my bad, sorry for lameness. Before the exploding text I do some encoding decodings. So? I do mis sequenced decodings. Thats why it does not work explode or trim, or str_replace even all other string functions. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 5.0.1 Date
Yes, TZ env var helps and it works when I use putenv(). However if I set TZ in the server, and restart apache/php, TZ is getting wiped out. I think my server admin and I have to do some poking around to figure out why. Thanks for the help. -phil -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 4:25 PM To: Shafer, Philip Cc: php-general@lists.php.net Subject: Re: [PHP] PHP 5.0.1 Date Almost for sure from the TZ environment variable, and almost for sure there's more about it in the FAQ, IIRC: http://php.net/faq.php On Wed, July 11, 2007 11:14 am, Shafer, Philip wrote: The time reported by the date() function is off by one hour. Currently our server is configured to EDT (-400) time zone, however our php installation is reporting the timezone at EST (-500). I know in php 5.1.x you can set the timezone in php.ini. However we're not prepared to update php at the moment. Can anybody let me know where PHP 5.0.1 gets the timezone information from? How can I change this so PHP returns the proper date. Thanks, Phil --- Philip Shafer Web Programmer University Web Services Rowan University Glassboro NJ 08028 856-256-4418 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help setting up php
Can someone please help me? I am new to installing and working with php and webservers. I am using IIS 6. I can not get php to load the ini file. I have followed multiple guides including those listed on the install pages and even went back and let the installer run, which changed nothing. php in installed in ISAPI mode. You can see my test page here: www.ctconline.com/test.php I can post screen shots over email it that will help. I need access to the gd library at least for work. Any help would be most appreciated. Thank you Karl Schmitt
Re: [PHP] need a form for connecting to paypal payment pro.
On 7/12/07, Ross [EMAIL PROTECTED] wrote: Hi, I need a secure form. I have one here http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no algorithm check on the CC number. Also I need to make the form secure. Can someone point me to an example or tutorial. Many thanks, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ross, If you're processing through PayPal Website Payments Pro, why do you need algorithms for credit card checking? PayPal only charges the fees on successful transactions, so you wouldn't pay anything if the numbers were incorrect. Also, for specific help with the PayPal API, just go directly to http://www.paypaldev.com/. It's a forum that is run by a third-party, but the actual people from PayPal's technical departments frequently post in there to assist. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help setting up php
On Thu, 2007-07-12 at 09:25 -0400, Karl Schmitt wrote: Can someone please help me? I am new to installing and working with php and webservers. I am using IIS 6. I can not get php to load the ini file. Your webserver is looking for it here: C:\WINDOWS\php.ini Is it there? Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by the riverside. [mumble] let the spinning wheel slide. Only later did I realize I broke the cardinal rule of Name That Tune and have NO IDEA what the song title is nor who wrote/sang it... [/snip] Spinning Wheel - Blood, Sweat Tears -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? That also illustrates to newbies the allowance of using an underscore as a variable. (Thank God it's almost Friday) -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Single Quote in String functions
On Thu, 2007-07-12 at 15:47 +0300, Sancar Saran wrote: On Thursday 12 July 2007 15:11:28 Stut wrote: Sancar Saran wrote: I cannot do any operation wiht single quote like explode(',$strContent); Did I miss someting ? In what way can't? What happens / doesn't happen? -Stut -- http://stut.net/ Hi, Problem was $strng = 'cInputI' style='width:146px;'; Shouldn't that be $string = ...? $arrExplode = explode(',$string); $arrExplode contins [array][1] * 0=[string]['cInputI' style='width:146px;'] And not only explode for example I canot trim first ' Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URLs
Hi. This may or may not be a PHP question - I'll let the group decide. Note this URL: http://www.someplace.com/SomeDirectory/SomeFile compared to this URL: http://www.someplace.com/SomeDirectory/SomeFile.php Okay. How does one create the URL with no file extension? Is this done through PHP or is this a server setting? Thanks in advance! ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URLs
Philip Thompson wrote: Hi. This may or may not be a PHP question - I'll let the group decide. Note this URL: http://www.someplace.com/SomeDirectory/SomeFile compared to this URL: http://www.someplace.com/SomeDirectory/SomeFile.php Okay. How does one create the URL with no file extension? Is this done through PHP or is this a server setting? Thanks in advance! ~Philip It is a server setting - see ModRewrite for Apache. HTH, Mikey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URLs
Philip Thompson wrote: This may or may not be a PHP question - I'll let the group decide. Note this URL: http://www.someplace.com/SomeDirectory/SomeFile compared to this URL: http://www.someplace.com/SomeDirectory/SomeFile.php Okay. How does one create the URL with no file extension? Is this done through PHP or is this a server setting? Thanks in advance! I do this under Apache with the MultiViews option. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URLs
On 7/12/07, Philip Thompson [EMAIL PROTECTED] wrote: Hi. This may or may not be a PHP question - I'll let the group decide. Note this URL: http://www.someplace.com/SomeDirectory/SomeFile compared to this URL: http://www.someplace.com/SomeDirectory/SomeFile.php Okay. How does one create the URL with no file extension? Is this done through PHP or is this a server setting? Thanks in advance! ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php That would be done via either a server setting (such as Apache's mod_rewrite) or having multiple directories to act as a file, with an index.php or other default file in there. So that if you called: http://www.somplace.com/somePath/ - OR - http://www.somplace.com/somePath/hawaii.php (with an .htaccess file holding: DirectoryIndex hawaii.php } -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On Thu, 12 Jul 2007 09:56:18 -0400, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Mine was trying to go for an old funk song that starts: What goes up, must come down. Spinning wheel got to go 'round Drop all the painted ponies by the riverside. [mumble] let the spinning wheel slide. Only later did I realize I broke the cardinal rule of Name That Tune and have NO IDEA what the song title is nor who wrote/sang it... [/snip] Spinning Wheel - Blood, Sweat Tears -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? That also illustrates to newbies the allowance of using an underscore as a variable. (Thank God it's almost Friday) -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 number of the beast? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Brain Teasers
Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? That also illustrates to newbies the allowance of using an underscore as a variable. (Thank God it's almost Friday) Thank _God_ it's Friday??? Covering all bases are we? ;) -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 number of the beast? :) N! It's the root of all evil!!! :p Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; I imagine that you are doing other actions between the above three lines? Correct? Really, the simplest way of doing this is to call this over and over again. $Rows[]['test'] = this is a test; it will give you the same results as array_push, but without a function call $Rows[]['test'] = this is a test; $Rows[]['test'] = this is another test; $Rows[]['test'] = this is even another test; print_r($Rows); this will show you that it does what you are doing in the above code, but again, the question. What are you doing between all the lines of code that made you think that you had to do it your example way? Are you using count() and doing math with it? or something else? Specifically I am wonder if I can avoid having to use 'count'. TIA, JC -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all evil, but the code above wouldn't work correctly anyway, as each time through the for() loop it'll try to get the square root of the array. Thank _God_ it's Friday??? Covering all bases are we? ;) No, I said, thank God it's ALMOST Friday. Nothing to do with the puzzle, I'm just exhausted this week for some reason. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all evil, but the code above wouldn't work correctly anyway, as each time through the for() loop it'll try to get the square root of the array. Thank _God_ it's Friday??? Covering all bases are we? ;) No, I said, thank God it's ALMOST Friday. Nothing to do with the puzzle, I'm just exhausted this week for some reason. -- Daniel P. Brown You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Brain Teasers
[snip] ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all evil, but the code above wouldn't work correctly anyway, as each time through the for() loop it'll try to get the square root of the array. [/snip] The actual quote is the love of money is the root of all evil, so you need to find the root of love. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bandwidth and Mail statistics
Fernando Cosso wrote: Hi guys I have been asked to create a php script. It has to create a pdf with the qmail and the bandwidth statistics. My first approach was to parse the html output of the isoqlog for the mail and copy the mrtg's images But it is a really nasty job. I wonder if someone has done something similar to this. Any help will be appreciated. Best regards You posted almost exactly the same request yesterday. No response usually means that nobody who can give you any assistance has seen it. Reposting it will not help and only serves to annoy. A few questions... 1) Have you searched the list archives? 2) Have you Googled? 3) Have you MSN'd? 4) Have you actually tried anything yet? -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? I wasn't born silly-ass, I was hatched. :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? I wasn't born silly-ass, I was hatched. :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... Did you come before or after the chicken egg? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URLs
This may or may not be a PHP question - I'll let the group decide. Note this URL: http://www.someplace.com/SomeDirectory/SomeFile compared to this URL: http://www.someplace.com/SomeDirectory/SomeFile.php Okay. How does one create the URL with no file extension? Is this done through PHP or is this a server setting? Thanks in advance! A number of ways. You could use mod_rewrite, though you shouldn't if you care at all about performance. Directories. ie. Make SomeFile a directory with an index.php file in it. You will end up up with a trailing slash on the URL though. ForceType (IIRC). Use this directive in Apache to specify that SomeFile is actually be parsed by PHP. SomeFile should be a PHP script. Or SomeDirectory could actually be a PHP file again used with ForceType which inspects the URL and serves up the correct content. The ForceType method is used on phpguru.org to make static look like a directory. It's actually a PHP file that shows the correct template based on the URL. Eg: http://www.phpguru.org/static/positioning.html -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On Thu, 2007-07-12 at 11:27 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? I wasn't born silly-ass, I was hatched. :) Did you come before or after the chicken egg? After the first one, but I fried it up and so earth had to wait another couple of million years for a chicken to evolve again. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
Robert Cummings wrote: On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote: On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. What do you mean us? Weren't you born before they invented the chimney? I wasn't born silly-ass, I was hatched. :) As in I've hatched a Cummings plan ?? ;) -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info Don't rub it in, Matijn ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info Don't rub it in, Tijnema ;-P -- Daniel P. Brown Hehe ;) *fixed your post * :P Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Tijnema [EMAIL PROTECTED] wrote: You can probably remember the good old time of being a child and having holiday ;) Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info Don't rub it in, Tijnema ;-P -- Daniel P. Brown Hehe ;) *fixed your post * :P Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info Ha! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On Thu, 2007-07-12 at 17:06 +0200, Tijnema wrote: On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: ? $evil[] = 6; $evil[] = 6; $evil[] = 6; for($i=0;$icount($evil);$i++) { $_ = sqrt($evil); } ? It was supposed to be money is the root of all evil, but the code above wouldn't work correctly anyway, as each time through the for() loop it'll try to get the square root of the array. Thank _God_ it's Friday??? Covering all bases are we? ;) No, I said, thank God it's ALMOST Friday. Nothing to do with the puzzle, I'm just exhausted this week for some reason. -- Daniel P. Brown You can probably remember the good old time of being a child and having holiday ;) G... must be nice, some of us had to toil 18 hours a day sweeping chimneys! ;) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
Daniel Brown wrote: Did you come before or after the chicken egg? Relevant to the above: $a = array('Chicken','Egg'); echo The . $a[array_rand($a)] . comes first.; I appologize if this one's already been done...I've only glanced at a few entries in this thread, entertaining though it is. :-) jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote: I wasn't born silly-ass, I was hatched. :) Did you come before or after the chicken egg? After the first one, but I fried it up and so earth had to wait another couple of million years for a chicken to evolve again. Ah, so then, presumably, the first chicken egg was a relative of yours doesn't that make you the Second Cummings? Who knew we were in the presence of holiness? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] can't open file
dear php developer, i have weird situation here, i can't create a file in 777 mode directory and stay in same server, is this a bug ?? fyi. i'm using fc6, and php 5.1.6 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/12/07, Jon Anderson [EMAIL PROTECTED] wrote: Daniel Brown wrote: Did you come before or after the chicken egg? Relevant to the above: $a = array('Chicken','Egg'); echo The . $a[array_rand($a)] . comes first.; I appologize if this one's already been done...I've only glanced at a few entries in this thread, entertaining though it is. :-) jon The same fault is made over and over again ;) as the fish egg was earlier (as noted here) Your code should be this: $a = array('Chicken','Chicken egg'); echo The . $a[array_rand($a)] . comes first.; Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can't open file
Anugrah Widya wrote: dear php developer, i have weird situation here, i can't create a file in 777 mode directory and stay in same server, is this a bug ?? fyi. i'm using fc6, and php 5.1.6 I'm not sure I understand what the problem is. Please post the code you're using and a more detailed description of what you're trying to achieve and what's actually happening. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can't open file
On 7/12/07, Anugrah Widya [EMAIL PROTECTED] wrote: dear php developer, i have weird situation here, i can't create a file in 777 mode directory and stay in same server, is this a bug ?? How are you attempting to create the file? What do your PHP settings allow and disallow? Do you mean directory on the same server or that you're magically bouncing to a different, random server every time you try to create a file? Can you provide the code that you're trying to use to create the file? Are you getting any errors? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can't open file
Stut wrote: Anugrah Widya wrote: dear php developer, i have weird situation here, i can't create a file in 777 mode directory and stay in same server, is this a bug ?? fyi. i'm using fc6, and php 5.1.6 I'm not sure I understand what the problem is. Please post the code you're using and a more detailed description of what you're trying to achieve and what's actually happening. -Stut here the situation is, i have two domain (two website), and both stay in same server, and use same php Website A - /var/www/html/A Website B - /var/www/html/B website A would like to create some file in website B, in /var/www/html/B/var/tmp/queue, and that map is in 777 mode created by script what i got is the fopen() won't succeed to create the file in website B but if i test to write into /var/www/html/A/var/tmp/queue in website A admin it succeed is it because of some configuration in php.ini i didn't activate or what ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can't open file
Anugrah Widya wrote: Stut wrote: Anugrah Widya wrote: dear php developer, i have weird situation here, i can't create a file in 777 mode directory and stay in same server, is this a bug ?? fyi. i'm using fc6, and php 5.1.6 I'm not sure I understand what the problem is. Please post the code you're using and a more detailed description of what you're trying to achieve and what's actually happening. -Stut here the situation is, i have two domain (two website), and both stay in same server, and use same php Website A - /var/www/html/A Website B - /var/www/html/B website A would like to create some file in website B, in /var/www/html/B/var/tmp/queue, and that map is in 777 mode created by script what i got is the fopen() won't succeed to create the file in website B but if i test to write into /var/www/html/A/var/tmp/queue in website A admin it succeed is it because of some configuration in php.ini i didn't activate or what ?? You probably have some form of safe mode enabled. See http://php.net/features.safe-mode for details. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying HTML characters in real format
Hi all, Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to display data on a page containing e.g. quot; but will like it to be displayed as htmlspecialchars or htmlentities or page character set ? Cheers - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more.
[PHP] Re: Help setting up php
In news: [EMAIL PROTECTED] - Karl Schmitt wrote : Can someone please help me? I am new to installing and working with php and webservers. I am using IIS 6. I can not get php to load the ini file. I have followed multiple guides including those listed on the install pages and even went back and let the installer run, which changed nothing. php in installed in ISAPI mode. You can see my test page here: www.ctconline.com/test.php I can post screen shots over email it that will help. I need access to the gd library at least for work. Any help would be most appreciated. Thank you Karl Schmitt Take a look here http://t56.hopto.org/out/ it's how I have it working. Chris -- Cheap As Chips Broadband http://yeah.kick-butt.co.uk Superb hosting domain name deals http://host.kick-butt.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Displaying HTML characters in real format
Best way to learn, and remember, things like this is to make a simple test page and see for yourself. Don Don wrote: Hi all, Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to display data on a page containing e.g. quot; but will like it to be displayed as htmlspecialchars or htmlentities or page character set ? Cheers - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying HTML characters in real format
Don Don wrote: Hi all, Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to display data on a page containing e.g. quot; but will like it to be displayed as htmlspecialchars or htmlentities or page character set ? Cheers - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more. a little confused with what you have to begin with. Are you saying that in the text that you want to have displayed, it has quot; instead of or is it that you have a quot and want to run htmlspecialchars() or htmlentities() on it? and then have it displayed as and not quot? which is it? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] About PHP/XML/XSLT/MYSQL Web Sites
I'm trying to setup a XSLT based web site. I wasn't exactly sure about the flow of the whole system when data from relational database is transferred to XML and in turn the data inputted from the user is relayed back to the database through XML (or directly to the database with PHP DB connection). I built a flowchart illustrating what the flow of the XSLT/PHP/MYSQL system might be like. If you think it's the wrong way or an inefficient way of getting user inputted data back to mysql, I would appreciate any comments. If you cannot download the PDF file, you can bring it up with direct address the the file: http://www.envigan.net/CMSFLOW.pdf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Displaying HTML characters in real format
string htmlentities ( string $string [, int $quote_style [, string $charset [, bool $double_encode]]] ) This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities. This means that if there's an HTML equivelant it will translate into that. For example. ' and don't have HTML equivelants, it is #039, anything with a #number won't get translated. With htmlspecialchars it will. Hope that answered your question. - Dan Don Don [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to display data on a page containing e.g. quot; but will like it to be displayed as htmlspecialchars or htmlentities or page character set ? Cheers - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMS questions
Brian, I was experimenting late last year using PHP to send SMS messages. I think there is a lot of potential in the marketplace around SMS. But most of the phone companies wouldnt even talk to me and all i was trying to do was hit a development API to test some code out. im almost certain you will have to go through a provider if you intend to have messages source # based upon a value you provide rather than a phone you own. i have already grown a deep hatred for telcos due to this exclusive club thing they have going. i will focus all my energy on any opportunity that arises to thwart them. good luck, -nathan On 7/12/07, Brian Dunning [EMAIL PROTECTED] wrote: Hi all - I've been looking at a number of the commercial service providers for bulk SMS messaging, most of whom have PHP APIs. But since they are selling something they don't answer my question Is there any (legal, legitimate) way to send an SMS message that can be replied to the desired SMS cell number? Like, if I use PHP to send an SMS to Bob, can I make it appear to come from Jim's cell phone so that Bob can reply directly to Jim normally? The services all require Jim to log into their web site to read any replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail function from and reply to address problem
Sounds more like the mail server than PHP. Although weird anyway ! What mail server are you using : local/remote, smtp/sendmail/qmail ? Try using whatever method and send a mail through this server from outside of PHP with the same problem parameters ? Does that work ? It should either eliminate PHP, or point the finger ! I suspect eliminate but you never know.. That's where I think I'd start anyway. Send uz an update when you have some answers. Steve -Original Message- From: Tanner Postert [mailto:[EMAIL PROTECTED] Sent: 13 July 2007 00:33 To: php-general@lists.php.net Subject: [PHP] mail function from and reply to address problem I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? thanks in advance. Tanner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail function from and reply to address problem
I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? thanks in advance. Tanner
[PHP] SMS questions
Hi all - I've been looking at a number of the commercial service providers for bulk SMS messaging, most of whom have PHP APIs. But since they are selling something they don't answer my question Is there any (legal, legitimate) way to send an SMS message that can be replied to the desired SMS cell number? Like, if I use PHP to send an SMS to Bob, can I make it appear to come from Jim's cell phone so that Bob can reply directly to Jim normally? The services all require Jim to log into their web site to read any replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP short tags: Questions
Hi, I am trying to describe why php short tags failed to work on a server... here is my simplified explanation: it had to do with the server settings... The short_open_tag directive in php.ini was set to 0. Do you think that is an ok way to describe the problem to a technically literate non php coder? Additionally, is there a good reference on the net that explains the differences between short open tags and normal open tags? Main negative things I have read about short open tags: 1. Not as portable. 2. Security risk/less secure. 3. Will conflict with XML tags. 4. Other? Thanks! Cheers, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP short tags: Questions
it had to do with the server settings... The short_open_tag directive in php.ini was set to 0. Do you think that is an ok way to describe the problem to a technically literate non php coder? Sure. Additionally, is there a good reference on the net that explains the differences between short open tags and normal open tags? Main negative things I have read about short open tags: 1. Not as portable. 2. Security risk/less secure. 3. Will conflict with XML tags. 1 3 definitely. No idea how it's a security risk. -- 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] SMS questions
Brian, Here's another thing that would be nice: A web service to look up the carrier for a cell number. That way you could simply send an email to [EMAIL PROTECTED], though this would still be only a partial solution. This is a lot harder now that numbers are transportable between carriers. from what i can tell this is somewhat of a pipe dream, unless youre a big company that a telco *really* likes and have tons of money. the voip industry which ive been working in for nearly 2 years now has lots of feature like this. the only reason they have those features is because of the sheer nature of voip, which enables almost anyone to provide telephone functionality over the internet. cell phones are a totally different story though and my fear is the only way to get in is a dirty hack they [telcos] are overlooking that if properly exploited could become an open source movement that the phone companies would have to accept. something similar to the open source voip movement but w/ cell phones. i was close to this hack late last year, but its so unreliable that theres no way to go to production w/ it. -nathan On 7/12/07, Brian Dunning [EMAIL PROTECTED] wrote: Here's another thing that would be nice: A web service to look up the carrier for a cell number. That way you could simply send an email to [EMAIL PROTECTED], though this would still be only a partial solution. This is a lot harder now that numbers are transportable between carriers. I was not able to find any service provider that makes the SMS messages appear to come from the sender's cell phone, so they could be replied to normally. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMS questions
Here's another thing that would be nice: A web service to look up the carrier for a cell number. That way you could simply send an email to [EMAIL PROTECTED], though this would still be only a partial solution. This is a lot harder now that numbers are transportable between carriers. I was not able to find any service provider that makes the SMS messages appear to come from the sender's cell phone, so they could be replied to normally. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Push question
As you guys can probably guess from the question I'm still getting to grips with some parts of php. I had stripped down the code for my original post, maybe this will clear things up a bit: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; $Rows[$currentRow]['Data'] = array(); $Rows[$currentRow]['Config'] = This is the row config; So from what you guys have said I have changed it to be the following: $Rows[] = array('test' = 'this is a test', 'Data' = array(), 'Config' = 'This is the row config'); Which seems to be doing what I want. Thanks for the replies, JC Jim Lucas wrote: John Comerford wrote: Hi Folks, Is there a better way of doing the following: $Rows[] = array(); $currentRow = count($Rows) - 1; $Rows[$currentRow]['test'] = this is a test; I imagine that you are doing other actions between the above three lines? Correct? Really, the simplest way of doing this is to call this over and over again. $Rows[]['test'] = this is a test; it will give you the same results as array_push, but without a function call $Rows[]['test'] = this is a test; $Rows[]['test'] = this is another test; $Rows[]['test'] = this is even another test; print_r($Rows); this will show you that it does what you are doing in the above code, but again, the question. What are you doing between all the lines of code that made you think that you had to do it your example way? Are you using count() and doing math with it? or something else? Specifically I am wonder if I can avoid having to use 'count'. TIA, JC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP short tags: Questions
Micky Hulse wrote: Hi Chris, thanks for the quick reply. I appreciate your help. Chris wrote: Sure. Thanks. :) 1 3 definitely. No idea how it's a security risk. Ah, great. Thanks for clarification. I probably mis-read the info about it being a security risk. I should have said I'm not aware of any security risks with using short tags ;) Just to clarify. -- 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 short tags: Questions
Hi Chris, thanks for the quick reply. I appreciate your help. Chris wrote: Sure. Thanks. :) 1 3 definitely. No idea how it's a security risk. Ah, great. Thanks for clarification. I probably mis-read the info about it being a security risk. Have a great day, Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Social Networking Sites OT
It's gotten to the point where I pretty much view social networking sites as just another form of spammers... I blogged about it, and would like feedback from members of this lists, for various reasons I would hope would be obvious. PLEASE put responses in my blog, or your blog, or whatever, but not here, as I'm sure this thread could be quite annoying as it has minimal to zero concrete PHP content. http://richardlynch.blogspot.com/ -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text field truncation with sql server
I have a simple page that displays a record from the sql server database. One of the fields is a text field and keeps getting truncated at 3980 characters. I searched and saw someone had reported this as a PDO bug so I'm not using PDO anymore, but I'm still getting the truncation. Anyone know about this or have a work around? Here is the code. It's the body field that is a text field. I've checked the field in the database and it definitely has more data than is displayed. $cn = mssql_connect($myserver, $myuser, $mypwd); mssql_select_db($mydb, $cn); $result = mssql_query(select * from emails where id = $emailid, $cn); $row = mssql_fetch_array($result, MSSQL_ASSOC); echo ul; echo libId:/b . $row['id'] . /li; echo libFrom:/b . $row['mailfrom'] . /li; echo libTo:/b . $row['mailto'] . /li; echo libCc:/b . $row['mailcc'] . /li; echo libSubject:/b . $row['subject'] . /li; echo libDate:/b . $row['sentdate'] . /li; echo libBody:/bbr . nl2br($row['body']) . /li; echo /ul; Thanks for any help. Regards, Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About PHP/XML/XSLT/MYSQL Web Sites
kelvin, attached is a very simple diagram i put together when i got home illustrating a possible relationship between the main components in an xsl templated php application w/ a database back-end. as ive mentioned there are other configurations as well. primarily the main options in the overall relationship are rendering the xhtml on the client or server side and building xml data in memory or reading in xml files from disk. also, this diagram does not take into account any sort of validation using DTDs or XMLSchemas. i am currently vaguely familiar w/ those technologies and therefore dont know how to incorporate them into the image. actually to be quite honest i dont think the would really be used when generating a page to send to the client. really those are important if you expose an API and allow clients to send data to your application. then it would be handy to validate that xml w/ a dtd or xml schema. the other thing as i mentioned before is i cannot see a reason to create xml data while processing a GET or POST request from a client; it would just be an extra step with no apparent benefit as far as i can tell. -nathan On 7/12/07, Kelvin Park [EMAIL PROTECTED] wrote: I'm trying to setup a XSLT based web site. I wasn't exactly sure about the flow of the whole system when data from relational database is transferred to XML and in turn the data inputted from the user is relayed back to the database through XML (or directly to the database with PHP DB connection). I built a flowchart illustrating what the flow of the XSLT/PHP/MYSQL system might be like. If you think it's the wrong way or an inefficient way of getting user inputted data back to mysql, I would appreciate any comments. If you cannot download the PDF file, you can bring it up with direct address the the file: http://www.envigan.net/CMSFLOW.pdf -- 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] SMS questions
[snip] ...schtuff [/snip] Please, do not cast aspersions upon the telcos, for those of us who work in the industry cannot even get some of what you are talking about. We have a vendor that provides the SMS part and they will not expose the SMS API to us (not all SMS platforms are equal either) and we paid for the equipment and software. But alas, I do have an advantage. I have reversed engineered some of the items and continue to work on this using PHP. If I can ever make it stable it will be a great kernel for an open source project. I must caution however that work proceeds slowly because the real job keeps jumping in the way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php