Re: [PHP] Sessions and Classes
What is the proper way to transfer class properties through-out my pages... if (!session_is_registered(myCart)){ $myCart = new ShoppingCart(); (some other stuffs...) session_register(myCart); } you dont need to do this, else { $myCart = new ShoppingCart(); } as far as i have experienced. the type of the session variable is saved in the session too, so php automatically realizes that myCart is an instance of ShoppingCart, you only need to be sure to have the class ShoppingCart defined before you start the session, if i remember right that's at least how i do it and it works already for quite a while very well :-) -- Wolfram -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 6 Feb 2002 08:35:33 -0000 Issue 1155
php-general Digest 6 Feb 2002 08:35:33 - Issue 1155 Topics (messages 83631 through 83684): Duplicate e-mails 83631 by: Anthony Rodriguez 83633 by: Analysis and Solutions Books on PHP 83632 by: Ronald D Wahlen 83634 by: Kevin Stone 83641 by: LaserJetter 83646 by: Manuel Lemos Re: whic OS is under? 83635 by: LaserJetter 83638 by: Lars Torben Wilson File Upload -- File Trailer Partial 83636 by: Richard Lynch 83640 by: Michael Kimsal POST to SSL Server without CURL? 83637 by: Gabriel Richards Curl Support Not Compiling 83639 by: Gabriel Richards Re: 72dpi with gdlibrary2? 83642 by: Andrew Chase Re: Changes in Sessions (PHP Versions) 83643 by: Yasuo Ohgaki mktime() problem 83644 by: toni baker How do I display variables in text boxes when the value of a drop down menu changes? 83645 by: Don 83648 by: Martin Towell date(), time() different to system time 83647 by: Anth Courtney 83655 by: DL Neil 83662 by: Anth Courtney MySQL selecting the maximum value from a column 83649 by: Melanie Gann 83650 by: Martin Towell 83652 by: Lars Torben Wilson Re: Can anyone jog my memory on HTTP_REFERER Javascript location:replace? 83651 by: Lazor, Ed How do I keep form inputs from being cleared - Please Help! 83653 by: SpamSucks86 83656 by: Miles Thompson Re: Problem...header already sent by 83654 by: Ryan F. Bayhonan safe mode/mkdir problem - HELP! 83657 by: Roberto P.Martins Jr Dynamic Dropdown menu question. 83658 by: Michael O'Neal 83659 by: Lars Torben Wilson 83660 by: Jeff Sheltren 83661 by: bvr 83665 by: jtjohnston RePOST: Sessions and Classes 83663 by: PHP-List Previous n Articles 83664 by: jtjohnston 83669 by: Jason Wong 83670 by: jtjohnston 83671 by: Jason Wong autoindex 83666 by: jtjohnston modDb Contribution 83667 by: Vincent - D. Ertner Convert 24hr to 12hr 83668 by: Gary 83672 by: Lars Torben Wilson Checkboxe problem 83673 by: Gaylen Fraley 83675 by: Niklas Lampén 83679 by: Mike Maltese Re: breaking out of two loops 83674 by: Lars Torben Wilson Using strings in switches 83676 by: phantom 83677 by: Justin Garrett Re: why !^ in email? 83678 by: nina Mysql 83680 by: Roman Duriancik Sessions and Classes 83681 by: PHP-List 83684 by: Wolfram Kriesing Re: mysql fails 83682 by: val petruchek show something 83683 by: val petruchek 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: [EMAIL PROTECTED] -- ---BeginMessage--- The following php script sends two (2) e-mails to each addressee. Why? ?php $connection=mysql_connect(localhost,wagner,XXX) or die (No connection!); $db=mysql_select_db(sbwresearch,$connection) or die (No database!); $message= Dear consumer,\n The following are the online surveys ... etc.\n; $qry_1=select * from con_inf; $result_1=mysql_query($qry_1,$connection) or die (No query # 1!); while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC)) { $e_mail=$row_1[e_mail]; mail($e_mail, News from SBW Research, $message, From:SBW Research [EMAIL PROTECTED]\n); }; mysql_free_result($result_1); mysql_close($connection); header (location:done.htm); exit; ? Anthony Rodriguez ([EMAIL PROTECTED]) ---End Message--- ---BeginMessage--- Hi Anthony: Anthony Rodriguez wrote: The following php script sends two (2) e-mails to each addressee. Why? I'll bet the email addresses in question are listed in the table twice. Open up a MySQL command line prompt and enter select * from con_inf; to make sure. To keep this from happening, you can delete the duplicates then add a unique index on the e_mail field in the MySQL table definition. $qry_1=select * from con_inf; Side Issue 1: why are you selecting everything (via *) rather than just e_mail, since that's all you're using in the script? $result_1=mysql_query($qry_1,$connection) or die (No query # 1!); while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC)) { $e_mail=$row_1[e_mail]; mail($e_mail, Side Note 2: You can combiune those two lines into one: mail($row_1['e_mail'], mysql_free_result($result_1); mysql_close($connection); Side Note 3: You don't worry about these commands in scripts you're about to exit anyway. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T
[PHP] Out of the box algorithms
Hi As part of a class I'm building I need to parse a file where following line occurrs: users: username username with spaces anotherusername I need to parse that into a structure like $users = array( 'username', 'username with spaces', 'anotherusername' ); The issue is the string after the : (the other part is relativly easy as you could think) Is there anyone having a parsing algorithm for that just out of the box? It would save me reinventing the wheel ;-) TIA stefan rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multi Threading in PHP
Hi, a few days ago i saw here a thread about multi threading, but this didn´t answer my question. I have a page, that must search the best price in multiple databases/plain text files and perhaps one day xml-interfaces, some of them can be located on extern hosts, every search can be a single function/object method. In my dreams i call this in multi thread (with a timeout functionality) to handle lost connections or anything else that would cause endless queries, and return after this to print out the results. Is this possible with any function today? Or will this be possible in future? Best Regards, Bart Frackiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Convert 24hr to 12hr
RTFM http://www.mysql.com/doc/D/a/Date_and_time_functions.html select date_format(DATEFIELD,%r) from TABLE or select time_format(TIMEFIELD,%r) from TABLE Look in the manual for more options... MUCH MORE :) Anyone know the difference between %h: 01-12 hour notation and %I: 01-12 hour notation ? Kind regards, Jerry -Original Message- From: Gary [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 3:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Convert 24hr to 12hr Hello All, Can someone please RTFM me so I can convert MySQL 24 hour time to 12 hour time. TIA gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The information contained in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any form of disclosure, production, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. Please notify the sender immediately. The content of the email is not legally binding unless confirmed by letter bearing two authorized signatures. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] show something
By default, PHP's output is buffered. To disable output buffering use ob_implicit_flush(); somewhere in your script. This flushes previous output to the client and disables buffering. For more info look at the manual's chapter on 'Output buffering'. bvr. On Wed, 6 Feb 2002 09:32:29 +0200, val petruchek wrote: Hello, list! I've php script that works for seveeral minutes (3-5) - it indexes my site and when page is indexed it echoes a one-row table (page bla.bla.bla indexed). But browser shows it only when it gets all the page. I want it to show line by line... I know it can be done in perl (www.tracert.com) How can this be done in php: sending to a browser parts of html generated? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Out of the box algorithms
users: username username with spaces anotherusername I need to parse that into a structure like $users = array( 'username', 'username with spaces', 'anotherusername' ); try preg_match i think the expression could look something like this: '/users:\s*(^\s+)(.*)\s*(.*)\n/' this should let you get 'username' in $1 'username with spaces' in $2 'anotherusername' in $3 i didnt test it, but it could work :-) -- Wolfram -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] socket - e-mailaddress validation
Question: Is it possible to validate an e-mailaddress by opening a socket-connection to the specified domein (@domain.com) and then search for username ([EMAIL PROTECTED]) to validate an e-mailaddress? I know how to set up a socket-connection, but how do I search for the user in the given domain? Regards, bart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check if var is a domain name
Hi, I would use a regular expression to check it. This is a pretty general one, but I think it should do the trick. It searches for 1 or more upper or lowercase letters, followed by a literal dot, followed by 2 or 3 lowercase letters. Of course there are valid domains that would not match this (foobar.co.uk) for example, but it should work with the values you specified. 1. Doesn't check every TLD as you acknowledge. 2. Doesnt't check validity as in the domain exists! If I wanted to check the domain was valid and existed I would do a Whois and NSLookup. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] show something
Thanks! Exactly what i need! Thanks a lot! By default, PHP's output is buffered. To disable output buffering use ob_implicit_flush(); somewhere in your script. This flushes previous output to the client and disables buffering. For more info look at the manual's chapter on 'Output buffering'. bvr. Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] socket - e-mailaddress validation
Yes, this is possible. However you would need to connect to the users mailserver instead of just the domain. Use getmxrr() to retrieve the mail exchanger associated with the domain. To check if the user is accepted on that server you can issue a RCPT TO: command on it and see what happens. Also you can use a local SMTP server that supports the VRFY (verify) command to check if the address is accepted. Google for 'RFC SMTP' for more details on the SMTP protocol. bvr. On Wed, 6 Feb 2002 11:05:31 +0100, B. Verbeek wrote: Question: Is it possible to validate an e-mailaddress by opening a socket-connection to the specified domein (@domain.com) and then search for username ([EMAIL PROTECTED]) to validate an e-mailaddress? I know how to set up a socket-connection, but how do I search for the user in the given domain? Regards, bart -- 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
Re: [PHP] Check if var is a domain name
You can online check for a valid domain using if (checkdnsrr($mydomain, SOA)) { echo(is valid domain); } note that www.mynewdomain.com CAN be a valid domain also. bvr. On Tue, 5 Feb 2002 07:59:22 -0800, Brandon Orther wrote: Hello, Does anyone know a function or how I could make a function to check a variable for being a valid domain name without the www. http://www./ In fron of it? Ex. $var = mynewdomain.com that would be TRUE Ex2. $var = www.mynewdomain.com that would be FALSE Ex3. $var = My Great Domain that would be FALSE And so on. Does anyone have a function that makes sure there are no illegal characters and there is a period in the middle of the text? Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check if var is a domain name
note that www.mynewdomain.com CAN be a valid domain also. Err... sub-domain. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array length
Isint there a function to determine the length of an array? I cant seem to find it in the manual http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is
Re: [PHP] Array length
On Wed, 6 Feb 2002, David Orn Johannsson wrote: Isint there a function to determine the length of an array? I cant seem to find it in the manual http://www.php.net/manual/en/function.count.php -- Nick Winfield. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array length
count($array) Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From: David Orn Johannsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 1:50 PM Subject: [PHP] Array length Isin't there a function to determine the length of an array? I can't seem to find it in the manual http://www.atom.is/ Davíð Örn Jóhannssson Vefforritari Atómstöðin hf. Garðastræti 37 101 Reykjavík sími: 595-3643 fax: 595-3649 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.atom.is/ http://www.atom.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create Mysql Records From a Comma separated Values String
Hi to everyone i have the following problem i have a string $foo which contains (n variable) comma separated values (example 1,17,23,45) and i want to insert these values in a mysql table . The destination field is int type and i need to insert one record per value Do you know which php function(s) should i use in order to (loop -extract the values from string) and do that ?? Thanks in advance for your help regars simos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create Mysql Records From a Comma separated Values String
$array_foo = explode(,, $foo); for ($i=0; $icount($array_foo); $i++) { mysql_query(INSERT INTO table VALUES ( . $array_foo[$i] . )); } Greets, Edward - Original Message - From: Simos Varelakis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 1:54 PM Subject: [PHP] Create Mysql Records From a Comma separated Values String Hi to everyone i have the following problem i have a string $foo which contains (n variable) comma separated values (example 1,17,23,45) and i want to insert these values in a mysql table . The destination field is int type and i need to insert one record per value Do you know which php function(s) should i use in order to (loop -extract the values from string) and do that ?? Thanks in advance for your help regars simos -- 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
[PHP] Firewall
Hi, i hope this is the right group for my question. i've written a php-program with a ftp-connection to a mysql database. now there is one problem. the local network has a firewall. Now, if i try to connect to the database via ftp there is an error. There are no problems if i try to connect from a place without firewall. What must i do to go through the firewall. Thanx Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Caching in php?
hello, i used asp and it seems there is an application object which can help in caching of data. (e.g., http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=142). is this possible using php? what can i do to use caching on my website which is totally database driven? thanks/erick __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] start a session crash
Hello, when i start a session ?php session_start(); ? at the begining of the documente *.php i receive this: in a dialog box: PHP provocó un error de página no válida en el módulo PHP4TS.DLL de 0177:10054363. Registros: EAX=0028 CS=0177 EIP=10054363 EFLGS=00010206 EBX=00760050 SS=017f ESP=0063fa48 EBP=100a01d0 ECX=0015 DS=017f ESI=00760050 FS=5db7 EDX=00763080 ES=017f EDI=10129020 GS= Bytes en CS:EIP: ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x Volcado de pila: ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x in the Browser: 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. Apache/1.3.22 Server at mailserver.lhhost.com Port 80 IN THE ERROR LOG [Tue Feb 05 22:08:18 2002] [error] [client 127.0.0.1] Premature end of script headers: c:/php/php.exe ¿anyone recognize the problem? Thanks Thanks ! Pablo.
Re: [PHP] Caching in php?
is this possible using php? what can i do to use caching on my website which is totally database driven? try PEAR::Cache http://pear.php.net -- Wolfram -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Books on PHP
On Tuesday, February 5, 2002, at 04:07 PM, Ronald D Wahlen wrote: Hello, I am new to PHP and was wondering if anyone can point me the right direction with PHP urls and books to learn how to develop web sites using PHP. I read some of the information on www.php.net web site and have the PHP Bible. The Wrox Beginning PHP (by Choi, et al) got me started quite comfortably with the basic syntax and theory, and the www.php.net + this list helps me expand on that knowledge. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Firewall
On Wed, 6 Feb 2002, Thomas Franz wrote: -Hi, - -i hope this is the right group for my question. - -i've written a php-program with a ftp-connection to a mysql database. - -now there is one problem. the local network has a firewall. Now, if i try to -connect to the database via ftp there is an error. -There are no problems if i try to connect from a place without firewall. - -What must i do to go through the firewall. Hmmm, well, FTP through a firewall requires some kind of openness on ports 20 and 21. Just port 20 is fine if you use passive mode to transfer data. I have to ask, how can you connect to a mysql database (which I assume is on port 3306) using an ftp connection? I realize you can instruct ftp to connect to 3306 (which would then require the firewall pass traffic on 3306), but why would this ever be preferable to using the usual connect methods in PHP? In any case, check that your firewall passes port 21 out, 3306 out and port 20 in. John - -Thanx - -Thomas - - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Multi Threading in PHP
Hi Bart This can be simulated using non-blocking sockets. However this is one time when using Perl or Python might be a better solution (sigh). Bart Frackiewicz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, a few days ago i saw here a thread about multi threading, but this didn´t answer my question. I have a page, that must search the best price in multiple databases/plain text files and perhaps one day xml-interfaces, some of them can be located on extern hosts, every search can be a single function/object method. In my dreams i call this in multi thread (with a timeout functionality) to handle lost connections or anything else that would cause endless queries, and return after this to print out the results. Is this possible with any function today? Or will this be possible in future? Best Regards, Bart Frackiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to pass value from popup window to php program
Hi all, I met one problem as below. To express clearly i use some psu-code instead: //this is php code if ($need_user_email_address) { //we popup a window to let user fill his/her email popup_window($give_me_your_email); //we get the user email from the popup window echo your email is $give_me_your_email \n; } I do not know whether it can be implemented or not, if it can be done, i really do not know how to produce the popup window and how to pass value from the popup window to the php main code. Thanks in advance! zhunbao __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] breaking out of two loops
Dang... That is so cool. i'd never noticed that before. well I've learned enough for today. maybe my boss'l let me go home. LOL On 04 Feb 2002 16:00:53 -0800, Lars Torben Wilson wrote: On Mon, 2002-02-04 at 15:54, Erik Price wrote: Short and sweet: If I have an if statement inside a switch statement, how can I break out of both blocks that I am in? Will one break end everything? Or should I use one for each level deep that I am? Erik From the manual: break accepts an optional numeric argument which tells it how many nested enclosing structures are to be broken out of You can find this at http://www.php.net/break (which will take you to http://www.php.net/manual/en/control-structures.break.php). Hope this helps, Torben Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- 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
[PHP] Satellite PHP module
Hi! Anybody knows, where can I find this module? In PHP sources from CVS I've found, that this module is in PEAR. I 've tried to find out it on pear.php.net, but I've failed and now I'm really confused, where it can be accesible. TIA rems -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to pass value from popup window to php program
On Wednesday, February 6, 2002, at 10:52 AM, Zhunbao Zhi wrote: I do not know whether it can be implemented or not, if it can be done, i really do not know how to produce the popup window and how to pass value from the popup window to the php main code. One way to do it is to store the $email_name as a session variable. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to pass value from popup window to php program
Hi all, I am a new comer for PHP. now my situation like below, to express clearly i used some expression instead of PHP code in below php code: if ($need_to_know_your_email) { //popup one window to get the user' email JavaScript:window.open(leave your email address); //then i try to get the $emailaddress from the //popup window , for example as $emailaddress echo your email is $emailaddress\n; } I just do not know whether above code can be implemented or not, if so, how can i get the email address from the popup window? Thanks, zhunbao __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how pass value from popup window to php program
Hi all, I am a new comer for PHP. now my situation like below, to express clearly i used some expression instead of PHP code in below php code: if ($need_to_know_your_email) { //popup one window to get the user' email JavaScript:window.open(leave your email address); //then i try to get the $emailaddress from the //popup window , for example as $emailaddress echo your email is $emailaddress\n; } I just do not know whether above code can be implemented or not, if so, how can i get the email address from the popup window? Thanks, zhunbao __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php help needed, is there a bright spark out there!
Hello All, I have been asked to do a project that seems to be baffling me. It's not really the php which is the hard part, but the mathematical problem behind the project that is causing me to have a headache! Imagine an ecommerce site where a user can pick 5 products (it must be 5) from a possible 60. That's the easy bit. The project that I have to do is to do with the way the order is dealt with. Imagine the company has a warehouse (the attached layout) where the yellow boxes are bins of 1 product in each (A1would be the bin with all products A1in). P1, P2, and P3 are stations where pickers (people who pack each order) receive the order. I have to build some PHP that shows the picker the optimum way around the warehouse to pick up all the 5 products, and then return him to the starting station. I hope there is a bright spark out there that can solve this easier than I have (my way requires calculating all the possible ways of picking up the 5 products and then calculating the shortest route from a stored database, but it would require 780 sql statements, that just isn't going to work!) Here are the rules that I have to follow: An Order Picking slip for a complete order is printed at 1 of 3 packing locations (P1, P2, or P3). A picker must start at one of these packing locations, collect all products required for that order then return back to the start position to deposit all items for packing. Note: A picker can only move one square at a time ( not diagonally) Pickers cannot walk through bin locations! A picker can only access a bin location when standing directly at the side. e.g. A picker standing at 'X' can access locations B8 or C8 from this position. A picker standing at 'Y' cannot access any locations. I live in hope! Hamish warehouse layout.xls Description: MS-Excel spreadsheet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php help needed, is there a bright spark out there!
Hello hamish, [msg converted from HTML to simple-text format] I have been asked to do a project that seems to be baffling me. It's not really the php which is the hard part, but the mathematical problem behind the project that is causing me to have a headache! ... =This reminds me of the test-problems we were given at Uni - in fact one of my contracts (was self-supporting not a scholarship student) was to support a post-grad student doing exactly this sort of thing - the routing of milk tankers around farm pick ups and delivering to a network of factories. =Sadly I have difficulty remembering that far back... What is my name again? =The issues of least-path, network analysis or even linear programming are discussed (big time) in Operations Research text books. Factory layout is a fairly 'standard' problem. A visit to a decent Uni/mgmt/technical library should give you a bunch of models and formulae to play with! =Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is this possible?
Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the product table and two rows from the price table in one line in a page? Is it possible? Best regards Raymond -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to pass value from popup window to php program
For info on JavaScript functions, like window.open() use google to find resources. For passing back values to PHP you need a script that does 2 things: - Ask for the email address - Handle the address with PHP Because PHP will not wait for a user to put in it's e-mail address, these are two separate pieces of code. You can do this for example by checking if the email address has been entered: ?php // myscript.phtml if ($email) { // Part 1 } else { // Part 2 } ? Part 1 handles the email address the way you want Part 2 can be done in a number of ways, as long as the e-mail address gets entered and send back to the script. A simple way is using a form: FORM ACTION=myscript.phtml INPUT TYPE=TEXT NAME=email /FORM But you could also use JavaScript to create a dialog and 'redirect' to your script, passing the email address in the URL, probably something like: email = prompt(Please enter your address); document.window.location.href = myscript.phtml?email= + escape(email); bvr. On Wed, 6 Feb 2002 07:52:46 -0800 (PST), Zhunbao Zhi wrote: it can be done, i really do not know how to produce the popup window and how to pass value from the popup window to the php main code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to pass value from popup window to php program
Storing variables on the client-side using JavaScript can be done by setting a cookie. The cookie data will ofcourse be available to PHP when the next script is executed (for example through a link or redirect). bvr. On Wed, 6 Feb 2002 11:13:01 -0500, Erik Price wrote: Sounds like if you don't want to do a lot of form-submitting, you'll have to use JavaScript to store/display the variable dynamically on the client side. I don't know how to grab JavaScript variables and use them as PHP variables, perhaps someone else on the list can help here. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mysql
Look-up GRANT PRIVILEGES in the mysql manual. That should get ya going -Original Message- From: Roman Duriancik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 1:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Mysql Pleae help me ! I need delete record from table user.mysql in mysql database, i log on in mysql like root and I log on on linux server like root. But when I write command : delete from user where user=''; mysql send me error message : ERROR 1036 Table 'user; is read only ! Thans for you helps... roman -- 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
Re: [PHP] Is this possible?
On Wednesday, February 6, 2002, at 12:16 PM, Raymond Lilleodegard wrote: So... how do I get only one row from the product table and two rows from the price table in one line in a page? Use this query: SELECT producttable.onerow, pricetable.onerow, pricetable.tworow FROM producttable, pricetable WHERE [use variable to constrain query here] This is valid for if you're using MySQL or other ANSI-standard database, I think. Then run your query against the database, and use one of the db functions (like mysql_fetch_assoc()) to pull your data out of the query's array. Pull out the data you want and assign it to different variables, then echo those variables surrounded by whatever HTML tags you want. Standard procedure, unless you're asking something different. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to pass value from popup window to php program
On Wednesday, February 6, 2002, at 12:26 PM, bvr wrote: Storing variables on the client-side using JavaScript can be done by setting a cookie. The cookie data will ofcourse be available to PHP when the next script is executed (for example through a link or redirect). Ahh... is this the standard procedure for passing variables form JS to PHP? Is there a way that will work on browsers with cookies disabled? Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to pass value from popup window to php program
There is no way of passing a variable from JS to PHP without sending something back to the server or using a cookie. I haven't followed the thread at all, but if I needed to pass a value from a pop-up window to a PHP program, I'd probably do something like this: In the pop-up window, once the form's submit button is clicked or a Click here link is clicked, the page calls the PHP program. The PHP program processes the variable (sticking the value in the database, whatever), then outputs a bit of HTML/JS just to close the window. Note that absolutely NOTHING will happen if the user closes the window by clicking the close widget on the window itself. On Wed, 2002-02-06 at 09:36, Erik Price wrote: On Wednesday, February 6, 2002, at 12:26 PM, bvr wrote: Storing variables on the client-side using JavaScript can be done by setting a cookie. The cookie data will ofcourse be available to PHP when the next script is executed (for example through a link or redirect). Ahh... is this the standard procedure for passing variables form JS to PHP? Is there a way that will work on browsers with cookies disabled? Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sliante, Richard S. Crawford mailto:[EMAIL PROTECTED] http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupery Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this possible?
Let prices(id,price etc.) be table of prices, products(NUM,name etc). Try smth like this: SELECT DISTINCT * FROM PRODUCTS P, PRICES P1, PRICES P2 WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE=SIZE1 AND P2.SIZE=P2 Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From: Raymond Lilleodegard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 7:16 PM Subject: [PHP] Is this possible? Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the product table and two rows from the price table in one line in a page? Is it possible? Best regards Raymond -- 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
[PHP] Re: Is this possible?
I believe you can do this using an INNER JOIN command. I have not done this in sometime, and I will give you a sample from my sql book. Inner joins extract rows that are common to both tables, based on values in the common column. For example, you could write a query that would extract a list of customer numbers (from the sales table) and the salesperson's first and last name (from the slspers table) who serves them. The common condition would be the salespersons REPID, which would exist in only certain rows in both tables. You would write such a query like this : SELECT custnum, fname, lname FROM sales INNER JOIN slspers on sales.repid = slspers.repid So to try and relate this to your solution assume the tables are called PRODUCTINFO and PRICES and the common value in both is PRODUCT_ID. PROD_DEC is in PRODUCTINFO and PROD_PRICE is in PRICES SELECT PROD_DESC, PROD_PRICE FROM PRODUCTINFO INNER JOIN PRICES on PRODUCTINFO.PRODUCT_ID = PRICE.PRODUCT_ID This SHOULD return a record set of product id's with descriptions and prices... I believe... I have not tested it... But I THINK this is what you are looking for... Dave Raymond Lilleodegard [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the product table and two rows from the price table in one line in a page? Is it possible? Best regards Raymond -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Is this possible?
Yes, it's entirely possible to abuse the PHP mailinglist by sending MySQL tutorials and useless complaints like this one. bvr. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending MIME emails with base64 encoded attachments
Title: Sending MIME emails with base64 encoded attachments Hello there My base64 encoded attachments in MIME emails come corrupted. I using PHP4 on SuSe Linux. I'm sending an MIME email (I generatate all the headers and so on) with attachments. The first part is7bit text, 2nd part is mime-type I get from file and encoding: base64 The file I need to attach I read from disc using $txt=fread($file,filesize($filename)); the file is opened by $file=fopen($filename,r). Then I encode the content with: $txt=base64_encode($txt) and split it with: $txt=chunk_split($txt,56,\r\n) When I then send it, the mail arrives, but the attached file (e.g. *.zip) is corrupted. Attachment is a little bit larger than original. In original there are #0 (char. ascii 0), in attachment they come as \0 (#92#48). Attachments like text files (even with characters behind #127) are OK, they come without any corruption. I tried to write small test.php, where I just load file, base64_encode it and then base64_decode it, and it's OK. Seems to me that PHP use another base64 coding than all email clients OR The way how I read the file is bad, so base64_encode gets a little different data, but is still able to get it back on the local OR I don't know :-( Please, help, if you can. Many thanks Petr Svarc This electronic message transmission contains information from TMP Worldwide and is confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify us by telephone immediately at +44 (0)20 7406 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this possible?
val, Surely this would only be possible if SIZE1 and P2 [sic - maybe SIZE2] were constants, ie that all small packs had SIZE=small and all large packs were defined as SIZE=large. (also that all products had no more than two sizes) Interesting thought though (subject to the =2 sizes constraint), could there be a LEFT JOIN off PRODUCTS, but put P1 and P2 into a cartesian product but only selecting where there is inequality: WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE P2.SIZE [sorry, machine is busy on something, so haven't prototyped it] Raymond: is there a SIZE (type of) field? Do the above constraints apply? What are the table definitions you are using? Any chance of some sample data? Please advise, =dn Let prices(id,price etc.) be table of prices, products(NUM,name etc). Try smth like this: SELECT DISTINCT * FROM PRODUCTS P, PRICES P1, PRICES P2 WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE=SIZE1 AND P2.SIZE=P2 Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From: Raymond Lilleodegard To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 7:16 PM Subject: [PHP] Is this possible? Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the product table and two rows from the price table in one line in a page? Is it possible? Best regards Raymond -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mysql question
I have a site using PHP Mysql. About a month ago to now one of the tables gets corrupted with the message Got Error 127... I fix it and everything works OK, except every time I loose 1 record. Today I could obtain mysql.err from the machine and I could see whenever an error is produced by date, previously I have the following line: 020205 9:57:46 Aborted connection 137 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Server shutdown in progress) 020205 9:57:46 Aborted connection 124 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Server shutdown in progress) or 020205 12:55:51 Aborted connection 377 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Unknown error) 020205 13:05:37 Aborted connection 504 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Unknown error) It doesn´t seems too clear for me because no ODBC client should be accessing to the database. Should I suppose that an unautorized ODBC client is breaking the table or could be another problem? Thanks a lot. Emiliano.
Re: [PHP] Is this possible?
At last! : ) Thank you very much for all help! ; ) I made it with two mysql_query() Here are my queries if it is interesting. $varetabell = mysql_query(SELECT varetabell.tekstbilde, varetabell.varenavn, varetabell.varenr, varetabell.innhold, pristabell.pris FROM varetabell, pristabell WHERE pristabell.varenr=varetabell.varenr AND pristabell.type='footlong',$db); $varetab = mysql_query(SELECT varetabell.varenr, pristabell.varenr, pristabell.pris FROM varetabell, pristabell WHERE pristabell.varenr=varetabell.varenr AND pristabell.type='6inch',$db); if ($myrow = mysql_fetch_array($varetabell) AND $myro = mysql_fetch_array($varetab)) { echo TABLE border=\0\ width=\450\\n; echo tr\n; echo td width=\300\ colspan=\2\bfont color=\#00\Subs/font/b/td\n; echo td align=\center\ width=\46\bfont color=\#00\6\/font/b/td\n; echo td align=\center\ width=\90\bfont color=\#00\Footlong/font/b/td\n; echo /tr\n; echo tr\n; echo td colspan=\4\ width=\444\hr color=\#00\ /td\n; echo /tr\n; do { printf( trform method=\POST\ action=\bestilling.php\ name=\%s\,$myrow[varenavn]); printf( td width=\6\input type=\image\ name=\sub\ SRC=\%s\ value=\%s\/td,$myrow[tekstbilde], $myrow[varenavn]); printf( td width=\290\/td); printf( td align=\center\ width=\46\font size=\2\b%s/font/td,$myro[pris]); printf( td align=\center\ width=\90\font size=\2\b%s/font/td,$myrow[pris]); printf( input type=\hidden\ name=\passord\ value=\$passord\); printf( input type=\hidden\ name=\fornavn\ value=\$fornavn\); printf( input type=\hidden\ name=\varenr\ value=\%s\,$myrow[varenr]); printf(input type=\hidden\ name=\sub\ value=\%s\/form,$myrow[varenavn]); printf( /tr); printf( tr); printf( td width=\290\small(%s)/small/td,$myrow[innhold]); printf( td width=\6\/td); printf( td width=\46\/td); printf( td width=\90\/b/td); printf( /tr\n); } while ($myrow = mysql_fetch_array($varetabell) AND $myro = mysql_fetch_array($varetab)); - Original Message - From: DL Neil [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Raymond Lilleodegard [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 7:20 PM Subject: Re: [PHP] Is this possible? val, Surely this would only be possible if SIZE1 and P2 [sic - maybe SIZE2] were constants, ie that all small packs had SIZE=small and all large packs were defined as SIZE=large. (also that all products had no more than two sizes) Interesting thought though (subject to the =2 sizes constraint), could there be a LEFT JOIN off PRODUCTS, but put P1 and P2 into a cartesian product but only selecting where there is inequality: WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE P2.SIZE [sorry, machine is busy on something, so haven't prototyped it] Raymond: is there a SIZE (type of) field? Do the above constraints apply? What are the table definitions you are using? Any chance of some sample data? Please advise, =dn Let prices(id,price etc.) be table of prices, products(NUM,name etc). Try smth like this: SELECT DISTINCT * FROM PRODUCTS P, PRICES P1, PRICES P2 WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE=SIZE1 AND P2.SIZE=P2 Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From: Raymond Lilleodegard To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 7:16 PM Subject: [PHP] Is this possible? Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the product table and two rows from the price table in one line in a page? Is it possible? Best regards Raymond -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql question
Yes, sorry by the off-topic but I wanted to know if wnybody here could help me because in mysql I couldn´t find any answer. Also I have seen a lot of questions relative to mysql answered here. But you´re right it´s a off-topic. Emiliano. -Original Message- From: Sam Masiello [EMAIL PROTECTED] To: Emiliano Marmonti [EMAIL PROTECTED] Date: Wednesday, February 06, 2002 12:45 PM Subject: Re: [PHP] Mysql question This is really a question for a MySQL mailing list, not a PHP list since this question has nothing to do with PHP. You can email the MySQL mailing list at [EMAIL PROTECTED], and you can join the MySQL mailing list off of the MySQL web site at www.mysql.com. HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 [EMAIL PROTECTED] - Original Message - From: Emiliano Marmonti [EMAIL PROTECTED] To: Lista PHP [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 4:32 AM Subject: [PHP] Mysql question I have a site using PHP Mysql. About a month ago to now one of the tables gets corrupted with the message Got Error 127... I fix it and everything works OK, except every time I loose 1 record. Today I could obtain mysql.err from the machine and I could see whenever an error is produced by date, previously I have the following line: 020205 9:57:46 Aborted connection 137 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Server shutdown in progress) 020205 9:57:46 Aborted connection 124 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Server shutdown in progress) or 020205 12:55:51 Aborted connection 377 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Unknown error) 020205 13:05:37 Aborted connection 504 to db: 'Biblioteca' user: 'ODBC' host: `localhost' (Unknown error) It doesn´t seems too clear for me because no ODBC client should be accessing to the database. Should I suppose that an unautorized ODBC client is breaking the table or could be another problem? Thanks a lot. Emiliano. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Sending MIME emails with base64 encoded attachments
Title: RE: Sending MIME emails with base64 encoded attachments Hello. That's me, again. I found a reason of my problem..not solution. PHP use Cstyle string, where end of string si #0. Let say I have a small 4byte file with content AB#0C (ascii: #65,#66,#0,#67) I load it (using binary save fread into $txt) When I try to get third character (#0), quess what I get: $x = ord(substr($txt,2,1)) $x IS NOT 0! $x IS 92, which mean backslash. Fourth char is 48, which means 0 and the fifth #67. So, PHP replaces any #0 with \0 in every string internally. Which wouldn't be do bad, BUT: INTERNAL base64_encode AND base64_decode FUNCTIONS FORGET IT! That's the reason why I can't read any base64 encoded attachment with external email client. WHAT A SHAME FOR PHP (or for me if I'm wrong :-) What do you thing about that? Do PHP develop centre know about it? Does exists any patch? One possible solution is: - Write custom base64 encoding/decoding, which will handle the problem (maybe encoding is enough)... Does somebody have such a function? Or do you see any other solution? Or am I completely wrong? :-o Regards Petr Svarc This electronic message transmission contains information from TMP Worldwide and is confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify us by telephone immediately at +44 (0)20 7406 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help!
This may or may not have anything to do with PHP but my goal deals with it. I have a box that I'm trying to turn into a linux box for php purposes. I have reformatted the hard drive so I could install it. The problem is that when I try to partition the disk during the installation, my hard drive is not recognized. I am new at this and I would appreciate any help I could get. Please help me!! -- Patrick Hanna Database integration--E-commerce solutions The Wentworth Company Get paid cash every time you receive email! Sign up FREE at: http://www.MintMail.com/?m=1080349
Re: [PHP] Sending MIME emails with base64 encoded attachments
Hi Petr: I using PHP4 on SuSe Linux. I'm sending an MIME email (I generatate all the headers and so on) with attachments. Your coding worked fine for me. When I then send it, the mail arrives, but the attached file (e.g. *.zip) is corrupted. In original there are #0 (char. ascii 0), in attachment they come as \0 (#92#48). Two things I can think of... First: things might run differnetly on SuSE Linux. Perhaps there are configuration settings on your server that are throwing things off. Check your OS documentation and newsgroup archives. I guess, also check the PHP mailing list archives too: http://groups.google.com/groups?hl=engroup=php.general. You might need to take a look at RFC-2045 Section 6.8 to see why that your system is properly converting things. Second: the way you've formatted the MIME headers et al may be causing some problem. Here's a test script (fix email line wrapping as needed) of mine that works (on PHP 4.0.7-dev / NT 4 / Apache). Try it on your system and see what happens. ?php # Set accordingly... $To = '[EMAIL PROTECTED]'; $FirstName = 'Joe'; # name of person who wants file $Subject = 'the big test'; $Email = '[EMAIL PROTECTED]'; # from address $Name = 'Analysis and Solutions'; # your name $FileName = 'email.attach.test'; # should be a .zip file # don't include file extension $InDir = '.'; # directory where file can be found # Used for purposes of this example, # but set another way in my real script... $Invoice = date('YmdHis'); # Leave this. $Encoding = 'base64'; # Make sure variables are empty to start with... $Body = ''; $AdditionalHeaders = ''; # Here we go... if ( !$InHandle = @fopen($InDir/$FileName.zip,r) ) { echo h3Couldn't open input file./h3; exit(); } $Boundary = =_$Invoice . ==_; $AdditionalHeaders .= Mime-Version: 1.0\n; $AdditionalHeaders .= Content-Type: multipart/mixed; boundary=\$Boundary\\n; $Body = This is a multi-part message in MIME format.\n\n; $Body .= --$Boundary\n; $Body .= Content-Type: text/plain; charset=us-ascii\n; $Body .= Content-Transfer-Encoding: 7bit\n\n; $Body .= Greetings $FirstName:\n\nThanks for your order.\n\n; $Body .= The copy of $Subject you ordered is attached below.\n\n; $Body .= \n\nSincerely,\n\n$Name\n\n; $Body .= --$Boundary\n; $Body .= Content-Type: application/x-zip-compressed; name=\$FileName.zip\\n; $Body .= Content-Transfer-Encoding: $Encoding\n; $Body .= Content-Disposition: attachment; filename=\$FileName.zip\\n\n; $Body .= chunk_split( base64_encode( fread( $InHandle, filesize($InDir/$FileName.zip) ) ) ); $Body .= \n--$Boundary--; mail($To, $Subject, $Body, From: $Email\nX-Loop: $Email\n$AdditionalHeaders\n); # Show results in browser... echo 'pThe following body was sent:/p'; echo \npre$Body/pre; ? Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help!
Offtopic! Try a linux list, or the list for the distribution you are trying to install! -Original Message- From: Pat Hanna [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 6 February 2002 7 8 To: php help Subject: [PHP] help! This may or may not have anything to do with PHP but my goal deals with it. I have a box that I'm trying to turn into a linux box for php purposes. I have reformatted the hard drive so I could install it. The problem is that when I try to partition the disk during the installation, my hard drive is not recognized. I am new at this and I would appreciate any help I could get. Please help me!! -- Patrick Hanna Database integration--E-commerce solutions The Wentworth Company Get paid cash every time you receive email! Sign up FREE at: http://www.MintMail.com/?m=1080349 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mktime() Algorithm
I need to create a function in another programming language that takes the same input as the php mktime() function and produces the exact same output as the php mktime() function. Does anybody out there know what the algorithm is? -- David A Dickson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mktime() Algorithm
You could look at the source code for PHP On Wed, 6 Feb 2002, David A Dickson wrote: I need to create a function in another programming language that takes the same input as the php mktime() function and produces the exact same output as the php mktime() function. Does anybody out there know what the algorithm is? -- David A Dickson [EMAIL PROTECTED] -- 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
[PHP] !isset ??
Hm. I hope I'm not opening an old wound: Curious about the proper way to test for the existence of a variable, I decided to read up on isset() at php.net's function manual pages. It seems at first to be a way to test whether or not a variable has been set. But reading the annotations below the documentation is mind boggling. Back and forth, it seems to go -- and then to find out that one method is to be used to test for POSTed variables, and another to be used for GETted variables (for $_POST, use $_POST['var'] !='' , and for $_GET, use !isset($_GET['var'])). Pretty confusing. Can anyone shed some light on whether or not there is a final definite way to do this? I've used (!($_POST['var'])) with no problems in the past, but does good coding style suggest that I use (!isset($_POST['var'])) now? Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this possible?
I am sorry, this has nothing to do with the logic of your code, but instead with style (and a little bit of perfomance, both from you and your system). Isn't easier to escape PHP when you are going to enter html code lines? Like this: ?php if ($myrow = mysql_fetch_array($varetabell) AND $myro = mysql_fetch_array($varetab)) { echo TABLE border=\0\ width=\450\\n; echo tr\n; ? IMHO would be better: ?php if ($myrow = mysql_fetch_array($varetabell) AND $myro = mysql_fetch_array($varetab)) { ? TABLE border=0 width=450 tr td width=300 colspan=2bfont ?php } ? Seems to be easier to type, prettier and faster Just a tought;-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: !isset ??
If your purpose is to see if an user wrote or selected anything, you can do: if (ereg(^[[:blank:]]*$,$_POST['var'])) { // It has only spaces } I am sorry if does not fit your need like I interpreted. But, just for not getting flamed, !isset() works fine for me on both cases (so far where I tested); -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Erik Price [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hm. I hope I'm not opening an old wound: Curious about the proper way to test for the existence of a variable, I decided to read up on isset() at php.net's function manual pages. It seems at first to be a way to test whether or not a variable has been set. But reading the annotations below the documentation is mind boggling. Back and forth, it seems to go -- and then to find out that one method is to be used to test for POSTed variables, and another to be used for GETted variables (for $_POST, use $_POST['var'] !='' , and for $_GET, use !isset($_GET['var'])). Pretty confusing. Can anyone shed some light on whether or not there is a final definite way to do this? I've used (!($_POST['var'])) with no problems in the past, but does good coding style suggest that I use (!isset($_POST['var'])) now? Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: !isset ??
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Erik Price) wrote: Pretty confusing. Can anyone shed some light on whether or not there is a final definite way to do this? I've used (!($_POST['var'])) with no problems in the past, but does good coding style suggest that I use (!isset($_POST['var'])) now? !$somevar != !isset($somevar) isset() evaluates as true only if the variable (or array index) exists. PHP's loose typing means that !$somevar evalutes as true if the variable is null, if it has an (integer, float, or string) value of zero, if it's an empty string, or if it is set to boolean false. Or if the variable/index does not exist. Both methods have their place (though for tests of the latter, I prefer empty()). The important part is understanding the implications of a method when you use it, so that your code isn't wrongly relying on !$somevar to mean the variable isn't set; it may well have been set, to a meaningful value which just happens to evaluate to false. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mktime() Algorithm
Most langauges have support for this type of function - i.e. the number of seconds since 1970. Check your language manual... David A Dickson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need to create a function in another programming language that takes the same input as the php mktime() function and produces the exact same output as the php mktime() function. Does anybody out there know what the algorithm is? -- David A Dickson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] socket - e-mailaddress validation
If the remote system has the finger service activated, that would work. However, most servers have stopped running this and also the user generally has a say in whether they want to be listed. Out of curiosity, why do you want to do this? Mike Frazer Bvr [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yes, this is possible. However you would need to connect to the users mailserver instead of just the domain. Use getmxrr() to retrieve the mail exchanger associated with the domain. To check if the user is accepted on that server you can issue a RCPT TO: command on it and see what happens. Also you can use a local SMTP server that supports the VRFY (verify) command to check if the address is accepted. Google for 'RFC SMTP' for more details on the SMTP protocol. bvr. On Wed, 6 Feb 2002 11:05:31 +0100, B. Verbeek wrote: Question: Is it possible to validate an e-mailaddress by opening a socket-connection to the specified domein (@domain.com) and then search for username ([EMAIL PROTECTED]) to validate an e-mailaddress? I know how to set up a socket-connection, but how do I search for the user in the given domain? Regards, bart -- 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
[PHP] Version checking
What's the best method for checking the PHP version number. I'm assuming that include() was available in all versions, so, from my main index.php script, I include a local script (common.php) : ?php // assume minimum version of PHP required is 4.0.5 if (phpversion() 4) { die(wrong version); } $ver = explode(., phpversion()); if ($ver[2] 5) { die(wrong version); } ? The problem I can see is that some of the earlier 4+ versions had a funny number scheme - i.e. 4.0.1pl2. Does anyone have a complete list of version numbers (or a better method of version checking)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: !isset ??
On Wednesday, February 6, 2002, at 03:28 PM, CC Zona wrote: PHP's loose typing means that !$somevar evalutes as true if the variable is null, if it has an (integer, float, or string) value of zero, if it's an empty string, or if it is set to boolean false. Or if the variable/index does not exist. Both methods have their place (though for tests of the latter, I prefer empty()). The important part is understanding the implications of a method when you use it, so that your code isn't wrongly relying on !$somevar to mean the variable isn't set; it may well have been set, to a meaningful value which just happens to evaluate to false. I guess the best thing to do is to test it each way when I'm testing for variables and make sure that the method I end up going with works correctly for true and false values, whatever they may end up being. No BFD, I was just wondering if there was a definite method for doing these tests. Thanks to all who've responded on this thread. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] !isset ??
At 03:06 PM 2/6/2002 -0500, Erik Price wrote: Pretty confusing. Can anyone shed some light on whether or not there is a final definite way to do this? I've used (!($_POST['var'])) with no problems in the past, but does good coding style suggest that I use (!isset($_POST['var'])) now? The problem with using (!$_POST['var']) as an expression is that you are asking the parser to evaluate the expression as a boolean. If $_POST['var'] isn't a boolean (and it won't be, because unless I'm mistaken all POST or GET variables are treated as strings unless you cast them) then the parser does an implicit cast to boolean while evaluating your expression. This is fine for most cases, but let's say that $_POST['var'] *is* set to either an empty string () or a string containing zero (0). Your test will fail, because both of these are evaluated as FALSE when cast as a boolean. That's the reason that isset() is a little more general purpose. If you aren't worried about missing an empty string or a string containing 0 then you can continue to use the method you have been using. For more info, see this: http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Version checking
Check this one out (I use it to define functions for versions of PHP that don't have wordwrap defined for example): // Function to determine if the current version of PHP is // at least the one specified as a string in the parameter. // This is needed because string comparison isn't always accurate: // 4.0.24.0.12 as strings, although that's not true when // speaking of comparing versions. // Usage example: // if (!isphpver(4.0.2)) // { // [do something] // } // Bogdan Stancescu [EMAIL PROTECTED], November 2001 // You may freely use this function as long as you keep the header function isphpver($minver) { $itis=2; // That is, undecided $minimum=explode(.,$minver); $current=explode(.,phpversion()); for ($i=0;(($isizeof($current)) ($isizeof($minimum)));$i++) { if ($current[$i]$minimum[$i]) { $itis=true; // In this case, we have a winner break; } if ($current[$i]$minimum[$i]) // { $itis=false; // In this case, we have a loser break; } } if ($itis==2) // This would only happen if all the common version // components are identical. But there are may be // differences: // Example 1: comparing 4.0.1 with 4.0 would be //identical for now, but the condition //is satisfied; // Example 2: comparing 4.0 with 4.0.1 - identical //for now, but the condition is NOT //satisfied { if (sizeof($current)=sizeof($minimum)) { $itis=true; } else { // Ok, only one more chance: if for example the user // specified 4.0.0 and phpversion returned 4.0. for ($i=sizeof($current)-1;$isizeof($minimum);$i++) // { if ($minimum[$i]) { $itis=false; } } if ($itis==2) { $itis=true; } } } return($itis); } Alan McFarlane wrote: What's the best method for checking the PHP version number. I'm assuming that include() was available in all versions, so, from my main index.php script, I include a local script (common.php) : ?php // assume minimum version of PHP required is 4.0.5 if (phpversion() 4) { die(wrong version); } $ver = explode(., phpversion()); if ($ver[2] 5) { die(wrong version); } ? The problem I can see is that some of the earlier 4+ versions had a funny number scheme - i.e. 4.0.1pl2. Does anyone have a complete list of version numbers (or a better method of version checking)? -- 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
[PHP] GetImageSize and iptcparse problems
I've read the manual, and I'm still stuck, partially due to the manual itself. This is the first time I've dealt with this particular issue (parsing IPTC info from JPEGs). The example provided in the manual entry on GetImageSize: ?php $size = GetImageSize (testimg.jpg,$info); if (isset ($info[APP13])) { $iptc = iptcparse ($info[APP13]); var_dump ($iptc); } ? Gives me the following error on php 4.0.6: Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of getimagesize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. I don't understand what I need to pass to getImageSize in order to extract the IPTC info. Can someone point me in the right direction with this? Thanks, Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] checking for off site image
I'd like a test to see if an image not saved locally exists or not, but I'm beginning to wonder if there's a way. I've tried: getimagesize ('http://offsite.image.gif', $info); if ($info[3] != ) $title= 'print out image html'; else $title= 'give some text'; My URL fopen wrapper is enabled... getimagesize doesent work for off site? My error? or do one of you have a crafty solution? Thanks for your help! Sean --- I N T E R C O N N E C T Internet Image Development Tel: 505 989 3749 http://www.InterConnect.is.it --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] !isset ??
On Wednesday, February 6, 2002, at 03:42 PM, Michael Sims wrote: This is fine for most cases, but let's say that $_POST['var'] *is* set to either an empty string () or a string containing zero (0). Your test will fail, because both of these are evaluated as FALSE when cast as a boolean. That's the meat of it, then. I wasn't aware of the different types of evaluation that could be done on a variable (boolean, etc). Okay, I'm reading that link as I write this. Thanks again. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: RE: Sending MIME emails with base64 encoded attachments
Title: RE: RE: Sending MIME emails with base64 encoded attachments FINAL SOLUTION! Hello Ok. It's me, the last time :-) Let say I have a small 4byte file with content AB#0C (ascii: #65,#66,#0,#67) I load it (using binary save fread into $txt) When I try to get third character (#0), quess what I get: $x = ord(substr($txt,2,1)) $x IS NOT 0! $x IS 92, which mean backslash. Fourth char is 48, which means 0 and the fifth #67. So, PHP replaces any #0 with \0 in every string internally. OK. THIS is true just for string obtained by fread() Strings created internally are OK. So the solution is: 1) get the string from the file using $str=fread($file,filesize($filename)); 2) I realize that in string obtained by fread() the following characters are changed: #0 () - #92#48 (\0) #34 () - #92#34 (\) #39 (') - #92#39 (\') #92 (\) - #92#92 (\\) 3) So solution is before put text into base64_encode procedure, do the following: $str=str_replace(chr(92).chr(48),chr(0),$str); $str=str_replace(chr(92).chr(34),chr(34),$str); $str=str_replace(chr(92).chr(39),chr(39),$str); $str=str_replace(chr(92).chr(92),chr(92),$str); 4) Now you can encode it. It works. Futhermore, I was trying to store some string to file using fwrite() method. fwrite() works fine for all characters except backslash, where you have to send there double backslash. So fwrite($file,chr(0)) writes really #0, but for writing #92 you have to call fwrite($file,chr(92).chr(92)); For writing #0 you can also call fwrite($file,chr(92).chr(48)); ( and similary for all four cases stated above in point 3) ) So, a thing, that's all for now Have a nice day... Petr Svarc This electronic message transmission contains information from TMP Worldwide and is confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify us by telephone immediately at +44 (0)20 7406 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Manual input, to form, to array, to session register...
Before 4.1 we used an input form with default field values and manual override input to an array and then posted to an action page. All was good until global_register were turned off. Now I need to make this work using the session register. I have the all this working and passing defined variables ok. How is this done with a manual input? I have tried to use the same input line as before print INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5'; but cannot integrate it into the session register.I have also tried track_var configurations with no luck. I can get $vars into the register but I need to input values to an array manually. I know it's here somewhere but can I get a pointer. Thanks. Floyd -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Manual input, to form, to array, to session register...
On Wednesday, February 6, 2002, at 04:08 PM, Floyd Baker wrote: Now I need to make this work using the session register. I have the all this working and passing defined variables ok. How is this done with a manual input? I have tried to use the same input line as before print INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5'; but cannot integrate it into the session register.I have also tried track_var configurations with no luck. I can get $vars into the register but I need to input values to an array manually. I thought that with 4.1, you didn't need to use session_register(). Rather, you just define the variable you want in the $_SESSION array: $_SESSION['rate'] = $rate; But maybe that's not what you want... ? Erik PS: you could get this value into the default by doing print input type='text' name='rate[]' value=' . $_SESSION['rate'] . ' size='5' /; IOW, concatenation. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mktime() Algorithm
On Wed, 2002-02-06 at 11:28, David A Dickson wrote: I need to create a function in another programming language that takes the same input as the php mktime() function and produces the exact same output as the php mktime() function. Does anybody out there know what the algorithm is? -- David A Dickson [EMAIL PROTECTED] Sure: it starts around line 80 on ext/standard/datetime.c in the source tree: http://cvs.php.net/co.php/php4/ext/standard/datetime.c?r=1.82 Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if variable is equal to 2 through 4
Also, it was excessive to cross-post to different lists, especially with this kind of question. It has nothing to do with MySQL. Cross-posting is really only relevant for certain kinds of important announcements, and even then probably aren't cool. Erik On Wednesday, February 6, 2002, at 04:25 PM, Erik Price wrote: On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo hello; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Caching in php?
There is Zend Cache, it expensive and you have to pay per processor. That drove folks to develop APC (Alternitive PHP Cache) which is open source. http://apc.communityconnect.com/ They take the PHP source and compile it into machine code and stores that code, which saves porcessor overhead when the page is loaded again. APC worked well for me, but that's not where my bottleneck is, mine is with database access so I wanted to cache database queries. I couldn't find any application that did what I wanted so I wrote a class that handles caching queries. In programming it I wanted it to be a transparent as possible and make using it just like using the PEAR mysql module so I could add it to my site with minor modifications. Here is a little on how it works. It checks to see if the query is cached, if not it queries the database. It takes the data returned from the query and stores it in a xml file, which I have on a RAM disk for speed. It returns a result object similiar to the result object from the PEAR mysql stuff. And that object has a FetchRow function just like the mysql result object so it drops right into existing code. It's new and I haven't truely tested it's proformance yet but if you are interested in it. Let me know, I'm positive that people will be able to improve the code in the class which would be cool. On Wed, 2002-02-06 at 09:23, Erick Papadakis wrote: hello, i used asp and it seems there is an application object which can help in caching of data. (e.g., http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=142). is this possible using php? what can i do to use caching on my website which is totally database driven? thanks/erick __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] if variable is equal to 2 through 4
i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo hello; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Should you have any questions, comments or concerns, feel free to call me at 318-338-2034. Thank you for your time, Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A == Bayou Internet..(888) 30-BAYOUhttp://www.bayou.com Mississippi Internet...(800) MISSISSIPPI...http://www.mississippi.net Vicksburg Online..(800) MISSISSIPPIhttp://www.vicksburg.com == Tel: (318) 338-2034ICQ: 38823829 Fax: (318) 323-5053 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] if variable is equal to 2 through 4
how would I write it if I wanted to say this: if $variable == 2 through 4 ??? if(( $variable = 2 ) ( $variable = 4 )) { echo Equals 2 through 4br\n; } Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] if variable is equal to 2 through 4
try this: if ($v=2 $v=4) { echo ...; } mihai On Wed, 6 Feb 2002, Jay Fitzgerald wrote: i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo hello; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Should you have any questions, comments or concerns, feel free to call me at 318-338-2034. Thank you for your time, Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A == Bayou Internet..(888) 30-BAYOUhttp://www.bayou.com Mississippi Internet...(800) MISSISSIPPI...http://www.mississippi.net Vicksburg Online..(800) MISSISSIPPIhttp://www.vicksburg.com == Tel: (318) 338-2034ICQ: 38823829 Fax: (318) 323-5053 -- PHP Database 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
Re: [PHP] if variable is equal to 2 through 4
On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo hello; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? if ($variable = 2) ($variable = 4) Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if variable is equal to 2 through 4
try: if ($variable=2 and $variable=4) echo hello; - Original Message - From: Erik Price [EMAIL PROTECTED] To: Jay Fitzgerald [EMAIL PROTECTED] Cc: PHP (E-mail) [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 1:33 PM Subject: Re: [PHP] if variable is equal to 2 through 4 Also, it was excessive to cross-post to different lists, especially with this kind of question. It has nothing to do with MySQL. Cross-posting is really only relevant for certain kinds of important announcements, and even then probably aren't cool. Erik On Wednesday, February 6, 2002, at 04:25 PM, Erik Price wrote: On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo hello; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- 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
[PHP] odbc_fetch_into(), is there a way to display each data while using this function?
Hi! I want to know is is there a way to see the data per loop when using hte odbc_fetch_into() function? I want to see all of hte data. Thanks, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fw: why !^ in email?
I think it has something to do with the lines being too long, try throwing in a few carriage returns and see if that solve your problem Martin -Original Message- From: nina [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 5:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Fw: why !^ in email? - Original Message - From: YY [EMAIL PROTECTED] Newsgroups: php.general Sent: Wednesday, February 06, 2002 1:29 PM Subject: why !^ in email? why appear !^ in email when I send HTML email with mail() function? It works w/ those HTML codes, but I've no idea why there are some ! signs appear in the email. Can anyone help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: RE: Sending MIME emails with base64 encoded attachments
Hey Petr: 2) I realize that in string obtained by fread() the following characters are changed: #0 () - #92#48 (\0) #34 () - #92#34 (\) #39 (') - #92#39 (\') #92 (\) - #92#92 (\\) WAIT A SECOND! You've got the magic_quotes_runtime configuration variable turned on! To solve your problem you can: a) turn off that feature via the the php.ini or .htaccess file http://www.php.net/manual/en/configuration.php#ini.magic-quotes-runtime OR b) use stripslashes() on the string you get back from the file http://www.php.net/manual/en/function.stripslashes.php Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] in_array algorithm
On Wed, 2002-02-06 at 08:26, John Fulton wrote: Does anyone know which algorithm in_array() uses? For example, if I say in_array(foo, $arr) Does in_array() do an unordered sequential serach of $arr for foo which takes up to n comparisons [where n = count($arr)], or does it do a binary search which takes about lg(n) comparisons? Is it up to me to maintain a sorted array in the later case? Thanks, John Well, the source for the currect version of that function (as of 4.2.0-dev) is here: http://cvs.php.net/co.php/php4/ext/standard/array.c?r=1.156 Search down the page for 'php_search_array'--that's the function which actually does the searching. Looks like a simple sequential search to me. Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML closing elements called for tag /
Is there any way to suppress or detect when the closing element event fires from tags in the form tag / rather than tag/tag?
Re: [PHP] Manual input, to form, to array, to session register...
On Wed, 6 Feb 2002 16:23:25 -0500, you wrote: On Wednesday, February 6, 2002, at 04:08 PM, Floyd Baker wrote: Now I need to make this work using the session register. I have the all this working and passing defined variables ok. How is this done with a manual input? I have tried to use the same input line as before print INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5'; but cannot integrate it into the session register.I have also tried track_var configurations with no luck. I can get $vars into the register but I need to input values to an array manually. I thought that with 4.1, you didn't need to use session_register(). Rather, you just define the variable you want in the $_SESSION array: $_SESSION['rate'] = $rate; But maybe that's not what you want... ? Erik PS: you could get this value into the default by doing print input type='text' name='rate[]' value=' . $_SESSION['rate'] . ' size='5' /; IOW, concatenation. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] What I'm trying to do would be more like the reverse... I don't have $rate predefined but need to input it manually via a form. It needs to go into the session register, not be read from it. How does one make a manual *form* entry go directly into the session register. That's about the basic idea I think. I can make name='rate[]' work the old way but can't get name='rate[]' into the session register. Floyd -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie: Question about filesize()
You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ It should come up as an error, but I'm not sure. Ben Manuel Ritsch wrote: Hello There I'm new to PHP and trying to code a function that reads all teh files out of a directory and printing out a link and the filesize, but it seems that the filesize() function doesn't work, here's the code so far: $handle = opendir ('images'); echo Files:brbr; while (false !== ($file = readdir ($handle))) { if($file != . $file != ..) { $file_s = filesize($file); echo a href=images/$file$file/a Filesize: $file_sbr; } } closedir($handle); and the output is somethingl ike this: Files: button_test_04.gif Filesize: button_test_03-down.gif Filesize: lilextras_01.gif Filesize: (and so on)... You see, there's no Filesize and I don't know why, please help me -- manu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Newbie: Question about filesize()
that should be okay - it's to make sure that it is exactly equal to (as opposed to equates to be equal to) eg (0 === false) = false (0 == false) = true -Original Message- From: Ben Crawford [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Newbie: Question about filesize() You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ It should come up as an error, but I'm not sure. Ben Manuel Ritsch wrote: Hello There I'm new to PHP and trying to code a function that reads all teh files out of a directory and printing out a link and the filesize, but it seems that the filesize() function doesn't work, here's the code so far: $handle = opendir ('images'); echo Files:brbr; while (false !== ($file = readdir ($handle))) { if($file != . $file != ..) { $file_s = filesize($file); echo a href=images/$file$file/a Filesize: $file_sbr; } } closedir($handle); and the output is somethingl ike this: Files: button_test_04.gif Filesize: button_test_03-down.gif Filesize: lilextras_01.gif Filesize: (and so on)... You see, there's no Filesize and I don't know why, please help me -- manu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File Uploads
I apoligize if this question has already been asked but I am looking to upload files to my server. I use a form and can get the files to upload as user nobody with a random file name on my Linux box. That is the problem, the user is 'nobody'. This is either an Apache thing or a PHP thing and I haven't been able to figure it out. Is there some sort of login that I should be doing. I have tried the basic login just to check if that will work but it doesn't. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Newbie: Question about filesize()
At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote: You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ I think you could eliminate the false != in the while condition... It should be just the same if you write while (($file = readdir($handle))) right? -Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Newbie: Question about filesize()
On Wed, 2002-02-06 at 07:27, Ben Crawford wrote: You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ It should come up as an error, but I'm not sure. Ben No, that's the 'identical' operator, which returns true when its operands are both equalivalent and of the same type: http://www.php.net/manual/en/language.operators.comparison.php Cheers, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File Uploads
The username will be the same username that apache is running as, which you can specify in your httpd.conf file. -Jeff At 10:32 AM 2/6/2002 -0500, Ben Crawford wrote: I apoligize if this question has already been asked but I am looking to upload files to my server. I use a form and can get the files to upload as user nobody with a random file name on my Linux box. That is the problem, the user is 'nobody'. This is either an Apache thing or a PHP thing and I haven't been able to figure it out. Is there some sort of login that I should be doing. I have tried the basic login just to check if that will work but it doesn't. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array !!!
Help!! How to move an array's internal pointer to the required element not the first one or last one??? Thanks!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Writing PHP files from inside a PHP file
I want to extract information from a database table and create a half-static, half-dynamic PHP page from the info. I want to store the template for the new page in an external file with tags in the places where I want variables to be printed. What;s the best of achieving this?? I tried fread but that just printed ? echo $variable; ? to the static page instead of replacing it with the value. Any suggestions? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Create Mysql Records From a Comma separated Values String
The function you are looking for is 'explode'. It works like this, say you have a line of text stored in line of say pizza topping like this: $pizza_toppings = topping1,topping2,topping3 and now you want the toppings in an array just do this: $toppings = explode(,, $pizza_toppings); then you will have an array $toppings with entries for each of the toppings. Hope this helps. Ben Simos Varelakis wrote: Hi to everyone i have the following problem i have a string $foo which contains (n variable) comma separated values (example 1,17,23,45) and i want to insert these values in a mysql table . The destination field is int type and i need to insert one record per value Do you know which php function(s) should i use in order to (loop -extract the values from string) and do that ?? Thanks in advance for your help regars simos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing PHP files from inside a PHP file
Use include(); or require(); Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -Original Message- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 3:32 PM To: [EMAIL PROTECTED] Subject: [PHP] Writing PHP files from inside a PHP file I want to extract information from a database table and create a half-static, half-dynamic PHP page from the info. I want to store the template for the new page in an external file with tags in the places where I want variables to be printed. What;s the best of achieving this?? I tried fread but that just printed ? echo $variable; ? to the static page instead of replacing it with the value. Any suggestions? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- 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
[PHP] Re: XML closing elements called for tag /
In 000a01c1af5a$dbf70140$73fd883e@laptop, Hammy wrote: Is there any way to suppress or detect when the closing element event fires from tags in the form tag / rather than tag/tag? no, i don't think so. It means exactly the same in the XML-sense, so why should there be a difference in reporting it... chregu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Newbie: Question about filesize()
On Wed, 2002-02-06 at 15:33, Jeff Sheltren wrote: At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote: You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ I think you could eliminate the false != in the while condition... It should be just the same if you write while (($file = readdir($handle))) right? -Jeff Wrong, actually. If you have any files in that directory which have names which would evaluate as false in PHP, then your way will fail on them and you'll get a truncated directory listing. Do 'touch 0' in a directory and give it a shot; you'll see what I mean. However, the original example does the same thing, since it only checks whether the result of the readdir() evaluates to FALSE, not whether it actually is a boolean FALSE value. The correct way to do this is: while (FALSE !== ($file = readdir($handle))) { . . . } Note the !== instead of !=. Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: XML closing elements called for tag /
if you set up the xml_set_character_data_handler(), maybe this isn't called for tag /, but it will be called for tag/tag (??) you might want to check that 'cause I haven't :) Martin -Original Message- From: Christian Stocker [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 10:50 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: XML closing elements called for tag / In 000a01c1af5a$dbf70140$73fd883e@laptop, Hammy wrote: Is there any way to suppress or detect when the closing element event fires from tags in the form tag / rather than tag/tag? no, i don't think so. It means exactly the same in the XML-sense, so why should there be a difference in reporting it... chregu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Writing PHP files from inside a PHP file
include() and require() were suggested, but you may also want to look into eval(), which parses a string as PHP code and returns the parsed PHP. Sounds like what you're looking for. (I.e. storing PHP code in a database, right?) J Georgie Casey wrote: I want to extract information from a database table and create a half-static, half-dynamic PHP page from the info. I want to store the template for the new page in an external file with tags in the places where I want variables to be printed. What;s the best of achieving this?? I tried fread but that just printed ? echo $variable; ? to the static page instead of replacing it with the value. Any suggestions? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Verisign / Payflow Pro
Hi =) I saw PHP has built-in support for Cybercash, but that Verisign has purchased them. It looks like I'll have to go with Payflow Pro, but I'm wondering if PHP has built-in support, available modules, or what the best approach is. Any recommendations? Thanks, -Ed This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cURL and XML?
Hi, has anyone successfully posted an XML data file using the PHP cURL functions? If so, could you please send an example of the curl_setopt function names used. Thanks in advance Petras