Re: [PHP] how PHP is batter?

2007-07-03 Thread Jon Anderson
Andrei wrote: I saw there is a free version of Studio, but I think it's for students... You cannot go build a corporate project with it I think... They're just designed for students and hobbyists (i.e. they stipped out the cool stuff), but you can use 'em for whatever. From the faq:

Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jon Anderson
Daniel Brown wrote: Did you come before or after the chicken egg? Relevant to the above: $a = array('Chicken','Egg'); echo The . $a[array_rand($a)] . comes first.; I appologize if this one's already been done...I've only glanced at a few entries in this thread, entertaining though it

Re: [PHP] Strategy when working with designer(s)?

2007-07-23 Thread Jon Anderson
Steve Finkelstein wrote: I was curious how do you folks who strictly do development and not designing, strategically work with a designer in this fashion? Do you have a skeleton you follow or preload some existing templates and then code around that? If there's even a book which focuses on

Re: [PHP] UTF-8 support

2007-08-03 Thread Jon Anderson
Naz Gassiep wrote: The functions trim() and explode() appear to be munging multibyte UTF-8 strings. I can't find multibyte safe versions of them in the manual, do they exist, or do I have to make my own? In what way are they munging the strings? I just tried with a bunch of UTF-8 characters

Re: [PHP] Premature Ajax-ulation

2007-08-03 Thread Jon Anderson
Stut wrote: Validation, validation, validation. The big danger with doing anything on the client-side is that it's all to easy to fall into blindly trusting what the client is giving you, even the smallest assumption can create a big hole in your app. Don't assume events will happen the way

Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)

2007-09-12 Thread Jon Anderson
Per Jessen wrote: Uh, how do know you it's do with the version-number?? Did I miss that posting? Not necessarily to do with the version number itself - it's that PHP is dying before having actually done anything - it never gets to any PHP code. From the first post - the last line of

Re: [PHP] Strategy for Secure File Storage

2007-09-24 Thread Jon Anderson
Kevin Murphy wrote: I'm working on a intranet site that uses an LDAP server to authenticate users and then a integrated CMS (kind of like a wiki with security features so only certain people can post things or upload files) runs the whole thing. (The CMS is custom built with PHP). I've got a

Re: [PHP] Secure Image Storage

2007-10-01 Thread Jon Anderson
Kevin Murphy wrote: Hello all, Following up with my success last week with putting downloadable files in a directory above the web root and then using a combination of fopen and stuff to download the file, I am now trying to do something similar with images. However, what I am trying to do

Re: [PHP] Alternate Colors in Rows

2007-10-03 Thread Jon Anderson
Steve Marquez wrote: I am attempting to alternate the colors of the container DIV. Anyone know how to do this? I've used variants of this: ?php while ($condition): ? div style=background-color: #?= ($i++%2) ? 'ff' : 'ee' ?; ?php endwhile ? jon -- PHP General Mailing List

Re: [PHP] User defined function problem

2006-07-18 Thread Jon Anderson
This would be the simplest work-around I can think of. In your config script, wrap an if around your function call: if (!function_exists('clean_sql')) { function clean_sql() { ... } } jon Stephen Lake wrote: Hey Guys and Gals, I am having a small problem with a user defined

Re: [PHP] User defined function problem

2006-07-18 Thread Jon Anderson
Oh, and the other obvious thing that I omitted would be to try using either the include_once() and require_once() functions wherever you include() or require() config.php. jon Stephen Lake wrote: Hey Guys and Gals, I am having a small problem with a user defined function, I placed it in a

Re: [PHP] Setting cookie on one domain for an other domain

