[PHP] Re: tow dimenshional arrays

2004-02-21 Thread Manuel Vázquez Acosta
As far as I know, there is no such a function. Maybe you should use a different approach. Manu. Joe-At [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hallo, 1) I want to work with the rows und columns of a tow dimensional array[i][j]. With array[i] I get the i'th row. But how can

Re: [PHP] Re: tow dimenshional arrays

2004-02-21 Thread Manuel Vázquez Acosta
Namaste Adwinwijaya: I meant there's no PHP function neither to get a column nor to transpose the matrix. The first answer you gave us, retrieves the amount of items in the column, not the column itself as an array. And the second one, just prints the matrix, but does not transpose it. Joe-At:

[PHP] Re: Algorithm....

2004-02-16 Thread Manuel Vázquez Acosta
I suggest a bit's mask technique; since max(i)=96, you can represent a day by 96/8 = 12 bytes = 3 (32-bits integers). TimeFrameA is an integer representing the first 32 15-minutes chunks(0-31), TimeFrameB represents 32-63, and TimeFrameC 64-95. If a bit is 1 the you that 15-minutes chunk is

[PHP] Re: Apache crashes on windows XP / PHP MySQL

2004-02-14 Thread Manuel Vázquez Acosta
Does this happens *everytime* you try to connect to MySQL using PHP? Does PHP is running as module or cgi? I've been using WinXP, PHP and MySQL. Although, I'm now running Apache 1.3.28, I did try Apache 2 (php as a cgi) Manu. Johan Kok [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

[PHP] Re: session expires

2004-01-13 Thread Manuel Vázquez Acosta
A tricky way to achive this is: 1. Start the session when the user request the login page 2. Send a hidden field with the PHPSESSID 3. When receiving the post compare the current session id with the submitted by the form, if they match it's likely the session has not expired. Other

Re: [PHP] Re: session expires

2004-01-13 Thread Manuel Vázquez Acosta
Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Manuel Vázquez Acosta wrote: A tricky way to achive this is: 1. Start the session when the user request the login page 2. Send a hidden field with the PHPSESSID 3. When receiving the post compare the current

Re: [PHP] problem with preg_replace

2004-01-13 Thread Manuel Vázquez Acosta
$new_file = preg_replace('/\b(?!\[sample\]|\[)(\w+)(?!\[\/sample\]|\])\b/', ' [tag]$1[/tag] ', $new_file); Replace the \w+ by [a-bA-Z]+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php doesn't work in html files

2004-01-12 Thread Manuel Vázquez Acosta
The facts is that EVERY html (php embeded or not) will be processed by PHP, which is totally unnecesary and a waste of time. The best practice is to append the .php extension to your php files. If your your working for production you must consider that your host provider won't agree to put his

[PHP] Re: GMT

2004-01-11 Thread Manuel Vázquez Acosta
As far as I know time() function returns the Unix timestamp which is GMT measured; althought date() function does the GMT convertion to the local timezone. You can store the result of time and then, modify the TZ environment var to matchs user timezone. Manu. Hassan Shaikh [EMAIL PROTECTED]

[PHP] Re: How do I do this select?

2004-01-11 Thread Manuel Vázquez Acosta
select distinct user.userId, fu.UserID as FriendID, fu.Name as FriendName from user, friendlist as f, user as fu where f.userkey = user.userkey and f.friendkey = fu.userkey order by user.userId, friendId; Chris W [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I sent this to the

[PHP] Re: Caps or No caps

2004-01-11 Thread Manuel Vázquez Acosta
From the docs: $foo = 'hello world!'; $foo = ucwords($foo); // Hello World! $bar = 'HELLO WORLD!'; $bar = ucwords($bar); // HELLO WORLD! $bar = ucwords(strtolower($bar)); // Hello World! Frank Keessen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All,

[PHP] Re: Regex help please

2004-01-11 Thread Manuel Vázquez Acosta
Try this: $pattern = '#function (\w+)\(((?:\$\w+(?:,\s*\$\w+)*?)|\s*)\)\s*\{[.\s]*((?:return\s+[^;]*\s*;)|)[ .\s]*#m'; Notice that \w means: A word character is any letter or digit or the underscore character, that is, any character which can be part of a Perl word. Though, any regexp for this

[PHP] Re: jpeg Uploader issue

2004-01-10 Thread Manuel Vázquez Acosta
Could you give us details on: how the uploads is being made: HTTP, or FTP; tests you have made, etc. Manu. Mike R [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am having an issue where a user with a MAC can't see jpegs uploaded to a web site I built. They are getting some sort

[PHP] Timezone and time() and date()

2004-01-07 Thread Manuel Vázquez Acosta
Hi all: How does the timezone of the server affects the behavior of the functions time and date. Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] array_diff question

2003-11-19 Thread Manuel Vázquez Acosta
Hi: I read on the docs that array_diff and array_intersect were broken on 4.0.4. Does this mean that there is a best method to do it? Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: how can i use sessions with frames

2003-11-19 Thread Manuel Vázquez Acosta
You can use a query technique: if (!session_registered(..)) session_start(); Or you can use the @ sign: @session_start(); Manu. Phptom [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi folks, I want to use a frameset with two frames, one leftFrame and one

[PHP] Re: file_exists on Windows problem

2003-11-19 Thread Manuel Vázquez Acosta
It may be an OS feature file_exists relies on... But you can use is_uploaded_file() function to check whether the file exists or not. Manu. Chris Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm again trying to understand differences in Apache and Windows installs of PHP

[PHP] Re: IE 6 mangling posted code

2003-11-19 Thread Manuel Vázquez Acosta
It seems to me a problem with the ' signs. I have posted, stored, and retrieved html in many projects, using IE6, and every time an error like this one showed up, the causes happened to be one of these: magic_quotes of PHP were not taken into account in the PHP code. strings delimiters

Re: [PHP] Trouble sending an image's contents as output using header Content-Type...

2003-11-10 Thread Manuel Vázquez Acosta
Type http://server.com/getthumbnail.php?fileid=12230983 in the location bar and see what happens. I have already done it; it didn't work. Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Trouble sending an image's contents as output using header Content-Type...

2003-11-10 Thread Manuel Vázquez Acosta
Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Manuel Vázquez Acosta wrote: Type http://server.com/getthumbnail.php?fileid=12230983 in the location bar and see what happens. I have already done it; it didn't work. Manu. Did you see any error? If not, do

[PHP] Trouble sending an image's contents as output using header Content-Type...

2003-11-09 Thread Manuel Vázquez Acosta
Hi all: I have a page with a img tag: img src=/getthumbnail.php?fileid=12230983 The script getthumbnail.php searchs for a thumbnail of the specified image id; if not thumbnail exists, the script creates one; and then using readfile() and header() functions flushes it contents to the browser. But

Re: [PHP] Trouble sending an image's contents as output using header Content-Type...

2003-11-09 Thread Manuel Vázquez Acosta
Maybe there's an error with _generateThumbnail() ? Do you know for certain that _generateThumbnail() works okay ? Martin I do; it works correctly, the returned path exists. I also tested sending the Content-Length header and it didn't work either. Manu. -- PHP General Mailing List

[PHP] Re: Object References Problem

2003-10-31 Thread Manuel Vázquez Acosta
I think, as for PHP4, that the problem is this function: function object_2($parent_object) { $this-my_parent = $parent_object; } Although you are passing the object by reference you're assigning a copy of it. Try this: $this-my_parent = $parent_object; Manu. -- PHP

[PHP] Re: Files question

2003-10-30 Thread Manuel Vázquez Acosta
Try file() function Bas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How can i read all files line by line? I am running windows. I know that there is then a \r\n but i don't know how to extract them... Can you help me? -- PHP General Mailing List (http://www.php.net/) To

[PHP] Trying to craft a regexp

2003-10-29 Thread Manuel Vázquez Acosta
Hi all: I'm trying to find every simple mail address in an HTML that is not inside an A tag. I have tried this regexp: (?!maito\:)([EMAIL PROTECTED](?:\.\w+)+)(?![^]*?/a) But its not working as I expect cause the only address in my tested HTML is: a href=mailto:[EMAIL PROTECTED]

[PHP] Re: String to Array or Hash Table

2003-10-20 Thread Manuel Vázquez Acosta
Try: parse_str($theStr, $assocArray); Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] HTTP_POST_RAW_DATA problem

2003-10-16 Thread Manuel Vázquez Acosta
building the megaupload progress bar. Manuel Vázquez Acosta wrote: Hello: I'm running into a problem when trying to get $HTTP_POST_RAW_DATA; it always returns NULL althought my php.ini always_populate_raw_post_data is set to On. My env: Windows XP-Pro; Apache 1.3.24/PHP module 4.3.3 Any

Re: [PHP] Return to browser and keep running!

2003-10-16 Thread Manuel Vázquez Acosta
Outch! I have read the long discussion of this bug. But I tested the register_shutdown_function on a RH system with Apache 1.3.24 and it didn't work either (the connection keeps alive). The apache_register_shutdown_function doesn't exists in either system. Manu. -- PHP General Mailing List

[PHP] Re: Regular Expressions

2003-10-16 Thread Manuel Vázquez Acosta
Um! This is like an OCR error. Maybe you'll need a dictionary and craft a soundex/diffin' scheme. I don't think regexp will solve this problem nicely. Manu. Shmuel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a misspelled sentence like this: I am not aIone. I want to change

Re: [PHP] Slow searches in large database

2003-10-15 Thread Manuel Vázquez Acosta
I used a variant of this scheme a time ago and it worked well though I had not reached 2 000 records. I separated the words using strtok(). Manu. PD: How large is the http://www.alenet.com DB; I searched the word 'the' (which is likely to be in every english doc) and it returned only 28 docs.

Re: [PHP] Run the same php function several times in th background

2003-10-15 Thread Manuel Vázquez Acosta
There's a PEAR (o PCLE, can't remeber, search at http://pear.php.net) implementation of threads, though its experimental yet. Manu. Kb [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear Mohamed Yes, I am looking for multithreading process , thank you for the suggestion charles

[PHP] Return to browser and keep running!

2003-10-15 Thread Manuel Vázquez Acosta
Hi all: I need to know if there is a way to send the output buffer to the browser, disconnect from it but keep running a task the user doesn't need to realize that is happening and that may take a few minutes to be complete. Something like: ?php /// PREPARE OUTPUT... flush();

Re: [PHP] Return to browser and keep running!

2003-10-15 Thread Manuel Vázquez Acosta
Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Use register_shutdown_function() I made this test: ?php function shutingdown() { $fh = fopen('d:/tmp/test.out', 'w'); if ($fh) { for($i=0; $i1000; $i++) fwrite($fh, $i\n);

Re: [PHP] Return to browser and keep running!

2003-10-15 Thread Manuel Vázquez Acosta
Add before the exit: set_time_limit(0); http://php.net/set_time_limit Curt You didn't get the idea. I want to be able to keep running a script disconnected from the browser; once all the output has been sent to the browser there's no need for the user to wait until the script finish its

[PHP] HTTP_POST_RAW_DATA problem

2003-10-15 Thread Manuel Vázquez Acosta
Hello: I'm running into a problem when trying to get $HTTP_POST_RAW_DATA; it always returns NULL althought my php.ini always_populate_raw_post_data is set to On. My env: Windows XP-Pro; Apache 1.3.24/PHP module 4.3.3 Any ideas? Manu. -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: I can't make 'read_tag.php' file

2003-10-12 Thread Manuel Vázquez Acosta
Try this: function readTag($filenane, $tagtype, $degub = false) // I prefer boolean for debug :) { $filedata = file_get_contents($filename); $tagtype = preg_quote($tagtype); $tagRegExp = /battag=$tagtype\s*((?:.|\s)*?)/battag\s*/; preg_replace_callback($tagRegExp, 'replaceFunc',

[PHP] Re: Search for an exact string inside of another string

2003-10-11 Thread Manuel Vázquez Acosta
Try: if (strpos($str2, $str1) !== false) echo $str1 is inside $str2; else echo could not find $str1 inside $str2; Php Webmaster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I have a little problem that I hope you can help me with. I have the following strings:

[PHP] Re: Detecting devices i.e. PDA, Mobile

2003-10-11 Thread Manuel Vázquez Acosta
Take a look at what is printed by: var_dump($_SERVER); Maybe the HTTP_USER_AGENT can lead you to somewhere out of this problem. Manu. Shaun [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have created an online system, and have created a WAP version, and am currently

[PHP] Compiled Regular Expressions?

2003-10-06 Thread Manuel Vázquez Acosta
Hi all: I need to know if PHP compiles regular expressions. If it does so, is there any way to cache the compiled resource in order to speed up next calls to preg_* functions? Manu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php