php-general Digest 21 Apr 2005 11:45:57 -0000 Issue 3410
php-general Digest 21 Apr 2005 11:45:57 - Issue 3410 Topics (messages 213544 through 213556): Re: Abstract Legacy question 213544 by: Rob Agar Re: script 213545 by: tommy 213546 by: Philip Hallstrom Re: parse error, unexpected T_CLASS 213547 by: Kim Briggs Regular Expression to replace pseudo-HTML? 213548 by: Murray . PlanetThoughtful Re: email through PHP] 213549 by: Balwant Singh Re: delete session cookie? 213550 by: William Stokes Re: Classe Variable 213551 by: Petar Nedyalkov Re: Session variables are not stored when set in implicitly calledconstructor!?? 213552 by: Jochem Maas Is it possible to get the whole address (including http:// ) ? 213553 by: Labunski Need urgent help on post php long code 213554 by: Pieter du Toit PHP4 to PHP5 upgrade help 213555 by: Mike PDO and Oracle... 213556 by: Charles FENDT Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Andy Pieters wrote: This is kinda hard to say in words, so I'll give a little example Class A function x calls function guid function y function z function guid Class B extends A function y calls function x function guid So what I'm wondering is when class B calls its function Y, it will in its turn call function X (which is not overloaded in class B) and function X calls the function GUID from which class? Class A or Class B? class B. Which makes sense if you think about the code, which will look like $this-guid() ... and '$this' is a 'B' Rob ---End Message--- ---BeginMessage--- Thank you both, this was indeed helpful. Now for one more question... I'd like to get my code to calculate the time between the current date (when the page is loaded by the visitor) and the very next Tuesday at 11pm. I suspect I can do this with date(w) but I can't quite figure out how to make Tuesday the beginning or end of the week in order to accomplish this... maybe I'm going about this the wrong way. Again, any pointers or assistance appreciated. Tommy On Apr 19, 2005, at 10:34 PM, Rob Agar wrote: here's the clue to the other half of the puzzle: you can do this kind of thing in php if (whatever) { include 'something.php'; } else { include 'something else.php'; } hth, Rob -Original Message- From: Stephen Johnson [mailto:[EMAIL PROTECTED] Sent: Wednesday, 20 April 2005 11:53 AM To: tommy Cc: php-general@lists.php.net Subject: Re: [PHP] script http://php.net/time http://php.net/date http://php.net/mktime one or a combination of these functions will help you do what you want. HTH On Apr 19, 2005, at 6:37 PM, tommy wrote: I'm hoping someone on this list can help me with something I've been struggling with lately... I have a php based web page that I'd like to have load an include file only when it is Tuesday 11pm - Weds 1 am Eastern Standard time (USA). At other times I would like my page to load and alternate include file. If someone could help me with the code or point me in the right direction it would be very appreciated. Thanks. Tommy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * Stephen Johnson [EMAIL PROTECTED] http://www.thelonecoder.com --continuing the struggle against bad code-- * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- I'd like to get my code to calculate the time between the current date (when the page is loaded by the visitor) and the very next Tuesday at 11pm. I suspect I can do this with date(w) but I can't quite figure out how to make Tuesday the beginning or end of the week in order to accomplish this... maybe I'm going about this the wrong way. Again, any pointers or assistance appreciated. Hmm... well, using date(w) will tell you what day of the week it is, and you know that 0=sunday and 2=tuesday. use that and some logic to compute the number of days between today and the next tuesday. Then figure out how many seconds have elapsed for today and use that in conjunction with the number of days in between and the number of seconds to get to 11pm (23*60*60). Then substract the two... and pass that to date in the format you want. Or something like that :) -philip ---End Message--- ---BeginMessage--- On 4/20/05, Jochem Maas [EMAIL PROTECTED] wrote: Dasmeet Singh wrote: BTW.. pls suggest some good editor.. I use notepad currently.. http://www.php-editors.com/ http://www.google.com/search?hl=enlr=q=good+editor+for+phpbtnG=Search
[Fwd: Re: [PHP] email through PHP]
thanks to all for the kind support. i resolved the problem, i would like to share the same with you:- 1. made the changes in php.ini (gave sendmail path) 2. gave my smtp server ip address and name in /etc/hosts file 3. gave my smtp server name in /etc/mail/sendmail.mc file 4. then made sendmail.cf file from sendmail.mc file. now i am able to send the mail to outside through PHP. pls feel free to give your suggestion on the above. once again thanks to all with best wishes balwant -Forwarded Message- From: Balwant Singh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Ken [EMAIL PROTECTED], php-general@lists.php.net Subject: Re: [PHP] email through PHP Date: 19 Apr 2005 17:15:11 +0530 thanks for your email, i read the manual and already tried the setting as told by you but its not working. i would like to again inform that i want to send email through PHP which is on a linux machine and our Company SMTP sever is on Windows Machine. i am certain the somebody has already tested it and can give me solution. pls help. with best wishes balwant On Tue, 2005-04-19 at 17:20, Angelo Zanetti wrote: why dont you read the manual, thats what its for. I know you can specify your smtp server setttings in your php.ini file. so just set your smtp to the windows server address from PHP.ini [mail function] ; For Win32 only. SMTP = smtp.myserver.com ; for Win32 only ; For Win32 only. sendmail_from = [EMAIL PROTECTED]; for Win32 only ; For Unix only. You may supply arguments as well (default: sendmail -t -i). ;sendmail_path = hope this helps Angelo Zanetti Z Logic [c] +27 72 441 3355 [t] +27 21 464 1363 [f] +27 21 464 1371 www.zlogic.co.za Balwant Singh wrote: i want to use the SMTP server which is already exists. pls. give more details.. with best wishes balwant On Tue, 2005-04-19 at 15:59, Ken wrote: On 19 Apr 2005 15:04:08 +0530, Balwant Singh [EMAIL PROTECTED] wrote: hi, I am using FEDORA 3 and PHP. I want to send email to outside by my above mentioned linux machine through PHP. For this i want to use my SMTP sever, which is on a WINDOWS machine Please inform what setting to be done in php.ini or any other file to send the email. with best wishes balwant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php erm, isn't it easier to have the smtp on your fedora box instead...? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delete session cookie?
Thanks. That's what I was looking for... Burhan Khalid [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED] William Stokes wrote: Hello, Is it possible to delete a session cookie from browser? If so how? http://www.php.net/manual/en/function.session-destroy.php See the example. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Classe Variable
On Wednesday 20 April 2005 21:04, Jochem Maas wrote: Petar Nedyalkov wrote: On Wednesday 20 April 2005 13:29, marc serra wrote: Hi, i got a problem to write automaticaly varibles in classes. i got a simple object name test like this classes Test{ public $id; public $text; } i want to affect my value to my variable like this $test = new Test missing a ';' above $champ = id; I think this should be: $champ = 'id'; $valeur_champ = 4; $test-$champ = $valeur_champ; Just use $test-{$champ} ;-) curlies are not required in this case (although they do allow more complex expressions), the following works for me: class T{public $id;}$t=new T; $a=i;$b=d;$c=id;$v=4;$t-$c=$v;$t-{$b.$a}=5; var_dump($c,$v,$t-$c,$t-id,$t-{$a.$b},$t); Curlies are just a good practice :-) my example is stupid i know but its just for an example. in fact when i write $test-$champ = $valeur_champ; I want that php execute $test-id = 4; can someone help me plz, Marc. -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgpb8zgdIVaIz.pgp Description: PGP signature
Re: [PHP] Re: Session variables are not stored when set in implicitly calledconstructor!??
Jason Barnett wrote: Adam wrote: Hallo again, thank You for Your response. // singleton for request class Request { function __destructor() { $_SESSION[variable] = hallo; The __destructor() method is supposed to be about killing the class (Request). It's probably bad practice to be changing $_SESSION vars inside of there even if that $_SESSION var affects your class. Here, read this page and maybe it will make more sense to you: http://php.net/manual/en/language.oop5.decon.php i agree that in *most* cases destructor should only clean up after object. unfortunatly for request class there are few requirements: 1) must allow immidiate use w/o any explicit initialization or finalizaion. e.g. at any file You can use only Request::getInstance()-isRefresh() /** test if this request was caused by browser refresh */. this should be one and only line (except for inclusion of request.php oc) referencing request class -- no explicit call to Request::saveToSession() or anything ugly and potentialy disastrous like that. Well ok, but why can't you just have saveToSession() in the conditional block? ?php $_SESSION['Request'] = Request::getInstance(); look $_SESSION['Request'] is now a reference to the Request getInstance(); when this session is closed the object will automatically be serialized - no need to saveToSession or whatever! just make sure you have always declared the Request class before you start the session. so have the Request::getInstance() deal with checking/setting $_SESSION['Request'] internally. if ($_SESSION['Request']-isRefresh() ) { $_SESSION['Request']-saveToSession(); /* etc. */ exit(); } /* Rest of script follows here */ ? IMHO the point of OOP is to keep each function split into the minimal functionality that you need. This allows you to reuse code easier because a function does only the *minimum* amount of work necessary instead of extra (unintended) functionality. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to get the whole address (including http:// ) ?
Hello, I know for example how to get http vars or basename, but this time I need to get the whole address, including http:// . Is it possible? Thanks in advance, Lab. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need urgent help on post php long code
I have the following code: function display_setcom() { global $config; dsprint(display_setcom()); dprint($_SESSION[logged_in]); $user_id = $_SESSION[logged_in]; $result = mysql_query(SELECT users.user_first_name, users.user_last_name, users.user_cell, users.user_idnom, users.user_email, users.user_adres1, users.user_adres2, users.user_pcode, users.user_city, users.user_prov FROM users WHERE users.user_id = '$user_id'); if (mysql_num_rows($result) == 1) { $user_detail = check_user_details($user_id); //app.func.inc.php dprint($user_detail); if ($user_detail === true) { $row = mysql_fetch_assoc($result); dprint($row); extract($row); $ewal_result = mysql_query(SELECT DECODE(ewallet.ewal_pass, '{$config[password_password]}') AS ewal_pass FROM ewallet WHERE ewallet.user_id = '$user_id'); if (!mysql_error()) { if (mysql_num_rows($ewal_result) 0) { $row = mysql_fetch_assoc($ewal_result); extract($row); dprint($row); } } else { dprint(mysql_error()); } dprint($ewal_tosetcom); $Co_ID = $config[e_wallet][Co_ID]; $Outlet = $config[e_wallet][Outlet]; $transac = get_nextid($_SESSION[database], transacs, tran_id, tran); ! this is where i echo all my required vars to post, and i get a value for each, but when i post to the next form only $co_id and $outlet is posted !! echo Admin testingbr; echo coid = .$Co_ID; echo Outlet = .$Outlet; echo user_email = .$user_email; echo ewal_pass = .$ewal_pass; echo user_id = .$user_id.$transac; echo END p class=WARNThe following details are used for your credit card transactions,brif they are incorrect or incomplete, please go to a href=index1.php?display=detailsMy Details/a and update your details.brIf it is correct, you can click on the button below to TopUp eWallet/p form action=testvars.php method=post name=setcom table CLASS=PREDICT border=1 align=center tr class=minmaxtxt tdName:/td td class=minmaxtxtcoinput name='Name' type='hidden' maxlength='25' size='35' value=$user_first_name $user_last_name$user_first_name $user_last_name/td /tr tr class=minmaxtxt tdCellphone Number:/td td class=minmaxtxtcoinput name='Tel' type='hidden' maxlength='10' size='15' value=$user_cell$user_cell/td /tr tr class=minmaxtxt tdID Number:/td td class=minmaxtxtcoinput name='Addonfields' type='hidden' maxlength='13' size=17 value=Identity:$user_idnom$user_idnom/td /tr tr class=minmaxtxt tdAddress:/td td table border=1 class=PREDICT tr class=minmaxtxt tdStreetname Number:/td td class=minmaxtxtcoinput name='Address1' type='hidden' maxlength='255' size='15' value=$user_adres1$user_adres1/td /tr tr class=minmaxtxt tdSuburb/Area:/td td class=minmaxtxtcoinput name='Address2' type='hidden' maxlength='255' size='15' value=$user_adres2$user_adres2/td /tr tr class=minmaxtxt tdPost/Zip Code:/td td class=minmaxtxtcoinput name='Zip' type='hidden' maxlength='9' size='10' value=$user_pcode$user_pcode/td /tr tr class=minmaxtxt tdCity:/td td class=minmaxtxtcoinput name='City' type='hidden' maxlength='25' size='15' value=$user_city$user_city/td /tr tr class=minmaxtxt tdProvince/State:/td td class=minmaxtxtcoinput name='State' type='hidden' maxlength='25' size='15' value=$user_prov$user_prov/td /tr tr class=minmaxtxt tdCountry/td td class=minmaxtxtco select name=Country option value=ZASouth Africa/option /select /td /tr /table /td tr class=ROW1 /table br table class=PREDICT border=1 align=center tr class=minmaxtxtco tdTopUp Amount:/td tdinput type=text name=CC_amount /tr tr class=minmaxtxt td colspan=2 align=center input type=submit name=register value=TopUp eWallet onClick=if (!ValidAmount(setcom.CC_amount.value)) { alert('Please enter a valid amount'); return (false);}; /td /tr /table input type=hidden name=Co_ID value=$Co_ID input type=hidden name=Outlet value=$Outlet input type=hidden name=UserName value=$user_email input type=hidden name=Password value=$ewal_pass input type=hidden name=Reference value=$user_id:$transac input type=hidden name=Lang value=ENG END; if ($tosetcom === 0) { //If the user has not been registered yet. print(\t\t\tinput type=\hidden\ name=\ConfirmPassword\ value=\$ewal_pass\\n); } print(\t\t/form\n); } else { print(p class=\WARN\Your details are not complete. Please update them at a href=\index1.php?display=details\My Details/a before you can TopUp your account/p\n); } } else { $_SESSION[error] .= p class=\WARN\Could not fetch user details, please try again later./p\n; dprint(mysql_error()); } } i really need help here, have a deadline -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP4 to PHP5 upgrade help
I want to upgrade my server from PHP 4.3.10 to PHP 5.0.4, however, many of my clients run scripts that will break if I do. The main problem seems to be 'classes'. Is there a way to put a band-aid on these scripts that will allow them to function when I upgrade? ++ Mike Yrabedra [EMAIL PROTECTED] Your Mac Intelligence Resource ++ W: http://www.macagent.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDO and Oracle...
I try to use PDO to access to Oracle database... I use PDO::prepare and bindParam to set var values... but it didn't work !!! PDO_PARAM_INT didn't work with columns of type NUMBER... What can i do ??? Regards, FENDT Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDO Oracle
I try PDO with Oracle... I want to use a prepared query with a param... but bindParam freeze Apache, exec(arra(...)) send me an error : OCIBindByPos: ORA-01036: numro/nom de variable interdit (..\pecl\pdo_oci\oci_statement.c:259) Any idee ?? Regards, FENDT Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDO Oracle
Charles FENDT a crit : I try PDO with Oracle... I want to use a prepared query with a param... but bindParam freeze Apache, exec(arra(...)) send me an error : OCIBindByPos: ORA-01036: numro/nom de variable interdit (..\pecl\pdo_oci\oci_statement.c:259) Any idee ?? Regards, FENDT Charles more precisions... table.id is NUMBER(8) ?php $pdo = new PDO(oci:dbname=MRFL3, nemca12, nemca12); $query = $pdo-prepare(SELECT * FROM table WHERE id = :id_value); $val = 1; $query-bindParam(':id_value', $val, PDO_PARAM_INT); $query-execute(); var_dump($query-errorInfo()); ? array(3) { [0]= string(5) HY000 [1]= int(1460) [2]= string(116) OCIStmtExecute: ORA-01460: unimplemented or unreasonable conversion requested (..\pecl\pdo_oci\oci_statement.c:132) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reverse MD5 ???
Hello, I have a system that uses certain id info. This info is stored in a session cookie in MD5 format. At certain parts of the code I need to update or insert to MySQL DB with that id info value in cleartext. Is this possible? If so, how to put this to a sql query? $sqlquery = insert into x_table (team_id,number,) values ('$team_id','$number') $team_id is the MD5 formatted cookie value and I need to put it to the x_table column team_id in cleartext. Thanks a lot -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reverse MD5 ???
William Stokes a écrit : Hello, I have a system that uses certain id info. This info is stored in a session cookie in MD5 format. At certain parts of the code I need to update or insert to MySQL DB with that id info value in cleartext. Is this possible? If so, how to put this to a sql query? $sqlquery = insert into x_table (team_id,number,) values ('$team_id','$number') $team_id is the MD5 formatted cookie value and I need to put it to the x_table column team_id in cleartext. Thanks a lot -Will MD5 = no reverse that's why it's secure... sorry... FENDT Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reverse MD5 ???
William Stokes wrote: Hello, I have a system that uses certain id info. This info is stored in a session cookie in MD5 format. At certain parts of the code I need to update or insert to MySQL DB with that id info value in cleartext. Is this possible? If so, how to put this to a sql query? $sqlquery = insert into x_table (team_id,number,) values ('$team_id','$number') $team_id is the MD5 formatted cookie value and I need to put it to the x_table column team_id in cleartext. Thanks a lot -Will Any information that you wouldn't want in the script in plain text, you probably don't want in the database in clear text. Moreover MD5 is a one way hash and although it is broken, you probably don't want to spend the processing time needed to reverse it. Instead, I would just suggest that you try to use the hashed value of the id for whatever purpose you need. If you show some code that relates to how you need the id then maybe we can suggest to you how you can do that. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
Re: [PHP] reverse MD5 ???
Hello William, Thursday, April 21, 2005, 2:28:01 PM, you wrote: WS $team_id is the MD5 formatted cookie value and I need to put it to the WS x_table column team_id in cleartext. You need to re-think how those cookie values are stored then. You cannot un-MD5 something at all, it's a one-way hashing algorithm. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is it possible to get the whole address (including http:// ) ?
Labunski wrote: Hello, I know for example how to get http vars or basename, but this time I need to get the whole address, including http:// . Is it possible? Thanks in advance, Lab. http://php.net/reserved.variables ?php var_dump($_SERVER['REQUEST_URI']); ? -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
[PHP] Re: PHP4 to PHP5 upgrade help
Mike wrote: I want to upgrade my server from PHP 4.3.10 to PHP 5.0.4, however, many of my clients run scripts that will break if I do. The main problem seems to be 'classes'. Is there a way to put a band-aid on these scripts that will allow them to function when I upgrade? If the main problem is classes then you might try changing your php.ini (note that this will only be in PHP5): zend.ze1_compatibility_mode = 1; http://php.net/manual/en/ini.core.php#ini.zend.ze1-compatibility-mode -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
[PHP] Post shorter code
You're far more likely to get someone to look at your problem code if you can narrow it down to a block of code. Hell, you didn't even state a problem!!! Sorry, but if you come back with a well defined problem then maybe someone can help you. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
Re: [PHP] Regular Expression to replace pseudo-HTML?
I'm hoping someone can help me figure out a regex that will replace pseudo-HTML codes in a string with desired HTML equivalents. In particular, I'm trying to implement a message quoting facility, such as when you click on the 'quote' button in phpBB. http://us2.php.net/manual/en/function.preg-replace.php There's an example part way down the page that's almost exactly what you want... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
You're far more likely to get someone to look at your problem code if you can narrow it down to a block of code. Hell, you didn't even state a problem!!! Sorry, but if you come back with a well defined problem then maybe someone can help you. It also helps if you quote a bit from the original post so new people to the thread will know what you are talking about... for example: I have no idea about which thread Jason(above) is talking about :-) Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.16 - Release Date: 4/18/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
On Thursday 21 April 2005 17:20, Ryan A wrote: You're far more likely to get someone to look at your problem code if you can narrow it down to a block of code. Hell, you didn't even state a problem!!! Sorry, but if you come back with a well defined problem then maybe someone can help you. It also helps if you quote a bit from the original post so new people to the thread will know what you are talking about... for example: I have no idea about which thread Jason(above) is talking about It's just up to Netiquette ;-) :-) Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.16 - Release Date: 4/18/2005 -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgpD3pb0dZj3p.pgp Description: PGP signature
[PHP] 1 web site, 3 servers, 3 countries - best practises?
Hi all, Are there any recommended readings (books, blogs, site articles) that deal with setting up a single web site split across multiple servers and countries? Specifically looking for best practises regarding handling the content (syncing between the servers) to ensure users get a seamless experience regardless of which country they access the site from. I have several ideas about how to approach this but am still in the research stage, so if any of the respected PHP bods (Mr. Schlossnagle, etc) have already covered it I'd love to know about it. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
All of them. :) -TG = = = Original message = = = You're far more likely to get someone to look at your problem code if you can narrow it down to a block of code. Hell, you didn't even state a problem!!! Sorry, but if you come back with a well defined problem then maybe someone can help you. It also helps if you quote a bit from the original post so new people to the thread will know what you are talking about... for example: I have no idea about which thread Jason(above) is talking about :-) Cheers, Ryan ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] view zip file contents
does anyone know of a way to view the contents of a zip file and its directory structure? i know there are zip file functions in php but they require extra libs i would rather not load right now. i know its possible, at least by looking at this download manager that does this: http://phpatm.free.fr/ i tried looking at the source code but its messy. nice app, but awful coding practice. anyway, if anyone knows a method to do this, please let me know. cheers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR Packages
Hi, I have just started to explore PEAR. I am using PHP 4.3.11 and so PEAR automatically comes with PHP. I would like to install PEAR's DB classes. However, I cam right now browsing the PEAR web site and cannot find information on how to install a package. I have also downloaded and opened the DB tgz file but there is no install document. Can someone point me to the proper URL that explains how to install a PEAR package? Thanks, Don
Re: [PHP] view zip file contents
does anyone know of a way to view the contents of a zip file and its directory structure? i know there are zip file functions in php but they require extra libs i would rather not load right now. http://pear.php.net/package/Archive_Zip don't know if it requires extra libs... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PEAR Packages
El Jue 21 Abr 2005 11:36, Don escribió: Hi, I have just started to explore PEAR. I am using PHP 4.3.11 and so PEAR automatically comes with PHP. I would like to install PEAR's DB classes. However, I cam right now browsing the PEAR web site and cannot find information on how to install a package. I have also downloaded and opened the DB tgz file but there is no install document. Asumming your are in a UNIX environment, I would do: # pear install DB for more information: # pear --help It should be similar on Windows system? -- 11:46:02 up 19 days, 20:14, 2 users, load average: 4.74, 2.00, 1.07 - Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar' Centro de Telematica | DBA, Programador, Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PEAR Packages
Don wrote: Hi, I have just started to explore PEAR. I am using PHP 4.3.11 and so PEAR automatically comes with PHP. I would like to install PEAR's DB classes. However, I cam right now browsing the PEAR web site and cannot find information on how to install a package. I have also downloaded and opened the DB tgz file but there is no install document. Can someone point me to the proper URL that explains how to install a PEAR package? Thanks, Don If you already have PEAR on your system then you should be able to do: pear install NAME_OF_PACKAGE For help on using the installed: pear help -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
Re: [PHP] view zip file contents
No releases have been made yet. Philip Hallstrom wrote: does anyone know of a way to view the contents of a zip file and its directory structure? i know there are zip file functions in php but they require extra libs i would rather not load right now. http://pear.php.net/package/Archive_Zip don't know if it requires extra libs... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PEAR Packages
I was a little confused at first, but it's actually REALLY simple. I was doing manual installations until I discovered that PEAR has made everything way too easy for us. From the PEAR manual: ## To update your PEAR installation from go-pear.org, request http://go-pear.org/ in your browser and save the output to a local file go-pear.php. You can then run php go-pear.php ## (http://pear.php.net/manual/en/installation.getting.php) (Go to that address, copy the text you get into a file called go-pear.php then run php go-pear.php from the command line) ## Next page of the manual talks about how to install packages. Says you need the latest PEAR package manager (I don't remember installing this.. maybe my PEAR came with it already) then from the command line you can do: pear remote-list This gives you a list of packages. pear install package This automatically downloads and installs the package you want. Just keep in mind that you need to be specific about the name. We were installing the Spreadsheet_Excel_Writer package. You can't just say: pear install Spreadsheet_Excel_Writer You have to get the actual filename correct. In this case, if you look at Excel Writer's page (http://pear.php.net/package/Spreadsheet_Excel_Writer) you'll see it has a version 0.8. Hover over the 0.8 and you'll see the download filename is Spreadsheet_Excel_Writer-0.8.tgz, so we used something like: pear install Spreadsheet_Excel_Writer-0.8 (I don't think we needed to use the .tgz) Anyway, been a while since I've messed with it, so I might not be 100% on the syntax, but hopefully this'll clarify the process a little more. We had to stumble through it a little, but once we figured it out, it was WAY too easy.. hah.. Good luck! -TG = = = Original message = = = Hi, I have just started to explore PEAR. I am using PHP 4.3.11 and so PEAR automatically comes with PHP. I would like to install PEAR's DB classes. However, I cam right now browsing the PEAR web site and cannot find information on how to install a package. I have also downloaded and opened the DB tgz file but there is no install document. Can someone point me to the proper URL that explains how to install a PEAR package? Thanks, Don ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PEAR Packages
For us, the unix instructions worked 100% on Windows as well. Guess since it's all PHP based it didn't make a difference. Probably some minor internal tweaks and checks due to filesystem differences, but the PEAR guys did a great job in making it all very easy. Now for us lazy Windows guys, someone needs to write a Winbinder based GUI PEAR package installer. Hmm... another project to add to my list of projects that I'll never finish. haha -TG = = = Original message = = = El Jue 21 Abr 2005 11:36, Don escribi~: Hi, I have just started to explore PEAR. I am using PHP 4.3.11 and so PEAR automatically comes with PHP. I would like to install PEAR's DB classes. However, I cam right now browsing the PEAR web site and cannot find information on how to install a package. I have also downloaded and opened the DB tgz file but there is no install document. Asumming your are in a UNIX environment, I would do: # pear install DB for more information: # pear --help It should be similar on Windows system? ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
It also helps if you quote a bit from the original post so new people to the thread will know what you are talking about... for example: I have no idea about which thread Jason(above) is talking about It's just up to Netiquette ;-) I dont think the above qualifies for netiquette all that much, because I have never found fault with Jason's netiquette, sometimes people just forget and it gets really confusing to the reader who comes in late. Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reverse MD5 ???
On 21 Apr 2005 Jason Barnett wrote: Any information that you wouldn't want in the script in plain text, you probably don't want in the database in clear text. Moreover MD5 is a one way hash and although it is broken, you probably don't want to spend the processing time needed to reverse it. In the general case, no reasonable amount of processing time will reverse it since (AFAIK) you have to brute force test all possible values, though for very short text it can sometimes be done, and there are online databases out there. For the OP, this is part of what it means to use a hash or digest (MD = message digest) as opposed to an encrypted value. The conversion from the original text to the hash is one-way and as a general rule cannot be reversed except by trying every possibility for the original text, which becomes an astronomical task with even very small text lengths. For example, for text using a-Z, A-Z, and 0-9, there are 218 trillion possible 8-character values (62 ^ 8) and 839 quadrillion possible 10-character values. Imagine MD5 (this is a very crude analogy) as taking a letter, tearing it up into tiny pieces, rearranging them according to some complex predefined algorithm, then selecting a hundred or so pieces with individual letters on them and putting those together as a code, and burning the rest. There is no way you can reproduce the letter from the code, except in the limited case where the letter is very short and your code actually incorporates all the pieces. I believe the places where MD5 can be broken by brute force are where common words or phrases are used -- then it is possible to create a database of possibilities and their MD5 hashes and the database lookup is then quite fast. For example this allows people who have the MD5 hash of a password to break short, common words used as passwords very easily. But if the MD5 value is not there, you are still stuck. For the example above (10-character values using A-Z, a-z, and 0-9) if my calculations are correct it would take about 32 million gigabytes to store those 839 quadrillion values and their matching MD5 digests in a database, not counting indexing (which adds to this) nor compression and other optimization (which could reduce it). I am not talking about general security here and saying it is OK to expose the MD5 values, just looking at the difficulty of reversing them. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
On Thursday 21 April 2005 18:21, Ryan A wrote: It also helps if you quote a bit from the original post so new people to the thread will know what you are talking about... for example: I have no idea about which thread Jason(above) is talking about It's just up to Netiquette ;-) I dont think the above qualifies for netiquette all that much, because I have never found fault with Jason's netiquette, sometimes people just forget and it gets really confusing to the reader who comes in late. OFFTOPIC Forgetting is also an issue in Netiquette ;-) A lot of people forget the rules, it's not a problem. I just meant that we have to be careful. /OFFTOPIC Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgphHhBMekHeB.pgp Description: PGP signature
Re: [PHP] reverse MD5 ???
It's simple. If your system supports it performance wise. Grab the id and compare it against the md5 version of the id saved in the cookie. if( $_COOKIE['id'])== md5($id)) { //.. then allow or let the user to do something } that's if you have the id already known. otherwise if you donno the id you gotta grab all the ids and md5 them and then compare them against the one stored in the cookie; which I dont recommand and is realy a stupid thing to do. HTH On 4/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 21 Apr 2005 Jason Barnett wrote: Any information that you wouldn't want in the script in plain text, you probably don't want in the database in clear text. Moreover MD5 is a one way hash and although it is broken, you probably don't want to spend the processing time needed to reverse it. In the general case, no reasonable amount of processing time will reverse it since (AFAIK) you have to brute force test all possible values, though for very short text it can sometimes be done, and there are online databases out there. For the OP, this is part of what it means to use a hash or digest (MD = message digest) as opposed to an encrypted value. The conversion from the original text to the hash is one-way and as a general rule cannot be reversed except by trying every possibility for the original text, which becomes an astronomical task with even very small text lengths. For example, for text using a-Z, A-Z, and 0-9, there are 218 trillion possible 8-character values (62 ^ 8) and 839 quadrillion possible 10-character values. Imagine MD5 (this is a very crude analogy) as taking a letter, tearing it up into tiny pieces, rearranging them according to some complex predefined algorithm, then selecting a hundred or so pieces with individual letters on them and putting those together as a code, and burning the rest. There is no way you can reproduce the letter from the code, except in the limited case where the letter is very short and your code actually incorporates all the pieces. I believe the places where MD5 can be broken by brute force are where common words or phrases are used -- then it is possible to create a database of possibilities and their MD5 hashes and the database lookup is then quite fast. For example this allows people who have the MD5 hash of a password to break short, common words used as passwords very easily. But if the MD5 value is not there, you are still stuck. For the example above (10-character values using A-Z, a-z, and 0-9) if my calculations are correct it would take about 32 million gigabytes to store those 839 quadrillion values and their matching MD5 digests in a database, not counting indexing (which adds to this) nor compression and other optimization (which could reduce it). I am not talking about general security here and saying it is OK to expose the MD5 values, just looking at the difficulty of reversing them. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- M.Saleh.E.G 97150-4779817
RE: [PHP] Post shorter code
Petar Nedyalkov mailto:[EMAIL PROTECTED] on Thursday, April 21, 2005 8:17 AM said: OFFTOPIC Forgetting is also an issue in Netiquette ;-) A lot of people forget the rules, it's not a problem. I just meant that we have to be careful. /OFFTOPIC Yeah and sometimes people forget to trim their messages... :| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
Chris W. Parker wrote: What? ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
dont fight guys, it makes me nervous... :) d On 4/21/05, Petar Nedyalkov [EMAIL PROTECTED] wrote: On Thursday 21 April 2005 18:21, Ryan A wrote: It also helps if you quote a bit from the original post so new people to the thread will know what you are talking about... for example: I have no idea about which thread Jason(above) is talking about It's just up to Netiquette ;-) I dont think the above qualifies for netiquette all that much, because I have never found fault with Jason's netiquette, sometimes people just forget and it gets really confusing to the reader who comes in late. OFFTOPIC Forgetting is also an issue in Netiquette ;-) A lot of people forget the rules, it's not a problem. I just meant that we have to be careful. /OFFTOPIC Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 -- dc .. drewcore.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 1 web site, 3 servers, 3 countries - best practises?
My domain, satyam.com.ar, though supposedly in Argentina resides in Spain, where I currently live hundreds of kilometers away from it, which I mention to point out that domain names do not correlate to physical locations. Unless there is a political issue regarding who owns the actual machine and budgeting problems, I would rather keep just one server farm fed from multiple international locations. Satyam Richard Davey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Are there any recommended readings (books, blogs, site articles) that deal with setting up a single web site split across multiple servers and countries? Specifically looking for best practises regarding handling the content (syncing between the servers) to ensure users get a seamless experience regardless of which country they access the site from. I have several ideas about how to approach this but am still in the research stage, so if any of the respected PHP bods (Mr. Schlossnagle, etc) have already covered it I'd love to know about it. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reverse MD5 ???
If I tell you that dividing a certain number by three gives you a remainder of 2, would you be able to guess the first number? Same thing with MD5, it is just one way, it can't be reversed. Satyam William Stokes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have a system that uses certain id info. This info is stored in a session cookie in MD5 format. At certain parts of the code I need to update or insert to MySQL DB with that id info value in cleartext. Is this possible? If so, how to put this to a sql query? $sqlquery = insert into x_table (team_id,number,) values ('$team_id','$number') $team_id is the MD5 formatted cookie value and I need to put it to the x_table column team_id in cleartext. Thanks a lot -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reverse MD5 ???
I am not really interested in reversing MD5 and I sure as hell hope its not easy to do for a LONG time to come as we use it in some of our licensing, for software we sell.BUT the below text was some good reading none the less. I'm gonna copy and save the below text for the next client who asks me since you are using it with my credit card,how safe is MD5 anyway? :-p Thanks mate! If i get time maybe even put it on the website we sell the software from (Tom, write to me if you object to this as its your text) even if your calculations are slightly off (dont know if they are..I have trouble counting higher than a few million :-) ), you convinced me! Cheers, Ryan In the general case, no reasonable amount of processing time will reverse it since (AFAIK) you have to brute force test all possible values, though for very short text it can sometimes be done, and there are online databases out there. For the OP, this is part of what it means to use a hash or digest (MD = message digest) as opposed to an encrypted value. The conversion from the original text to the hash is one-way and as a general rule cannot be reversed except by trying every possibility for the original text, which becomes an astronomical task with even very small text lengths. For example, for text using a-Z, A-Z, and 0-9, there are 218 trillion possible 8-character values (62 ^ 8) and 839 quadrillion possible 10-character values. Imagine MD5 (this is a very crude analogy) as taking a letter, tearing it up into tiny pieces, rearranging them according to some complex predefined algorithm, then selecting a hundred or so pieces with individual letters on them and putting those together as a code, and burning the rest. There is no way you can reproduce the letter from the code, except in the limited case where the letter is very short and your code actually incorporates all the pieces. I believe the places where MD5 can be broken by brute force are where common words or phrases are used -- then it is possible to create a database of possibilities and their MD5 hashes and the database lookup is then quite fast. For example this allows people who have the MD5 hash of a password to break short, common words used as passwords very easily. But if the MD5 value is not there, you are still stuck. For the example above (10-character values using A-Z, a-z, and 0-9) if my calculations are correct it would take about 32 million gigabytes to store those 839 quadrillion values and their matching MD5 digests in a database, not counting indexing (which adds to this) nor compression and other optimization (which could reduce it). I am not talking about general security here and saying it is OK to expose the MD5 values, just looking at the difficulty of reversing them. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post shorter code
Chris W. Parker wrote: What? ;) HAHAHAHA -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post redirect
if you redirect the browser to a new page, once that new page loads up, any POST or GET variables from the previous page will be replaced with the new redirected to page. Jem777 wrote: If I submit a post and then, serverside, I redirect the request to another page, do the post variables still live in the new page? Thanks, Jem777 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reverse MD5 ???
On 4/21/05, Satyam [EMAIL PROTECTED] wrote: If I tell you that dividing a certain number by three gives you a remainder of 2, would you be able to guess the first number? Yes. 5, 8, 11, 14, etc. Same thing with MD5, it is just one way, it can't be reversed. MD5 collisions were found last year: http://cryptography.hyperlink.cz/md5/MD5_collisions.pdf Just a matter of time/cpu power. -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reverse MD5 ???
Interesting reading, even though most of it went over my head :-) There ar'nt any tools freely available to the average joe to decypher a md5 hash though...right? Cheers, -Ryan On 4/21/2005 6:34:45 PM, Greg Donald ([EMAIL PROTECTED]) wrote: On 4/21/05, Satyam [EMAIL PROTECTED] wrote: If I tell you that dividing a certain number by three gives you a remainder of 2, would you be able to guess the first number? Yes. 5, 8, 11, 14, etc. Same thing with MD5, it is just one way, it can't be reversed. MD5 collisions were found last year: http://cryptography.hyperlink.cz/md5/MD5_collisions.pdf Just a matter of time/cpu power. -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DB::DataObject 1.7.13
Dear All, It appears that the behaviour of the DataObject generator has changed so that it now uses schemas, the links file that it generates now doesnt' seem to have the correct key information so things like FormBuilder no longer work. Is there a way to 1) disable the schemas for legacy applications 2) set up an option in the config file to use a given schema transparently? In other words, can one add in the config file something like Default_schema = myschema so that Myobject.php now refers to the table myschema.myobject In this way the best of both worlds can be maintained. -ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need help in mail and instant messenger source
Hi, Please send me if you know any open source sites for Instant Messenger and Mail Package applications in PHP. I found some, but not so good. Thnaks in advance. --srinadh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I need do paging in php, I use ODBC Access
Dear Friends. Somebody did paging in php for data origin in ODBC Access? I need an algorithm for doing this, please Help me! Ok? TOMAS - Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27 en el dominio de correo angerona.cult.cu y no se encontro ninguna coincidencia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] formatting logic
Hi, Am having a bit of logic problem figuring this outI just think the easy solution would cost me in having too many sql queries from my script so there has to be a easier way. I am allowing our members to upload pictures and they can choose which category the pictures go under, the first category public is made for them. When I sql the DB I call it like this: select picture_names,more fields from table where member_id=x order by category. which i display something like this: __ | pic-here | some text here | category here| | pic-here | some text here | category here| | pic-here | some text here | category here| | pic-here | some text here | category here| - how can i display it like this: __ category here| - | pic-here | some text here | | pic-here | some text here | | pic-here | some text here | __ category here| - | pic-here | some text here | | pic-here | some text here | - I thought of just getting the categories into an array and then sqling on each category but if there are 30 user defined categories that would mean 30 queries Another more complicated way would be to get all the records and sort them into arrays via categories and child arrays...I just feel this is too complicated for the above job. What am I missing? Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reverse MD5 ???
Nope.. nothing that'll easily decrypt MD5 back to it's original value. As the line below says and the rest of the thread explained, MD5 is a one-way function. In ordre to take an MD5 hash and get back to the original value, you'd basically have to take every possible combination of letters/numbers/etc and create an MD5 hash out of them and compare that with the one you're trying to Decrypt. So you're not really decrypting, just methodically guessing and then automatically trying the next guess. This is a VERY long and time consuming process and essentially isn't worth it. The short answer? No, there are no tools to decrypt MD5. It's a hash (like a checksum) not an encrypted string. You could write your own brute force program like above in about 2 minutes, but it wouldn't do you any practical good. -TG = = = Original message = = = Interesting reading, even though most of it went over my head :-) There ar'nt any tools freely available to the average joe to decypher a md5 hash though...right? Cheers, -Ryan Just a matter of time/cpu power. ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I need do paging in php, I use ODBC Access
* Tomás Rodriguez Orta [EMAIL PROTECTED]: Somebody did paging in php for data origin in ODBC Access? I need an algorithm for doing this, please Help me! Grab PEAR Pager, and let it do the work for you. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formatting logic
I am allowing our members to upload pictures and they can choose which category the pictures go under, the first category public is made for them. When I sql the DB I call it like this: select picture_names,more fields from table where member_id=x order by category. which i display something like this: __ | pic-here | some text here | category here| | pic-here | some text here | category here| - how can i display it like this: __ category here| - | pic-here | some text here | | pic-here | some text here | __ category here| - | pic-here | some text here | | pic-here | some text here | - I thought of just getting the categories into an array and then sqling on each category but if there are 30 user defined categories that would mean 30 queries Another more complicated way would be to get all the records and sort them into arrays via categories and child arrays...I just feel this is too complicated for the above job. Keep your query like it is... and do something like this: $current_category = ; while ( $row = db_get_object_function($db_result) ) { if ($current_category != $row-category) { print($row-category header goes here); $current_category = $row-category; } print(pic-here stuff goes here); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formatting logic
Hi First, execute your query unset($fail); $res=mysql_query($sql,$dbhandle) or $fail=true; if( (isset($fail)) || (!(is_resource($res)) ) echo There was a problem with the execution of the query; if(mysql_num_rows($res)==0) echo The query resulted in ZERO records; #now that's out of the way, start processing the records. Since you ordered them by category already, just do like this $oldcat=''; while($rec=mysql_fetch_assoc($res) {if(!($oldcat==$rec['category'])) {echo Your category header here; $oldcat=$rec['category'];} echo picture data here;} if(is_resource($res)) mysql_free_result($res); What am I missing? The way to the php.net website. http://www.php.net/ -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] htaccess file
Is there any way that i can see if using htaccess file is enabled on server without contacting my isp. I created a htaccess file and ftp'd it to the server with the register_globals flag set to 0: this is the htaccess code # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* Limit GET POST order deny,allow deny from all allow from all /Limit Limit PUT DELETE order deny,allow deny from all /Limit AuthUserFile /home/predicta/public_html/_vti_pvt/service.pwd AuthGroupFile /home/predicta/public_html/_vti_pvt/service.grp php_flag engine off AllowOverrid ALL php_admin_flag register_globals 0 and this is what happens Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.33 Server at www.predictabid.com Port 80 I suppose this means that htaccess use is not enabled? If this is the case, what else can i use to set register_globals to on? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I need do paging in php, I use ODBC Access
Somebody did paging in php for data origin in ODBC Access? I need an algorithm for doing this, please Help me! I assume by paging you are referring to a scrolling algorithm that allows you to view only a small portion of your query result set. The algorithm that comes to mind is dependent on the database that ODBC is connected to. If the database is MySQL, the query that would allow do this is the SQL LIMIT clause, where executing and re-executing the query will return only a portion of the sequence set produced by the query; $query = SELECT .$columnlist . from my_table where col1 = \sold\ order by order_date .LIMIT .sprintf(%01d,$rowno)., 10 ; If $rowno = 0 the query will return the first 10 rows If you add 10 to $rowno and re-execute the query, it will return the second set of 10 rows And so on. I have used ODBC to access Microsoft SQL Server and DB2 Databases, and I believe neither support the SQL LIMIT clause, although I am not as certain about my memory of MSS as DB2. Someone will correct me if I am wrong. The only approach left that I could come up with is to transfer the entire sequence set to your application, and count the rows, perhaps only displaying the rows you want to show. This is obviously not very efficient (in fact, with enough rows it may prove impossible because of memory limitations), but it will produce what appears to be a paged result. HTH, Warren Vail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can I use $_REQUEST for file uploads?
Hi When I use $_REQUEST for accessing files uploaded, it is working fine in PHP PHP 4.3.10. But it is not working in PHP 4.3.4. $_FILES working in both the versions. Can I use $_REQUEST in PHP 4.3.10 also? Do I need to change any configuration in php.ini? server is Apache/2.0.49 Please help me in this regard. Thanks, S.Srinadh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] htaccess file
Well, if the htaccess file caused an internal server error (500) then yes, it's reading it. This isn't an apache list, you probably want to ask this question somewhere else... That being said... Are you missing an 'e' in the AllowOverride line near the bottom? Pieter du Toit wrote: Is there any way that i can see if using htaccess file is enabled on server without contacting my isp. I created a htaccess file and ftp'd it to the server with the register_globals flag set to 0: this is the htaccess code # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* Limit GET POST order deny,allow deny from all allow from all /Limit Limit PUT DELETE order deny,allow deny from all /Limit AuthUserFile /home/predicta/public_html/_vti_pvt/service.pwd AuthGroupFile /home/predicta/public_html/_vti_pvt/service.grp php_flag engine off AllowOverrid ALL php_admin_flag register_globals 0 and this is what happens Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.33 Server at www.predictabid.com Port 80 I suppose this means that htaccess use is not enabled? If this is the case, what else can i use to set register_globals to on? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] htaccess file
On 4/21/05, Pieter du Toit [EMAIL PROTECTED] wrote: Is there any way that i can see if using htaccess file is enabled on server without contacting my isp. I created a htaccess file and ftp'd it to the server with the register_globals flag set to 0: php_admin_flag register_globals 0 php_flag register_globals Off is what I've always used. -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PEAR Packages
On Thursday 21 April 2005 17:04, [EMAIL PROTECTED] wrote: Hmm... another project to add to my list of projects that I'll never finish. haha Glad to know I'm not the only one. ;-) Andy -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need do paging in php, I use ODBC Access
You are right about MSSQL not having a limit, but here is an article that shows a work around http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=850lngWId=5 Warren Vail [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Somebody did paging in php for data origin in ODBC Access? I need an algorithm for doing this, please Help me! I assume by paging you are referring to a scrolling algorithm that allows you to view only a small portion of your query result set. The algorithm that comes to mind is dependent on the database that ODBC is connected to. If the database is MySQL, the query that would allow do this is the SQL LIMIT clause, where executing and re-executing the query will return only a portion of the sequence set produced by the query; $query = SELECT .$columnlist . from my_table where col1 = \sold\ order by order_date .LIMIT .sprintf(%01d,$rowno)., 10 ; If $rowno = 0 the query will return the first 10 rows If you add 10 to $rowno and re-execute the query, it will return the second set of 10 rows And so on. I have used ODBC to access Microsoft SQL Server and DB2 Databases, and I believe neither support the SQL LIMIT clause, although I am not as certain about my memory of MSS as DB2. Someone will correct me if I am wrong. The only approach left that I could come up with is to transfer the entire sequence set to your application, and count the rows, perhaps only displaying the rows you want to show. This is obviously not very efficient (in fact, with enough rows it may prove impossible because of memory limitations), but it will produce what appears to be a paged result. HTH, Warren Vail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PEAR Packages
[EMAIL PROTECTED] wrote: For us, the unix instructions worked 100% on Windows as well. Guess since it's all PHP based it didn't make a difference. Probably some minor internal tweaks and checks due to filesystem differences, but the PEAR guys did a great job in making it all very easy. Now for us lazy Windows guys, someone needs to write a Winbinder based GUI PEAR package installer. Hmm... another project to add to my list of projects that I'll never finish. haha Do you mean a PHP-GTK2 frontend for the PEAR installer? That would be a cross platform solution and of course it makes use of PHP. This of course assumes that PHP-GTK2 gets finished some time this decade. http://gtk.php.net/wiki/Resources/TutorialLinks?from=PhpGtk.TutorialLinks Correction: so I browsed the site a bit and maybe GTK2 is ready to go after all. But I haven't used it at all so YMMV. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
[PHP] Count totals (might be 0T)
Hi again, Am faced with a new problem (either that or working straight 10 hours is catching up!) Heres my table (easy to figure out so i wont waste your time explaining the fields): cno, date_added, pic_name, pic_size_kb, pic_desc_text, pic_category the way i am displaying the data is like this (thanks to Phillip and Andy from this list) __ category here 2pics, 90kb | - | pic-here | pic_desc_text | | pic-here | pic_desc_text | __ category here 2pics, 160kb | - | pic-here | pic_desc_text | | pic-here | pic_desc_text | - When I sql the DB I call it like this: select picture_name,more fields from table where cno=x order by category. Any ideas as to how i get how many pics per category and size per category? I'm not sure if its a PHP thing or a MySql thing... Last problem for the day...then i hit the sack! Thanks in advance, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Count totals (might be 0T)
Hey, Thanks for replying. That means I will have to run a query per categorywhich I would like to avoid if possible as they could be a high amount of categories as they are user created and not defined by us. Thanks, Ryan On 4/22/2005 12:08:31 AM, Drewcore ([EMAIL PROTECTED]) wrote: run another sql query: select pic_size_kb from table where pic_category='$current_category, then make a loop that increments a) the total number of records (ie total number of pics in category), and then adds the pic size from each record to some variable (eg $total_kb) and then you have your total. hope that helps. drew On 4/21/05, Ryan A [EMAIL PROTECTED] wrote: Hi again, Am faced with a new problem (either that or working straight 10 hours is catching up!) Heres my table (easy to figure out so i wont waste your time explaining the fields): cno, date_added, pic_name, pic_size_kb, pic_desc_text, pic_category the way i am displaying the data is like this (thanks to Phillip and Andy from this list) __ category here -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 4/20/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Count totals (might be 0T)
Hi, Friday, April 22, 2005, 8:03:06 AM, you wrote: RA Hi again, RA Am faced with a new problem (either that or working straight 10 hours is RA catching up!) RA Heres my table (easy to figure out so i wont waste your time explaining the RA fields): RA cno, RA date_added, RA pic_name, RA pic_size_kb, RA pic_desc_text, RA pic_category RA the way i am displaying the data is like this (thanks to Phillip and Andy RA from this list) RA __ RA category here 2pics, 90kb | RA - RA | pic-here | pic_desc_text | RA | pic-here | pic_desc_text | RA __ RA category here 2pics, 160kb | RA - RA | pic-here | pic_desc_text | RA | pic-here | pic_desc_text | RA - RA When I sql the DB I call it like this: select picture_name,more fields from table where cno=x order by category. RA Any ideas as to how i get how many pics per category and size per category? RA I'm not sure if its a PHP thing or a MySql thing... RA Last problem for the day...then i hit the sack! RA Thanks in advance, RA Ryan Something like SELECT COUNT(pic_name) as pic_count, SUM(pic_size_kb) as pic_total FROM pic_table GROUP BY pic_category -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to save a file with UTF-8 encoding and no BOM using PHP?
I am trying to have a file that I generated with PHP saved as UTF-8 without the BOM (Byte Order Mark). Does PHP do anything like this? I am a beginner with PHP, but very technically experienced otherwise. I'm talking about the FILE encoding here -just to be clear. e.g. fopen(what_ever_file, a+) now I want PHP save the file itself with UTF-8, NOT system default. I have searched for hours to find an answer, but have not found any info on the subject. Does PHP have any ability to create a text file saved in UTF-8 encoding??
[PHP] How to save a file with UTF-8 encoding and no BOM using PHP?
I am trying to have a file that I generated with PHP saved as UTF-8 without the BOM (Byte Order Mark). Does PHP do anything like this? I am a beginner with PHP, but very technically experienced otherwise. I'm talking about the FILE encoding here -just to be clear. e.g. fopen(what_ever_file, a+) now I want PHP save the file itself with UTF-8 encoding, NOT system default. I have searched for hours to find an answer, but have not found any info on the subject. Does PHP have any ability to create a text file saved in UTF-8 encoding?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Count totals(might be 0T)
Ryan A mailto:[EMAIL PROTECTED] on Thursday, April 21, 2005 3:03 PM said: When I sql the DB I call it like this: select picture_name,more fields from table where cno=x order by category. Any ideas as to how i get how many pics per category and size per category? I'm not sure if its a PHP thing or a MySql thing... By either running a query for each category grabbing the data you want. Or by grabbing the data you want in the initial query and adding it all up BEFORE you start to do you display logic. So the second option would be: 1. Get all the data. 2. Loop through all the data creating the tally(s) you want. 3. Loop through the data again creating your visual gropings and throwing in the tally(s) you created earlier. Try both options and time them. Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: 1 web site, 3 servers, 3 countries - best practises?
Hello Satyam, Thursday, April 21, 2005, 5:07:52 PM, you wrote: S My domain, satyam.com.ar, though supposedly in Argentina resides in Spain, S where I currently live hundreds of kilometers away from it, which I mention S to point out that domain names do not correlate to physical locations. S Unless there is a political issue regarding who owns the actual machine and S budgeting problems, I would rather keep just one server farm fed from S multiple international locations. No offense, but that entire post was completely useless with regards to my original message. This is nothing to do with domain names, I was simply asking if anyone had experience of handling one site spread across multiple remote located servers from a PHP/SQL perspective (syncing content, user accounts, etc). Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to save a file with UTF-8 encoding and no BOM using PHP?
I am trying to have a file that I generated with PHP saved as UTF-8 without the BOM (Byte Order Mark). Does PHP do anything like this? I am a beginner with PHP, but very technically experienced otherwise. I'm talking about the FILE encoding here -just to be clear. e.g. fopen(what_ever_file, a+) now I want PHP save the file itself with UTF-8, NOT system default. I have searched for hours to find an answer, but have not found any info on the subject. Does PHP have any ability to create a text file saved in UTF-8 encoding??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: 1 web site, 3 servers, 3 countries - best practises?
well, i guess it all depends... are you talking about having one server in south america that acts as your database server, one server in asia that's your web server, and then another server in north america that servers some other task? or are you talking about having a localized database, http, etc, server for each location (read: continent/country)? the first is easy... it'll all just mesh... the second is more difficult. drew -- dc .. drewcore.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can I use $_REQUEST for file uploads?
$_REQUEST should work fine with 4.3.10 IF $_FILES does not have any problems since both depend more or less on the same php.ini directives. Take a look at http://www.php.net/manual/en/reserved.variables.php#reserved.variables.files Cheers, Prathap -- Original Message --- From: Srinadh Sannidhanam [EMAIL PROTECTED] To: Sent: Fri, 22 Apr 2005 01:18:19 +0530 Subject: [PHP] Can I use $_REQUEST for file uploads? Hi When I use $_REQUEST for accessing files uploaded, it is working fine in PHP PHP 4.3.10. But it is not working in PHP 4.3.4. $_FILES working in both the versions. Can I use $_REQUEST in PHP 4.3.10 also? Do I need to change any configuration in php.ini? server is Apache/2.0.49 Please help me in this regard. Thanks, S.Srinadh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End of Original Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php