2006-07-20 Thread Jon Anderson
AFAIK, this could be a security risk, so even if PHP would allow it (which it might - I don't know), there is a good chance most browsers would not. I certainly wouldn't count on being able to do so. You could however use something like AJAX to do an asynchronous request to domain2, which

Re: [PHP] UTF-8 With content-type text/xml problem.

2006-07-21 Thread Jon Anderson
I'm somewhat new to this stuff as well, so take this with a grain of salt... Someone else was hinting at this, but more directly, try running utf8_encode() on whatever part of your data that requires utf8 encoding. In the case of your example, you could just utf8_encode the test get variable.

Re: [PHP] captcha and blacklist

2006-07-25 Thread Jon Anderson
So you want a blacklist that bans IPs for some amount of time, and that's capable of sharing the blacklist between multiple HTTP servers... Seems to me that you need some sort of central or shared database...I'm not quite sure why SQL wouldn't be an option, but it seems to me that it should

Re: [PHP] Error Reporting for file commands

2006-07-25 Thread Jon Anderson
You could try prefixing the unlink function call with an @: if (file_exists($fn)) { @unlink($fn); } The @ should suppress any errors. jon James Nunnerley wrote: We've created a file manager which allows users to access their web space on a server. It's working brilliantly, except that it

Re: [PHP] APC - problems with CLI odd return values from apc_clear_cache()

2006-07-28 Thread Jon Anderson
Just replying to the list on this one 'cause I'm pretty sure you're on it. :-) AFAIK, with many caches the web server cache and CLI caches are exclusive to each process. The APC manual seems to suggest that the CLI cache is not connected to the web server cache: From:

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Andrei wrote: Then get a SSL certificate and let the browser do the job. If you do it with JavaScript or open-code language why shouldn't I just take your code and sniff the data you/the browser sends and decrypt it. Just playing devil's advocate here...But I believe that if implemented

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: [snip] Just playing devil's advocate here...But I believe that if implemented properly, encryption/decryption on the client could be secure, for example a diffie-hellman key exchange with AJAX, followed by encryption. [/snip] Doesn't matter the key, you must use SSL to

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: This still leaves any Javascript exposed, doesn't it? Yes, but that shouldn't matter. The algorithms for RSA, AES, etc, etc are all publicly available, why bother hiding their JavaScript implementations? Only the data would be encrypted. jon -- PHP General Mailing

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: Yes, but that shouldn't matter. The algorithms for RSA, AES, etc, etc are all publicly available, why bother hiding their JavaScript implementations? Only the data would be encrypted. [/snip] So, you're suggesting that you can use Ajax or some other mechanism to hide the

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: I am quite familiar with diffie-helman and have used it extensively with PGP and can see how it would be used like this, but isn't this a munged fix as opposed to using SSL? Yep. :-) There are cases (testing new algorithms, proof of concept, something I haven't thought

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Robin Vickery wrote: How about if the third party can control one side of the transaction by altering the javascript that implements it while in transit - for instance by adding a couple of lines that transmit the key to the third party after the key exchange? If the algorithm written in

Re: [PHP] Mail reply-path

2006-08-15 Thread Jon Anderson
bob pilly wrote: Im trying to send emails using the mail() function but im having a problem. Because the box that the scripts sit on is a shared web-hosting package the Reply-path part of the header always comes up as [EMAIL PROTECTED] but i have set the from part of the header to [EMAIL

Re: [PHP] S: function to remove break URLs

2006-08-27 Thread Jon Anderson
RalfGesellensetter wrote: Dear list, does anybody of you know these spammers filling up your guestbook with URLs? With strip_tags, I managed to remove the html tags. But what I want is this: 1. Detect such entries (to hide them by default) 2. Destroy URLs As for 2. I am thinking of adding

Re: [PHP] Re: character set when sending emails with PHP

2006-08-30 Thread Jon Anderson
Angelo Zanetti wrote: thanks for the reply, I've got the classes now how do I know which character set to use for the TM to be shown correctly? Character sets can be a nasty business... You were using the ISO-8859-1 character set in your headers. TM doesn't exist in that character set.

Re: [PHP] Texture and wrap

2006-08-31 Thread Jon Anderson
Emil Edeholt wrote: I would like to output an image from php where an input image is textured and wrapped around a frame. Like when you assemble a canvas on a frame (on, not under). So I get a sort of canvas looking texture on the image and that the edges of the image are wrapped around the

Re: [PHP] How to add user to linux using php

2006-09-04 Thread Jon Anderson
eqla3.com eqla3.com wrote: is there any way to add user and apply password by executing shell command through php? Depending on the distribution, you should have a user addition command that takes a password argument. In my case, useradd other args -p 'password' user. Check the manual page

Re: [PHP] How to add user to linux using php

2006-09-05 Thread Jon Anderson
J R wrote: 1. give user apache the addusser priviledge (which is very unsecure), then execute shell_exe as root would. 2. create a root process like a cron job which will start at boot of your server, then on your shell_exe pass your command to that process and have that root process execute

Re: [PHP] Is this unsecure?

2006-09-05 Thread Jon Anderson
Ruben Rubio wrote: md5 is unsecure. Use sha1 ( http://www.php.net/sha1 ) instead SHA1 has also been partially broken. Until more hash algorithms work their way into PHP, using both md5 and sha1 plus the remote IP as mentioned in a previous email would certainly add to the security of the

Re: [PHP] Re: How to add user to linux using php

2006-09-08 Thread Jon Anderson
Michelle Konzack wrote: Am 2006-09-05 08:36:21, schrieb Jon Anderson: Or create a simple shell/perl/php/whatever wrapper for adduser, and allow sudo for that wrapper by the web server user only. For example, you could create a wrapper that only allows one alphanumeric argument

Re: [PHP] Memcache function usage

2006-09-09 Thread Jon Anderson
Chris wrote: Hi, I'm trying to use memcache ( http://uk2.php.net/manual/en/function.memcache-add.php ) but I'm having a problem. When using the add/set functions I want to set an expire time, but dont want the data to be compressed (using small strings it seems silly to try to and

Re: [PHP] Re: Newbie question about ?= ?

2006-09-10 Thread Jon Anderson
Al wrote: Structurally, there is a far better way to compile your html pages. This approach is easier to design and debug and it is faster since it sends one complete packet instead of one for every short tag. And, it saves using ob_start() and ob_flush(). Consider: $report= ''; $report

Re: [PHP] Re: Newbie question about ?= ?

2006-09-11 Thread Jon Anderson
Satyam wrote: for ($x=0;$x1000;$x++) { echo ' trtdX is ' , $x , '/td/tr'; } This seems to be a hair faster. I extended the test to 1 requests (still concurrency 10) to make the test a little more reproducible: echo str,var,str did 604.65 requests a second where trtd?= $x ?/td/tr did

Re: [PHP] Question on explode and join.

2006-09-13 Thread Jon Anderson
Beauford wrote: I have a form which I want to check for inappropriate words before it is posted. I have used explode to put the string into an array using a space as the delimiter and then I check it against another array that contains the inappropriate words. I then replace the inappropriate

Re: [PHP] security include from remote server

2006-09-14 Thread Jon Anderson
Brad Fuller wrote: Miguel - If my solution is not viable, is there any other way of hosting my files someplace else, but still access the local database? Yes. Your remotely hosted code would call the database on your local server. Something like: ? $link = mysql_connect(foo.com,

Re: [PHP] Iteration through letter

2006-09-14 Thread Jon Anderson
Norbert Wenzel wrote: Hi, just for fun I tried the following code: code for($letter = 'A'; $letter = 'Z'; ++$letter) { echo($letter . ' '); } /code What surprised me was the output, which looked like this: A B C [...] Y Z AA AB AC [...] YY YZ I don't have any idea how these letters get

Re: [PHP] security include from remote server

2006-09-14 Thread Jon Anderson
Miguel Vaz wrote: Yes, right on the spot. Main reasons being code theft and using it on other projects. This being done by our office (its actually a college and i work in a multimedia department) system administrators, which are nothing left than arrogant leaches. All i was

Re: [PHP] security include from remote server

2006-09-15 Thread Jon Anderson
Miguel Vaz wrote: Yes, 10 minutes after i sent my last email i realized that. They would be txt files, easily read anywhere. Encoders, you say? What do you mean? This is one example. There are many more. http://www.zend.com/products/zend_guard I'm not sure if there are any

Re: [PHP] Frustrated trying to get help from your site

2006-09-18 Thread Jon Anderson
Jay Blanchard wrote: So let me send a rant to other users, in fact a general list of users, because I cannot read. If I could I would know that I subscribed to a list where questions are asked to other users rather than me trying to send an e-mail to the president of PHP (a hat worn proudly).

[PHP] Object Memory Leakage...

2006-09-22 Thread Jon Anderson
Sorry folks, this is a long one...I've re-read a bunch of the documentation, and I can't find a solution. In debugging an out of memory condition, I found that PHP doesn't seem to garbage collect unreferenced objects. It seems to work fine for anything other than objects. (Arrays, strings,

Re: [PHP] Object Memory Leakage...

2006-09-22 Thread Jon Anderson
Richard Lynch wrote: If you get no satisfaction on PHP-General, PHP-Internals may be able to help... Might have to give that a shot...Subscribing to one more mailing list can't hurt I guess. :-) Thanks for the suggestion. You really need to specify PHP version and platform and all that,

Re: [PHP] Object to array conversion oddity

2006-09-23 Thread Jon Anderson
Marcus Bointon wrote: Sure, but don't you think that coding should at least try to be driven by logic rather than luck? I'm also not denying that it's not too hard to work around (with a function not dissimilar to what you suggested), but I'd really prefer it if it just did what it says on the

Re: [PHP] Alternative to FCKeditor

2006-09-24 Thread Jon Anderson
John Taylor-Johnston wrote: Anyone know of a good alternative to FCKeditor? Or a decent file uploader? Even after paying for a little help, I get zip for FCK. I need another solution, another editor with an active forum or support, John TinyMCE...I don't know how good/bad TinyMCE is, but if

Re: [PHP] MySQLDump and master/slave Behavior

2006-10-03 Thread Jon Anderson
David Giragosian wrote: So, Question 1 is: does mysqldump's connection to the slave db exist for the entire script execution time, or just for the length of time of its own execution? I imagine if I used mysql_connect() in the script that it would be for the entire length of the script

Re: [PHP] Memory

2006-10-12 Thread Jon Anderson
Maybe I'm doing my math wrong here, but for 1 to 9, make a string 9 bytes long, 10 including terminating null. (And PHP probably includes a little extra for overhead)... 9 * 10 bytes = 90 bytes - that's about 9 and a half gigs... jon Doug Fulton wrote: I'm running out

Re: [PHP] Send process to background

2006-10-13 Thread Jon Anderson
Richard Lynch wrote: On Fri, October 13, 2006 11:05 am, André Medeiros wrote: I am working on a backup system that needs to be called through a webpage to start the process. I am trying to do this on a one-file-only sollution. The thing is, the first request to the site needs to start the

Re: [PHP] PHP Denial of service

2006-10-13 Thread Jon Anderson
Ryan Barclay wrote: Thanks for the reply. I can't seem to find ignore_user_abort in my php.ini. I would like to do it at server level, rather than individual scripts. Do you know roughly where is it? I think there were some versions with this missing in the ini, which was later fixed.

Re: [PHP] What is the smallest, fastest web server to run PHP and SSL (on a soekris box)

2006-10-18 Thread Jon Anderson
I've been through the research on that one a couple years ago, and I found that lighttpd/php-fcgi is the best combination... I've run lighttpd/php (FastCGI) on many soekris boxes. PHP runs beautifully. I've even done it in less than 8 megs of CF with uClibc/busybox. I've used the Soekris

Re: [PHP] connectivity weirdness

2006-10-20 Thread Jon Anderson
For what it's worth, for me telnet php.net 80 (then GET ...) takes ~25 seconds, most of which seems to be the reverse lookup. If I just telnet directly to php.net's IP directly and do the same, it's instant. Doing file_get_contents takes less than 1s numerically or not. jon (Replied directly

Re: [PHP] How does the Zend engine behave?

2006-10-25 Thread Jon Anderson
Take this with a grain of salt. I develop with PHP, but I am not an internals guy... [EMAIL PROTECTED] wrote: Are the include files only compiled when execution hits them, or are all include files compiled when the script is first compiled, which would mean a cascade through all statically

Re: [PHP] PHP Memory Allocation (checked via TOP)

2006-10-31 Thread Jon Anderson
Cabbar Duzayak wrote: Hi, I have written a simple test program to see how php allocates memory. Test code allocates ~10 Meg of RAM in an array within a loop till it runs out of memory as: $str = rand(65, 95) . rand(65, 95) . rand(65, 95) . rand(65, 95) . rand(65, 95); $aa[] =

Re: [PHP] why so slow?

2006-11-03 Thread Jon Anderson
Richard Lynch wrote: On Thu, November 2, 2006 3:01 pm, Alan Milnes wrote: Don't call files .inc - call them .inc.php if you really must have the inc somewhere, that way the Web Server will actually treat it as a php file and not display your details to the world if accessed directly.

Re: [PHP] why so slow?

2006-11-03 Thread Jon Anderson
Richard Lynch wrote: On Fri, November 3, 2006 1:12 pm, Jon Anderson wrote: Or you can .htaccess Deny From All them out... That's my preferred solution. It keeps the include tree near the code that accompanies it without risking anything even if they're called *.php. Until you upgrade

Re: [PHP] pdo and mysql 5

2006-11-10 Thread Jon Anderson
jonathan wrote: I know that PDO has drivers only for MySQL 3/4. Is anybody getting it work with MySQL 5. I'd like to try out the Zend Framework but our db uses MySQL 5. We could create a second db in 4.1 and run it with that but I'd rather not to. It's kinda surprising how long MySQL 5 has

[PHP] PHP product licensing...

2006-11-12 Thread Jon Anderson
I'll get right to the point, then explain after... I'm looking to release some PHP code as partially open-source. Basically a GPL-like license for non-commercial use, and proprietary license for anyone else. I'm wondering about people's experience with various licenses (open-source or not).

Re: [PHP] one click - two actions?

2006-11-14 Thread Jon Anderson
Mel wrote: YES YES! that is exactly what I want. But I don't know how to do what you are suggesting! You'll have to read some documentation about AJAX if that's what you want, but thankfully there are some easy AJAX toolkits out there. Of the ones I've tried, I find xajax (xajax.sf.net) to be

Re: [PHP] How to output an MP3 file?

2006-11-15 Thread Jon Anderson
Brian Dunning wrote: header('Content-Type: application/octet-stream'); snip What should I change? I think you should use a content type more specific to MP3s. My install of firefox seems to think the appropriate content type for those is audio/mpeg - try that, and see what happens.

Re: [PHP] cURL uses

2006-11-15 Thread Jon Anderson
Philip Thompson wrote: I've been doing some reading trying to figure out why I would want to use cURL. I have not found a solid reason yet. Does anyone have a useful example on why you would want to use cURL? It allows significant configurability and flexibility over PHP's more direct

Re: [PHP] Re: Space in regex

2006-11-16 Thread Jon Anderson
Dotan Cohen wrote: I should add more information. This is the entire regex: $text=preg_replace_callback('/\[([A-Za-z0-9\'.-:underscore:]+)\|([A-Za-z0-9\'. -:underscore:]+)\]/i' , findLinks, $text); This regex should match any pair of square brackets, with two bits of text between them

Re: [PHP] security question

2006-11-22 Thread Jon Anderson
Alain Roger wrote: I've heard that cookies and sessions can be easily hacked...so what do you use to secure your web page. which methods ? If you want to be secure, don't trust anything. Cookies are easily modified by a user, so never store anything sensitive in there without masking it

Re: [PHP] Process of creating invoices requiring human thought!

2006-11-28 Thread Jon Anderson
James Nunnerley wrote: Can anyone see an easy way of putting that sort of “human thinking” into a script? Any guidance would be gratefully received… You could include a fuzz factor that is acceptable to your application. You could also provide a nicer fuzz factor to people who don't use up

Re: [PHP] Byte order Mark (BOM, UTF-8, Header)

2006-12-06 Thread Jon Anderson
Bernhard Zwischenbrugger wrote:. My Question: Is PHP UTF-8 ready? Is there an other reason to stick on iso-8859-1 or ascii beside the BOM? Is it a PHP bug, or is it a bug of the editor software? My opinion is that it is basically a code problem. You have data before the ?php (the

Re: [PHP] Trying to insert a large number from php to mysql

2006-12-20 Thread Jon Anderson
WeberSites LTD wrote: I'm trying to insert the number 1970324970930197 into a mysql BigInt(20) field. If I do a direct insert from mysql command prompt and select the record I get back the same number. If I do this from PHP I get back 197032497093. Notice that the 197 at the end is not

Re: [PHP] Count empty array

2006-12-21 Thread Jon Anderson
Kevin Murphy wrote: I'm wondering why this is. $data = ; $array = explode(,,$data); $count = count($array); $count will = 1 $data = Test; $array = explode(,,$data); $count = count($array); $count will = 1 $data = Test,Test; $array = explode(,,$data); $count = count($array); $count will = 2

Re: [PHP] Script's length, echo, and execution speed

2006-12-23 Thread Jon Anderson
Casey Chu wrote: Yeah, try testing. Maybe something like this: ?php $form = form action=' ' method='post'textarea name='code'/textareabr /button type='submit'Execute/button/form; if ($_POST['code']) { echo div style='border: 1px'; $time_start = microtime_float(); eval($_POST['code']);

Re: [PHP] md5

2007-01-17 Thread Jon Anderson
Be warned, crypto isn't a strength of mine, so any/all of this may be total BS. Ross wrote: Does md5 really offer much in terms of protection? Depends on what you're doing with it. AFAIK, md5's weakness comes in the form of collisions - it has been cryptanalysed to the point where it is

[PHP] PHP and Connection: Close

2006-03-21 Thread Jon Anderson
I've been looking at a problem with our software. It uses Flash with SOAP to connect to a PHP backend. It seems to work okay, except that at the TCP level, the client keeps initiating new connections for every soap request rather than using a single connection for multiple requests. One

Re: [PHP] PHP and Connection: Close

2006-03-21 Thread Jon Anderson
Chris wrote: That's the design of http - it's stateless. Each connection is treated separately and as such closes itself when it's finished. If you want to keep it open you'll need to create your own service that listens to a port and responds accordingly - which can be quite a lot of work.

Re: [PHP] PHP and Connection: Close

2006-03-21 Thread Jon Anderson
Chris Shiflett wrote: Check the KeepAlive configuration directive in httpd.conf. Keep alives are definitely configured in the server - I can request scripts multiple times manually from a telnet client. It seems to be just SOAP requests in PHP that get mucked up - even if I send a Connection:

Re: [PHP] PHP and Connection: Close

2006-03-21 Thread Jon Anderson
Chris Shiflett wrote: In that case, I think a good next step would be to examine the HTTP request. One guess is that the request you type in manually with telnet is HTTP/1.1, and the one being sent in your SOAP request is HTTP/1.0. You are actually quite correct... The requests are being sent

Re: [PHP] PHP and Connection: Close

2006-03-23 Thread Jon Anderson
Richard Lynch wrote: I *think* both client and server have to agree/support keep-alive, and both have to be ready for the other guy to close the connection even though they agreed in advance to keep-alive. So you can use keep-alive, and it can work nifty, but ya gotta be ready for the

Re: [PHP] where php at?

2006-03-27 Thread Jon Anderson
Anthony Ettinger wrote: In a related question, I have php5 installed on my box (works fine with Apache2)...but I can't seem to find php5 on the command line. Is there a separate package I need (fyi: I'm using Gentoo). Enable the cli USE flag in either /etc/make.conf or /etc/portage/package.use

Re: [PHP] permissions

2006-04-21 Thread Jon Anderson
Benjamin Adams wrote: I have a text file that is just being read by php Can I change the permissions of it so www can not read it? what username does php uses to read files? Use a .htaccess file, if your web server supports it. For example, in apache2 you can do this: FilesMatch yourfile.txt

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread Jon Anderson
This is my opinion on the matter... From experience, I would say that mixing PHP and HTML together in a complicated page can often get very ugly. I prefer to separate out presentation and code into separate layers as much as possible. I have most often used template systems such as Smarty

Re: [PHP] File Download Headers

2006-06-15 Thread Jon Anderson
Richard Lynch wrote: Can any experts on this list explain to me why, despite the 1,000,000 places that application/octet-stream is documented to work, and has always worked, since Mosaic 1.0 days, people manage to find these goofball Content-type: headers that are supposed to work, but only work

Re: [PHP] Still trying to figure this out...

2006-06-19 Thread Jon Anderson
John Nichel wrote: P I never close my option tags that way option value=foo /Bar :-p I didn't think this would compute as proper XHTML...Sure enough validator.w3c.org says: Error /Line 10 column 10/: character data is not allowed here. |option /*t*est| You have used

Re: [PHP] shutting down a web app for maintenance

2006-06-20 Thread Jon Anderson
Assuming you're using a web server that supports htaccess files, you could easily just pop in a .htaccess file that denies access to everything. You could even add a PHP ini directive like: php_value auto_prepend_file maintenance.php where maintenance.php could contain something like:

Re: [PHP] templating

2006-06-22 Thread Jon Anderson
Ryan A wrote: Hi, A pal of mine needed some help on his project, he is using a header and footer file to template his project... but its gotten a bit complicated as he has a few dynamic parts in the header and footer files, so I told him to go with a proper templating method of templating the

Re: [PHP] working on a template system...

2006-06-28 Thread Jon Anderson
I really don't understand why people have such disregard for PHP as a template system... I'm not saying one way is better or worse (it's really a matter of preference), just that the PHP way isn't implicitly bad or messy... /* The Smarty way */

Re: [PHP] working on a template system...

2006-06-28 Thread Jon Anderson
Robert Cummings wrote: Simplistic examples don't properly illustrate the mess that occurs in complex situations. However, a simplistic example does properly illustrate my point nicely. I could even take one of my complex multi-page smarty templates, run and perl script to convert it, and end

Re: [PHP] most powerful php editor

2007-01-24 Thread Jon Anderson
Miles Thompson wrote: More seriously, many times I've taken a It's right, but not working, dammit! SQL statement, broken it up so it's listed vertically and discovered the error. Just my 2 cents worth... SQL actually does lend itself rather well to normal code style indenting, even though

Re: [PHP] bit wise math? Is there a function to easily return the bits?

2007-01-25 Thread Jon Anderson
function bits($num) { $bit_array = str_split(strrev(decbin(intval($num; $val_array = array(); foreach ($bit_array as $pow = $bit) { if ($val = $bit * pow(2,$pow)) $val_array[] = $val; } return($val_array); } (I wanted

Re: [PHP] SQL Readability.. (was Re: most powerful php editor)

2007-01-26 Thread Jon Anderson
This may not be an option for many people, 'cause ISPs and web hosts may not be forward-thinking enough to install PDO or recent PHP, but... PDO can do do this in a very database independant way, without having to do the equivalent of mysql_real_escape_string: $table = 'xyz'; $data = array(

Re: [PHP] memory_limit Setting?

2007-01-26 Thread Jon Anderson
Jay Paulson wrote: Hi everyone, I¹m trying to upload a 25MB file via PHP and I¹m setting the memory limit way high so I don¹t get a fatal error from php (the error is below). What I find really odd about this is that the error message says that PHP tried to allocate almost 54MB. First

Re: [PHP] which package to use for unzipping zipped files with PHP

2007-01-29 Thread Jon Anderson
I've used the PECL zip extension. I believe it was originally based on zzip, but is now based on another zip library. http://pecl.php.net/package/zip I won't make any claims about it being better or worse than the other two you mention ('cause I really don't know), but I can tell it works

Re: [PHP] Parsing mail file

2007-01-30 Thread Jon Anderson
I realize I'm probably stepping on some toes here, but I'm going to assume that there is (judging from the wording) a language barrier here. While I'm all for the teach a man to fish philosophy, I'm not sure that language isn't getting in the way of the lesson... Pierre Pintaric wrote: I

Re: [PHP] Help wtih a query?

2007-01-30 Thread Jon Anderson
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(left joined table.some field in that table). Of

Re: [PHP] Who uses PHP

2007-02-01 Thread Jon Anderson
Eric Gorr wrote: PHP has to many security issues and should not be used with a user authentication system. We should use XXX. Well, people's complaints about PHP probably stem from some security pitfalls built-in for simplicity's sake. (The most common being register_globals.) For

Re: [PHP] Encoding problem

2007-02-05 Thread Jon Anderson
Guus Ellenkamp wrote: I have a string with an n with a tilde. mb_detect_encoding says it's UTF-8. I set the http encoding to UTF-8 and also the internal encoding. However, I cannot produce proper output with echo $varwithtilde. echo $returnArray[$i]-address1.' has

Re: [PHP] Javascript and $_POST

2007-02-07 Thread Jon Anderson
Dan Shirah wrote: And this is my Save option at the bottom of my page form name=Submit action=save.php method=post enctype=multipart/form-data table align=center border=0 cellpadding=0 cellspacing=0 width=680 tr td width=64 align=lefta href=javascript:checkForm() title=SaveSave/a/td /tr /table

Re: [PHP] Javascript and $_POST

2007-02-08 Thread Jon Anderson
I'm no JavaScript expert, but I could maybe suggest an alternate method: use document.getElementById() or document.getElementsByName() AFAIK, the direct document.xyz doesn't work exactly the same way accross browsers (if at all). e.g. (WARNING! TOTALLY UNTESTED CODE!) function

Re: [PHP] Javascript and $_POST

2007-02-08 Thread Jon Anderson
Dan Shirah wrote: Jon, Tried your method and still got: *Error: Object doesn't support this property or method. Code: 0* *I don't know what browser/platform you're using, but the following works for me on IE7/Windows, FF2/Linux, Opera9/Linux. jon html head script language=JavaScript

Re: [PHP] Javascript and $_POST

2007-02-08 Thread Jon Anderson
Jon Anderson wrote: ... item.focus(); } ** alert(onError); **return(false);* *} ... Sorry about the *s everywhere (there aren't supposed to be any). I pasted the code in, and Thunderbird thought it was supposed to be bold for some reason, then converted the bold text to text with *s

Re: [PHP] base64-encoding in cookies?

2007-02-08 Thread Jon Anderson
Fletcher Mattox wrote: I have learned that apparently PHP silently runs urldecode() on all cookies before copying them into the $_COOKIE variable, under the assumption that all cookies have been urlencoded. This seems like a bad assumption to me, and is perhaps an attempt to be consistent with

Re: [PHP] Reflection API Questions

2007-02-09 Thread Jon Anderson
Check out the runkit extension to PHP (http://www.php.net/manual/en/ref.runkit.php). It should let you do all the class mucking you need to do. jon Jim Wilson wrote: Dear PHP Users, I have two questions regarding PHP 5's Reflection API (I apologize if this isn't the right list to ask):

Re: [PHP] base64-encoding in cookies?

2007-02-09 Thread Jon Anderson
Fletcher Mattox wrote: Actually, wouldn't you say it is left up to whoever is sending the cookie? But more on that later. It is totally left up to the user with PHP as well, but you agree with that (grudgingly) later. There is no way that you can argue the fact that there are two

Re: [PHP] base64-encoding in cookies?

2007-02-10 Thread Jon Anderson
Myron Turner wrote: Jon Anderson wrote: Fletcher Mattox wrote: In terms of the behavior, I think it makes total sense. The only case where it would ever bite you is yours (which is rare because most people wouldn't mix perl and PHP in the same system). I'm not going to get into the middle

Re: [PHP] round to nearest 500?

2007-02-12 Thread Jon Anderson
blackwater dev wrote: Is there an easy way in php to round to the nearest 500? So if I have 600, I 500 and if I have 800 I want 1000? Multiply by 2, round to 1000, divide by 2. Maybe there's an easier way, but that's what I use. 600*2 = 1200, round(1200,-3) = 1000, 1000/2 = 500 800*2 =

Re: [PHP] round to nearest 500?

2007-02-13 Thread Jon Anderson
[EMAIL PROTECTED] wrote: hah yeah, always worth a little skepticism, but it seemed to make some kind of sense. If you always round up or always round down, that's obviously not right and you end up losing potentially a lot of money or over-estimating the money involved. Founding up for 5

Re: [PHP] Deny processing of non included files

2007-02-15 Thread Jon Anderson
Easy answer: deny access to them. Use your web server to prevent execution of the files. Generally, if you're using Apache, you can just do this: Directory /path/to/modules/ Order Allow,Deny Deny From All /Directory You may also be able to do that from a .htaccess file. If you can't

  1   2   >