Re: [PHP] Uploading PDF
Pastor Steve escribió: Greetings, I am getting an error when I am trying to upload a PDF file through a script. When I do a print_r($_FILES) I get the following: Array ( [userfile] => Array ( [name] => document.pdf [type] => [tmp_name] => [error] => 2 Error 2: http://us3.php.net/manual/en/features.file-upload.errors.php You exceeded the MAX_FILE_SIZE size. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() and wrong timezone (or time)
Jochem Maas escribió: Martin Marques schreef: Nathan Nobbe escribió: On Feb 6, 2008 6:13 AM, Martin Marques <[EMAIL PROTECTED]> wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. I doubt that debian stable is pushing newer versions of TZ db, than that found in php ... you don't mention your php version btw. The tzdata was from volatile. # php -v PHP 5.2.0-8+etch10 (cli) (built: Jan 18 2008 18:52:58) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date mié feb 6 09:03:57 ARST 2008 $ echo ""|php5 08:04 What can my problem be? what timezone does php think it's in? - output all stuff from date, not just hour:minutes. Already solved it. I installed timezonedb from pecl. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Progressive answers from a php query?
Richard escribió: Hello, I don't know if this is possible with PHP alone but this is what I'm trying to do : My script would check say for example 10 or 20 different http:// site addresses and collect some text from each page. My problem is that it takes quite a long time to query so many sites, and the user would have to wait for un to 30 sec to 1 min before the page comes up ... So there are two ways I can think of inorder to reduce the waiting time. 1) Perform asynchronous searches at the same time so all details are collected at the same time instead of waiting for the script to collect data from each one, one by one. 2) Somehow show data as it arrives instead of waiting for all the queries to be done. Is it possible to do either of these two, or both of these two with only PHP? If so how would I do it? or is it necessary to use javascript? I think it's best to do this on the client side. If you want to have something done on the server, then at least use AJAX so the page gets loaded on demand. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() and wrong timezone (or time)
Nathan Nobbe escribió: On Feb 6, 2008 12:13 PM, Martin Marques <[EMAIL PROTECTED]> wrote: see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. then you should probly set it ;) It has the right TZ set. I checked it with date_default_timezone_get(). I changed the system wide TZ to a zone that has the -2 TZ and it works now, but it's a lousy solution Anyway, I found out that PHP uses an internal tz database (very bad IMHO) and it might be out of date. what is a better alternative in your opinion; i dont know much about any alternatives.. How about use the tzdata that is already installed is the system? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() and wrong timezone (or time)
Nathan Nobbe escribió: On Feb 6, 2008 6:13 AM, Martin Marques <[EMAIL PROTECTED]> wrote: I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date mié feb 6 09:03:57 ARST 2008 $ echo ""|php5 08:04 What can my problem be? see what you have as the value for the date.timezone ini setting. I've already checked that, and it's not set. Anyway, I found out that PHP uses an internal tz database (very bad IMHO) and it might be out of date. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date() and wrong timezone (or time)
I got an update from tzdata on a Debian server due to a daylight saving change here in Argentina. The problem is that, even when the system sees the correct time, php keeps giving me the *old* hour. $ date mié feb 6 09:03:57 ARST 2008 $ echo ""|php5 08:04 What can my problem be? BTW, I did a useless reboot (I knew it wouldn't help at all, but I did it anyway). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image galleries
Lisa A escribió: > Does anyone know of an image gallery I can use on multiple pages of a > website. I'd like to be able to click on the thumbnails and see a larger > image. > Hopefully something simple and easy to install. gallery2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL connector installation/upgrade problems
David Zentgraf escribió: Hi, I'm trying to upgrade a server running CentOS 3 to an up-to-date MySQL 5 installation + PHP4. I installed the MySQL 5 package, server and client, via RPMs and they work fine, the client tells me it's version 5.0.45. I went on to recompile PHP 4.4.7 --with-mysql, but it's still using MySQL client libraries version 3.23.58. I'm kind of at a loss where it takes these versions from or how I can get it to use the newer libraries. Any hints would be greatly appreciated. Wouldn't it be easier to upgrade to CentOS 5? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] This, then that.
tedd wrote: Hi gang: I would like to run a php script that creates a web page and AFTER it is finished creating the page, then it runs another php script -- how you do that? CLI or apache2 module? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] redefine contante value
I'm redefining constant values and get notices on my log files: [18-Oct-2007 16:01:37] PHP Notice: Constant FPDF_FONTPATH already defined in /usr/share/php/tcpdf/config/tcpdf_config.php on line 50 How can I re-define them without getting notice messages? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] the opposite of a join?
[EMAIL PROTECTED] wrote: I have a company table and a contacts table. In the contacts table, there is a field called "companyID" which is a link to a row in the company table. What is the easiest way to query the company table for all the company rows whose ID is NOT linked to in the contact table? Basically, the opposite of a join? SELECT * FROM company WHERE id NOT IN (SELECT companyID FROM contacts); -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Very Large text file parsing
Paul Scott wrote: On Thu, 2007-09-20 at 08:03 -0400, Robert Cummings wrote: Post some samples of the data you are parsing and a sample of the code you've written to parse them. If you're parsing 750 megs of data then it's quite likely you could squeeze some performance out of the parse routines themselves. Today's dataset is in a CSV (tab separated) , so I am using fgetcsv, it looks like this (geo data): 936374 Roodepoort Roodepoort Roodeport-Maraisburg-26.167 27.867 P PPL ZA ZA 06 0 1759Africa/Johannesburg 2004-05-11 Code: [SNIP] $row = 1; $handle = fopen($csvfile, "r"); while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) { $num = count($data); $row++; What's $num and $row for? $insarr = array('userid' => $userid, 'geonameid' => $data[0], 'name' => $data[1], 'asciiname' => $data[2], 'alternatenames' => $data[3], 'latitude' => $data[4], 'longitude' => $data[5], 'featureclass' => $data[6], 'featurecode' => $data[7], 'countrycode' => $data[8], 'cc2' => $data[9], 'admin1code' => $data[10], 'admin2code' => $data[11], 'population' => $data[12], 'elevation' => $data[13], 'gtopo30' => $data[14], 'timezoneid' => $data[15], 'moddate' => $data[16] ); $this->objDbGeo->insertRecord($insarr); Those objDbGeo->insertRecord() do some sort of control over the data that is passed in the array? If not, you should just use the COPY command of PostgreSQL (you are using PostgreSQL if I remember correctly) or simply do a bash script using psql and the \copy command. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Very Large text file parsing
Robert Cummings wrote: On Thu, 2007-09-20 at 13:55 +0200, Paul Scott wrote: On Thu, 2007-09-20 at 12:50 +0100, Edward Kay wrote: In addition to Martin's good suggestions (and also assuming you're running php-cli via cron), you could use nice to stop it consuming too many resources: This is the current approach that I am taking, was just really wondering if there was some kind of voodoo that would speed things up a bit. Thanks both for your responses, appreciate it! Post some samples of the data you are parsing and a sample of the code you've written to parse them. If you're parsing 750 megs of data then it's quite likely you could squeeze some performance out of the parse routines themselves. Adding to Robert's comment, try not to copy variables, but to reference them, so you will use less resources. Also free DB results after query. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Very Large text file parsing
Paul Scott wrote: I have a very large text file that gets dumped into a directoory every now and then. It is typically around 750MB long, at least, and my question is: What is the best method to parse this thing and insert the data into a postgres db? I have tried using file(), fget*() and some others, all with limited success. It goes through OK (I am sending it to a background process on the server and using a callback function to email me when done) but it is really knocking the machine hard, besides taking a real long time to finish. Is there a better way of approaching this? Any help would be greatly appreciated. First, which is your approach? I suspect that you are doing this with a cron job through php-cli. Now, to avoid using to many resources, try with fopen() and fgets(). Also work with persistent connections, so you don't have that overhead. The problem with file() is that it will load all the file to memory, and you don't want 700+MB in memory. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)
Zbigniew Szalbot wrote: Hi there, No, basically I just use wordpress on this site and that's all. No fancy or advanced scripting, etc. It is family machine for family issues. I can try and go back to v4 but I do think v5 should work just as fine. At least I hope so. Does phpinfo work? What does it say? Also, when you have problems like this, he best to do is put error reporting to E_ALL and display_errors=on. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reload page after form submit
Stut wrote: Wagner Garcia Campagner wrote: header('Location: index.php'); Although technically speaking that should be an absolute URL. AFAIK, they are both equivalent. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PostgreSQL and select nextval
Richard Lynch wrote: On Sun, August 12, 2007 2:35 am, Alain Roger wrote: I'm getting an error message when i run the following SQL request : $sql = "INSERT INTO tmp_importedxls (rec_id, publisher) VALUES (SELECT nextval('tmp_importedxls_rec_id_seq'),'$pb')"; Error in SQL query: ERROR: syntax error at or near "SELECT" LINE 2: VALUES (SELECT nextval('tmp_importedxls_rec_id_seq'),' ^ I have the feeling that we can not use the select nextval(...) SQL request in an INSERT INTO one under PHP. Is it true? No. PHP doesn't care diddly-squat what is in your query -- It just sends it to PostgreSQL. The query you have written just plain won't work in PostgreSQL, period. Try it in the psql monitor. OT: Almost for sure, you just need to strip out the "VALUES (" bit and the closing paren for it. Nop. If you don't put the "VALUES (" you are passing a query with applyable values for the table in the INSERT. He only wants the next value in the sequence. In that case he just has to not put the SELECT. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PostgreSQL and select nextval
Alain Roger wrote: Hi, I'm getting an error message when i run the following SQL request : $sql = "INSERT INTO tmp_importedxls (rec_id, publisher) VALUES (SELECT nextval('tmp_importedxls_rec_id_seq'),'$pb')"; Error in SQL query: ERROR: syntax error at or near "SELECT" LINE 2: VALUES (SELECT nextval('tmp_importedxls_rec_id_seq'),' ^ You don't use SELECT, just put nextval(...) INSERT INTO tmp_importedxls (rec_id, publisher) VALUES (nextval('tmp_importedxls_rec_id_seq'),'$pb') Luck! -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert (windows-1250) to (utf-8)
Alain Roger wrote: Hi, I import a csv file (which includes characters from "windows-1250" charset) to postgreSQL database which is in UTF-8. How can i convert windows-1250 to utf-8 charset ? This is a PostgreSQL question. Check client_encoding and server_encoding. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Segmentation fault on PHP CLI
Stut wrote: Martin Marques wrote: I have a script which I run from cron. I'm testing it directly from the console: /usr/bin/php -f /path/to/script.php The thing is: Script executes great, and everything it has to do gets done, but it throughs a segmentation fault at the end. Is there anyway to debug PHP CLI? I'm using php5 from debian etch: $ php -v PHP 5.2.0-8+etch7 (cli) (built: Jul 2 2007 21:46:15) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies BTW: all this is on the development server. On the production server the cron runs without this problem. Is PHP on the production server the same old version? I would start by upgrading your development server to the latest version as you may be hitting a known bug that's already been fixed. Same version on both. The idea is to use the same version, so we don't end up with unhappy results when putting new stuff in production. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Segmentation fault on PHP CLI
I have a script which I run from cron. I'm testing it directly from the console: /usr/bin/php -f /path/to/script.php The thing is: Script executes great, and everything it has to do gets done, but it throughs a segmentation fault at the end. Is there anyway to debug PHP CLI? I'm using php5 from debian etch: $ php -v PHP 5.2.0-8+etch7 (cli) (built: Jul 2 2007 21:46:15) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies BTW: all this is on the development server. On the production server the cron runs without this problem. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mbstring problems
Crayon Shin Chan wrote: On Friday 15 June 2007 04:09, Martin Marques wrote: Using PHP 5.2.0 and I get this error: Fatal error: Call to undefined function mb_list_encodings_alias_names() in /home/martin/prueba.php on line 3 But mb_list_encodings() works like a charm. What's wrong? RTFM Did it, but gives no real answer about it. I even found the BUG report about the issue. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mbstring problems
Using PHP 5.2.0 and I get this error: Fatal error: Call to undefined function mb_list_encodings_alias_names() in /home/martin/prueba.php on line 3 But mb_list_encodings() works like a charm. What's wrong? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file charset: something like file -i
Is there something like the UNIX command "file -i" to know the charset of a file? I don't want to use a system call, so I was wondering if there was some predefined function in PHP. P.D.: I'm using PHP 5.2.0 -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bounty, NOW!
Brad Sumrall wrote: I got 5 IP breaking Federal Regulations. Hehehehe Do you think you are not being logged? Yeah, and I bet those IP are from Kathmandu. :-D -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ajax?
Greg Donald escribió: On 5/9/07, bruce <[EMAIL PROTECTED]> wrote: from my reading.. i thought yahoo's user interface (yui) components where for interfacing with yahoo am i missing something here?? Yes. :) The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. http://developer.yahoo.com/yui/ Prototype is very good too. http://www.prototypejs.org/ Combined with Rico you can do very interesting things: http://www.openrico.org/ -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Authentication
Stut escribió: As with most things these days it probably breaches the DMCA. But frankly speaking, if doing that works then the developers of the application, and by extension the company, deserve everything they get. DMCA is a real piece of crap. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Authentication
Tijnema ! escribió: Who said firefox is legal? :P I believe that what firefox can do is limited, some things that are illegal are not possible. I don't know exactly what's illegal, i searched for it a few years ago, and that's what i found then. Explain how it would be illegal to modify cookies that are in MY computer. On the other hand, it's STUPID to rely on data that comes from a cookie without double checking it. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Authentication
Davi escribió: Sessions are stored in the temporary's server folder... So... If I known my session ID and where it's stored, I can do something... Have you tried it? I mean, as a non-root, non-apache user. :-P -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Authentication
Tijnema ! escribió: On 4/9/07, Martin Marques wrote: So what? The user authenticated himself, so what is he gonna crack? Yes, but i guess you're not only storing if the user has authenticated, also storing a username? And if that's not the case, then you could authenticate by creating a cookie where it says authenticated = yes, and you're authenticated... That would the stupidest thing to do. I can't even imagine somebody thinking about doing it. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Authentication
Tijnema ! escribió: On 4/9/07, Martin Marques wrote: Yes: Don't use transparent session id, or even better, save the authentication in a cookie on the client (seperated from the session array). And then the user would crack the cookie I know they are encrypted, but trust me, cookies can be edited. So what? The user authenticated himself, so what is he gonna crack? You want better info on this subject, see how webmail apps store the suthentication information (gmail.com comes to mind now). -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect http to https
Ben Liu escribió: What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by googling: This should be done with the rewrite instruction of apache, or what ever instructionyour web server has. {header("Location: https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);exit;} ?> Very bad solution. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Authentication
Ólafur Waage escribió: Lets say i have a login system. This system authenticates the user via mysql, when the user is authenticated, i set a session variable to let the system know the user is authenticated. ie. $_SESSION["authenticated"] = true; Lets also say i know that's how the system works, that a session variable within my browser is set to true. Could i do this if i knew all this info and "authenticate" myself by setting the variable from the client side? The only way I know is, if you use transid (transparent session id), the cracker could hijack your session id and the system would think that it's you (suppose that it's your session that got hijacked) If it is possible, what can i do to prevent this or increase security? Yes: Don't use transparent session id, or even better, save the authentication in a cookie on the client (seperated from the session array). -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Smarty Website down?
On Tue, 27 Mar 2007, Mario Guenterberg wrote: Hi... I try to connect in the last hours and the results are timeouts. Excelent connection here. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting last record ID created from DB
On Mon, 19 Mar 2007, Richard Lynch wrote: The MySQL developers spent a zillion hours making the LAST_INSERT_ID() function be tied to YOUR database connection. You get *your* LAST_INSERT_ID(), not some random one from some other database connection. That's why http://php.net/mysql_insert_id takes the connection as an argument. Okay, so it's an optional arg, and PHP uses the last-used connection by default, but that's another issue entirely... Best thing would be to use DB or MDB2 and let the object get the last id with it's internal functions. IMHO. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php +html mail
On Sat, 17 Mar 2007, Wasantha De Silva wrote: Dear all, I want get a help from you for some php codes. Use google. There is plenty of code out there. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail
Dani Dws escribió: I just want to know if the mail function works from a localhost (local server)? I've checked my php.ini all the setting are right but the mail function is not sending any mail, any idea? How are you using it? -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Looking for a good Ajax Mailing List
bruce escribió: Hi... I know this is off topic.. I'm looking for a good Ajax Mailing list for Ajax discussions. I've seen a few via google, but not alot of traffic. Best I know of are the Mozilla JavaScript and DOM mailling lists. There's an AJAX list, but I mainly use the JS one: https://lists.mozilla.org/listinfo/ -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] different and logic between PHP4 and PHP5
Vieri escribió: Hi The following code: Change here: echo "A = " . (int)$a; -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
Robert Cummings escribió: On Mon, 2007-03-12 at 14:18 -0300, Martin Marques wrote: But it was quite crappy. Don't blame the tool. I've never had a problem with the amount of OOP support in PHP4. That's just taste. I started feeling very comfortable when I got to use constructors, destructors (very important, especially when dealing with DB objects), and even more with __autoload() and clone (referencing by default was a great thing). I have to say, life is easier with PHP5 :-) -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php 4 and 5
Robert Cummings escribió: On Mon, 2007-03-12 at 10:21 +0200, Haydar Tuna wrote: Hello, Most important change is Object Oriented Features. PHP 5 support Object Oriented programming features. I think you mean supports "more" OOP features. PHP4 had plenty of OOP support also. But it was quite crappy. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 4 and 5
tedd escribió: At 8:14 AM +0800 3/12/07, [EMAIL PROTECTED] wrote: Dear All, What different between 4 and 5 ? Edward. 1 No! -1 :-D Unless we are talkaing about absolute difference (distance between). -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Limiting speed when using CURL functions
Tijnema ! wrote: Hi, Is there any way i can limit the transfer speed when using CURL? I'm uploading a file to a server, and i don't want the script to f*** up all bandwidth. man renice P.D.: This is not a PHP question. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Separating HTML code from PHP code
Don Don escribió: Hi all, i am building a system using php and am trying to separate the html codes from the php codes (i.e. placing them in separate files), I am from the java struts/spring background and seem to be finding it difficult doing that at the moment with php. I've got a registration form in html with the action pointing to a separate php file that will process the form when submitted. when i want to output errors or messages, its currently being outputed in the resulting code generated by the php file. What i would like is to return to the html page and display the messages there. Can someone help me with ways of doing this pls ? Use a template engine, like HTML_Template_IT, or if you want some compleity in your system chack smarty. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with script needed
Tijnema ! escribió: On 3/7/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote: I just need to add code to print something different, say "foo" if the output is a multiple of 5 or 10 for example. How do I go about doing this? I've seen that question a lot, what i use is fairly simple if( intval($number / $multiple) == ($number / $multiple ) ) try that Very bad solution. Try the % operator: if($number % $multiple == 0) http://www.php.net/manual/en/language.operators.arithmetic.php -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: pictures stored in PostgreSQL DB
Robert Cummings escribió: On Mon, 2007-03-05 at 14:48 -0500, markw@mohawksoft.com wrote: Yea, and 1+1 = what ever the engineer or the business requirements want it to be, right? Once again it depends. What base are we working in? Are we working in some kind of odd algebraic space? 1+1 only equals 2 in specific situations. Well, it's really the metric of the space you're in. That is, how you are going to measure things. :-) This is engineering, not art class. There are ways to evaluate solutions as being better than others. This is computer science, not engineering. There are considerations for one approach over another not necessarily confined to your idea of "efficiency". The problem encompasses time, space, economics, and any number of other dimensions. Most people put programming nearer to literature, art and mathematics then to physics and mechanic. So I would say that we are closer to an art class then to a class of engineering. :-D -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to display images stored in DB
On Sat, 3 Mar 2007, steve wrote: Also, when you hit the 1024 image limit you have to think about directory schema to store the images, as the linux filesystem (and also on other 32 bit systems) will start getting slow, until things like ls will just give you an error. We have a system (I didn't work on it, just maintaining it) that has about 1100 images in a directory. I think we aren't seen any problems just because it's on a 64bit system. What filesystem has a 1024 image (file) limit? None, but they start to decay. The real problem comes at about 1, which for a DB is a very small amount of data. The real problem with these 1100 images is that the names are being put by the user (very bad, not something I would ever do) and the are running out of understadable names :-) Also, on ext3 you can add the dir_index option to a volume to use a btree index on directories (which, funny enough, is the base for some databases). Not that ext3 is great, mind you, though it is well tested. It's the FS we normaly use. :-) -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pictures stored in PostgreSQL DB
Robert Cummings escribió: On Sat, 2007-03-03 at 11:02 +0100, Alain Roger wrote: I know how to do that for 1 picture. But i want to display the pictures as thumbnail... so several pictures on the same PHP pages, with some texts. therefore, your solution does not correspond to what i need. You need two scripts. One script that contains the tags to your thumbnails, and another script that creates the thumbnails (possiblies caches them), sets the appropriate header (Content-Type: image/xxx -- where xx is png or jpeg or gif or ...) and then flushes the image binary content to the browser. You will also need to make use of the image functions in PHP to create your thumbnail. Here are some links: http://ca.php.net/manual/en/function.header.php http://ca.php.net/manual/en/function.imagecreatefromstring.php http://ca.php.net/manual/en/function.imagecopyresampled.php Let say you create two scripts... gallery.php and showImage.php. Then gallery.php will output content something like: Robert! You're spoiling him! :-D He has to know how to read the messages and interpret them correctly (and get the code done well). -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pictures stored in PostgreSQL DB
Alain Roger wrote: Hi, It's amazing that my previous post has raised so much consideration about the fact to store or not pictures into DB. It was nice, wasn't it? :-D However, none of those posts answered to my question... How can i retrieve and display those pictures to my PHP pages ? ??? How do you plan to store them? bytea, text with base64 encoding/decoding, blobs? Basically, on my PHP page I have some texts and I would like to extract from DB the pictures to display. Therefore, set the header to mine JPEG or GIF does not allow to have text also. You have to do it in two seperate steps (which IMHO is good): 1) First build an app to extract an image and show it. You should test it with you're browser and it should just show the image. 2) Build you're PHP page and make references in scr of the tag to the app above (referencing with some ID to the JPG you want. I think that you will have to send some headers in one so the the browser knows the length of the image, content type, etc. Not really sure, but it won't hurt to check it out. So please, how can i do to display pictures from DB, when my PHP page also include texts and other images (from filesystem) ? In fact i would like to do something like a thumbnail... That's a differnet, and even more complicated story. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to display images stored in DB
steve wrote: As a newbie, is storing an image in a dB a "good" thing or a "bad" thing? I tend to go with "depends". We actually store files in a DB in development, as those machines are separate from the grid. Since some are windows, linux, and MacOS, it is far easier to store in a DB than have different code for each development machine depending on their filesystem. Otherwise, in production, neither way really works, so there is the hybrid way I alluded to before. Also, when you hit the 1024 image limit you have to think about directory schema to store the images, as the linux filesystem (and also on other 32 bit systems) will start getting slow, until things like ls will just give you an error. We have a system (I didn't work on it, just maintaining it) that has about 1100 images in a directory. I think we aren't seen any problems just because it's on a 64bit system. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP4 and PHP5
Is it posible to run apache with PHP4 and PHP5 on different virtual domains? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem Directing the Page with header
On Thu, 15 Feb 2007, Ashish Rizal wrote: You need to put a session_commit(); here, so session gets writen. header("Location: $adminAddress"); exit(); } -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please critique my database class.
barophobia escribió: Hi! I was thinking about asking for recommendations for a lightweight database class. But I realized I hadn't thought much about what my requirements are so I decided instead to ask the list to critique my own class. I don't need anything as robust as ADOdb and I always use MySQL. Why not use MDB2? -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Count empty array
On Thu, 21 Dec 2006, Kevin Murphy wrote: I'm wondering why this is. $data = ""; $array = explode(",",$data); $count = count($array); $count will = 1 $array has 1 element: An empty string. $data = "Test"; $array = explode(",",$data); $count = count($array); $count will = 1 $array has 1 element: The string "Test" $data = "Test,Test"; $array = explode(",",$data); $count = count($array); $count will = 2 $array has 2 elements:. Why doesn't the first one give me an answer of 0 instead of 1. I know I could do a IF $data == "[empty]" and then not count if its empty and just set it to 0, but am wondering if there was a better way. Because explode divides the string in n+1 elements, where n is the amount of "," (or your favorite delimiter) found in the string. So if no "," is found, explode will return 1 element: the whole string (even if it's empty). -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems re-reading from socket
On Fri, 24 Nov 2006 13:41:59 -0600 (CST), "Richard Lynch" <[EMAIL PROTECTED]> wrote: > On Fri, November 24, 2006 1:21 pm, Martin Marques wrote: >> I have a daemon class which reads and answers using socket_read and >> socket_write functions. The things is that I connect to the daemon, >> sent a chain and the I get an answer, but after that the daemon get's >> struck in the next socket_read. > > Have you set: > http://www.php.net/manual/en/function.socket-set-nonblock.php If I set non-blocking, I get endless warnings when trying to accept connexions: Warning: socket_accept(): unable to accept incoming connection [11]: Resource temporarily unavailable in /usr/local/php/offline/lib/daemonSocket.inc on line 100 socket_accept() failed: reason: Success > It seems to me that if you don't, you are going to wait for 2048 > bytes, no matter how little/much data is there... >From the socket_read manual: The function socket_read() reads from the socket resource socket created by the socket_create() or socket_accept() functions. The maximum number of bytes read is specified by the length parameter. Otherwise you can use \r, \n, or \0 to end reading (depending on the type parameter, see below). I'm using PHP_NORMAL_READ BTW. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems re-reading from socket
I have a daemon class which reads and answers using socket_read and socket_write functions. The things is that I connect to the daemon, sent a chain and the I get an answer, but after that the daemon get's struck in the next socket_read. The problem appears to be here (a method from my class). I put the 2 echos for debugging purposses: function socketRead(){ echo "Vamos a leer nomas!\n"; $lectura = socket_read($this->conexion, 2048, PHP_NORMAL_READ); echo $lectura; return $lectura; } In th output from the socket daemon I get the 2 strings (generated by the 2 echos), after that I get again the first echo, but no matter how I try to send a new string to the socket, it just stays there reading from the socket. By the way $this->conexion is a socket resource from socket_accept. Also the socket reads and answers one time, so it is working, but after that first answer it stays reading. All this I'm testing from the console using a telnet to the socket. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5, PDO in debian
On Mon, 2 Oct 2006, David Tulloh wrote: Martin Marques wrote: Does anyone have an idea on when PDO is going to be available in Debian? not a clue... http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348882 Saw that already yesterday, but it's from the begining of this year. It's so frustrating. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5, PDO in debian
Does anyone have an idea on when PDO is going to be available in Debian? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WebMail client
On Mon, 2 Oct 2006, Peter Lauri wrote: Are there any AJAX supporting client? RoundCube webmail, but it's in development still. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing values in .htaccess
On Thu, 28 Sep 2006, Curt Zirzow wrote: On 9/28/06, Google Kreme <[EMAIL PROTECTED]> wrote: On 28 Sep 2006, at 14:30 , Curt Zirzow wrote: > If you can, set this on a per directory setting in your virtualhost > setting within a or , instead of turning on > .htaccess. Er... why? So you have to get root privs to edit your virtual conf? You dont need to have root, just the proper privs to modify the paticular virtual conf file. And how do you reload the apache configuration? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing values in .htaccess
yOn Thu, 28 Sep 2006, Curt Zirzow wrote: On 9/28/06, Martin Marques wrote: I'm trying helplessly to get session.use_trans_sid to true in one directory that needs it. So I put this in an .htaccess file: php_value session.use_trans_sid 1 The thing is, it didn't work. I also tried changing 1 to On with no luck at all. Is .htaccess enabled at all? by default apache doesn't have it enabled in most installations. OK, just found this in my VirtualHost file: AllowOverride None If you can, set this on a per directory setting in your virtualhost setting within a or , instead of turning on .htaccess. As I have to modify it anyway, maybe I'll just put it in the virtualhost configuration file. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing values in .htaccess
I'm trying helplessly to get session.use_trans_sid to true in one directory that needs it. So I put this in an .htaccess file: php_value session.use_trans_sid 1 The thing is, it didn't work. I also tried changing 1 to On with no luck at all. Ideas are welcome. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 object construct
On Fri, 22 Sep 2006 20:15:49 -0400, "Chris Boget" <[EMAIL PROTECTED]> wrote: >> http://us2.php.net/class > > Any particular place on that page I should be looking? I've read it > several > times and didn't see anything like the above. The closest thing I saw > were > actual methods called setBob() and getBob(), which isn't exactly what I'm > looking for... Check here: http://us2.php.net/manual/en/language.oop5.magic.php -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] web browser shows blank page when accessing *.php file
On Thu, 21 Sep 2006 17:13:44 -0400, Anna Barnes <[EMAIL PROTECTED]> wrote: > > and the error_log file says > > [Tue Sep 19 15:53:57 2006] [error] PHP Fatal error: Maximum execution > time of 60 seconds exceeded in /websites/ical/functions/ > ical_parser.php on line 494 What is there in line 494 of ical_parser.php? -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] security include from remote server
On Thu, 14 Sep 2006, Miguel Vaz wrote: I thought about having a simple php local file that would include my files that are hosted someplace else, and therefor be able to access my local database, would that be possible? My first thought would probably be no, but i cant really do any tests right now, thats why i am asking you guys. It's posible (depending on the php.ini configuration), but very insecure. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using a variable to call another variable
On Sat, 09 Sep 2006 08:55:35 -0500, Christopher Weldon <[EMAIL PROTECTED]> wrote: > > class myClass { > private var $_001; > private var $_002; > private var $_003; > > public function access_var($var) { > return $this->$$var; > } > } > > $cs = new myClass; > $cs->access_var('_001'); How about call a function whose name is returned from the function myFunc()? :-D Ansewer: {myFunc()}() My 2 cents. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quotes?
On Tue, 5 Sep 2006, Gustav Wiberg wrote: I want to save this to a string...var uri = 'http://impse.tradedoubler.com/imp/img/16352388/1122503?' + new String (Math.random()).substring (2, 11); document.write('href="http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388"; target="_blank">');How could i type? Escape " and ', like this: \" and \'. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with clases, methods, HTML_Template_I T, etc.
On Fri, 01 Sep 2006 18:35:45 -0400, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Fri, 2006-09-01 at 19:30 -0300, Martin Marques wrote: >> >> Now, each time the system gets executed, I get this in my php >> error log: >> >> PHP Fatal error: Call to a member function get() on a non-object >> in /xxx///lib/Planta.inc on line 135 >> >> Line 135 has: >> >> $this->cascara->loadPrincipal($this->tpl->get("todo")); >> >> It would seam $this->tpl is not an object, but I put an output >> of is_object($this->tpl) and it gave me true. > > Maybe it's the "wrong" object. Why don't you do a print_r() or > var_dump() instead of assuming the correct object type? :p Did a var_dump earlier, and it gave me the HTML_Template_IT object. I did a is_object because the error says that: "Call to a member function get() on a non-object". >> >> BTW I with PHP 5.0.4 (it's what comes with Fedora Core 4), and >> HTML_Template_IT 1.2.1. > > Maybe you should upgrade. It's in my TODO. I may have to hurry it up. :-( -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with clases, methods, HTML_Template_IT, etc.
I'm buidling a system in OOP, and I have a main clase which objects in it. One of the objects inside is of type HTML_Template_IT, which I use to handle presentation tier. Now, each time the system gets executed, I get this in my php error log: PHP Fatal error: Call to a member function get() on a non-object in /xxx///lib/Planta.inc on line 135 Line 135 has: $this->cascara->loadPrincipal($this->tpl->get("todo")); It would seam $this->tpl is not an object, but I put an output of is_object($this->tpl) and it gave me true. The page gets viewed OK, so it's not really a problem of the program not working, but I just don't like to have "Fatal Errors" in my log files. BTW I with PHP 5.0.4 (it's what comes with Fedora Core 4), and HTML_Template_IT 1.2.1. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file type and recode
On Wed, 30 Aug 2006, Curt Zirzow wrote: On 8/29/06, Martin Marques wrote: Simple question: Is there a built-in function in PHP to get the charset of a file, so that I can pass the right parameters to recode_file()? It depends. If it is a .txt file (nope) a .doc file (mabey, pending the .doc format) a .xml file (most likely, unless it is a poorly formatted xml file) It all depends how the document is stored and if it keeps the charset within the document. I want something more like the output of the unix command "file -i" (without running a system call). And yes, they are text files. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file type and recode
Simple question: Is there a built-in function in PHP to get the charset of a file, so that I can pass the right parameters to recode_file()? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include defer from cli to apache
I' trying to include files from a script which will be executed from CLI via cron. Now, if I execute the script from the command line it works OK, but when it's executed via cron I fails to include a file, which is being included via and include from the script. It looks like when including a file directories are changes, and so the new include doesn't work as it's referencing from a different directory. Is there something I should be aware of? -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 20 Jul 2006, Robert Cummings wrote: On Thu, 2006-07-20 at 17:09, John Nichel wrote: Adam Zey wrote: Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Ding ding ding Give that man a cigar. Why would anyone wish cancer on somebody else? Seems mean to me. jajaja Give Robert a Beer please! ;) -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 20 Jul 2006, Adam Zey wrote: Jochem Maas wrote: Robert Cummings wrote: I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing '?>' wrong (and use Rasmus' comments to back that up) we're having another heatwave here in europe so that could be compounding my lack of understanding ;-) I believe it's the opposite. I said it was bad practice. He disagreed, and used his links to back himself up. Note that just because the fact that it works is a feature, doesn't mean it's good coding style. register globals is a feature too, but it isn't exactly a good idea to use it. Explain yourself. register_globals can give you a big headache, but in which way is not closing the script like using register_globals? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 20 Jul 2006, Stephen Lake wrote: As far as getting the header error resolved, try this: http://ca3.php.net/manual/en/function.ob-start.php I'll stick with not closing my scripts, just like Rasmus said. :-) -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: headers and newline at end of script
On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Thu, 2006-07-20 at 12:12, Adam Zey wrote: >> Martin Marques wrote: >> > Now, my question is: Is it a bad practice to "NOT" close the script >> with >> > the PHP closing "?>"? I mean, just leave the script without a closing >> > PHP simbols, as this scripts are included? >> >> Yes. > > Wrong :) Why? ;-) -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] headers and newline at end of script
On Thu, 20 Jul 2006 11:30:14 -0400, John Nichel <[EMAIL PROTECTED]> wrote: > Jochem Maas wrote: >> >> I never add the final closing '?>' in any script for this very reason. >> > > 'Cause you're a SLACKER!!! What the hell is a SLACKER??? -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] headers and newline at end of script
I'm looking for an opinion on programming style. Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This last one puts all the HTML away from the PHP code, which has made life much easier. Now, sometimes I warning messages like this one: PHP Warning: Cannot modify header information - headers already sent in I know what it means, so I just look for newlines at the end of my PHP scripts, especially after the closing ?> and delete them. Now, my question is: Is it a bad practice to "NOT" close the script with the PHP closing "?>"? I mean, just leave the script without a closing PHP simbols, as this scripts are included? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once and E_WARNING?
On Thu, 6 Jul 2006, chris smith wrote: Have you tried this handler with something more fatal, like a missing semi-colon or a } missmatch? That will cause a parse error and the script won't even run. You're right. My wrong. :-( -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once and E_WARNING?
On Wed, 5 Jul 2006, [EMAIL PROTECTED] wrote: Hello all, According to the PHP Manual, when require or require_once failes, an E_ERROR is triggered: "require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error." (With 'Fatal Error' being a link to E_ERROR). Thing is, when using a custom error handler via set_error_handler(), it appears to be triggering an E_WARNING, not an E_ERROR. Using PHP 5.1.4 under Linux. There are one of three possibilities: I am suffering from a lapse in lucidity (common), the manual is wrong (possible), or PHP is broken somehow (unlikely). I'm guessing it's the first, but what am I doing wrong? I'd like to get a second opinion before submitting a bug. I searched bugs.php.net but was unable to find anything relevant for 5.1.4. Code: function default_error_handler($code, $error, $file, $line) { switch ($code) { case E_ERROR: die ("Error: $error"); case E_WARNING: die("Warning: $error"); default: die("Something else entirely: $error"); } } What happens if you put breaks after the die()? This shouldn't be necesary, but it wouldn't hurt to try. ;-) As I see in the example of the PHP manual, a break is put even after an exit(1) call. set_error_handler('default_error_handler'); require('This file does not exist. At least not here!'); Have you tried this handler with something more fatal, like a missing semi-colon or a } missmatch? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PROBLEM WITH MAIL FUNCTION
On Thu, 6 Jul 2006, Juanjo Pascual wrote: Hello, I have a problem with the mail function when I send a mail with acents or Ñ in the subject. When I receive the mail this caracters have been replaced by X. I'm using the mail function in this way: mail([EMAIL PROTECTED], 'Consulta Señalítica desde la página web', 'Hola, esto es una prueba','From: [EMAIL PROTECTED]' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n"); Worked great for me. But I would try with something more like this: mail("mimail.midom.com","Consulta Señalítica desde la página web", "Hola, esto es una prueba", "From: [EMAIL PROTECTED] \n Content-type: text/html; \n charset=iso-8859-1 \n"); -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sad PHP Poem
On Sat, 1 Jul 2006 07:03:54 -0700 (PDT), Ryan A <[EMAIL PROTECTED]> wrote: > >> Soccer... what's that? >> >> tedd > > Its a mis-spelling of two words taken out of context, > its actually "sock her" and meant for Hillary Clinton Actually, Hillary wasn't the one "sucking". ;-) -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Templates, PHP Frameworks, and DB Abstraction?
On Fri, 30 Jun 2006, KermodeBear wrote: http://pear.php.net/package/DB/ This one has no more development, besides bug fixes. It was merged to create the one below. http://pear.php.net/package/MDB2/ -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Templates, PHP Frameworks, and DB Abstraction?
On Fri, 30 Jun 2006, Jay Paulson wrote: I'd like to get some feedback on what the list thinks is a good template engine other than smarty. PEARs HTML_Template_IT... or mix it with other HTML_Template* I'd also like to do some quick prototyping using a PHP framework does anyone have any recommendations for one that is easy to pick up and run with? The only important one I know of is Horde (http://www.horde.org). Finally, does anyone have any suggestions for a good PHP database abstraction library? For PHP 5 I've heard wonderfull things about PDO, but the documentation sucks. I personally am working with PEAR::DB which has been merged with MDB to make MDB2 (this would be a good start point). -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] working on a template system...
On Thu, 29 Jun 2006, Charlene Wroblewski wrote: *joining the fray a little late* What is the difference between this, Smarty and template.inc? I have found Smarty to be unusable in my situation where a graphic designer needs to be able to edit the html and is easily confused by non-html. So, I am using template.inc which is apparently old (PHP 3) but seems to work great even with PHP 4.1. Another question is whether it will work with PHP 5? Try HTML_Template_IT from PEAR. Excelente! We use it with web designers that know nothing about programming. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] working on a template system...
On Wed, 28 Jun 2006 12:28:43 -0400, tedd <[EMAIL PROTECTED]> wrote: > At 8:32 AM -0300 6/28/06, Martin Marques wrote: >> >>Because it's a mess. >> > > That's because it got out of hand. Now, practice the 3R's, regroup, > rethink, and redo. Already did. That's when I started to use a template system. :-D -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] working on a template system...
On Wed, 28 Jun 2006, Ligaya Turmelle wrote: Martin Marques wrote: Why not try to use one of the template systems that already exist? HTML_Template_IT, Smarty, etc. Or just use PHP... Because it's a mess. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] working on a template system...
Why not try to use one of the template systems that already exist? HTML_Template_IT, Smarty, etc. On Tue, 27 Jun 2006 10:22:42 +0300, sempsteen <[EMAIL PROTECTED]> wrote: > hi, i'm working on a template system. Basically i'm building raw > contents in arrays and then put them in templates by some special > tags. > > for loop systems my basic array structure is like this: > $array['key'][]['keyword'] = ... > > for example, for a bulletin board system, array structure for > categories is something like this: > $array['categories'][]['text_category_name'] = ... > > it is looped through database recordset, so final array for 2 categories > can be: > $array['categories'][0]['text_category_name'] = 'programming' > $array['categories'][1]['text_category_name'] = 'life' > > template file structure for loops is something like this (ex, categories): > > >[$text_category_name$] > > > > i can easily loop this template and replace [$text_category_name] for > every category set in the array. after removing the comment tags i get > the final content: > > >programming > > >life > > > But i'm stuck with nested loops. For example i want to put related > forums after each categories. > > array structure is: > $array['categories'][0]['text_category_name'] = programming > $array['categories'][0]['forums'][0]['text_forum_name'] = php > $array['categories'][0]['forums'][1]['text_forum_name'] = ruby > > $array['categories'][1]['text_category_name'] = life > $array['categories'][1]['forums'][0]['text_forum_name'] = music > $array['categories'][1]['forums'][1]['text_forum_name'] = sports > > template structure is: > > >[$text_category_name$] > > > >[$text_forum_name$] > > > > > i've written some functions, used them recursively but it didn't work. > actually i couldn't find the true logic. note that it isn't a limited > array. it can have messages under each forums, peoples under each > messages, so on.. > > help me find the true approach to handle this. thank you. > > - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If statement question
On Mon, 26 Jun 2006 19:10:59 +0100, Alex Major <[EMAIL PROTECTED]> wrote: > Hi list. > Basically, I'm still learning new things about php and I was wondering if > things inside an if statement get 'looked at' by a script if the condition > is false. > For example, would this mysql query get executed if $number = 0 ? > > If ($number == 1) { > mysql_query($blah) > } NO! -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GET, POST, REQUEST
On Sat, 17 Jun 2006 09:55:05 -0400, tedd <[EMAIL PROTECTED]> wrote: > At 8:52 AM -0300 6/17/06, Martin Marques wrote: >>Yesterday when reading some doc on PHP I noticed the $_REQUEST predefined > array, which looked like a solution to having to check in GET and POST data > (I'm not sure if it will really have an impact on my program yet). >> >>The thing is, I also saw this description: >> >>Variables provided to the script via the GET, POST, and COOKIE input > mechanisms, and which therefore cannot be trusted. >> >>Now, why shouldn't it be trusted? > > Martin: > > Lot's of reasons why you shouldn't trust user input. OK, let's clear something out (which I didn't put in my original mail, and should have). I know user input shouldn't be trusted. What I want to know is IF and WHY $_REQUEST should be more untrusted then $_POST or $_GET. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GET, POST, REQUEST
On Sat, 17 Jun 2006 14:25:30 -0400, Ben Ramsey <[EMAIL PROTECTED]> wrote: > On 6/17/06 9:30 AM, David Tulloh wrote: >> Martin Marques wrote: >>> Yesterday when reading some doc on PHP I noticed the $_REQUEST >>> predefined array, which looked like a solution to having to check in > GET >>> and POST data (I'm not sure if it will really have an impact on my >>> program yet). >> >> Yes, request is simply a merge of these arrays. It can be very useful >> and tends to be rather under used in PHP examples. > > Using $_REQUEST is similar to using register_globals. You simply cannot > trust the origin of the data. It's possible that a variable by the name > of "foo" exists as a cookie, POST value, and GET value. If you use > $_REQUEST, you cannot be assured that the value you are getting is from > the scope you intend to retrieve it. OK, now it's clear for me! Thanks for the enlightenment. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GET, POST, REQUEST
On Sat, 17 Jun 2006 15:01:23 +0200, "Satyam" <[EMAIL PROTECTED]> wrote: > In general, user input should never be trusted. Someone once told me that > if you ask for yes or no, you should always validate for yes, no and don't > know (of course, this was before windowed environments where the users can > only click what you offer them). Yes, I do validation. Incoming data is insearted to objects via methods that validate it first. What I was asking is why the $_REQUEST is untrueted while $_POST and $_GET are (or at least the are not explicitly untrusted). -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GET, POST, REQUEST
Yesterday when reading some doc on PHP I noticed the $_REQUEST predefined array, which looked like a solution to having to check in GET and POST data (I'm not sure if it will really have an impact on my program yet). The thing is, I also saw this description: Variables provided to the script via the GET, POST, and COOKIE input mechanisms, and which therefore cannot be trusted. Now, why shouldn't it be trusted? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Solved (Re: [PHP] HTML form)
On Thu, 01 Jun 2006 13:06:24 -0600, John Meyer <[EMAIL PROTECTED]> wrote: > Martin Marques wrote: >> doesn't seem to get it right. Here is the HTML output: >> >> >> Profesor titular >> Profesor asociado >> Profesor adjunto >> Jefe de trabajos pracáá½ticos >> Ayudante de cat½edra >> Ayudante alumno >> Pasante >> Colaborador externo >> > > Works fine on my firefox, by the way. What version of Firefox are you > using? Just found out what the problem was talking to a fellow ex-coworker. Aparently putting the values (value="4") surrounded by doble quotes (as the specs say) solved the problem. -- - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML form
Sorry for the OT, but this is PHP output anyway :-) I have a bunch of code to input and modify data through an HTML form. When I modify the options, some are in text, others in textarea, and some are in select options. Now wat I did is make the current value be the selected one, but my browser doesn't seem to get it right. Here is the HTML output: Profesor titular Profesor asociado Profesor adjunto Jefe de trabajos pracáá½ticos Ayudante de cat½edra Ayudante alumno Pasante Colaborador externo But the browser doesn't show the option "Ayudante de catedra" selected by default. Am I so blind that I can't see the problem or those my firefox have a problem? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
On Mon, 22 May 2006, Richard Lynch wrote: On Mon, May 22, 2006 11:25 am, [EMAIL PROTECTED] wrote: After the form is submitted, some fields are filled with single and/or double quote info (like: 1'2"x2'4", or sky's blue, or "cool" stuff). I validate what I got using mysql_real_escape_string() and then store the result in MySQL. And, it will be stored as:1\'2\"x2\'4\", and sky\'s blue, and \"cool\" stuff. Is this correct way No. If you still see \' in your data after it's in MySQL, then you have done TWO escapes, and should have only done ONE. By the way, the right way to escape single quotes is by adding anothe single quote (this is SQL standard). Somthing like: O'Conner --> O''Conner -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing single and double quote in MySQL
On Mon, 22 May 2006, John Nichel wrote: Brad Bonkoski wrote: Looks good to me, just make sure you use: http://www.php.net/manual/en/function.stripslashes.php if you have to dump that information back to the users. (you might want to check out: addslashes() to add the slashes before your DB insert, just to keep those things under your command) -Brad No, no, no. Bad coder. I was about to say the same! ;-) Always, always, always... mysql_real_escape_string() The best way is to use PEAR::DB and work with quoteSmart() :-D -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New PostgreSQL
A new version on PostgreSQL came out with a security SQL-injection hole fixed. Reading the docs, I find that clients have to be rebuilt, and with changes in regard to the use of the libpq library. Is there going to be a new version of PHP4 and 5 to ajust to this? Here is the data: http://www.postgresql.org/docs/techdocs.49 -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP daemons
On Tue, 16 May 2006, Richard Lynch wrote: On Tue, May 16, 2006 6:27 am, Martin Marques wrote: In the first daemon all I have to do to kill it is execute a pkill server_name. But with the new daemon (the object orientaded one) it doesn't die. After you pkill it, does it still work? Yes, I can still connect to the socket and send commands to it. Or is it a zombie? bugs:~# ps auxw | grep php root 29327 0.0 0.5 16992 2288 ?SMay15 0:00 /usr/bin/php -q /usr/local/php/printSocket/printSocket.php root 4066 0.0 1.3 17424 5352 ?SMay16 0:00 /usr/bin/php -q /usr/local/php/offline/offlineSocket.php bugs:~# pkill printSocket.php bugs:~# ps auxw | grep php root 4066 0.0 1.3 17424 5352 ?SMay16 0:00 /usr/bin/php -q /usr/local/php/offline/offlineSocket.php bugs:~# pkill offlineSocket.php bugs:~# ps auxw | grep php root 4066 0.0 1.3 17424 5352 ?SMay16 0:00 /usr/bin/php -q /usr/local/php/offline/offlineSocket.php It's possible PHP's shutdown functions trying to close the sockets and destroy the instances have a bug... You could try to pastebin the code somewhere. The code from the socket that accepts the kill is at: http://bugs.unl.edu.ar/~martin/socket1.phps The code of the socket that doesn't get killed is here: http://bugs.unl.edu.ar/~martin/socket2.tar -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP daemons
On Tue, 16 May 2006, Jad madi wrote: Martin, I'm afraid we cannot help you without reading the code, paste it to phpfi.com and send the url here now the general answer is, OOP or not OOP it doesn't matter there is problem in the code whatever and however it's written dude. Yes (the code is really big, that's why I didn't paste it). My question would be then, how can I control a SIGTERM signal from inside a PHP CLI script? P.D.: My original problem was solved, as you can see in an earlier post. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php