[PHP] Re: PHP: inexplicable behaviour of pre- and post-increment operators

2010-03-01 Thread Martin Zvarík
Mess Dne 27.2.2010 5:01, clanc...@cybec.com.au napsal(a): A week ago Dasn asked a question about converting arrays, and I quoted one possible way of achieving his task, using the operation: $i = 0; while ($i $k) { $b[$a[$i++]] = $a[$i++]; } I added the comment that I have always been wary

[PHP] Array references - how to unset() ?

2009-09-02 Thread Martin Zvarík
$ARR = array( 'a' = array('b' = 'blah') ); function set($key) { global $ARR; foreach ($key as $i = $k) { if ($i == 0) { $sourcevar = $ARR[$k]; } else { $sourcevar = $sourcevar[$k]; } } // unset($sourcevar); // will

Re: [PHP] Array references - how to unset() ?

2009-09-02 Thread Martin Zvarík
Robert Cummings napsal(a): Martin Zvarík wrote: $ARR = array( 'a' = array('b' = 'blah') ); function set($key) { global $ARR; foreach ($key as $i = $k) { if ($i == 0) { $sourcevar = $ARR[$k]; } else { $sourcevar = $sourcevar[$k

Re: [PHP] Array references - how to unset() ?

2009-09-02 Thread Martin Zvarík
AHA !!! OMG... how come I did not see that!? Instead this: $array = $array[$final]; unset($array); This: unset($array[$final]); 3 AM in the morning... that must be the reason! .) Thanks. This is possible. You're just not giving enough consideration to your exit strategy :) ?php

Re: [PHP] Re: Re: Re: Design Patterns

2009-08-13 Thread Martin Zvarík
Ralph Deffke napsal(a): NO NO NO OOP is the best ever inventet ! see my comments on this list, I will also come up with an pure oop opensource OMS very soon. I just think a dam big pattern catalog like this one is like an elephant chacing mice. I mean I can think of customers asking for a

[PHP] Re: file_set_contents() do several times?

2009-07-20 Thread Martin Zvarík
David Otton napsal(a): 2009/7/20 Martin Zvarík mzva...@gmail.com: ?php $i = 0; do { $i++; $r = file_put_contents('file.txt', 'content'); } while($r === false $i 3); if ($r === false) die('error'); ? Makes sense? or is it enough to do it just once? Assuming 'content' changes

[PHP] file_set_contents() do several times?

2009-07-19 Thread Martin Zvarík
?php $i = 0; do { $i++; $r = file_put_contents('file.txt', 'content'); } while($r === false $i 3); if ($r === false) die('error'); ? Makes sense? or is it enough to do it just once? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Lookup domain in directories VS database

2009-07-05 Thread Martin Zvarík
Imagine you are hosting 10.000 subdomains. SOLUTION #1: you create directories like: a/ b/ ... s/ s/some-subdomain.freehosting.com/ (this includes CONF.php, where you store some basic infos) Everytime visitor hits the page you do:

[PHP] Re: Image Type BMP @ Save Image As Dialog on IE

2009-06-28 Thread Martin Zvarík
Nitsan Bin-Nun napsal(a): I have wrote a PHP script that serves JPEG images in smaller size, the resize is done using GD on-the-fly. I have noticed an interesting issue during the save image as... dialog on serveral internet explorer browsers, somehow, for some strange reason, the JPEG file is

[PHP] Re: XSS Preventing.

2009-06-23 Thread Martin Zvarík
Don't htmlentiies() before DB save. In general: - mysql_real_escape_string() before DB insertion - htmlentities() before dispaly I, on the other hand, would do htmlentities() BEFORE insertion. Pros: --- The text is processed once and doesn't have to be htmlentitied() everytime you read

Re: [PHP] Re: XSS Preventing.

2009-06-23 Thread Martin Zvarík
Cons: 1. Can't easily edit information in the database True, so if you use phpmyadmin for editing - don't do what I suggested. 2. Can't display raw for the user (e.g. edit a forum post) Edit a forum? You display the data in TEXTAREA... 3. Uses more space in the DB True, although I

Re: [PHP] Re: XSS Preventing.

2009-06-23 Thread Martin Zvarík
Eddie Drapkin napsal(a): 2. Can't display raw for the user (e.g. edit a forum post) Edit a forum? You display the data in TEXTAREA... Because seeing something like: textareaquot;Yeah!quot; is what he said. /textarea Is awesome for the user experience. If you don't do

Re: [PHP] Re: XSS Preventing.

2009-06-23 Thread Martin Zvarík
Philip Thompson napsal(a): On Jun 23, 2009, at 9:29 AM, Martin Zvarík wrote: Don't htmlentiies() before DB save. In general: - mysql_real_escape_string() before DB insertion - htmlentities() before dispaly I, on the other hand, would do htmlentities() BEFORE insertion. Pros: --- The text

[PHP] Re: Query stopping after 2 records?

2009-05-04 Thread Martin Zvarík
Miller, Terion napsal(a): I need help/advice figuring out why my query dies after 2 records. Here is the query: // Build your INSERT statement here $query = INSERT into `warrants` (wid, name, age, warrant, bond, wnumber, crime) VALUES (; $query .= '$wid', '$name',

Re: [PHP] Re: Query stopping after 2 records?

2009-05-04 Thread Martin Zvarík
, or do you get an error message? Depending on how long it's taking to perform the action, the script will stop just because it's taking a while. (by default, I think it's 30 seconds.) If so, use: ini_set(max_execution_time, time in seconds); On Mon, May 4, 2009 at 3:43 PM, Martin Zvarík mzva

[PHP] Resampling images -- need lock ?

2009-04-20 Thread Martin Zvarík
I have 10 images of different sizes. If user clicks ROTATE, a script will go through all these 10 images and rotates them. If the user clicks TWICE, the first script will get aborted in the middle (so few images are already rotated) and then the second request will rotate all of them again.

Re: [PHP] Resampling images -- need lock ?

2009-04-20 Thread Martin Zvarík
kranthi napsal(a): yeh. if u want it to be on server side that is a good approach. but i feel it'll be very easy to do it with javascript... but what i did not understand is: what should happen if the user clicks ROTATE second time(when the script completed rotating say 5 images)? Well, few

Re: [PHP] Resampling images -- need lock ?

2009-04-20 Thread Martin Zvarík
I see... I will need this too: ignore_user_abort(true); kranthi napsal(a): i dont think flock will help in this case.. flock will b of help when u want to lock a particular file(to read/write) but it'll not help u to stop execution of a php script -- PHP General Mailing List

[PHP] Re: Resampling images -- need lock ? SOLVED

2009-04-20 Thread Martin Zvarík
Martin Zvarík napsal(a): I have 10 images of different sizes. If user clicks ROTATE, a script will go through all these 10 images and rotates them. If the user clicks TWICE, the first script will get aborted in the middle (so few images are already rotated) and then the second request

[PHP] Cygwin - compilation of PHP extension

2009-03-30 Thread Martin Zvarík
Hi, I am totally new in compiling under cygwin. I need to compile an PHP extension, and this is what I figured so far: gcc -c extension_name.c (that's the only *.c file in that extension directory) ERROR: php.h: No such file... So, I changed the env PATH:

Re: [PHP] Cygwin - compilation of PHP extension

2009-03-30 Thread Martin Zvarík
Martin Zvarík napsal(a): Per Jessen napsal(a): Martin Zvarík wrote: Hi, I am totally new in compiling under cygwin. I need to compile an PHP extension, and this is what I figured so far: I wouldn't expect cygwin to be that different to a real Linux environment - how about: untar

Re: [PHP] Cygwin - compilation of PHP extension

2009-03-30 Thread Martin Zvarík
Per Jessen napsal(a): Martin Zvarík wrote: Hi, I am totally new in compiling under cygwin. I need to compile an PHP extension, and this is what I figured so far: I wouldn't expect cygwin to be that different to a real Linux environment - how about: untar the extension cd dir phpize

[PHP] Re: [PHP-DB] SQL for counting comments - is this smart?

2009-03-16 Thread Martin Zvarík
Chris napsal(a): Martin Zvarík wrote: Is it smart to use all of this on one page? Or should I rather do one SQL and let PHP count it? $q = $DB-q(SELECT COUNT(*) FROM comments); $int_total = $DB-frow($q); $q = $DB-q(SELECT COUNT(*) FROM comments WHERE approved IS NULL); $int_waiting = $DB

[PHP] Which hashing algorithm is best to check file duplicity?

2009-03-15 Thread Martin Zvarík
I want to store the file's hash to the database, so I can check next time to see if that file was already uploaded (even if it was renamed). What would be the best (= fastest + small chance of collision) algorithm in this case? Is crc32 a good choice? Thank you in advance, Martin -- PHP

Re: [PHP] Which hashing algorithm is best to check file duplicity?

2009-03-15 Thread Martin Zvarík
Fastest depends mostly on the size of the file, not the algorithm used. A 2gig file will take a while using md5 as it will using sha1. Using md5 will be slightly quicker than sha1 because generates a shorter hash so the trade-off is up to you. $ ls -lh file.gz 724M 2008-07-28 10:02

[PHP] Re: The PHP filter class I'm working on (securiity)

2009-03-14 Thread Martin Zvarík
What's the point? If user puts in a search input something like scriptalert('I am super hacker');/script And the website outputs: You are searching for: script/script then what? it shows an alert(), who cares? I, as an owner of this website, don't mind AT ALL. Aha, forget to mention

Re: [PHP] Re: The PHP filter class I'm working on (securiity)

2009-03-14 Thread Martin Zvarík
Jochem Maas napsal(a): Martin Zvarík schreef: What's the point? If user puts in a search input something like scriptalert('I am super hacker');/script And the website outputs: You are searching for: script/script then what? it shows an alert(), who cares? replace the alert

Re: [PHP] Re: The PHP filter class I'm working on (securiity)

2009-03-14 Thread Martin Zvarík
Michael A. Peters napsal(a): Martin Zvarík wrote: What's the point? The point is detailed on the (not fully complete) description page I just put up - http://www.clfsrpm.net/xss/ Yeah, I just had a quick look... The browser will only execute script in source files from the white-listed

Re: [PHP] Re: The PHP filter class I'm working on (securiity)

2009-03-14 Thread Martin Zvarík
Jan G.B. napsal(a): 2009/3/15 Martin Zvarík mzva...@gmail.com: The browser will only execute script in source files from the white-listed domains and will disregard everything else, including embedded and inline scripts. wtf, can't you just take care of the INPUT and type strip_tags($_GET

[PHP] Re: PHP/Apache: script unexpectedly invoked multiple times in parallel every 30 secs.

2009-03-11 Thread Martin Zvarík
Marc Venturini napsal(a): Hi all, I wrote a PHP script running in Apache which takes more than 30 seconds to complete. It uses set_time_limit() to extend the time it is allowed to run. The script generates thumbnails from a list of images. Upon completion, the script redirects the browser to

[PHP] Re: Question about template systems

2009-03-03 Thread Martin Zvarík
Matthew Croud napsal(a): Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data

Re: [PHP] syntax

2009-02-24 Thread Martin Zvarík
Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= WHERE stamp NOW()-7 ; I have no clue here on this

Re: [PHP] syntax

2009-02-24 Thread Martin Zvarík
Micah Gersten napsal(a): Martin Zvarík wrote: Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query

Re: [PHP] Unique User Hashes

2009-02-19 Thread Martin Zvarík
tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen a poll where you need to input your email address - and if I would I would not vote - because it's a waste of my time... if you want me to vote you do everything you can to make it as pleasant as possible

Re: [PHP] Unique User Hashes

2009-02-19 Thread Martin Zvarík
tedd napsal(a): At 5:10 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen a poll where you need to input your email address - and if I would I would not vote - because it's a waste of my time... if you want me to vote

Re: [PHP] Unique User Hashes

2009-02-19 Thread Martin Zvarík
tedd napsal(a): At 5:28 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 5:10 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen a poll where you need to input your email address - and if I would I would

Re: [PHP] Unique User Hashes

2009-02-19 Thread Martin Zvarík
Chris napsal(a): Martin Zvarík wrote: tedd napsal(a): At 5:28 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 5:10 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen a poll where you need to input your email

Re: [PHP] Unique User Hashes

2009-02-19 Thread Martin Zvarík
Chris napsal(a): Martin Zvarík wrote: Chris napsal(a): Martin Zvarík wrote: tedd napsal(a): At 5:28 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 5:10 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen

Re: [PHP] Unique User Hashes

2009-02-19 Thread Martin Zvarík
Ashley Sheridan napsal(a): On Thu, 2009-02-19 at 23:34 +0100, Martin Zvarík wrote: Chris napsal(a): Martin Zvarík wrote: Chris napsal(a): Martin Zvarík wrote: tedd napsal(a): At 5:28 PM +0100 2/19/09, Martin Zvarík wrote: tedd

[PHP] Re: shell_exec - asynchronous would be cool!

2009-02-18 Thread Martin Zvarík
German Geek napsal(a): Hi all, A while ago, i had a problem with shell_exec: I was writing some code to execute imagemagick to convert a bunch of images. This could take ages to execute and the page therefore ages to load. The solution was to get a linux box and append a at the end to do it

Re: [PHP] Unique User Hashes

2009-02-18 Thread Martin Zvarík
Guys, I have not seen a poll where you need to input your email address - and if I would I would not vote - because it's a waste of my time... if you want me to vote you do everything you can to make it as pleasant as possible -- certainly that isn't requirement of an email validation.

[PHP] Re: Unique User Hashes

2009-02-17 Thread Martin Zvarík
I don't think there is more precise way to determine the visitor than by the IP address, and it sucks indeed. You can't rely on the cookies, can't rely on what's in 'HTTP_USER_AGENT' ... as said: registration could be a solution - but it's an annoyance for the visitors - although you can try

[PHP] Files redirect - using PHP and .htaccess

2009-02-16 Thread Martin Zvarík
Hi, there are two choices (example): 1) file_redirect.php?src=file/root.jpg --- shows an image 2) .htaccess --- if is requested file/root.jpg than redirect to xyzfile/root.jpg In both cases I can restrict the access to some files only. If we talk about PHP, the file/image.jpg can be

[PHP] Re: Files redirect - using PHP and .htaccess

2009-02-16 Thread Martin Zvarík
Martin Zvarík napsal(a): Hi, there are two choices (example): 1) file_redirect.php?src=file/root.jpg --- shows an image 2) .htaccess --- if is requested file/root.jpg than redirect to xyzfile/root.jpg In both cases I can restrict the access to some files only. If we talk about PHP

Re: [PHP] Speed Opinion

2009-02-08 Thread Martin Zvarík
Nathan Rixham napsal(a): Ashley Sheridan wrote: On Thu, 2009-02-05 at 09:44 +1100, Chris wrote: PHP wrote: Hi all, I am seeking some knowledge, hopefully I explain this right. I am wondering what you think is faster. Say you have 1000 records from 2 different tables that you need to get

Re: [PHP] cgi vs php

2009-02-05 Thread Martin Zvarík
Thodoris napsal(a): Y In cgi i can use perl ,c etc suppose i use perl now how efficiency differs? How cgi written in perl and php is differ in working in context of web service? other difference?. but their differ. On Thu, Feb 5, 2009 at 6:45 PM, Jay Blanchard jblanch...@pocket.com

Re: [PHP] Make New-Age Money Online with Google

2009-01-27 Thread Martin Zvarík
Ashley Sheridan napsal(a): On Sat, 2009-01-24 at 10:14 +0200, Dora Elless wrote: That's why I am sending this email only to people I know and care about. And they send to a mailing list. Come again? Ash www.ashleysheridan.co.uk The sad thing though is that there will be always people who

[PHP] PHP webhosting - USA

2009-01-24 Thread Martin Zvarík
Hi, I currently host my site by Powweb, and I am WANT to change it - can you guys recommend me something good? Powweb's website looks awesome and it's the best marketing I think I had saw! After a minute it makes you think there is NO better hosting - and it's a LIE. What happened to me?

Re: [PHP] PHP webhosting - USA

2009-01-24 Thread Martin Zvarík
That's an awful looking website, but thanks for reply. I am looking for rather a US hosting company. Andrew Williams napsal(a): go to www.willandy.co.uk http://www.willandy.co.uk best value for money On Sat, Jan 24, 2009 at 3:03 PM, Martin Zvarík mzva...@gmail.com mailto:mzva...@gmail.com

[PHP] Re: PHP webhosting - USA - conclusion

2009-01-24 Thread Martin Zvarík
I should have said in the beginning it's a small website and I am not looking for a dedicated server. Howewer, I decided to move to Lypha.com Thanks for all your fruitful* comments :) Martin PS: PHP mailgroup rulz *) that was in dictionary -- PHP General Mailing List (http://www.php.net/)

[PHP] Re: =.='' what wrong ? just simple code, however error.

2009-01-03 Thread Martin Zvarík
It works as expected on my PHP 5.2.4 LKSunny napsal(a): ? $credithold = 100; for($i=1;$i=1000;$i++){ $credithold -= 0.1; echo $creditholdbr /; } //i don't know why, when run this code, on 91.3 after expect is 91.2, however..91.2001 //who can help me ? and tell me why ?

[PHP] get_browser() too slow

2008-12-22 Thread Martin Zvarík
Hello, anyone has a good function for getting a user's browser, OS and crawler detection ? I have looked at google etc, but I ran only into long list of ineffective ereg()s functions or not checking if it's crawler... Is it possible to make an array list and just check using strpos() each

[PHP] Re: get_browser() too slow

2008-12-22 Thread Martin Zvarík
Martin Zvarík napsal(a): Hello, anyone has a good function for getting a user's browser, OS and crawler detection ? I have looked at google etc, but I ran only into long list of ineffective ereg()s functions or not checking if it's crawler... Is it possible to make an array list and just

[PHP] IP and gethostbyaddr() --- difference?

2008-12-13 Thread Martin Zvarík
Hello, I am doing a view stats for my website. I've seen that many of such statistic scripts store two values to identify the visitor: IP and getHostByAddr(IP) I've been searching..., but I don't get why the IP address isn't enough by itself?! What is the getHostByAddr() = Internet host

[PHP] Re: operators as callbacks?

2008-11-29 Thread Martin Zvarík
Joe napsal(a): Is it possible to use a PHP operator as a callback? Suppose I want to add two arrays elementwise, I want to be able to do something like this: array_map('+', $array1, $array2) but this doesn't work as + is an operator and not a function. I can use the BC library's math functions

[PHP] Re: Secure redirection?

2008-11-09 Thread Martin Zvarík
I might have not read your post thorougly, but it's important to know, that Header sends a HTTP request to the browser - you are not hiding the destination URL. So, calling header(location: in PHP is basically same as redirect using JS. Martin Zoran Bogdanov napsal(a): Hi, I'm building a

[PHP] Re: how to kill a session by closing window or tab clicking on X?

2008-11-03 Thread Martin Zvarík
Afan Pasalic napsal(a): hi. I'm sorry for posting this more javascript then php question, but it's somehow php related. here is the issue: very often people close the window/tab without logging out. I need solution how to recognize when [x] is clicked (or File Close) and kill the session

Re: [PHP] Dynamically creating multi-array field

2008-10-27 Thread Martin Zvarík
:-D :-D :-D :-D :-D :-D :-D :-D ok :) Robert Cummings napsal(a): On Mon, 2008-10-27 at 02:09 -0400, Robert Cummings wrote: On Sun, 2008-10-26 at 22:39 -0700, Jim Lucas wrote: Even slimmer ?php $node = '[5][1][]'; $text = 'some text'; preg_match_all('|\[([^\]\[]*)\]|', $node,

Re: [PHP] create/write to psd file

2008-10-27 Thread Martin Zvarík
What I know is that you can control GIMP over the command line = you can use PHP to do this. Though I guess GIMP doesn't support PSD files, I had to express myself anyways. vuthecuong napsal(a): Hi all Is there a way to create/read/write to psd file? (photoshop format) I would like to

Re: [PHP] Dynamically creating multi-array field

2008-10-27 Thread Martin Zvarík
2008/10/26 Martin Zvarík [EMAIL PROTECTED]: PHP Version 5.2.4 ? $node = '[5][1][]'; ${'tpl'.$node} = 'some text'; print_r($tpl); // null ? I really don't like to use the EVAL function, but do I have choice?? This sucks. Hi there, While this question can spur some neat solutions

[PHP] Dynamically creating multi-array field

2008-10-26 Thread Martin Zvarík
PHP Version 5.2.4 ? $node = '[5][1][]'; ${'tpl'.$node} = 'some text'; print_r($tpl); // null ? I really don't like to use the EVAL function, but do I have choice?? This sucks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Dynamically creating multi-array field

2008-10-26 Thread Martin Zvarík
Lucas napsal(a): Martin Zvarík wrote: PHP Version 5.2.4 ? $node = '[5][1][]'; ${'tpl'.$node} = 'some text'; print_r($tpl); // null ? I really don't like to use the EVAL function, but do I have choice?? This sucks. You should print the results that you are looking for! Are you looking

Re: [PHP] Dynamically creating multi-array field

2008-10-26 Thread Martin Zvarík
Nope, you have to use the eval() everytime for read/write. Martin Zvarík napsal(a): No offense, but I thought it's obvious what I want to print. print_r() shows null, and it should print what you just wrote = array field. It works when first defining with eval(): eval('$tpl'.$node.'=array

[PHP] XCache, APC, Memcached... confused

2008-10-22 Thread Martin Zvarík
Hi, I became confused after an hour trying to understand the PHP cache solutions. XCache, APC, eAccelerator and others are opcode cache systems... is memcache in the same category? or is it completely different? If I install for example XCache, set it for certain directory... it will

[PHP] Re: XCache, APC, Memcached... confused

2008-10-22 Thread Martin Zvarík
I guess the XCache everybody talks about is the open-source here: http://xcache.lighttpd.net/ But what about this: http://www.xcache.com/ ... is it the same author? :-O Martin Zvarík napsal(a): Hi, I became confused after an hour trying to understand the PHP cache solutions. XCache, APC

[PHP] Re: ZendOptimizer + APC

2008-10-22 Thread Martin Zvarík
Jochem Maas napsal(a): anyone know whether running ZendOptimizer + APC simultaneously still causes allsorts of problems ... I know it did in the past but I can't find any very recent stuff about the issues online. I believe you should look up eAccelerator or XCache, which should work with

Re: [PHP] XCache, APC, Memcached... confused

2008-10-22 Thread Martin Zvarík
, at 22:19, Martin Zvarík wrote: I became confused after an hour trying to understand the PHP cache solutions. XCache, APC, eAccelerator and others are opcode cache systems... is memcache in the same category? or is it completely different? Memcache is completely different in that it's

Re: [PHP] XCache, APC, Memcached... confused

2008-10-22 Thread Martin Zvarík
? are the variables accessible across the whole server? I still don't really understand, but I am trying... Stut napsal(a): On 22 Oct 2008, at 22:19, Martin Zvarík wrote: I became confused after an hour trying to understand the PHP cache solutions. XCache, APC, eAccelerator and others

[PHP] Re: searching by tags....

2008-10-19 Thread Martin Zvarík
Ryan S napsal(a): Hey, this the first time I am actually working with tags but it seems quite popular and am adding it on a clients requests. By tags I mean something like wordpress' implementation of it, for example when an author writes an article on babies the tags might be baby,babies,

[PHP] PHP tags - any reasons to close ?

2008-09-23 Thread Martin Zvarík
Hi, I have seen some projects where people start with opening tag ?php but they DON'T close it with ? This is especially the case of CONFIG.php files... 1) What's the reason of that? 2) What if you would not close any 100% PHP files? 3) What's the reason of making an empty space after ? I've

