Re: [PHP] XML Parser misbehaves with &
This is normal. You have illegal XML there, as it should be in . I have run across this, and have to clean it up with an awk script. Ampersand is a no-no. Just running xmllint on the file will tell you about the problem(s). _justin Jeff Bearer wrote: > > I've come across this frustrating behavior with the XML parser when it > reads an escaped ampersand (&) > > If the xml being evaluated is: Blue, Green & Red > > it calls the character data handler 3 times: > the first time the $data is "Blue, Green " > the second time is "&" > and the third time is " Red" > > Needless to say this is screwing up my parser, and the stuff I'm doing > won't make it easy to add this allowance. I'm hoping somebody can point > out a way to turn off this behavior. If this is the proper operation, > is it documented anywhere? I've been unable to find it. > > -- > Jeff Bearer, RHCE > Webmaster, PittsburghLIVE.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing a file (fopen) and replacing text...
Quiller wrote: You can certainly do this with regular expressions, rewriting your source file. Why don't you just use Smarty templates and be over with it? _justin > > This is for a very inefficient skin script I'm writing; the CMS I am using > is based in PHP but generates static files, so in order to change skins I am > opening the page in question and loading it into $url. From there I do an > ereg and take out what I need. The script itself can be found: > > http://equiller.com/skins/skin.txt > > And an example of it in use: > > http://equiller.com/skins/skin.php?url=http://equiller.com/markviii.htm&skin > =tan > > What I need to do to complete this is to format my navigation depending on > the skin being used. The navigation files are staticly generated as nav.htm > in each area. Now, an easy way would just take: > > < div id=nav001>navigation peice > < div id=nav002>navigation peice > < div id=nav003>navigation peice > < div id=nav004>navigation peice > > Then take each peice out, put some code around it and transform it into: > > > > navigation peice > > navigation peice > > navigation peice > > navigation peice > > > Is this possible? Is there any easier, less server-intensive way to do what > I am attempting? Thanks for anyone's help! > > - Quiller > equiller.com > aijalon.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CC Transactions with Vital Processing Services
I am curious if anyone on this list has written a PHP Class or even some spaghetti that properly interfaces with the Vital Processing Services credit card transaction gateway into associated banks? I have searched the list and have found nothing. Interfacing with this transaction gateway requires adhering to three specifications, found on the Vital Processing Services web site at http://www.vitalps.com/sections/int/int_interfacespecs.html namely specifications EIS 1080 EIS 1081 Virtual Net Interface specification Any information would be appreciated. _justin -- Justin Farnsworth - Technical Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Error Handling Class - Any Recommendations?
I have jumped into this thread late, perhaps this has alread been mentioned. Why don't you use PEAR Error _justin Julio Nobrega Trabalhando wrote: > > Hi Manuel! > > I am looking for anything that's already done, constructed, tested. PHP > does have error handling, and I could code my own class to glue all > functions/necessities together, but that would take too much time. Just > something at least to start from is a good thing... > > Saves a lot of time, you know :-D > > If I can't find this class, I will make one and submit it to your website, > okay? ;-) > > -- > > Julio Nobrega. > > > Why do you want to use a bloated 800 lines error handling class when PHP > > already has built-in functions to do exactly what you want? > > > > http://www.php.net/manual/en/ref.errorfunc.php > > > > Regards, > > Manuel Lemos > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Nasty DoS in PHP
Darren Gamble wrote: This is probably just one of those cases that by the time the application determines that its child has exceeded its configured limits in resources, there are not enough resources (memory in this case) left to do the housekeeping and kill off the child. An acceptable algorithm to handle this might be difficult, namely, Apache would possibly have to keep track of the amount of heap left to it, make a difficult decision to kill the child before it exceeded its configured limits. In the mean time, sendmail, running on the same machine as Apache, grabs a bunch of memory and Apache, doing its best with what it thinks is available, gets screwed anyway with its new, sophisticated algorithm. Sendmail dies too. Maybe kerneld dies too. The machine dies. Er, I'll leave this to the CS researchers. We ain't gonna solve problems like this. I am not even sure this is worth a bug report... If there could be a moral to this thread, it is, go buy a few more Gigs of memory. _justin === > > Good day, > > Just reading this thread, figured I would put my $0.02 in. > > This is apparently a known problem. It seems to occur whenever the php > script uses lots of memory, actually, and it does the same thing whether > it's run standalone or as a module. > > I first experienced it when I had a PHP script load a 10 meg LDAP database > into memory, which took some 90 Megs of RAM to do (overhead, I guess). If I > ran the script standalone, it wouldn't quit right away. If it was run as a > module, Apache would have to kill the child off (it logged this activity) if > I asked Apache to shut down. If I ran the script a few times, all of the > memory of the machine would be used up, and I'd have to kill off Apache to > get it back. > > > Darren Gamble > Planner, Regional Services > Shaw Cablesystems GP > 630 - 3rd Avenue SW > Calgary, Alberta, Canada > T2P 4L4 > (403) 781-4948 > > -Original Message- > From: Jason Soza [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 18, 2002 12:10 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] Nasty DoS in PHP > > Mine produced the same error message as yours, Jason, but the memory and CPU > usage continued until I hit the 'stop' button on the browser. It seemed to > have overridden both time and memory limits, as it had racked up 320 megs of > my RAM by the time I stopped it. > > Jason > > -Original Message- > From: Jason Murray [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 9:57 PM > To: 'CC Zona'; [EMAIL PROTECTED] > Subject: RE: [PHP] Nasty DoS in PHP > > > So that was both as an Apache mod and a CGI binary? Sounds like it's > > reproducible. > > Running as an Apache module here, it terminated as expected at 30 seconds. > > Jason > > -- > 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 -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Nasty DoS in PHP
Guys: This is a rather meaningless thread. It is a security issue that is displaced. Anybody can take down his own machine with a couple of lines of code. It is not the (entire) responsibility of the language to protect the machine from resource exhaustion or whatever. In security, you have the concept of the trusted user, and the users on my machine I trust. If you are running a public server, you just don't let any code go on to the machine if it is not from a trusted user. The only alternative is for the server owner to inspect the code in order to trust the code, if he does not trust the user. If a server owner lets script kiddies on the server, it is a security issue, not a PHP issue. If the originator of this thread thinks this is a weakness in PHP with the posted code, he is mistaken. _justin -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content Management
You might check out binarycloud. This is a platform but there is probably going to be an app for content management very soon as this is being worked on. SEE: http://binarycloud.tigris.org/ SEE: http://www.binarycloud.com/ _justin karthikeyan wrote: > > Hi, > > How should i go about to developing a php application to manage the content of a >web site OR is there allready some ready made script available which i can use in my >project. > > Looking forward for yours response. > > karthikeyan. -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ODBC Driver for UniVerse Database
Does anyone on this list know where a client-side, for Linux, ODBC driver is available for the UniVerse Database. I have not yet found any commercial products on IBM->Informix->UniVerse chain... _justin -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP on client-side
Re below, I am just curious if anybody on this list has already written a "significant" application using PHP/Gtk. I keep looking at Gtk, but it still seems to be too much shifting sand right now. I want to use these widgets et al for some applications that I would normally use Python for. The great disadvantage seems, of course, the difficulty to port/use something in PHP/Gtk for Windows... _justin Pavel Jartsev wrote: > > Tom Malone wrote: > > > > I don't think PHP-GTK does that, does it? > > >From http://gtk.php.net > > Too often PHP is thought of as only an HTML-embedded web scripting > language. However, it is also a very full-featured > general purpose language that can be used for much more. One of the > goals behind this project was to prove that PHP can > be used to write client-side GUI applications. -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Feasibility of using XML, PHP for a database-driven webapplication
Gerry: Check out binarycloud. You have XML-driven site generation, complete separation of layout/content, et cetera. _justin == Gerry Kirk wrote: > > Hello, > > I've been doing some research to assess the feasibility of using PHP and > XML for a web-based database-driven application. From what I've read, it > seems that presently the costs of using XML outweigh the benefits. > > Here are the costs I see: > 1. XML standards are still maturing > 2. XSLT is complex and difficult to understand > 3. Their is minimal support for XML in relational databases, and none for MySQL > 4. PHP's XML tools are still in their infancy > 5. The processing time to go from SQL to XML to HTML via XSLT is often high. > > The benefits? > 1. Greater abstraction between data, logic and presentation which can be > easier to design, develop and maintain. > > Your thoughts? > > Thanks, > Gerry Kirk > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Attitude of B van Ouwerkerk
This is not to condone discourtesy, but the key to this complaint is "being on the list for a while". In the everyday friction of life, terse emails are easily misinterpreted. I happen to feel that van Ouwerkerk's reponse is not "disgraceful", and attributing it to his "attitude" is a leap of the imagination. Sometimes one feels like being curt to those myriad posts that ask questions, maybe 30-50 percent of the posts on this list, where the answer is in the manual. One could allege "discourtesy" to those people that "abuse" the list by asking questions that are in the manual. The point is, it would be also "legitimate" for anyone to complain about the "disgraceful" attitude of of people who post before looking. I would think it appropriate that the dues for posting should be that at least individuals search the manual first. The occasional poster that missed the item in the search in the manual would certainly be easily tolerated. _jef -- Steve Wright wrote: > > I have to say, after only being a member of the list for a while that the > attitude of B van Ouwerkerk to be disgraceful. > > Everybody needs help sometimes, and no one can know it all.. so if you don't > have anything positive to say, then don't say anything! > > Thanks for reading, -- -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ODBC for UniVerse Database
Anybody on this list: 1. Have experience with ODBC for Universe 2. Know where there is a driver available You may reply privately if you think it is not of interest to this group _jef -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What tools do you use to develop PHP?
1. We prefer binarycloud for many, many reasons. I suggest everyone at least look into this touchstone that finally and elegantly separates layout from content... 2. vim 3. RCS/CVS _justin Gerry Kirk wrote: > > Hi, > > I'm putting together a PHP development framework for our small group. We > have worked on a couple of small apps, so now it's time to do things a > little more methodically, i.e. make life easier for everyone. :) > > So, I scanned the web and found quite a few options for code libraries, > and a few for PHP code editors. > > I'm interested to know what tools / libraries people prefer - > > 1. Code libraries: > a) Metabase (for database abstraction) > b) PHPLib > c) PEAR > d) BinaryCloud > e) other > > 2. What code editor do you use? > > 3. Source code control. CVS appears to be the only real option here. > > TIA, > Gerry > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Zip Code Locator?
Kurth Bemis wrote: > > At 04:42 PM 7/24/2001, Benjamin Bleything wrote: > > i'm pretty sure that the extra numbers are coord of that town. you know > the long and lat. [== snip, snip ==] FWIW, here is the formula needed, here just a snippet getting the distance between two ZIP's, and, yes, Virginia, you have to have the latitude and longitude in radians: #== construct the computed distance field (artificial field) == $dist = "(ACOS(SIN($this->LAST_LAT) * "; $dist .= "SIN(LatRad) + "; $dist .= "COS($this->LAST_LAT) * "; $dist .= "COS(LatRad) * "; $dist .= "COS(LongRad -$this->LAST_LONG)) *"; $dist .= "3958.88012572)"; For this snippet, consider LAST_LAT and LAST_LONG the "first point" in this spherical geometry solution, nicely all done by MySQL. But you can do the formula in PHP, if you wish. -- > > >On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote: > > > > > >> Hi, > > >> > > >> Does anyone know where can I find documentation or example scripts for > > > > > >> a zip code locator. I'm looking for something that will list other zip > > > > > >> codes within a number of miles radius of the zip specified. > > >> > > >> Thanks! > > >> > > >> Vince -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mailing in batches
> > Also is there any examples of this kind of app? Just do something like this with shell, logically while read_line_from_email_address_list ; do cat your_text_file | mail -s "Your Subject" address_from_list; sleep 1; done; and put it in the background. You only need the sleep for "safety" as some sendmail(1)'s/systems don't take kindly to queueing up 20,000 messages _jef -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problem with php and htmldoc
It is not exactly clear what you are doing. Are you buffering up the HTML file with ob_start, and then flushing the buffer after you run the buffer through htmldoc, that is, are you processing everything before into html before you flush out the page? If you are not buffering, then you probably have a side effect that you are "blaming" on a red herring, namely, "more than ten records". Though I cannot know with the information supplied, it seems that you are not buffering, and ten records just happens to be the amount when the Apache buffer "fills" and sends the first packet. Then, what is left at the end of the built-up HTML, is a fragment in any case of "illegal HTML" that htmldoc will break on... Just what are you doing?? _jef Luis Lebron wrote: > > I am currently having a problem with php and htmldoc. I have a php script > that queries a myql database and creates a series of tables each with a 800 > x 600 product screenshot. The file is then sent to htmldoc to be converted > into a pdf file. Here is my problem, if I request ten records (screenshots) > or less everything works fine, however, if I request more than ten nothing > happens (the php script creates the tables but the pdf file is not created). > I have run htmldoc on the command line with the php created html file and it > works without any problems regardless of the amount of tables(records). I > have tried increasing the max script time and memory usage but it still > doesn't work. Any ideas? > > thanks, > Luis R. Lebron > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PEAR Integrated Template Class
Dear Power Jessie (I just had to write that..): This is a bit to the side of your question, but if you are asking this question because you are trying to do what every web developer is trying to do today, namely, reach that holy grail of separating layout from content, you might look at binarycloud, found at http://www.binarycloud.com/. We looked at the dozen of YATS now a-building, nearly rolled our own (like you must be doing?), but finally settled on binarycloud for its other many elegant features. In any case, you can see in binarycloud how you can wrap up groups of PHP files within multiple layout templates and then the final generated HTML in a "master" template with the CSS et cetera. _jef - power jessie wrote: > > Hi! > > Anyone using this? > Can someone point me to a link on > how to use this class. > > Thanks in advance! > >~{{}}~ >jessie > .o0O()O0o. > > -- > j e s s i e @ p o w e r - j e s s i e . n e t > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Problem with cookie
You may have different behaviour between browsers, but you are never going to be able to use this method reliably because of the vagaries of "times" encountered on the client side. Just look at the postings to this list, supposedly more sophisticated computer users, as some postings are dated 1972, last month, 2010 et cetera. _jef - Yasuo Ohgaki wrote: > > IE does not accept cookie expires less than 7200 sec. > Someone mentioned it before. (I don't verified this) > > Is this true? > > -- > Yasuo Ohgaki > > "Mihailo Dzigurski" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hello, > > > > I need cookie that will expire in 15 mins. My server is in different time > > zone than most of my clients. When I set cookie, the cookie is already > > expired when it reach clients. I use setcookie("Test", "1", time()+600). > > > > This problem only happens with IE, Netscape is working fine?! > > > > Is there any solution for my problem? > > > > Regards, > > Mihailo. > > > > > > _ > > Do You Yahoo!? > > Get your free @yahoo.com address at http://mail.yahoo.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sort an array by its values
Try something like: uasort($your_hash[$first_level][$any_second_level], create_function('$a,$b', 'return $a["what_level"] - $b["what_level"];')); and adjust this according to the level and what you want to sort on accordingly... _jef Aaron Bennett wrote: > > Hi All, > I'm trying to sort an array of objects by the value of one of those > objects... > for instance, I'll have an object with 2 properties, "id" and "score", where > id is unique and score is its relevant (and sometimes simelar) score. i've > tried using sort() and asort() but i can't figure how to base the sorting > off the value (i.e. score) of the object in the array. Any help? > -- > Aaron -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] High Ascii chars
rm: Yes, we have this problem with clients submitting stories, or some such, by cutting and pasting from word processors. You can get around it by using javascript to check the text on exit from the form field, and then either replace the high ASCII with "?" or strip it out, as appropriate. This is "better" too, for performance, as the javascript will warn and block on the client side, avoiding a round trip. _jef --- rm wrote: > > php3.x > > We have a large number of people submitting a large > number of docs...I'm having a problem with some docs > coming through with high ascii characters in the text, > apparently the dbm database we're using chokes on some > high ascii chars. I need to eliminate characters in > the text from 122 to 255. I can't seem to find a > simple way to do thisI have a routine, it works > but it takes too long, something like; > > for ($i=122; $i<256; $i++){ > > $textline=str_replace(chr($i),'',$textline) > > } > > Anyone know of a better, faster way to filter out > these high ascii charcters > > kb > > __ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail > http://personal.mail.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] get a screen resolution
Marc van Duivenvoorde wrote: > > I know I can do it with javascript, but if possible I'd like to do it with php. - Then have PHP write out the necessary javascript. There is, obviously, no way for PHP, on the server side, to know what the screen resolution is of a client, until that client returns its screen resolution to the server/PHP for PHP to use. So, as previously stated by many, use javascript to find out and send back on the round trip for PHP/you to use however you wish. _jef -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] where can I find a good documentation on regular expressions?
I like the O'Reilly book on "Regular Expressions". _jef --- Mick Foster wrote: > > where can I find a good documentatio on regular expressions? > I´m desperate in need of it... > > thanks for your time > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session troubles
You must have some white space going out somewhere before your code/HTML "starts", that you are unaware of. If you can't find it, you can always buffer up your output with ob_start() and put it out later... --- Brad Wright wrote: > > Hi all, > Im new to this mailing list so im not sure what to expect from 'y'all' but > i'm hoping this will be the beginning of a long and beautiful friendship. > > My question: > > i have a series of PHP4 pages that if I start a session (session_start()) on > the first page (adminLogin.php), all is fine and dandy...all the > session_resources get passed to the next page (login2.php) and i can get > acccess to those session resources. Te problem is, at the top of the page a > warning message is displayed: > > Warning: Cannot send session cache limiter - headers already sent (output > started at /home/e-smith/files/ibays/test/html/login2.php:1) in > /home/e-smith/files/ibays/test/html/login2.php on line 1 > > What does this mean?? If i comment out the "session_start()" line, i dodnt > get this message BUT i also dont get the session variuables i need. > > Hope Im making some sense, Hope someone can help. > > Thanks, > Brad > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Socket Madness !!!!
Steve Brett wrote: > > fixed it now by adding ascii(10) to reply from server BUT what if i use > fgetc ? > > does anyone know the ascii value for EOF ? > > cheers, > > Steve I think it is four (CTRL-D), viz: | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | | 28 ( | 29 ) | 2a * | 2b + | 2c , | 2d - | 2e . | 2f / | | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | | 38 8 | 39 9 | 3a : | 3b ; | 3c < | 3d = | 3e > | 3f ? | | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | | 58 X | 59 Y | 5a Z | 5b [ | 5c \ | 5d ] | 5e ^ | 5f _ | | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | | 68 h | 69 i | 6a j | 6b k | 6c l | 6d m | 6e n | 6f o | | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] optimal code
Nick Davies wrote: > > surely the include function only "pastes" the contents of the included > file into the point where the include statement occours. Php still has to > parse it all. --- Right, and so no matter what, you still have the extra cost of the file operation, something almost a magnitude slower that PHP running through it... -- > On Thu, 5 Jul 2001, Richard Heyes wrote: > > > > If you are talking about speed, opening a file is expensive > > > because it is a kernel call, a directory search and all that. > > > Your "some big code" in-line will beat it every time... > > > > Not in my experience. I have a file which defines ~40 functions, with > > the bodies > > included when the function is called. Eg: > > > > function blah(){ > > > > return include('includes/func.blah.inc'); > > } > > > > Having all the function bodies in the same file would cause php to have > > to parse all > > of that code, probably about 3-4000 lines causing awful slowdowns. And > > the reason to define all of > > the functions in one file, is so that we can include that file, and all > > the functions are then available. > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] optimal code
But, my friend, if you include that file, PHP _still_ has to parse it. You just didn't benchmark. No matter what will beat because of the addition of the call to the kernel. You cannot get around this. Richard Heyes wrote: > > > If you are talking about speed, opening a file is expensive > > because it is a kernel call, a directory search and all that. > > Your "some big code" in-line will beat it every time... > > Not in my experience. I have a file which defines ~40 functions, with > the bodies > included when the function is called. Eg: > > function blah(){ > > return include('includes/func.blah.inc'); > } > > Having all the function bodies in the same file would cause php to have > to parse all > of that code, probably about 3-4000 lines causing awful slowdowns. And > the reason to define all of > the functions in one file, is so that we can include that file, and all > the functions are then available. > > -- > Richard Heyes -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] optimal code
This depends upon what you mean by "effective". For administration purposes, it may be that you want to include some "commen" code, and therefore not rewrite reusable bits. If you are talking about speed, opening a file is expensive because it is a kernel call, a directory search and all that. Your "some big code" in-line will beat it every time... If you require, and the thingy has been already loaded, then you will have to analyze how many times you use it, and try to determine tradeoffs. This is difficult. My take is, unless you are getting 100,000 hits a day and your server load is 0.99, do what is best for reusability, clarity, and administration purposes. _jef -- Adrian Ciutureanu wrote: > > Is any of the versions below more effective? > > /** Version 1 **/ > if($condition) { > // some big code > } else { > // other big code > } > ?> > > /** Version 2 **/ > if($condition) { > include 'file_with_some _big_code.php'; > } else { > include 'file_with_other_big_code.php'; > } > ?> > > /** Version 3 **/ > if($condition) { > require 'file_with_some _big_code.php'; > } else { > require 'file_with_other_big_code.php'; > } > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php binary ??
Just an observation.. It is already "installed" in RedHat 7x and is found in /usr/bin/php. If you are running Linux, you can probably easily get the RPM. _jef Marc van Duivenvoorde wrote: > > I've got a small question, can I make php system scripts just like perl > when I have compiled php as a dso module for apache or do I have to > compile it to an binary executable ?? > > something like #! /usr/bin/perl -w with a script except then for php. > > Marc van Duivenvoorde > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mailing list php-general@lists.php.netµÄ×Ô¶¯»ØÐÅ
What is going on in this sub-culture? Now I see this as a row of penguins. Is this a kind of Kilroy Was Here phenomenon -- like Linux Was Here or something? Somebody please enlighten me on this new er, ASCII art, "social phenomenon". [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: > >ºÜ¸ßÐËÊÕµ½ÄãµÄÓʼþ£¡ > > === > Ãâ·Ñµç×ÓÓÊÏä http://home.sina.com.cn -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending 5000+ emails - use PHP?
Richard Heyes wrote: > > > We regularly use PHP to send messages to a 100,000+ member > > mailing list. No > > problem. I did insert some periodic pauses to give the mail > > server some > > breathing room. :) > > Are you using the mail() function for this? Or talking direct to an smtp > server? - We do this with mail() now and then. The caution about doing "periodic pauses" may be important. A few years ago I crashed a mail server by doing a mass email with no sleep() embedded. However, FWIW, not more than a month or so ago, just for the heck of it, for a message that went to "only" about 2500, I took sleep() out. I don't know what sendmail woes on our mail server running Linux 6.2, but it did things gracefully, queued things up somehow, and didn't choke. I have no idea what our mail server would do with 100,000, though... -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error: Needs T_VARIABLE or $
You are trying to add the output of a function call, called twice, BTW, to a string, apparantly. You don't saw what $tdStr is, really, in the scope. Jason Lustig wrote: > > This is really weird. Very, very, very weird. I have the following code in a > script: > > if (!empty(trim($rowData[3]))) > { > $tdStr.= trim($rowData[3]); > } > > Now, when I run it, I get the following error: > > Parse error: parse error, expecting `T_VARIABLE' or `'$'' in > c:\server\wwwroot\contributors.php on line 70 > > (note: line 70 is the first liine of the code snippet above) > > Now, this shouldn't be a problem. There is no problem with the parens, and I > don't see anything wrong with the code. Can someone help me out with this? > This is happening in another script (when I use the empty() function) and it > is really weird... > > --Jason > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] converting Word documents to something sensible
Well, this doesn't really surprise me too much. We are a linux shop on the backend and AbiWord reads just fine Word files from all the Windows machines, running Windows 2000. However, AbiWord chokes on a Word document from our local Macs, for reasons that I don't know, and I am not too interested. And, after we read in a Word file, we _can_ write it out to HTML, but it ain't pretty... I sympathize with you. The best of British luck. _jef --- Phil Driscoll wrote: > > On Sunday 24 June 2001 16:32, Justin Farnsworth wrote: > > Try the latest AbiWord... > I've just installed it, but I can't find any obvious way to invoke it at the > command line to load a Word file and save out html or rtf. Am I missing > something? Also, when I tested the software via its gui and load a Word file > from the project I'm working on, the software crashed and exited with a load > of panic messages :( > > Cheers > -- > Phil Driscoll -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] converting Word documents to something sensible
Try the latest AbiWord... Phil Driscoll wrote: > > I have to build a web site for a local government education authority in the > UK which will allow them to make available a large range of documents to > schools. They INSIST on submitting documents in Word format. I think it is > immoral to make the schools have to accept documents in that format so I am > determined to translate them to something sensible (html, rtf or pdf will do) > at the server. The server is a Linux box so there's no opportunity to play > any tricks with COM. > > Has anyone come across any tools to do this, using php or otherwise? > > Cheers > -- > Phil Driscoll > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Why is this happening
Some time ago, if I remember correctly, this question was asked. Rasmus replied that the interpreter, due to its mechanization, would interpret "raw" strings as strings in associative arrays but that THIS BEHAVIOUR WAS NOT GUARANTEED IN THE FUTURE. It had something to do with the symbol table mechanization. One has to admit that "raw" strings are, per se, illegal in the PHP language definition. --- "Boget, Chris" wrote: > > Ok, I found out what the problem was. I'm still curious > why the problem is occuring. > > > if( $tmpArray[errorNumber] & $typesToDisplay ) { // line to comment out > > I almost always access associative arrays like the above - > almost never without the quotes. IE > > $there = 5; > > echo "$this[that]\n"; > echo "$joe[bob]\n"; > echo "$here[$there]\n"; > > etc. > > And so when I tried to access that element in $tmpArray, I > did so w/o using the double quotes. As soon as I added the > double quotes, however ($tmpArray["errorNumber"]) the > problem corrected itself. The arrays iterated through as they > should have (and did when the line was commented out). > > Why would using the double quotes in this situation have > fixed the problem with the infinite loop? > > Chris -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]