SV: [PHP] Need sql-editor
Niklas Karlsson wrote: > Hello everyone > > > > I need a good sql-editor where I can write sqlcode. The problem is that I > don't have rights to list tables, functions and so on. Now I use EMS Sql > Manger 2005, and if I want to write and execute sqlcode I need access to the > system tables, and I don't have it on this database. > > > > So, I need a sqlmanger that I cant write and execute sqlcode and don't have > the access, and where a can view the result nicely. Chris wrote: > Best to ask on a more appropriate list of forum - like one that > discusses your chosen database whatever that may be (ms-sql?). I use Postgresql. I have find a application that's fill my requirement. QueryIT http://www.dbtools.com.br/EN/queryit/ And next time, I am going to think about the subject. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pwersistent Queue
Hi everyone I aneed top maintain a persisistent Queue can anyone help. -- Have A plesant Day Chetan. D. Rane Location: Pune , India Contact: +91-9890792762 otherID: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP] ereg() problem
On Jan 31, 2007, at 4:38 PM, Richard Lynch wrote: On Tue, January 30, 2007 8:36 pm, jekillen wrote: I am having trouble with ereg(). The following is the problem code $x = ereg("", $get_route, $m); testing $route I get: $route = $m[1]; print $route.''; jk/in' rec='a_378e6dc4.xml' /> (out put of print) jk is all I am looking for but is it greed that is missing the forward slash and the single quote? No, it's that you put the parens () around only the .* and not around what you wanted: ereg("", ... It seems like every time I do this I have to monkey around with it until I get what I want. Join the club. :-) You may want to consider a couple actions: Switch to PCRE http://php.net/pcre It's better documented, less confusing, faster, and just better all around. Download and play around with "The Regex Coach" which provides a visual feedback on what happens when you change the #$^%& inside your pattern. I have even changed the formatting of files just so a regular expression would work without this sort of trial and error. Is there a way I can turn off greed in php's regex? I haven't used ereg in so long, I can't answer this for ereg. In PCRE, you use tack on 'U' after your end patter delimiter. Thanks, I believe I do have pcre in my installation, and that was my next target for investigation. As I turns out I got a regex that works, albeit more complicated than (.*). See this post subject + solution. by me. thanks for the response. JK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg() problem: solution
Hi In reference to my query about 'greed' in regex in php and the following code $x = ereg("", $get_route, $m); I solved the immediate problem with the following: as you can see, the regex is quite a bit more complicated and I do not know if it will match all the possibilities that it will have to. It looks like it should. one possibility that it is matching is just two letters, in this case jk. The other possibility is u_ or au_ followed by 8 randomly selected letters and/or numbers. In short I was trying to be as simple and comprehensive as possible with (.*) as the regular expression. But the idea of greed came to mind when the match was containing far more than antic- ipated. Greed is when the regular expression tries to match as much as possible, in this case (.*) appears to be matching every instance of anything and everything else in the way, so it ends up including the entire balance of the line. A least that is my explanation. So I did something more complicated to get what I wanted. Simplicity is not always so simple. Thanks for all responses. JK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing mail file
On 01/02/07, Richard Lynch <[EMAIL PROTECTED]> wrote: Actually, I suspect most people at least make some kind of attempt to read docs before posting here... Reading does not guarantee comprehension. For that matter, reading WHICH docs is always an interesting challenge. Clearly, nobody can read *ALL* the docs. And it's very very very easy when entering a new domain to read and comprehend what seems like a reasonable amount of documentation, but still be missing some crucial fundamental bit of information. This is often-times, in my experience, because: A) Documentation assumes a certain knowledge level way higher than I actually had. B) Documentation glossed over something "basic" in such a way that did not make it clear just how important/crucial that bit of info was. I have no problem believing that the OP read the php.net IMAP pages but didn't know that a single email could be stored in a file and treated as an mbox. Similarly, knowing that email is MIME encoded does not mean that one should automatically know that MIME is the keyword commonly used to find/describe the software, nor that that's the result you should examine. Most email is in Latin-1, ASCII, or UTF-8 these days, yet you wouldn't search for those when trying to learn something about pasrsing a single email, would you? Throw in some second language difficulties, and I have to say that maybe certain people were a bit hasty in their assumptions about the effort expended by the OP... Perhaps NEXT TIME we could avoid some of this noise?... Excellent point of view, Richard. I bother the php list with a lot less questions now than I did two years ago not because I've learned the language better, but because from reading the list continually I've learned a lot of new keywords to google on. That's the whole trick, and like you said it is impossible to RTFM and comprehend the whole thing in one shot. No matter how many times I read the section on PCRE I sometimes get stuck for hours before I land on one keyword and then I can google properly. Thanks for being considerate, and always helpful. Dotan Cohen http://lyricslist.com/lyrics/artist_albums/20/aerosmith.html http://what-is-what.com/what_is/bluetooth.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need sql-editor
Niklas Karlsson wrote: Hello everyone I need a good sql-editor where I can write sqlcode. The problem is that I don't have rights to list tables, functions and so on. Now I use EMS Sql Manger 2005, and if I want to write and execute sqlcode I need access to the system tables, and I don't have it on this database. So, I need a sqlmanger that I cant write and execute sqlcode and don't have the access, and where a can view the result nicely. Best to ask on a more appropriate list of forum - like one that discusses your chosen database whatever that may be (ms-sql?). -- 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] Parsing mail file
On Tue, January 30, 2007 11:06 am, Jay Blanchard wrote: > [snip] > of course people read documentation before asking help > [/snip] > > ROFLMMFAO! Sorry, that just made my day! Actually, I suspect most people at least make some kind of attempt to read docs before posting here... Reading does not guarantee comprehension. For that matter, reading WHICH docs is always an interesting challenge. Clearly, nobody can read *ALL* the docs. And it's very very very easy when entering a new domain to read and comprehend what seems like a reasonable amount of documentation, but still be missing some crucial fundamental bit of information. This is often-times, in my experience, because: A) Documentation assumes a certain knowledge level way higher than I actually had. B) Documentation glossed over something "basic" in such a way that did not make it clear just how important/crucial that bit of info was. I have no problem believing that the OP read the php.net IMAP pages but didn't know that a single email could be stored in a file and treated as an mbox. Similarly, knowing that email is MIME encoded does not mean that one should automatically know that MIME is the keyword commonly used to find/describe the software, nor that that's the result you should examine. Most email is in Latin-1, ASCII, or UTF-8 these days, yet you wouldn't search for those when trying to learn something about pasrsing a single email, would you? Throw in some second language difficulties, and I have to say that maybe certain people were a bit hasty in their assumptions about the effort expended by the OP... Perhaps NEXT TIME we could avoid some of this noise?... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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] Teste - Sorry
Teste -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing mail file
An mbox file is pretty much just a whole bunch of email files smushed together into one big file. If you pretend that your single email *IS* an mbox, by putting it into a file, it will work. On Tue, January 30, 2007 3:32 am, Pierre Pintaric wrote: > Jim Lucas a écrit : >> Pierre Pintaric wrote: >>> Hello there, >>> >>> I'm sure this question was ask 1,000 times, but I didn't find any >>> archive about this, that's why I need help... >>> >>> Here is my problem: >>> I receive mail file from my MTA (ie QMail), that works fine. Now, I >>> would to find a class or a function that parse the mail and gives >>> headers informations, body of the mail (even if it is a multi-part >>> mail) and file attachments. >>> I found nothing in PEAR library, nothing on the web, ... >>> >>> I don't what want to rebuild the wheel if somebody works on it and >>> made a good job... >>> If somebody uses a great function and want to share, I will please >>> him... :-) >>> >>> Thanks for your help. >>> >>> Pierre >>> >> >> google.com and ask for php web mail client >> >> This will return you many different examples of php programs that >> have >> the function/class that you are looking for. >> > > Of course, I looked for that, in PEAR, you can find Mail::IMAP and > Mail::MBox... > All this exemples connect to an IMAP server or to a MBox file, I would > only parse an email file... > > -- > 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 starving 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
RE: [PHP] time
On Mon, January 29, 2007 10:55 pm, Jay Blanchard wrote: > [snip] > I am writing a program for managing leads and contacts. I would like > to > add > the ability to see what TIME it is where the contact is not there > server > time. So if you looked at a list of contacts from all over the country > you > would see different times compared to what time it is where the user > is > at. > What should I be looking at to calculate out the different time zones. > Could > somebody just point me in the write direction at this time I have no > idea on > how to proceeded. > [/snip] > > You would use JavaScript to capture their local 'browser' time and > process it with PHP Since their computer clock is probably wrong (way wrong) this may be very problematic... Assuming contacts know what time zone they (usually) live in, you can ask them to set that in their profile. You can even pre-populate it with your best guess from their IP and one of the zillion IP to country databases floating around. Ultimately, however, you're going to have problems because there's no way you can know for sure for sure where the user is, even if they are "usually" in time zone X. It's amazing just how complicated time can be, when you start actually trying to do anything useful with it. Puns intended. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] Parsing mail file
Just leave the email in your Inbox (or whatever mailbox you want) and use this: http://php.net/imap You cna also open up a local file with that, if it's more convenient. On Tue, January 30, 2007 2:58 am, Pierre Pintaric wrote: > Hello there, > > I'm sure this question was ask 1,000 times, but I didn't find any > archive about this, that's why I need help... > > Here is my problem: > I receive mail file from my MTA (ie QMail), that works fine. Now, I > would to find a class or a function that parse the mail and gives > headers informations, body of the mail (even if it is a multi-part > mail) > and file attachments. > I found nothing in PEAR library, nothing on the web, ... > > I don't what want to rebuild the wheel if somebody works on it and > made > a good job... > If somebody uses a great function and want to share, I will please > him... :-) > > Thanks for your help. > > Pierre > > -- > 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 starving 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
Re: [PHP] return bounced email to specific email address
On Tue, January 30, 2007 9:44 am, [EMAIL PROTECTED] wrote: > is it possible to specify email address in mail() function where > bounced > email could return? > > I checked http://us2.php.net/manual/en/function.mail.php but didn't > find > anything. Some MTAs follow some standards which at one time or another allowed headers such as: Error-to: It's not 100%, but works with many MTAs. There's another header like Bounces-to: or somesuch, I think, that is in much less widespread use, but may be worth researching. This is not PHP-specific, so you may want to look more at mailing list software and how they do it than at PHP functions. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] ereg() problem
jekillen wrote: On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote: jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg("", $get_route, $m); do we need to break out of the text to include the $to variable?? The $to variable is what I use to id the tag to get the path from, it is critical. It is like answering the question 'What is Joe's address?' Joe in this example is the $to variable. testing $route I get: do you mean $get_route? No, I mean $route after I have assigned $m[1] to it; $route = $m[1]; print $route.''; jk/in' rec='a_378e6dc4.xml' /> (out put of print) Is this an example of th input? This is what the regular expression (.*) is matching in the tag. It will have a steadily increasing number of tags in the above pattern and nothing else (accept for opening and closing xml tags. What does an actual line of $get_route look like? $get_route is what was read from the XML file. It will have a steadily increasing number of tags in the above pattern and nothing else (accept for opening and closing xml tags. do a var_dump($m); and show output The problem is that the regex is missing the closing single quote and matching to the end of the tag instead of just matching what is between the parenthesis. jk is all I am looking for but is it greed that is missing the forward slash and the single quote? It seems like every time I do this I have to monkey around with it until I get what I want. I have even changed the formatting of files just so a regular expression would work without this sort of trial and error. Is there a way I can turn off greed in php's regex? I am using php v5.1.2 with Apache 1.3.34 Thanks in advance. JK or better yet, try this I am assuming on the actual structure of $get_route but the following return to me $match[1] = '../jk' $to = 'something'; $get_route = ""; preg_match("||", $get_route, $matches); var_dump($matches); O.K. thanks, $m[0] is supposed to have the whole match and $m[1...n] is supposed to contain the matches made by each set of parenthesis. Does anyone know or understand the concept of greed in regular expressions, and how to turn it off in php? That is all I am asking for. JK Sent you the source link. Try it without the 's' at the end. http://www.cmsws.com/examples/php/ereg.php http://www.cmsws.com/examples/php/ereg.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg() problem
jekillen wrote: On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote: jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg("", $get_route, $m); do we need to break out of the text to include the $to variable?? The $to variable is what I use to id the tag to get the path from, it is critical. It is like answering the question 'What is Joe's address?' Joe in this example is the $to variable. testing $route I get: do you mean $get_route? No, I mean $route after I have assigned $m[1] to it; $route = $m[1]; print $route.''; jk/in' rec='a_378e6dc4.xml' /> (out put of print) Is this an example of th input? This is what the regular expression (.*) is matching in the tag. It will have a steadily increasing number of tags in the above pattern and nothing else (accept for opening and closing xml tags. What does an actual line of $get_route look like? $get_route is what was read from the XML file. It will have a steadily increasing number of tags in the above pattern and nothing else (accept for opening and closing xml tags. do a var_dump($m); and show output The problem is that the regex is missing the closing single quote and matching to the end of the tag instead of just matching what is between the parenthesis. jk is all I am looking for but is it greed that is missing the forward slash and the single quote? It seems like every time I do this I have to monkey around with it until I get what I want. I have even changed the formatting of files just so a regular expression would work without this sort of trial and error. Is there a way I can turn off greed in php's regex? I am using php v5.1.2 with Apache 1.3.34 Thanks in advance. JK or better yet, try this I am assuming on the actual structure of $get_route but the following return to me $match[1] = '../jk' $to = 'something'; $get_route = ""; preg_match("||", $get_route, $matches); var_dump($matches); O.K. thanks, $m[0] is supposed to have the whole match and $m[1...n] is supposed to contain the matches made by each set of parenthesis. Does anyone know or understand the concept of greed in regular expressions, and how to turn it off in php? That is all I am asking for. JK Check out this working example of what I think you are asking for. http://www.cmsws.com/examples/php/ereg.phps -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't get PHP extension to Load
Check permissions on all the intermediary directories from C: down to the DLL. Check the environment PATH on the two machines -- If dev has a different PATH that leads to the DLL... Some folks advocate putting the DLLs in System or System32 or whatever... If there are any directories with SPACE in the dirname, like "Program Files", it will cause you grief sooner or later. On Tue, January 30, 2007 11:09 am, Aaron Smith wrote: > I have a Microsoft 2003 server running IIS 6.0 and PHP > 5.1.2. We have an application (Moodle) that uses a database > connection > to our MSSQL 2000 server. For whatever reason, it doesn't work > properly > with the built in php_mssql.dll so we have to use a replacement of > either FreeTDS or ODBTP. ODBTP is working on the production machine, > but is slow as molasses. I configured a test server (Everything the > same, OS, IIS, PHP) and set it up to use FreeTDS. It worked a lot > faster so I attempted to move the production machine over to FreeTDS. > It loads a PHP extension called php_dblib.dll that replaces (the same > way ODBTP does) the php_mssql.dll. The problem is that on the > production machine, even though it is the same version of everything, > it > refuses to load the php_dblib.dll. The only error it says is that the > "specified module could not be found". The DLL file is definitely in > extensions directory, and the path that the error message presents has > been triple checked to exist. The version of the DLL file is the same > between the two servers and I even went so far as to copy the > production > server's entire C:\php directory over to the test server and it STILL > worked. The only other component is a freetds.conf file that lives at > the root directory of "C:\". I checked the permissions of said file > and > they match on both servers. > > > > Anyone have an ideas on this? > > > > > > Aaron Smith[EMAIL PROTECTED] > > System Administrator (269) 337-7496 > > Kalamazoo College > > > > > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
RE: [PHP] TR: Manipulating "categories" in a php database
On Tue, January 30, 2007 12:47 pm, Tim wrote: > Oh and about the double msg, sorry fighting with outlook here, not my > usual > client ;) It's not on-topic, but go ahead and just abandon Outlook now. :-) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] Manipulating "categories" in a mysql database
On Tue, January 30, 2007 12:36 pm, Tim wrote: > This is more of a conceptional question rather then a technical one. > > I am developping an online catalog, the catalog is a standard > categorie/subcat/subsubcat system using the following logic in my > database: > > cat_id cat_name > > 10DVD > 1010 DVD/Action > 1020 DVD/Adventure > 20CD > 2010 CD/Reggae > 2020 CD/Electro > > Up to now I enter the category id's manually from an administration > console. > > I would like to be able to have my console automagically generate a > cat_id > when my users add categories (so they don't have to bother with that > aspect > of adding a category) and I would also like to be able to move a > category up > or down in the way it displays on the page, as of now I am sorting by > cat_id Rule of thumb for SQL: Never ever ever sort by *_id, because it will almost alway send up biting you in the butt sooner or later. Add a 'rank' column and maintain that in your web application. > I have been for a while trying to develop a logical scheme to be able > to > generate the id's and change their cat_id to reflect a "new" position > in how > it displays (displaying DVD/Action after DVD/Adventure for example I > would > need to change the cat_id from 1010 to something above 1020 say 1021). > This > is fine as I can test the previous elements cat_id and add or subtract > 1 but > I get stuck when I have a cat_id say 1010 that I would want to put > between > 1011 and 1012. I'm having trouble developing the algorithm that would > allow > this.. Once you separate the cat_id and the 'rank' you will have no problems. Your cat_id can just be auto_increment and never displayed to the user. Your 'rank' can be a simple integer, and to re-order you'll just do like: = $new_rank"; mysql_query($query) or error_log(mysql_error() . " $query"); $query = "update catalog set rank = $new_rank where cat_id = $cat_id"; mysql_query($query) or error_log(mysql_error() . " $query"); ?> This may create a "hole" in the rank listing, if $cat_id 7 used to be LOWER than 42. A little bit more effort can solve this, however. AFTER the above queries, tack on: if ($old_rank < $new_rank){ $query = "update catalog set rank = rank - 1 where rank > $old_rank"; mysql_query($query) or error_log(mysql_error() . " $query"); } You could go even further and change the minimum number of ranks needed in any given change, to avoid thrashing the index on the rank. This would be crucial if your table was very large. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] nested, referenced foreach & implicit current array pointer issues
speedy wrote: > Hello Jochem, > > Wednesday, January 31, 2007, 7:41:42 PM, you wrote: > >> use of 'global' is bad practice in anything that resembles a complex/real >> application. your function has no control over the what $arr is and any >> piece of >> code code change $arr into *anything* at any time. > >> instead I would suggest that your better off doing one of 2 things: > >> bad advice? I'm open to being corrected :-) > > I wondered privately if anyone would give that very useful advice. O:) > It is similar to what I told a colleague who wrote the code which > triggered the bug. :) lol :-) (side-note: I was kinda sympathetic to what he did - he > was cutting corners in a relatively small, stand-alone project :p) besides that, it's annoying to run into weird behaviour when you (he) has been consiencious with regard to what was being coded. ce la vie. > > Be what may be, the hard-to-debug side-effect stands as weak point > of PHP design no less. I'll take you word on in :-) like I said I got a bit lost in your explaination - if nothing else it teaches me to pay even closer attention whenever I use references. AFAIK, as far as scalars in php are concerned, references don't buy you anything in terms of performance if your *not* intending on changing the copied variable because of the 'copy-on-change' strategy php uses internally. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nested, referenced foreach & implicit current array pointer issues
Roman Neuhauser wrote: > # [EMAIL PROTECTED] / 2007-01-31 19:41:42 +0100: >> instead I would suggest that your better off doing one of 2 things: >> >> 1. pass in the array to the function explicitly. >> 2. use a special function that can be called to retrieve the array >> from within your example function. >> >> bad advice? I'm open to being corrected :-) > > 2. is only marginally better than "global". if you use a function you can make sure it's output is consistent and you have a single point of control. personally I consider that some what more than a marginal gain. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What search algorithm does in_array() use?
On Tue, January 30, 2007 2:30 pm, Ken Dozier wrote: > Thanks to all for your input, guys. > > Regarding the construction of the SQL query, I would love to try it > with > SUBSELECTs; but, alas, we are using RHEL 3 which ships with MySQL > 3.23. I > don't think RH supports any 4.0 or later versions of MySQL on RHEL 3, > so I'm > stuck with 3.23 for the time being. I had tried a query like this: > > SELECT d.account FROM data AS d, accesslist AS a WHERE > d.account=a.account > AND a.username='username' > > but it also took quite a bit of time. Since the problem would appear > for > only a few users, I may have to simply hard code a workaround for the > time > being and then come back to it later. You should DEFINITELY look into the EXPLAIN statement to find out what MySQL isn't using any indices on that query... You *do* have indices on your tables, right?... It should not be a slow query at all, I don't think. In the short term, getting the a.account WHERE a.username='username' should be a VERY fast query, and then you don't really care what d.account is, because it is equal to a.account in your JOIN. So you're probably over-simplified whatever you are trying to do to the point where we can't help you... But the SQL question should be on an SQL list anyway, so that's just as well. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] Socket problem plz read.
On Wed, January 31, 2007 9:39 am, Németh Zoltán wrote: > On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote: >> I'm making a simple socket server that just receive some data, and >> then >> send some data back again to the client. >> >> EDIT: >> I forgot to tell that i need help! >> >> I have search around for hours now, and the examples are always not >> what >> I needed :( >> >> the program is written in Python, if that helps, and is something >> like this > > this is PHP list. go to Python list with that, I suggest I believe the OP is asking how to write the PHP to RECEIVE that data from the Python script. Or, possibly, how to implement that same code in PHP. http://php.net/sockets is still my best answer... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] PHP equivalent to Perl $0
On Wed, January 31, 2007 6:42 pm, Mark Charette wrote: > Richard Luckhurst wrote: >> Hi Richard, >> >> >> RL> And, frankly, why would you want to do that? It only sows >> confusion >> RL> in ps output. :-) > > Unless you're talking about apps spawned by inetd and its cousins. ps > shows the name as specified in arguments in the inetd.conf file, not > the > name of the executable, which often prefixed by "in." , to indicate > it's > supposed to be spawned by inetd. Well, yes, but you probably aren't going to be spawning a PHP script with inetd... Or, maybe you are... That might be one way to achieve what the OP wanted. :-) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] Socket problem
On Tue, January 30, 2007 2:31 pm, Scripter47 wrote: > I'm making a simple socket server that just receive some data, and > then > send some data back again to the client. > > it is a program that send data by sockets, (not port 80) > > It has to a simple solution :) > > plz ask for more infomation. http://php.net/sockets Most people who go this route usually end up having trouble with the 2-way communication on a single socket. You may want to open up 2 sockets, one for input, one for output, and save yourself the headaches. YMMV -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] XML error in browser
Take out the @ symbol. Better to have error output to confuse the XML parser but lead you where you need to go, than to have NO OUTPUT which is what is confusing you *and* the XML parser. On Tue, January 30, 2007 2:34 pm, Skip Evans wrote: > Hey all, > > I have getting the following error page in the > browser when trying to redirect to an iTunes XML > file to open the player. > > === > Cannot view XML input using style sheet. > Please correct the error and then click the > Refreshbutton, or > try again later. > -- > > XML document must have a top level element. Error > processing resource ' > http://www.fiql.com/~podlist/get_podlist.php?id=27'. > === > > And here is the code: > > header('Content-Type: text/xml; charset=UTF-8'); > > require_once "db_connect.php"; > require_once "db_manage.php"; > > // SEE skip evans -- 1/29/07 -- check if superfeed > XML file is due to be rebuilt. > // if so, rebuild the file and pass the new file > on to iTumes. > > Check_XML_file($id); > > @readfile("itpc://www.fiql.com/~podlist/superfeeds/superfeed$id.xml"); > > === > > No style sheet gets read in, and there is no echo > or print statements outputting anything to the > browser until the readfile() call. > > Any suggestions would be greatly appreciated. By > the way, I used the post at the bottom of this > forum for the hint on using readfile(). > > http://www.pmachine.com/forums/viewthread/37591/ > > -- > Skip Evans > Big Sky Penguin, LLC > 61 W Broadway > Butte, Montana 59701 > 406-782-2240 > http://bigskypenguin.com > =-=-=-=-=-=-=-=-=-= > Check out PHPenguin, a lightweight and > versatile PHP/MySQL development framework. > http://phpenguin.bigskypenguin.com/ > > -- > 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 starving 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
Re: [PHP] Select record by ID
On Tue, January 30, 2007 7:23 pm, Craige Leeder wrote: >> atleast this part: $user_id = mysql_real_escape_string((int) >> $_GET['user_id']); > > I'm not sure who put this in there, but you don't need to use > mysql_real_escape_string() on that value if you're type casting it. If > you are forcing it to be an integer, there is nothing to escape. > Integers are perfectly fine to be put into a query as they are. Can you guarantee that in every character encoding, past, present, and future?... Before you answer, keep in mind that the '-' sign is part of an (int). I'm not claiming that there is any real danger -- only that there is the theoretical possibility, and skimping on a mysql_real_escape_string() call is not the right thing to do. Actually, all I really wanted to do with that was to be sure that the OP did *something* to learn more about the security issues of user input and SQL injection attacks... Didn't expect it to engender this much discussion, but there it is. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] Select record by ID
On Tue, January 30, 2007 4:14 pm, nitrox . wrote: > Richard, ive included your suggested code and now my php script is > working > properly. But I dont want to be a php copy/paste newb who has no clue > of how > things are working. If its not too much would you (or anybody) give a > brief > explanation of what this code is doing? Or are there any tutorials > online > that I can read that will educate me on this? Thanks again to all for > your > replies. Ive saved them all for future reference. > > atleast this part: $user_id = mysql_real_escape_string((int) > $_GET['user_id']); $_GET is an array which has all the values from the URL. For example, this URL: http://example.com/yourscript.php?user_id=42 would cause PHP to pre-build this for you: $_GET['user_id'] = 42; If you didn't care about SECURITY, you could just do: $user_id = $_GET['user_id']; and go on your merry way. All the rest of the stuff is about SECURITY. Bad Guys know that you are probably using that user_id in an SQL query, and will do mean things like: http://example.com/yourscript.php?user_id=NULL http://example.com/yourscript.php?user_id= http://example.com/yourscript.php?user_id[]= http://example.com/yourscript.php?user_id=1 http://example.com/yourscript.php?user_id=reallylongstringtocauseabufferoverflowfollowedbynastyexecutablecode http://example.com/yourscript.php?user_id=42 OR user_id IN (update mysql.users set password = password('password') where user = 'root') . . . in attempts to break into your website/webserver or otherwise wreak havoc. I did not URL encode the value in that last URL for demonstrative purposes. Plus most browsers fix that for you these days anyway. And I don't know if any SQL engine would actually *DO* that, but it's sort of the idea of much more complicated things that could work. So, to tear apart the rest. (int) in PHP will type-cast a value to an integer. This means that if you do: $user_id = (int) $_GET['user_id']; you are immediately protected from most of the hacks above, since you are forcing the $user_id variable to contain an INTEGER, such as 42, 0, 27, or -14. You have thrown out the possibility that they are going to splice in some nasty text SQL. It's not perfect, as they could still perhaps manage to pretend to be user #5 instead of user #42, if your script was silly enough to implicitly trust GET input data. The mysql_real_escape_string() part is a function provided by MySQL which will make sure that the value you are providing is properly escaped. It is a more mature solution to what http://php.net/addslashes and Magic Quotes were trying to solve. Specifically, suppose your user_id in the database was NOT a number, but was just people's names: 'Richard Lynch' 'Nitrox' 'Kevin O'Brien' Ooops. Look at that last name. The ' in O'Brien is going to confuse the ' that MySQL uses to delimit a string. mysql_real_escape_string() takes the 'Kevin O'Brien' and converts it to 'Kevin O\'Brien' so that when the MySQL SQL parser reads it, it *knows* that the \' in O'Brien is part of the name. That way, MySQL can store the right thing down in the guts of its storage: Kevin O'Brien Calling mysql_real_escape_string() on an integer is probably a bit of overkill -- There is NO WAY for anything other than [0-9-] to be in the result of the (int) typecast. However, recent attacks have been using very funky features of Unicode character sets, for languages other than English, so that what looks like a perfectly normal valid input in English turns into something realy nasty (in computer science terms, not linguistics). I don't *think* there are any character sets for which 0-9 and - are anything other than 0-9 and -, but I'd rather be safe than sorry. To understand more about why I added all this stuff, start reading here: http://phpsec.org and keep reading that site until it's second nature. > die ("Could not perform query $query: ".mysql_error()."\n"); This is a Bad Thing to do on most newbie servers where php.ini has: display_errors = On because it will expose your exact query and all kinds of mysql stuff to the Bad Guys, which just makes it easier for them to attack. You should explore setting up your server with php.ini or .htaccess so that you have display_errors OFF and log_errors ON, and then you can use trigger_error("Could not perform query $query: " . mysql_error(), E_USER_ERROR); or something similar to that. A simpler short-term option would be to replace die("...") with: die("An error has occured." . error_log("Could not perform query $query: " . mysql_error()); I'm not sure what error_log returns, but it probably won't be particularly useful, nor dangerous to expose to the Bad Guys. The Bad News is that you should count on spending about 3 X as much time thinking about Security to write your application as you would have spent if everybody in the world was Good People. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some sta
Re: [PHP] PHP equivalent to Perl $0
Richard Luckhurst wrote: Hi Richard, RL> And, frankly, why would you want to do that? It only sows confusion RL> in ps output. :-) Unless you're talking about apps spawned by inetd and its cousins. ps shows the name as specified in arguments in the inetd.conf file, not the name of the executable, which often prefixed by "in." , to indicate it's supposed to be spawned by inetd. It seems to me that whoever wrote the specification had this thing about ps showing a nice string instead of the program name actually running. Of course I know that this is what ps is supposed to do and Perl allows you to tell nice lies to ps :-) As does C, C++, and a host of other languages. PHP does not - even though there's no error when you stuff a CLI php's $argv[0] with a different name: #!/usr/local/bin/php ./qq.php & ps 20232 pts/000:00:00 qq.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg() problem
On Tue, January 30, 2007 8:36 pm, jekillen wrote: > I am having trouble with ereg(). > The following is the problem code > $x = ereg("", $get_route, > $m); > testing $route I get: > $route = $m[1]; > print $route.''; > jk/in' rec='a_378e6dc4.xml' /> (out put of print) > jk is all I am looking for but > is it greed that is missing the > forward slash and the single quote? No, it's that you put the parens () around only the .* and not around what you wanted: ereg("", ... > It seems like every time I do this I have to monkey around > with it until I get what I want. Join the club. :-) You may want to consider a couple actions: Switch to PCRE http://php.net/pcre It's better documented, less confusing, faster, and just better all around. Download and play around with "The Regex Coach" which provides a visual feedback on what happens when you change the #$^%& inside your pattern. > I have even changed the > formatting of files just so a regular expression would > work without this sort of trial and error. > Is there a way I can turn off greed in php's regex? I haven't used ereg in so long, I can't answer this for ereg. In PCRE, you use tack on 'U' after your end patter delimiter. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re[2]: [PHP] PHP equivalent to Perl $0
Hi Richard, RL> And, frankly, why would you want to do that? It only sows confusion RL> in ps output. :-) I happen to agree with you. Why would you want to do it. The reason it is being done in this application is to keep a specification for he application happy. When the php program is executing and you do a ps you see /usr/local/bin/php -q listener.php which is perfectly fine by me :-) What happens with the Perl application beacuse of stuffing the string back into the $0 is that you see Listener is accepting connections on Port 15556 It seems to me that whoever wrote the specification had this thing about ps showing a nice string instead of the program name actually running. Of course I know that this is what ps is supposed to do and Perl allows you to tell nice lies to ps :-) Regards, Richard Luckhurst Product Development Exodus Systems - Sydney, Australia. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP equivalent to Perl $0
On Wed, January 31, 2007 5:59 pm, Richard Luckhurst wrote: > In Perl there is the predefined $0 which contains the name of the file > containing the Perl script being executed. Is there an equivalent in > PHP? $_SERVER['PHP_SELF'] > I am working on converting a Listener script from Perl to PHP and at > one point > when the script forks it has a line > > $0 = "Listener is accepting connections on Port $port"; > > When this Perl script is running and I do a ps I see a process ID with > the > program being > > Listener is accepting connections on Port $port > > instead of the actual name of the Perl script. > > Is such a thing possible in PHP? If so how? I have been Google > searching for a > while and can not see one way or the other if it is possible. I have no idea if you can cram some whack value into that and then ps would show that instead of the path... I doubt it. And, frankly, why would you want to do that? It only sows confusion in ps output. :-) Unless the whole rest of the application is relying on this sugar candy feature (scary idea) I'd say just skip that line. If PHP does have such a feature, it would probably be grouped with the functions here: http://php.net/manual/en/ref.info.php I'm not seeing anything there. You might be able to hack something with http://php.net/exec and the http://php.net/getmypid to do whatever it is that Perl does when you assign a value to $0 (shudder). -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving 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
Re: [PHP] ereg() problem
On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote: jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg("", $get_route, $m); do we need to break out of the text to include the $to variable?? The $to variable is what I use to id the tag to get the path from, it is critical. It is like answering the question 'What is Joe's address?' Joe in this example is the $to variable. testing $route I get: do you mean $get_route? No, I mean $route after I have assigned $m[1] to it; $route = $m[1]; print $route.''; jk/in' rec='a_378e6dc4.xml' /> (out put of print) Is this an example of th input? This is what the regular expression (.*) is matching in the tag. It will have a steadily increasing number of tags in the above pattern and nothing else (accept for opening and closing xml tags. What does an actual line of $get_route look like? $get_route is what was read from the XML file. It will have a steadily increasing number of tags in the above pattern and nothing else (accept for opening and closing xml tags. do a var_dump($m); and show output The problem is that the regex is missing the closing single quote and matching to the end of the tag instead of just matching what is between the parenthesis. jk is all I am looking for but is it greed that is missing the forward slash and the single quote? It seems like every time I do this I have to monkey around with it until I get what I want. I have even changed the formatting of files just so a regular expression would work without this sort of trial and error. Is there a way I can turn off greed in php's regex? I am using php v5.1.2 with Apache 1.3.34 Thanks in advance. JK or better yet, try this I am assuming on the actual structure of $get_route but the following return to me $match[1] = '../jk' $to = 'something'; $get_route = ""; preg_match("||", $get_route, $matches); var_dump($matches); O.K. thanks, $m[0] is supposed to have the whole match and $m[1...n] is supposed to contain the matches made by each set of parenthesis. Does anyone know or understand the concept of greed in regular expressions, and how to turn it off in php? That is all I am asking for. JK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP equivalent to Perl $0
Jay Blanchard wrote: [snip] In Perl there is the predefined $0 which contains the name of the file containing the Perl script being executed. Is there an equivalent in PHP? [/snip] $_SERVER['PHP_SELF'] Or if you're using it from the command line, $argv[0] -- 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 equivalent to Perl $0
On 1/31/07, Richard Luckhurst <[EMAIL PROTECTED]> wrote: Hi In Perl there is the predefined $0 which contains the name of the file containing the Perl script being executed. Is there an equivalent in PHP? I am working on converting a Listener script from Perl to PHP and at one point when the script forks it has a line $0 = "Listener is accepting connections on Port $port"; When this Perl script is running and I do a ps I see a process ID with the program being Listener is accepting connections on Port $port instead of the actual name of the Perl script. Is such a thing possible in PHP? If so how? I have been Google searching for a while and can not see one way or the other if it is possible. Regards, Richard Luckhurst Product Development Exodus Systems - Sydney, Australia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __FILE__ contains the full path and filename of the file on the filesystem. There are several $_SERVER indices that give something you can get the filename/path from as well. See http://us2.php.net/manual/en/reserved.variables.php -- Kevin Jordan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP equivalent to Perl $0
[snip] In Perl there is the predefined $0 which contains the name of the file containing the Perl script being executed. Is there an equivalent in PHP? [/snip] $_SERVER['PHP_SELF'] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP equivalent to Perl $0
Hi In Perl there is the predefined $0 which contains the name of the file containing the Perl script being executed. Is there an equivalent in PHP? I am working on converting a Listener script from Perl to PHP and at one point when the script forks it has a line $0 = "Listener is accepting connections on Port $port"; When this Perl script is running and I do a ps I see a process ID with the program being Listener is accepting connections on Port $port instead of the actual name of the Perl script. Is such a thing possible in PHP? If so how? I have been Google searching for a while and can not see one way or the other if it is possible. Regards, Richard Luckhurst Product Development Exodus Systems - Sydney, Australia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Need desperate help with query
On Wed, 31 Jan 2007 17:49:20 +0100, Tim wrote: > >> -Message d'origine- >> De : Skip Evans [mailto:[EMAIL PROTECTED] >> Envoyé : mercredi 31 janvier 2007 17:26 >> À : PHP-General >> Objet : [PHP] Need desperate help with query >> >> Okay, so SQL questions shouldn't come to the list, > > You are aware of that too eh? > So why mail here? The OP said he was seeking "desperate help". What better place? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Programacion orientada a objetos
Try to google for "orientada a objetos en PHP con MySql" :) Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free -Original Message- From: Jairo Torres [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 10:05 PM To: php-general@lists.php.net Subject: [PHP] Programacion orientada a objetos Señores buenas tardes. Tienen un buen ejemplo o manual para programación orientada a objetos en PHP con MySql. Muchas gracias. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Programacion orientada a objetos
[snip] Tienen un buen ejemplo o manual para programación orientada a objetos en PHP con MySql. [/snip] Hay varios buenos libros y clases particulares. Búsqueda Google. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programacion orientada a objetos
HI Jairo! This is a list only in english. Please, check other list in spanish. Esta es una lista en inglés. Por favor, verificá otras listas en español. JP On 1/31/07, Jairo Torres <[EMAIL PROTECTED]> wrote: Señores buenas tardes. Tienen un buen ejemplo o manual para programación orientada a objetos en PHP con MySql. Muchas gracias. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Programacion orientada a objetos
Señores buenas tardes. Tienen un buen ejemplo o manual para programación orientada a objetos en PHP con MySql. Muchas gracias.
RE: [PHP] Need desperate help with query
SELECT COUNT(*) AS thecount FROM table1 LEFT JOIN tabel2 ON (table1.col1 = table2.col2) GROUP BY table1.col3 ORDER BY thecount; It might give you some hints... Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free -Original Message- From: Skip Evans [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 6:26 PM To: PHP-General Subject: [PHP] Need desperate help with query Okay, so SQL questions shouldn't come to the list, but I am in dire need of some assistance that uses a LEFT JOIN and must also get a count of records in the RIGHT table, plus group by that count and order by it. If anyone can help out with this and would be willing to email me off list to take a look at it the good karma and appreciation would rain down upon you in such multitudes as to... as to... as... to... I've run out of hyperbole. Help! -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL development framework. http://phpenguin.bigskypenguin.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] nested, referenced foreach & implicit current array pointer issues
Hello Jochem, Wednesday, January 31, 2007, 7:41:42 PM, you wrote: > use of 'global' is bad practice in anything that resembles a complex/real > application. your function has no control over the what $arr is and any piece > of > code code change $arr into *anything* at any time. > instead I would suggest that your better off doing one of 2 things: > bad advice? I'm open to being corrected :-) I wondered privately if anyone would give that very useful advice. O:) It is similar to what I told a colleague who wrote the code which triggered the bug. :) (side-note: I was kinda sympathetic to what he did - he was cutting corners in a relatively small, stand-alone project :p) Be what may be, the hard-to-debug side-effect stands as weak point of PHP design no less. -- Best regards, speedymailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nested, referenced foreach & implicit current array pointer issues
# [EMAIL PROTECTED] / 2007-01-31 19:41:42 +0100: > instead I would suggest that your better off doing one of 2 things: > > 1. pass in the array to the function explicitly. > 2. use a special function that can be called to retrieve the array > from within your example function. > > bad advice? I'm open to being corrected :-) 2. is only marginally better than "global". -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SOLVED] [PHP] return bounced email to specific email address
> [EMAIL PROTECTED] wrote: >> hi, >> is it possible to specify email address in mail() function where bounced >> email could return? >> >> I checked http://us2.php.net/manual/en/function.mail.php but didn't find >> anything. > > That's the right place. It's the 5th parameter you want to change. > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > yesterday somebody posted really good explanation about this :) Thanks. -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nested, referenced foreach & implicit current array pointer issues
speedy wrote: > Hello Martin, > > Wednesday, January 31, 2007, 4:50:22 PM, you wrote: > >> There is nothing wrong with the global keyword, just use $GLOBAL >> ['arr'] instead to avoid the reference, or create a copy by >> assignment. > > Yep, already did, 10x for the suggestion. :) > >> Anyway, I couldn't find this change of behaviour in the foreach in >> the changelog, but it seems it have been introduced around may >> 2005. Maybe is too late to complain, but, now that I know, I think >> this behaviour doesn't seem right. > > I'd rather see global being equal to $GLOBAL[] in combination with removal > of hidden current pointer from arrays. But I don't have much experience in > designing high-level languages nor did I give a lot of thought about it in > the > global picture. :) regardless of whether your right or wrong from a theoretical/language POV (I didn't really understand your explaination completely - which is probably my lack of insight ;-) I would proffer the following: use of 'global' is bad practice in anything that resembles a complex/real application. your function has no control over the what $arr is and any piece of code code change $arr into *anything* at any time. instead I would suggest that your better off doing one of 2 things: 1. pass in the array to the function explicitly. 2. use a special function that can be called to retrieve the array from within your example function. bad advice? I'm open to being corrected :-) > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Socket problem plz read.
Stut skrev: Németh Zoltán wrote: On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote: I'm making a simple socket server that just receive some data, and then send some data back again to the client. EDIT: I forgot to tell that i need help! I have search around for hours now, and the examples are always not what I needed :( the program is written in Python, if that helps, and is something like this this is PHP list. go to Python list with that, I suggest greets Zoltán Németh The script the OP is connecting to is a PHP script, so assuming it's that script that the OP is having problems with it's kinda relevant. To the OP: Your Python script is wrong. The host should just be localhost. You are trying to mix HTTP and UDP, and it's never going to work. For the PHP side, read the manual (http://php.net/socket_create), have a go and come back if/when you have problems. But before you do that, make sure the Python side is right, for which you'll need a Python mailing list. -Stut # Set the socket parameters host = "http://localhost/in/sql.php"; port = 1 buf = 1 addr = (host,port) # Create socket UDPSock = socket(AF_INET, SOCK_DGRAM) # Send messages: # Loop while (1): # userinput data = raw_input('>> ') if not data: break else: # Send to the PHP page if(UDPSock.sendto(data,addr)): print "Sending message '",data,"'." # Close socket UDPSock.close() it is a program that send data by sockets, (not port 80) It has to a simple solution :) plz ask for more information. -- _.____ __ / _/ ___|__|__/ |_ ___ / | \__ \ \_ \_/ ___\_ __ \ \ \ __\/ __ \_ __ \/ | |_ // /\ \___| | \/ | |_> > | \ ___/| | \/^ / // /___ /\___ >__| |__| __/|__| \___ >__| \ | // \/ \/ |__| \/ |__| OKay. thanks I didn't knew that you couldn't mix http and UDP :D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need desperate help with query
> -Message d'origine- > De : Skip Evans [mailto:[EMAIL PROTECTED] > Envoyé : mercredi 31 janvier 2007 17:26 > À : PHP-General > Objet : [PHP] Need desperate help with query > > Okay, so SQL questions shouldn't come to the list, You are aware of that too eh? So why mail here? > but I am in dire need of some assistance that uses > a LEFT JOIN and must also get a count of records > in the RIGHT table, plus group by that count and > order by it. Not all PHP developpers use MySQL, am sure you would get a much better answer on a MySQL list? > If anyone can help out with this and would be > willing to email me off list to take a look at it > the good karma and appreciation would rain down > upon you in such multitudes as to... as to... > as... to... Don't think most here do it for the praise...> I've run out of hyperbole. > > Help! Indeed :P Regards, Tim > -- > Skip Evans > Big Sky Penguin, LLC > 61 W Broadway > Butte, Montana 59701 > 406-782-2240 > http://bigskypenguin.com > =-=-=-=-=-=-=-=-=-= > Check out PHPenguin, a lightweight and > versatile PHP/MySQL development framework. > http://phpenguin.bigskypenguin.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] nested, referenced foreach & implicit current array pointer issues
Hello Martin, Wednesday, January 31, 2007, 4:50:22 PM, you wrote: > There is nothing wrong with the global keyword, just use $GLOBAL > ['arr'] instead to avoid the reference, or create a copy by > assignment. Yep, already did, 10x for the suggestion. :) > Anyway, I couldn't find this change of behaviour in the foreach in > the changelog, but it seems it have been introduced around may > 2005. Maybe is too late to complain, but, now that I know, I think > this behaviour doesn't seem right. I'd rather see global being equal to $GLOBAL[] in combination with removal of hidden current pointer from arrays. But I don't have much experience in designing high-level languages nor did I give a lot of thought about it in the global picture. :) -- Best regards, speedymailto:[EMAIL PROTECTED]
[PHP] Need desperate help with query
Okay, so SQL questions shouldn't come to the list, but I am in dire need of some assistance that uses a LEFT JOIN and must also get a count of records in the RIGHT table, plus group by that count and order by it. If anyone can help out with this and would be willing to email me off list to take a look at it the good karma and appreciation would rain down upon you in such multitudes as to... as to... as... to... I've run out of hyperbole. Help! -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL development framework. http://phpenguin.bigskypenguin.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg() problem
jekillen wrote: Hello php list; I am having trouble with ereg(). The following is the problem code $x = ereg("", $get_route, $m); do we need to break out of the text to include the $to variable?? testing $route I get: do you mean $get_route? $route = $m[1]; print $route.''; jk/in' rec='a_378e6dc4.xml' /> (out put of print) Is this an example of th input? What does an actual line of $get_route look like? do a var_dump($m); and show output jk is all I am looking for but is it greed that is missing the forward slash and the single quote? It seems like every time I do this I have to monkey around with it until I get what I want. I have even changed the formatting of files just so a regular expression would work without this sort of trial and error. Is there a way I can turn off greed in php's regex? I am using php v5.1.2 with Apache 1.3.34 Thanks in advance. JK or better yet, try this I am assuming on the actual structure of $get_route but the following return to me $match[1] = '../jk' $to = 'something'; $get_route = ""; preg_match("||", $get_route, $matches); var_dump($matches); -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] nested, referenced foreach & implicit current array pointer issues
2007/1/30, speedy <[EMAIL PROTECTED]>: Hello Martin, > Tuesday, January 30, 2007, 8:45:50 PM, you wrote: > > function f() > { >global $arr; > >foreach($arr as $k=>$v) { >$v->do_something(); >} > } > > I don't see your point anywhere... foreach iterates over a copy of > the array so where is the potential side-effect? Even so there will > be references if the items of the original array are references, or > if they are objects in PHP5, but that's expected behaviour. That's > the way many OOP languages have been implemented (eg: Java) without > coders having the problems you mention. Just give me one good > reason to even consider your proposal. Humm, you seem to have misunderstood (& that could be one reason in itself). In my example foreach() iterates over the original $arr array (contrary to what you say) - and so may deeply nested fns in the called do_something() method, making global + foreach construct unuseable/"unstable" in non-trivial cases. Damn, I hate localized documentation. The spanish manual isn't updated to what foreach does in the latest PHP5, and I didn't bother to check the english version. Foreach uses a copy only if the array is not a reference, and that's why you have that problem. There is nothing wrong with the global keyword, just use $GLOBAL['arr'] instead to avoid the reference, or create a copy by assignment. Anyway, I couldn't find this change of behaviour in the foreach in the changelog, but it seems it have been introduced around may 2005. Maybe is too late to complain, but, now that I know, I think this behaviour doesn't seem right.
Re: [PHP] Socket problem plz read.
Németh Zoltán wrote: On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote: I'm making a simple socket server that just receive some data, and then send some data back again to the client. EDIT: I forgot to tell that i need help! I have search around for hours now, and the examples are always not what I needed :( the program is written in Python, if that helps, and is something like this this is PHP list. go to Python list with that, I suggest greets Zoltán Németh The script the OP is connecting to is a PHP script, so assuming it's that script that the OP is having problems with it's kinda relevant. To the OP: Your Python script is wrong. The host should just be localhost. You are trying to mix HTTP and UDP, and it's never going to work. For the PHP side, read the manual (http://php.net/socket_create), have a go and come back if/when you have problems. But before you do that, make sure the Python side is right, for which you'll need a Python mailing list. -Stut # Set the socket parameters host = "http://localhost/in/sql.php"; port = 1 buf = 1 addr = (host,port) # Create socket UDPSock = socket(AF_INET, SOCK_DGRAM) # Send messages: # Loop while (1): # userinput data = raw_input('>> ') if not data: break else: # Send to the PHP page if(UDPSock.sendto(data,addr)): print "Sending message '",data,"'." # Close socket UDPSock.close() it is a program that send data by sockets, (not port 80) It has to a simple solution :) plz ask for more information. -- _.____ __ / _/ ___|__|__/ |_ ___ / | \__ \ \_ \_/ ___\_ __ \ \ \ __\/ __ \_ __ \/ | |_ // /\ \___| | \/ | |_> > | \ ___/| | \/^ / // /___ /\___ >__| |__| __/|__| \___ >__| \ | // \/ \/ |__| \/ |__| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Socket problem plz read.
On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote: > I'm making a simple socket server that just receive some data, and then > send some data back again to the client. > > EDIT: > I forgot to tell that i need help! > > I have search around for hours now, and the examples are always not what > I needed :( > > the program is written in Python, if that helps, and is something like this this is PHP list. go to Python list with that, I suggest greets Zoltán Németh > > # Set the socket parameters > host = "http://localhost/in/sql.php"; > port = 1 > buf = 1 > addr = (host,port) > > # Create socket > UDPSock = socket(AF_INET, SOCK_DGRAM) > > # Send messages: > > # Loop > while (1): > # userinput > data = raw_input('>> ') > if not data: > break > else: > # Send to the PHP page > if(UDPSock.sendto(data,addr)): > print "Sending message '",data,"'." > > # Close socket > UDPSock.close() > > > it is a program that send data by sockets, (not port 80) > > It has to a simple solution :) > > plz ask for more information. > > > > > -- >_.____ __ > / _/ ___|__|__/ |_ ___ / | \__ \ > \_ \_/ ___\_ __ \ \ \ __\/ __ \_ __ \/ | |_ // > /\ \___| | \/ | |_> > | \ ___/| | \/^ / // > /___ /\___ >__| |__| __/|__| \___ >__| \ | // > \/ \/ |__| \/ |__| > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Socket problem plz read.
I'm making a simple socket server that just receive some data, and then send some data back again to the client. EDIT: I forgot to tell that i need help! I have search around for hours now, and the examples are always not what I needed :( the program is written in Python, if that helps, and is something like this # Set the socket parameters host = "http://localhost/in/sql.php"; port = 1 buf = 1 addr = (host,port) # Create socket UDPSock = socket(AF_INET, SOCK_DGRAM) # Send messages: # Loop while (1): # userinput data = raw_input('>> ') if not data: break else: # Send to the PHP page if(UDPSock.sendto(data,addr)): print "Sending message '",data,"'." # Close socket UDPSock.close() it is a program that send data by sockets, (not port 80) It has to a simple solution :) plz ask for more information. -- _.____ __ / _/ ___|__|__/ |_ ___ / | \__ \ \_ \_/ ___\_ __ \ \ \ __\/ __ \_ __ \/ | |_ // /\ \___| | \/ | |_> > | \ ___/| | \/^ / // /___ /\___ >__| |__| __/|__| \___ >__| \ | // \/ \/ |__| \/ |__| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Suggestions of GPL plugin-system?
Thanks everyone for the useful input. I've looked around a bit using the various links and info that I got. The Gallery2 documentation on the modules is far from transparent to me, and the idea of having a general module class that needs to get extended by the module doesn't appeal to me either. I really like the Drupal system with it's "hooks" and I like the idea of having my project communicate with various modules through these hooks. The whole system with the API is kinda big though, and right now I don't plan to give modules control over my menu or anything. So I guess, inspired by the Drupal system, I'm going to create a much smaller system that I will implement myself... Thanks again! Ivo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need sql-editor
Hello everyone I need a good sql-editor where I can write sqlcode. The problem is that I don't have rights to list tables, functions and so on. Now I use EMS Sql Manger 2005, and if I want to write and execute sqlcode I need access to the system tables, and I don't have it on this database. So, I need a sqlmanger that I cant write and execute sqlcode and don't have the access, and where a can view the result nicely. Hope you understand, my English isn't on top :-) // Niklas
RE: [PHP]SOLVED convert date to reversed date
Thx All -Oorspronkelijk bericht- Van: Jim Lucas [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 30 januari 2007 16:52 Aan: Jim Lucas CC: Arpad Ray; [EMAIL PROTECTED]; php-general@lists.php.net Onderwerp: Re: [PHP] convert date to reversed date Jim Lucas wrote: > Arpad Ray wrote: >> $filename = implode(array_reverse(explode('/', $value))); I should have checked before I wrote. It does work, but through me off, didn't realize that the first arg was optional. Sorry > I think you ment > > $filename = implode('', array_reverse(explode('/', $value))); > >> >> Arpad >> >> Reinhart Viane wrote: >>> Is this a good way to convert 01/02/2007 to 20070201 >>> >>> >>> >>> $value='01/02/2007'; >>> >>> list($day, $month, $year) = split('[/.-]', $value); >>> >>> $filename=$year.''.$month.''.$day; >>> >>> >>> >>> It does work but i would like to verify if there are no better, more >>> logical >>> ways to do this. >>> >>> Thanks in advance >>> >>> >>> >> > > -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- 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] Parsing mail file [RESOLVED]
Finally, after a long course about the fishing philosophy :-) A private discussion with Jon give me a very good way to find a solution. I would to share it with guys who need it : PECL mailparse package: http://pecl.php.net/package/mailparse It parses mail files with attachments (rfc822 and rfc2045 compliant messages). Good luck Mauro Lorenzutti a écrit : Hi Pierre, I have the same problem: I'm searching a function to parse an email file. I found this one: http://pear.php.net/package/Net_IMAP/ I think that you can extract the code you need from the function getParsedHeaders. Regards, Mauro Lorenzutti e-mail: [EMAIL PROTECTED] - WEBFORMAT srl | Corte Europa, 12 | I-33097 SPILIMBERGO PN Tel +39-0427-926.389 -- Fax +39-0427-927.653 [EMAIL PROTECTED] -- www.webformat.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help wtih a query?
- Original Message - From: "Jon Anderson" <[EMAIL PROTECTED]> To: "Skip Evans" <[EMAIL PROTECTED]> Cc: "PHP-General" Sent: Tuesday, January 30, 2007 11:46 PM Subject: Re: [PHP] Help wtih a query? Wrong list. Putting "$sql=..." in there doesn't make it a PHP question. ;-) Skip Evans wrote: Is that what the left/right joins do??? Yea. LEFT JOIN will give you NULL entries in the left joined table, so you'd just have to say WHERE ISNULL(.that table>). Of course, you'll need to do the right JOINs in there for that to work. Personally, I think that implicit joins are sloppy, so I would suggest using JOIN with ON or USING...but I suppose that's a preference thing, and some (all?) might disagree with me. SQL engines have many techniques to improve the performance of the queries, with dozens of scholarly papers backing each slight improvement. The more the SQL engine knows about your intentions, the better chances it has to apply the best techniques to improve the performance of your query. For a particular engine, only a subset of all these tricks might be implemented so little might be gained from writing queries this way instead of that way and this might change with each version but it still holds that the chances for better performance improve if you make it clear what you want, eventually. Satyam jon -- 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