Re: Re: [PHP] CMS-Blog system

2008-09-04 Thread Martin Zvarík
Thank you for all the comments. Thanks for the WP tip: I don't know much about wordpress (it looks good), but I have tryed enough of open-source CMS to say that they are based on messy solutions (one for all = joomla) + it won't be free blog system, so I don't think using this free system

[PHP] CMS-Blog system

2008-09-03 Thread Martin Zvarík
Hi, I am working on CMS-Blog system, which will be using approx. 10 000 users. I have a basic question - I believe there are only two options - which one is better? 1) having separate databases for each blog = fast (problem: what if I will need to do search in all of the blogs for some

[PHP] Installing php_pgsql.dll to Apache - this is unreal

2007-11-05 Thread Martin Zvarík
Hi, I am trying now for almost 2 hours to get this working: I had Apache and PHP with modules installed as CGI (also tryed as module). Now I added extension (in php.ini) php_pgsql.dll and also installed postgreSQL. And it shows me error when starting apache: module could not be found. The

[PHP] MIME email = Content-ID in CSS not supported

2007-10-31 Thread Martin Zvarík
Hello, I am trying to send MIME type email with in message image attachments. It works OK when doing img src=cid:specialcode ...but it does not work in this div style=background:url(cid:specialcode) I am trying to have fading background, is there any way I can achieve this without using

Re: [PHP] Something you can do with AJAX + PHP as well

2007-10-09 Thread Martin Zvarík
lame... you can use javascript (which is faster) for this kind of stuff Mark napsal(a): Hey, I've made a nice video where you see ajax in combination with php. and it works really well although really is misspelled realy. Here is the video:

[PHP] Sending lots of emails - 2 choices - choose the best one

2007-10-06 Thread Martin Zvarík
Hello-- I want to send email to 100+ recipients. Two choices I thought of: 1) once call mail() and use BCC, but the negative of this method is that every recipient in BCC has header To same (so I used to put my email in here - not email of one of the recipients). 2) several calls to

Re: [PHP] Extract printable text from web page using preg_match

2007-02-27 Thread Martin Zvarík
I believe it is better to use strpos() in this case because it's faster. ?php $start = strpos(strtolower($website_code), 'body'); // not necessary $end = strpos(strtolower($website_code), '/body'); $code = substr($website_code, $start, $end-$start); echo strip_tags($code); // clean text ?

[PHP] PHP+MySQL website cache ? Yes/No

2007-02-25 Thread Martin Zvarík
Hi, I am making an eshop and I am thinking about caching system. You understand, that it cannot be entirely cached because visitor has it's own shopping cart etc. So, my thought is to cache only few blocks like Categories, Navigation menu etc. by storing it to an HTML file. The

RE: [PHP] PHP+MySQL website cache ? Yes/No

2007-02-25 Thread Martin Zvarík
I did a benchmark with and without caching to HTML file and it's like: 0.0031 sec (with) and 0.0160 sec (with database) I know these miliseconds don't matter, but it will have significant contribution in high-traffic website, won't it? Martin -- PHP General Mailing List

Re: [PHP] PHP+MySQL website cache ? Yes/No

2007-02-25 Thread Martin Zvarík
in 300 files, can I?). So I decided to put the cache in database table - For each URL Name (news/, products/ etc) a Cache (which will be an array of all HTML blocks). Martin [EMAIL PROTECTED] napsal(a): Quoting Martin Zvarík [EMAIL PROTECTED]: I did a benchmark with and without caching

Re: [PHP] read file local not remote

2007-02-25 Thread Martin Zvarík
Difference: You don't call file as http://www.myweb.com/ but instead you use the path like c:\some.txt or ../some.txt etc. PHP 5 = echo file_get_contents(some.txt); PHP 4 = $fp = fopen(some.txt, r); echo fread($fp, filesize (some.txt)); fclose($fp); Another solution

[PHP] MySQL - HEAP table type

2006-05-13 Thread Martin Zvarík
Hi, I am sorry for this not being really a PHP question, anyway I use MySQL database, I have a table, which is HEAP (memory) type and I found out I can store only about 22000 entries in it, then when I want to insert new entry it gives me an error that the table is full. The question is:

[PHP] Session - when they expirate ?

2006-05-01 Thread Martin Zvarík
Hi, I was looking all over the internet and I don't understand when and how does the PHP session expirate. I suppose that it happens when the user is inactive. On my website I don't use cookies for session and it has standard php.ini configuration: session.gc_maxlifetime = 1440

Re: [PHP] forms and dynamic creation and unique field names

2006-04-27 Thread Martin Zvarík
Jason Gerfen wrote: I have come upon a problem and am not sure how to go about resolving it. I have an web form which is generated dynamically from an imported file and I am not sure how I can loop over the resulting post variables within the global $_POST array due to the array keys not

[PHP] PHP Standard style of writing your code

2006-04-24 Thread Martin Zvarík
Hi, I see everyone has its own way of writing the code. If there is 10 programmers working on same thing, it would be good if they would have same style of writing the PHP code. So, my question is: Is there anything what would define standard style of writing PHP code? Thanks, Martin

Re: [PHP] Re: double lines

2006-04-13 Thread Martin Zvarík
Barry wrote: clive wrote: Does the html textarea add in \r. Normally not. But the mailing function might do. Replace every \n with linbreak and every \r with linefeed with str_replace And probably you see where the problem is It's because of the operation system. Win32 and Linux works

[PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Martin Zvarík
Hi, I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? MZ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Martin Zvarík
Richard Lynch wrote: On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote: I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? Yes, but... Suppose you write a script to read data from one MySQL

[PHP] Upload with process meter

2006-01-02 Thread Martin Zvarík
Hi, is it possible to upload a file and see the process of uploading (before the file is uploaded, there is something showing from 0% to 100%) using PHP and Javascript ? I saw some applications in Perl and mostly in JAVA, but I also found out something about some extension for PHP, but i

[PHP] Script Multitasking

2005-10-29 Thread Martin Zvarík
Hi, I have a file, which I run using command line. The file I am running, runs several files using passthru(). What I realise is, that it runs each file in sequence and waits for its result. I need to run all files at once and they don't have to return the result to the main file. How do I do

[PHP] Themes, pictures directory

2005-08-25 Thread Martin Zvarík
Hi, I have a website, which uses themes. The web tree looks like this: * webroot o *themes* + default # images + red design # images o *index.php* Let's say I choose red design theme. All the