RE: [PHP] Arrays/Hashes
You forgot the printf method printf("Some text %s\n",$myhash['mykey']); Jerry -Original Message- From: jimtronic [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 5:59 PM To: TD - Sales International Holland B.V. Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Arrays/Hashes I've noticed this, too. There are at least two things you can do to make them work... print("Some text {$myhash['mykey']}\n") or print("Some text ".$myhash['mykey']."\n") jim >Hey there, > >sortta simple question... Is it just me or can't you access hashes within >strings? >This works... >print("Some text $myarray[0]\n"); >This doesn't >print("Some text $myhash['mykey']\n"); > >i'm asking in relation to databases (not that that matters). If i fetch a row >from the database I can use the $array[0], [1], etc in the print statements >if i use mysql_fetch_array (oh sorry, u people call it associative arrays >instead of hashes, my mistake) i can't access $array['fieldname'] from within >a print statement but I CAN do >$DBID = $resultarray['idfieldname']; >and then use $DBID. > >regards > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: max # of characters for links to work in emails?
The maximum allowed of characters in a domain name is 3 (www) + 64 (domainname) + 3 (tld) = 70 chars. So if you try to limit it within the 70 chars you should be safe. Jerry -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 6:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: max # of characters for links to work in emails? a good guess would be every email client does it differnetly. unfort Id have to say try it yourself. Id imagine its long enough that you shouldnt have to worry about it, but I could be wrong. -- Chris Lee [EMAIL PROTECTED] "Tom Churm" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi, > > i'm working on an eCard project and somehow need to find out what the > reasonable limit is on characters for urls in email bodies (normal text, > not mime). > > i know that some mail clients will cut off urls that are too long or > else throw a line break in the middle of them--thus rendering them > 'unclickable'. and this is exactly what i wanna avoid. > > anyone have any advice to offer in this area? > > muchos gracias, > > tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: max # of characters for links to work in emails?
Don't think thats necessarily true - what about news.bbc.co.uk or games.yahoo.com. Neither of them fits into the spec you described there... Richy -Original Message- From: Jerry Verhoef (UGBI) [SMTP:[EMAIL PROTECTED]] Sent: 19 December 2001 08:41 To: 'Chris Lee'; [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject:RE: [PHP] Re: max # of characters for links to work in emails? The maximum allowed of characters in a domain name is 3 (www) + 64 (domainname) + 3 (tld) = 70 chars. So if you try to limit it within the 70 chars you should be safe. Jerry -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 6:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: max # of characters for links to work in emails? a good guess would be every email client does it differnetly. unfort Id have to say try it yourself. Id imagine its long enough that you shouldnt have to worry about it, but I could be wrong. -- Chris Lee [EMAIL PROTECTED] "Tom Churm" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi, > > i'm working on an eCard project and somehow need to find out what the > reasonable limit is on characters for urls in email bodies (normal text, > not mime). > > i know that some mail clients will cut off urls that are too long or > else throw a line break in the middle of them--thus rendering them > 'unclickable'. and this is exactly what i wanna avoid. > > anyone have any advice to offer in this area? > > muchos gracias, > > tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: MySQL Native Function in PHP Query Not Working?
LAST_INSERT_ID() only works in a select. This should be the correct syntax, but MySQL 3.xx.xx doesnot support SubQueries. I believe that MySQL 4 does or will in the near future. SELECT * FROM table WHERE aid=(SELECT LAST_INSERT_ID()) Jerry Verhoef -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 6:45 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: MySQL Native Function in PHP Query Not Working? that command doesnt even work from the mysql command prompt for me, Ive never used LAST_INSERT_ID(), but it dont work for me. try it on your mysql command prompt. -- Chris Lee [EMAIL PROTECTED] "Ise" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > Can someone explain to me why the below SQL query when executed with the PHP > mysql functions does not work? (it returns nothing) > > SELECT * FROM table WHERE aid=LAST_INSERT_ID() > > If I replace the MySQL function "LAST_INSERT_ID()" with a integer, it works > fine so its not the query. Further, I was returned results on the above > query when I ran it directly from a MySQL client. Does PHP not support > certain MySQL native functions? > > > Thanks, > > Michael Caplan > Institute for Social Ecology > http://www.social-ecology.org/ > > 1118 Maple Hill Road > Plainfield, VT, 05667 USA > > Tel.: 1 (514) 421-3515 > General Tel. / Fax.: 1 (802) 454-8493 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: max # of characters for links to work in emails?
> The maximum allowed of characters in a domain name is 3 (www) + 64 > (domainname) + 3 (tld) = 70 chars. So if you try to limit it within the 70 > chars you should be safe. Uh? First of all it should be 73 (what listed plus three dots). In the second place, do you mean "allowed" as in " what *I* arbitrarily set as a limit in my code" or "allowed" as in " Standard so and so dictates this"? If so, which standard? OK for the tld part, but domains like: mywww.subnet.domain.com (leftmost substring > 3char, more than three substrings) do exist. mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: max # of characters for links to work in emails?
There are even more variants possible. But I am trying to get into the minds of the programmers of the Email clients, what THEY would consider the biggest allowed URL. But of course an URL could be bigger (2kb if my memory serves me correctly) And the Question was: max # of characters for links to work in emails? And my answers is: Stay within the 70 chars and you should be safe Jerry Verhoef -Original Message- From: Richard Black [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 9:50 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Re: max # of characters for links to work in emails? Don't think thats necessarily true - what about news.bbc.co.uk or games.yahoo.com. Neither of them fits into the spec you described there... Richy -Original Message- From: Jerry Verhoef (UGBI) [SMTP:[EMAIL PROTECTED]] Sent: 19 December 2001 08:41 To: 'Chris Lee'; [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject:RE: [PHP] Re: max # of characters for links to work in emails? The maximum allowed of characters in a domain name is 3 (www) + 64 (domainname) + 3 (tld) = 70 chars. So if you try to limit it within the 70 chars you should be safe. Jerry -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 6:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: max # of characters for links to work in emails? a good guess would be every email client does it differnetly. unfort Id have to say try it yourself. Id imagine its long enough that you shouldnt have to worry about it, but I could be wrong. -- Chris Lee [EMAIL PROTECTED] "Tom Churm" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi, > > i'm working on an eCard project and somehow need to find out what the > reasonable limit is on characters for urls in email bodies (normal text, > not mime). > > i know that some mail clients will cut off urls that are too long or > else throw a line break in the middle of them--thus rendering them > 'unclickable'. and this is exactly what i wanna avoid. > > anyone have any advice to offer in this area? > > muchos gracias, > > tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: max # of characters for links to work in emails?
http://www.isi.edu/in-notes/rfc1034.txt excerpted: To simplify implementations, the total number of octets that represent a domain name (i.e., the sum of all label octets and label lengths) is limited to 255. unless using one of the new extended names..., but I digress Typically URL's work fine up to about 70 chars - your limit is more on the wrapping side - once wrapped different email programs do different things. Outlook for example munges up wrapped urls' - at least in OL98. -Original Message- From: Jerry Verhoef (UGBI) [mailto:[EMAIL PROTECTED]] Sent: December 19, 2001 4:53 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: max # of characters for links to work in emails? There are even more variants possible. But I am trying to get into the minds of the programmers of the Email clients, what THEY would consider the biggest allowed URL. But of course an URL could be bigger (2kb if my memory serves me correctly) And the Question was: max # of characters for links to work in emails? And my answers is: Stay within the 70 chars and you should be safe Jerry Verhoef -Original Message- From: Richard Black [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 9:50 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Re: max # of characters for links to work in emails? Don't think thats necessarily true - what about news.bbc.co.uk or games.yahoo.com. Neither of them fits into the spec you described there... Richy -Original Message- From: Jerry Verhoef (UGBI) [SMTP:[EMAIL PROTECTED]] Sent: 19 December 2001 08:41 To: 'Chris Lee'; [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject:RE: [PHP] Re: max # of characters for links to work in emails? The maximum allowed of characters in a domain name is 3 (www) + 64 (domainname) + 3 (tld) = 70 chars. So if you try to limit it within the 70 chars you should be safe. Jerry -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 6:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: max # of characters for links to work in emails? a good guess would be every email client does it differnetly. unfort Id have to say try it yourself. Id imagine its long enough that you shouldnt have to worry about it, but I could be wrong. -- Chris Lee [EMAIL PROTECTED] "Tom Churm" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi, > > i'm working on an eCard project and somehow need to find out what the > reasonable limit is on characters for urls in email bodies (normal text, > not mime). > > i know that some mail clients will cut off urls that are too long or > else throw a line break in the middle of them--thus rendering them > 'unclickable'. and this is exactly what i wanna avoid. > > anyone have any advice to offer in this area? > > muchos gracias, > > tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: [PHP-DB] Re: while...if statements???
and i always thought the best tactic was to go ugly early. seriously, this isn't really that ugly a solution, most textbooks tend to tell you to use this method to start with as its a bit simpler to understand for beginners - an if...else statement to see if an initial row is returned, then you can happily use a do...while on that first row, and it'll carry on outputting the following rows if there are any more. -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: 18 December 2001 20:49 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Re: while...if statements??? because the while() statement works like this - do something while x is true. if x is not true dont do anything. - do something while conent is in the db. if there is no conent in the db dont do anything. your if() statement is never run if there is no content. $return = mysql_fetch_row($result); if ( isset($return['pet_name']) ) do { echo $return['pet_name'] .""; } while( $return = mysql_fetch_row($result) ); else echo " No Pets "; its ugly but it works. I dont like ugly, so I wrote my own db wrappers. http://www.mediawaveonline.com/examples/ foreach( $db->select_array('', 'petinfo', '') as $pos => $val ) echo $val['pet_name'] .""; if ( !isset($val['pet_name']) ) echo " No Pets "; I like that more. but whatever. -- Chris Lee [EMAIL PROTECTED] "Jay Fitzgerald" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Does anyone know why this isn't working?? What I am trying to do is display > photos from a database based on each month. This part works fine when I set > it to the current month of December (today) as that is when I uploaded the > photos. > > However, when I manually set the date to a month that has no photos in it, > I want it to echo the No Animals string belowThis is only working > half-way...meaning that it will display a blank page with nothing on it > instead of actually echoing the No Animals string > > Can anyone please help?? Is there really a way to have a "while...if" > statement > > > > = > $connection = mysql_connect($hostname, $user, $pass) or die ("Unable to > connect!"); > $query = "SELECT petname, petDesc, petpicture FROM petinfo WHERE petmonth = > 'Apr'"; > $result = mysql_db_query($database, $query, $connection) or die ("Error in > query: $query. " . mysql_error()); > > while (list($pet_name, $pet_Desc, $pet_picture) = mysql_fetch_row($result)) > { > if ($pet_picture == "") > { > echo "No Animals have been posted for $date at this moment. Please check > back soon."; > exit; > } > > else > { > echo " > Pet of the month > > > SRC=\"http://moss.bayou.com:/oppj/admin/animalcontrol/photos/$pet_pictur e\" > HEIGHT=150> > > > $pet_Desc > > > To adopt $pet_name please visit the Ouachita Parish Animal Shelter. > The adoption fee is \$50.00 which includes Spade, Neutering and 7-N-1 > Shot. > > > Sorry, we can not hold $pet_name for you (First come first serve > basis). > "; > } > } > ?> > = > > Thanks, > > > Confus3d > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fwd: [PHP] Re: need some help
Hey you might wanna look at this: http://www.mysql.com/articles/ddws/index.html it's a tutorial to PHP with MySQL, I sure liked reading it. I also got a book the PHP 4 Bible. The dutch translation has some translation errors but the english version should be fine. Has nice examples et al. also check out www.webmonkey.com they have tutorials/lessons (all free!) for a kinds of web related stuff. I also send my kid brother there and he has learned a lot from that page. I've seen some PHP stuff on there as well. Hope that helps regards -- Forwarded Message -- Subject: [PHP] Re: need some help Date: Tue, 18 Dec 2001 08:38:10 -0800 From: "Chris Lee" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] I'll try and answer your questions as will the rest off the forum Im sure, just post away. -- Chris Lee [EMAIL PROTECTED] "Melva Garcia" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am looking for a mentor to help me along with > using php and mysql > > i am a designer for over 9 years now..and will > in return help you with anything pertaining to > layout and design > > i have alot of dumb questions pertianing to > php and mysql dba can someone help me > i would appreciate any help I can get > > thanks > Mel > > __ > Do You Yahoo!? > Check out Yahoo! Shopping and Yahoo! Auctions for all of > your unique holiday gifts! Buy at http://shopping.yahoo.com > or bid at http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Client Side Printing
Hello, I am not sure if this is common question. I am just starting to write php code and I found one problem with printing. If my php server is sitting on 5th floor of our network and staff at 1st floor want to print the page without those URL and header included in the printout (just like printing invoice out of the intranet) at the printer directly connected to his/er client computer, how can I write php code for that? What function should I use.? REgards, Ye Tun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] inscription
Lynda Haouhach Ingénieur système SONATRACH Email :[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $PHP_SELF not working -please help
Hi there, I have created a script that is suppose to get some input from user and display back, and i have the following method so i have a script that if login fails it will ask the user to register, if(!$username) { session_unregister("userid"); session_uregister("userpassword"); echo "Authorisation Failed." . "you must enter a valid credentials.". "try again.\n"; echo "Login"; echo "If you're not a member please regsiter.\n"; echo "Membership"; exit; } else echo "welcome, $username!"; Now for some strange reasons it tries to access my web direcorty that does not contain any file, and i get the 404 page not found error. any help would do, Thanks Caleb _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php telnet
The following code generated garbase output. what is wrong ?? The output was as follows: [root@ispms html]# php telnet.php X-Powered-By: PHP/4.1.0 Content-type: text/html ÿý▒ÿý ÿý#ÿý'[root@ispms html]# -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Client Side Printing
Turn that off in the browser print setup dialog. Alternately, there may be a Javascript function to do that, but if I was a user I would not be happy if code in a page messed with my settings. Remember PHP is server-side, not client side. Miles At 10:21 AM 12/19/2001 -0700, Ye Tun wrote: >Hello, > >I am not sure if this is common question. I am just starting to write php >code and I found one problem with printing. If my php server is sitting >on 5th floor of our network and staff at 1st floor want to print the >page without those URL and header included in the printout (just like >printing invoice out of the intranet) at the printer directly connected to >his/er client computer, how can I write php code for that? What function >should I use.? > > >REgards, > >Ye Tun > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] array_walk() and class methods
i have class instance snagfu, of class snafu, with a method, fubar() i have an array, $tarfu, and want to run it through array_walk(), array_walk($tarfu, $snagfu->fubar) seems to be logical, if it's possible. this obviously doesn't work. How do i use a class method with array walk? or is it even possible? if it's not possible, why not? seems to be as if it should be possible... thanks. Jeff Levy Software Design Meta-Craft Creations -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Random
Lo all, Can anyone please explain why this doesn't work... $floor = 10; $ceiling = 99; srand((double)microtime()*100); $random = rand($floor, $ceiling); I get the error... Warning: rand(): Invalid range: 10..99 in d:\htdocs\ezone\web\signup2.php on line 49 Thankyou Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php telnet
... and what did you expect? :o) Telnet uses charcters under ascii[32] to sync and manage connection/session - try http://www.faqs.org/rfcs/rfc854.html - description of TELNET protocol. M.N. -- kancha wrote: > The following code generated garbase output. what is wrong ?? > >$sp = fsockopen("localhost", 23); > if(!$sp){ > echo "error"; > exit; > } > socket_set_blocking($sp, FALSE); > > function getLine(){ > global $sp; > > $op = fgets($sp, 1024); > while(empty($op)){ > $op = fgets($sp, 1024); > } > return $op; > } > > echo getLine(); > ?> > > The output was as follows: > > [root@ispms html]# php telnet.php > X-Powered-By: PHP/4.1.0 > Content-type: text/html > > ÿý▒ÿý ÿý#ÿý'[root@ispms html]# > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] addslash/stripslashes
On Wednesday 19 December 2001 13:12, you wrote: "test\"" === 'test"' evals true :-) what I don't get however, the second the var is set like $string = "escaping \" quotes"; the backslash dissapears in the variable. The backslash is no longer there thus so having the statement mysql_query("insert into table values(\"$string\")"); would be interpreted: mysql_query("insert into table values(\"test"\")"); in which case the quote shouldn't appear in the database cause it will see that as delimiter of the first one, however I think the mysql_query fixes this by adding a backslash to it which is interpreted by mysql again cause it doesn't store the backslash. The only problem i still have is HTML. If i insert quotes into a field and retrieve them for my form like this: the value will stop at the first quote in the string dropping the rest on the floor since it doesn't recognize is (most likely) as a tag. So there an exploit there (only HTML/Javascript though not PHP) since you could insert a field like value">
RE: [PHP] Sending out mass mail without having timeout problems ..
http://www.php.net/manual/en/function.set-time-limit.php http://www.php.net/manual/en/function.ignore-user-abort.php Robert V. Zwink http://www.zwink.net/daid.php -Original Message- From: bain [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 11, 2001 3:41 AM To: php general list Subject: [PHP] Sending out mass mail without having timeout problems .. Hi all I've been working on a system for our company that uses MySQL to grab user data and then send personalized mail to them once a month. currently I step thought the mysql result mailling one mail per return. as you can imagine .. my script timeout value is sitting on 24hours to allow all the mail in our big database to go throught. Is there a way I can fork or thread the mail send process so I can send more then one mail at a time .. or maybe even buffer the MySQL result and send the mail in the background but still return the browser .. any sugestions .. please -- Henti Smith Systems Administrator The House Of Synergy http://www.thos.co.za [EMAIL PROTECTED] +27 11 259-9821 -- Let us not look back in anger or forward in fear, but around us in awareness. -- James Thurber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTTP_POST_FILES not working with 4.1.0?
Having trouble with HTTP_POST_FILES not working under 4.1.0. Track vars is enabled, and HTTP_POST_VARS works fine. Anyone experiencing simular problems? === Ron Dyck WebbTech www.WebbTech.net [EMAIL PROTECTED] 905 734-1164 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP_POST_FILES not working with 4.1.0?
Try $_FILES array, if it works that means that register_globals is off. Regards, Andrey - Original Message - From: "Ron Dyck" <[EMAIL PROTECTED]> To: "PHPList" <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 4:41 PM Subject: [PHP] HTTP_POST_FILES not working with 4.1.0? > Having trouble with HTTP_POST_FILES not working under 4.1.0. Track vars is > enabled, and HTTP_POST_VARS works fine. > > Anyone experiencing simular problems? > > === > Ron Dyck > WebbTech > www.WebbTech.net > [EMAIL PROTECTED] > 905 734-1164 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HTTP_POST_FILES not working with 4.1.0?
> Try $_FILES array, if it works that means that register_globals is off. $HTTP_POST_FILES is present with either setting of register_globals, and fwiw is working fine here with 4.1.0. Bear in mind that you still need to global it if inside a function, whereas with $_FILES you don't - it's a "super-global". -- Richard Heyes "If you have any trouble sounding condescending, find a Unix user to show you how it's done." - Scott Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Working with designers...
Hmm... can you point out to them that there's a similarity between using an external style sheet and using header/footer includes? And that as a coder, it would be your responsibility to maintain these include files, not theirs? Personally, I think .css external style sheets are awesome -- there's no reason I can see that they couldn't continue to use them. You don't need control over the .css file, and it would be easy for you to do in the include header, which gives them control over the contents of the
[PHP] form layout tool
On going Cold Fusion convert question... I use CF Studio as my primary editor. When working with cold fusion itself, it will let you specify an database and table, and it will then create a series of html forms that allow you to add/edit/delete information in that table. Very, very handy. Usually it requires some customization after the fact, but it saves you gobs of time. Does anyone know of such a tool/code for php? Thanks, Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] outputting db content
Silly question, Does anyone have a quick example of how you would show X numbers of database records at a time from a query? (you know, list 25 of 400 records with next/previous navigation)... Thanks Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] sessions var
I need some help with sessions. I need to pass variables to a page that will load in a new browser window (window.open("",myWindow,"") and ). I used session_register and I tried using start_session and still no luck. Once I get the session vars registered, how do I access them from the new window opened... thanks in advantage... William. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Client Side Printing
As the printing is done by the browser and not by anything controlled by PHP, it is impossible to create a solution for this with PHP. You might be able to change your browser settings with some javascript for this function but not with PHP. Remember: PHP is run on the webserver and returns a 'plain' html page to the client. It can't do any client side processing. Javascript(and java apps) on the other hand are run on the client and can interface with the browser. Robert Klinkenberg -Oorspronkelijk bericht- Van: Ye Tun [mailto:[EMAIL PROTECTED]] Verzonden: Wednesday, December 19, 2001 6:21 PM Aan: [EMAIL PROTECTED] Onderwerp: [PHP] Client Side Printing Hello, I am not sure if this is common question. I am just starting to write php code and I found one problem with printing. If my php server is sitting on 5th floor of our network and staff at 1st floor want to print the page without those URL and header included in the printout (just like printing invoice out of the intranet) at the printer directly connected to his/er client computer, how can I write php code for that? What function should I use.? REgards, Ye Tun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] outputting db content
> Does anyone have a quick example of how you would show X > numbers of database records at a time from a query? (you > know, list 25 of 400 records with next/previous navigation)... I've used this code snippet and lots of projects and it seems to work pretty well. Would appreciate advice on how to make it more efficient. -schnippy // set number of records to display per screen $page_limit=15; // get a quick count of all available records $query = "select * from records"; $result = mysql_query($query); $num_records = mysql_num_rows($row_count_result); // construct the navigation string $nav_string = ""; if (!$min) { $min="1"; } if (!($min=="1")) { $pmin=$min-$page_limit; $nav_string .= "Previous $page_limit Records -- "; } if ($x>$min+$page_limit) { $nmin=$min+$page_limit; $nav_string .= "Next $page_limit Records -- "; $max = $nmin; } else { $max = $x; } // set the 'real' values for display and mysql $rmax = $max-1; $rmin = $min-1; $nav_string .= " Viewing records $min through $max"; $nav_string .= " -- There are $x records for this query"; print $nav_string; // now select the range of records you want $query .="select * from records LIMIT $rmin,$page_limit"; $result = mysql_query($query); //display them or whatever -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] JavaScript & php question - mainly JS though so slightly OT but hep needed!!! :o)
Many Thanks everyone!! Mart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: outputting db content
Hello, Kelly Meeks wrote: > > Silly question, > > Does anyone have a quick example of how you would show X numbers of database records >at a time from a query? (you know, list 25 of 400 records with next/previous >navigation)... You may want to try this class that does exactly what you want and also displays alternated rows with different colors for readability and even can highlight the row that is under the mouse pointer. Also it works with any supported database (not just MySQL). http://phpclasses.upperdesign.com/browse.html/package/130 Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] outputting db content
On Wednesday 19 December 2001 16:28, you wrote: yea that's easy :-) first I have to tell you that the first result is numbered 0 like in arrays ok? now you would do a select like this select * from table limit 10; this will give you the first 10 results since you didn't supply a start number after that you want the second 10 ofcourse so then you do select * from table limit 10,10; 10 is actually the 11th result starting from there you'll get 11 through 20 select * from table limit 20, 10; will give you 21 through 30 etc etc ofcourse in PHP it would be easier to supply the first rule as select * from table limit 0, 10; since you then don't have to check whether it's the first so it'll save ya a loop or an if statement. proof of concept: mysql> select * from test; +--+ | bla | +--+ |1 | |2 | |3 | |4 | |5 | |6 | |7 | |8 | |9 | | 10 | | 11 | | 12 | +--+ mysql> select * from test limit 0,3; +--+ | bla | +--+ |1 | |2 | |3 | +--+ mysql> select * from test limit 3,3; +--+ | bla | +--+ |4 | |5 | |6 | +--+ mysql> select * from test limit 6,3; +--+ | bla | +--+ |7 | |8 | |9 | +--+ hope that helps > Silly question, > > Does anyone have a quick example of how you would show X numbers of > database records at a time from a query? (you know, list 25 of 400 records > with next/previous navigation)... > > > Thanks > > Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-DB] Re: while...if statements???
personal pref. Once I knew php and mysql better I wrote my own wrappers, I found using them easier. But there is no reason why someone couldnt do fine without one. writing a set of wrappers allowed me to better optimize my queries and write code faster without having to worry about everything else. have you tried the PEAR db wrappers? PEAR came out after I wrote mine, therfore I never used them, you? Chris Lee [EMAIL PROTECTED] - Original Message - From: "matt stewart" <[EMAIL PROTECTED]> To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 1:16 AM Subject: RE: [PHP-DB] Re: while...if statements??? > and i always thought the best tactic was to go ugly early. > > seriously, this isn't really that ugly a solution, most textbooks tend to > tell you to use this method to start with as its a bit simpler to understand > for beginners - an if...else statement to see if an initial row is returned, > then you can happily use a do...while on that first row, and it'll carry on > outputting the following rows if there are any more. > > -Original Message- > From: Chris Lee [mailto:[EMAIL PROTECTED]] > Sent: 18 December 2001 20:49 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP-DB] Re: while...if statements??? > > > because the while() statement works like this > > - do something while x is true. if x is not true dont do anything. > - do something while conent is in the db. if there is no conent in the db > dont do anything. > > your if() statement is never run if there is no content. > > $return = mysql_fetch_row($result); > if ( isset($return['pet_name']) ) > do > { > echo $return['pet_name'] .""; > } while( $return = mysql_fetch_row($result) ); > else > echo " No Pets "; > > its ugly but it works. I dont like ugly, so I wrote my own db wrappers. > > http://www.mediawaveonline.com/examples/ > > foreach( $db->select_array('', 'petinfo', '') as $pos => $val ) > echo $val['pet_name'] .""; > if ( !isset($val['pet_name']) ) > echo " No Pets "; > > I like that more. but whatever. > > -- > > Chris Lee > [EMAIL PROTECTED] > > > > "Jay Fitzgerald" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Does anyone know why this isn't working?? What I am trying to do is > display > > photos from a database based on each month. This part works fine when I > set > > it to the current month of December (today) as that is when I uploaded the > > photos. > > > > However, when I manually set the date to a month that has no photos in it, > > I want it to echo the No Animals string belowThis is only working > > half-way...meaning that it will display a blank page with nothing on it > > instead of actually echoing the No Animals string > > > > Can anyone please help?? Is there really a way to have a "while...if" > > statement > > > > > > > > = > > > $connection = mysql_connect($hostname, $user, $pass) or die ("Unable to > > connect!"); > > $query = "SELECT petname, petDesc, petpicture FROM petinfo WHERE petmonth > = > > 'Apr'"; > > $result = mysql_db_query($database, $query, $connection) or die ("Error in > > query: $query. " . mysql_error()); > > > > while (list($pet_name, $pet_Desc, $pet_picture) = > mysql_fetch_row($result)) > > { > > if ($pet_picture == "") > > { > > echo "No Animals have been posted for $date at this moment. Please check > > back soon."; > > exit; > > } > > > > else > > { > > echo " > > Pet of the month > > > > > > > > SRC=\"http://moss.bayou.com:/oppj/admin/animalcontrol/photos/$pet_pictur > e\" > > HEIGHT=150> > > > > > > $pet_Desc > > > > > > To adopt $pet_name please visit the Ouachita Parish Animal Shelter. > > The adoption fee is \$50.00 which includes Spade, Neutering and 7-N-1 > > Shot. > > > > > > Sorry, we can not hold $pet_name for you (First come first serve > > basis). > > "; > > } > > } > > ?> > > = > > > > Thanks, > > > > > > Confus3d > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ldap rename, anyone? help!
I'm having a great deal of trouble with the new ldap_rename function... it won't seem to work for me at all! I am running on the following: Solaris 8 on Ultra1e (dev server, 256M ram) OpenLDAP 2.0.18 PHP 4.1.0 I can set the LDAP version no problem (from 2 to 3 to have this function), but every time I try anything with the ldap_rename function, it comes back as an unsupported call (protocol error). Does anyone out there know why this would happen and how to get ldap_rename working? OR can someone give me a good idea of how to change a DN with PHP? help! -- Greg Ulyatt REDNET Ltd. UNIX Systems Administrator High Wycombe, Bucks, UK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] regular expression
Hi, Can you help me on this simple regexp? I've this string: $testata = "NEWS A ROTAZIONEcancella"; and this eregi: eregi("^(.*)$",$header,$regs); In this way I'd like to obtain the properties of the row (ie: bgcolor=\"#FF9900\" valign=\"middle\") and all the columns in the row (the content of each pair ...). I'm expecting to have this: in $reg[1]: bgcolor=\"#FF9900\" valign=\"middle\" in $reg[2]: NEWS A ROTAZIONEcancella Instead I''ve this: $reg[1]: bgcolor=\"#FF9900\" valign=\"middle\">NEWS A ROTAZIONEcancella" was found, but I'd like the FIRST one!! Can someone give me a solution? Thanks, Carlo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] array_walk() + class methods
I'd like to call a class method with array_walk(). Is this possible? class widget { function sicballs($arg){ print $arg; } } $x = new widget(); $ar = array('my','values'); array_walk($ar, ???) ... the only way I've been able to get this (simplified) code to work the way I want it is: function snafu($arg) { global $x; call_user_method("sicballs", $x, $arg); } obviously, I want to call the method direcly, without writing this function, snafu()... anyone know? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Random
should be because rand() can\'t generate such a large number for u. use $max_random_number = getrandmax(); to check http://sg.php.net/manual/en/function.getrandmax.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] regular expression
Good day, The problem here is with the .* expression, which matches any character, including > . The regex is "greedy" and will try and match as much as it possibly can. What you could do is change it so that it doesn't match > . Then, the > will be matched later in the expression,, as you want. So, [^>]* instead of .* should do it, I believe. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Wakan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 9:08 AM To: [EMAIL PROTECTED] Subject: [PHP] regular expression Hi, Can you help me on this simple regexp? I've this string: $testata = "NEWS A ROTAZIONEcancella"; and this eregi: eregi("^(.*)$",$header,$regs); In this way I'd like to obtain the properties of the row (ie: bgcolor=\"#FF9900\" valign=\"middle\") and all the columns in the row (the content of each pair ...). I'm expecting to have this: in $reg[1]: bgcolor=\"#FF9900\" valign=\"middle\" in $reg[2]: NEWS A ROTAZIONEcancella Instead I''ve this: $reg[1]: bgcolor=\"#FF9900\" valign=\"middle\">NEWS A ROTAZIONEcancella" was found, but I'd like the FIRST one!! Can someone give me a solution? Thanks, Carlo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] QUESTION: how to validate credit card number before sent to Versign?
We collect credit card info. on our site and send it to Verisign for processing. We collect the credit card info. on the last page of our registration form. We have about 50% of the credit card numbers declined because people use dashes in their cc number (even though our directions ask them not to). Is there anyway to incorporate the following function so that the dashes would be stripped out before going directly to Verisign for processing? or do I need to create a middle page that would validate the credit card info. before going to Verisign? If the latter is true, then is there a way I can run this validation "invisibly" - maybe using header(Location:)? Thanks for your help, Shawna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Socket functions
Hi, just wondering if anyone have tried the socket functions in php http://www.php.net/manual/en/ref.sockets.php does it work on win32(apache)? i tried the simple TCP/IP example on that page but it does\'nt work for me. I\'m using 4.1.0 and enabled that entension already. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Random
On Thu, 20 Dec 2001, Necro wrote: > Lo all, > > Can anyone please explain why this doesn't work... > > $floor = 10; > $ceiling = 99; > srand((double)microtime()*100); > $random = rand($floor, $ceiling); > > I get the error... > Warning: rand(): Invalid range: 10..99 in > d:\htdocs\ezone\web\signup2.php on line 49 > > Thankyou > > Andrew Hi there. I see you use windows, but when I looked up 'microtime' in the manual it says the following : --- microtime microtime -- Return current UNIX timestamp with microseconds Description string microtime(void); Returns the string "msec sec" where sec is the current time measured in the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This function is only available on operating systems that support the gettimeofday() system call. See also time(). --- So you'll probably have to use something else for your rand (or change OS ;) ) Good luck, and a merry Christmas to you. -- Knut -- Knut H. Hassel Nielsen, [EMAIL PROTECTED] Principal Engineer, Office : ITS 204 IDI NTNU, Sem Saelands vei 7-9 N-7491 Trondheim, Norway Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35 "Programmers don't die, they just GOSUB without RETURN." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Random
On 19 Dec 2001, David wrote: > should be because rand() can\'t generate such a large number for u. > > use $max_random_number = getrandmax(); to check > > http://sg.php.net/manual/en/function.getrandmax.php Hmmm... My webserver gives me no problems witht this at all. (Sun E250 with Solaris 8, Apache 1.3.20 and PHP4.6) This : Gives me a 6-digit integer every time -- Knut -- Knut H. Hassel Nielsen, [EMAIL PROTECTED] Principal Engineer, Office : ITS 204 IDI NTNU, Sem Saelands vei 7-9 N-7491 Trondheim, Norway Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35 "Programmers don't die, they just GOSUB without RETURN." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session destroy ??
In my online store i use session. I use a script to check that a user dont make 2 order during the same session using the back button for that i put his sessionid in the db and check it before processing the order. My probleme is how can i give a new session_id to the person when he goes back to the home page of my site so he can do a new order ? I try session_destroy , session_unset but the person have still the same session_id REMARK I always use the same string into session_name("abcdef") for all the user. Is it a problem? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How should I do this site...?
Heya, OK - I have a site I've been working on on and off for a while. It started as a static page, then I changed it so it uses php. This was great - until I started putting content in the design. I now have about 300 *.inc files for the site, and updating them is a joke! The site is designed in a heirachical way: Top Section 1 id 1 id 2 id 3 id 4 Section 2 id 1 id 2 id 3 Section 3 id 1 id 2 id 3 id 4 etc... I'm using 1 file for the code - index.php?sect=XX&id=XX and the nav menus are dynamically generated and populated on the page along with the content which is filled by an inc file in directory: root/php/"sectname"/"id".inc where "sectname" is the name of a section defined in an array in index.php (eg, section 6 is "synthesizers"). The images and headings on the page are also dynamically generated (images have a number eg "2.jpg" for the heading of section 2 etc.) In sections 6 though, ids 2-6 are based on one template, so i have 5 files: 2.inc, 3.inc, ... 6.inc all exactle the same, just containing This seems somewhat stupid. Oer X-Mas & New Year, I want to entirely recodethe site so it is more "user friendly" for me to maintain. I am slowly getting better and better at php so it should be good. Does ANYONE have any pointers as to how to start and do this thing. Any ideas for how my site should be layed out (directory-wise etc - is it easier to have 1 directory per section and hold everything in it - images included, or is it best to have a separate img/ directory??). many thanks all - Seasons greets!! Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] QUESTION: how to validate credit card number before sent to Versign?
I presume you are sending the details to verisign by posting the info from the directly to versign. If this is the case the post to a local php script, do the validation and then use the http_post class from http://phpclasses.upperdesign.com/ to send it to verisign Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 5:16 PM Subject: [PHP] QUESTION: how to validate credit card number before sent to Versign? > We collect credit card info. on our site and send it to Verisign for > processing. We collect the credit card info. on the last page of our > registration form. We have about 50% of the credit card numbers declined > because people use dashes in their cc number (even though our directions ask > them not to). > > Is there anyway to incorporate the following function so that the dashes > would be stripped out before going directly to Verisign for processing? or > do I need to create a middle page that would validate the credit card info. > before going to Verisign? If the latter is true, then is there a way I can > run this validation "invisibly" - maybe using header(Location:)? > > > > > > Thanks for your help, Shawna > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] QUESTION: how to validate credit card number before sent to Versi gn?
Look at the strings section of the PHP online manual. The function of choice is probably something like str_replace(). Not sure if this is the correct thing, but I know you can do what you want with a PHP string function. Good luck and make sure to keep those damn CC numbers nowhere on your machine. J On Wed, 19 Dec 2001 [EMAIL PROTECTED] wrote: >-We collect credit card info. on our site and send it to Verisign for >-processing. We collect the credit card info. on the last page of our >-registration form. We have about 50% of the credit card numbers declined >-because people use dashes in their cc number (even though our directions ask >-them not to). >- >-Is there anyway to incorporate the following function so that the dashes >-would be stripped out before going directly to Verisign for processing? or >-do I need to create a middle page that would validate the credit card info. >-before going to Verisign? If the latter is true, then is there a way I can >-run this validation "invisibly" - maybe using header(Location:)? >- >- >-ereg_replace ('[^0-9]+', '', $cc_no); }?> >- >- >-Thanks for your help, Shawna >- >--- >-PHP General Mailing List (http://www.php.net/) >-To unsubscribe, e-mail: [EMAIL PROTECTED] >-For additional commands, e-mail: [EMAIL PROTECTED] >-To contact the list administrators, e-mail: [EMAIL PROTECTED] >- ** John Huggins VANet 7101 Oriole Avenue Springfield, VA 22150 703-912-6453 703-912-4831 fax [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq))
Hi, I wonder if someone can help me solve this niggling problem: I have a hyperlink [javascript:openwindow('http:myserver/files.php?expid=67.iq')], which passes the argument 'expid' to the PHP script, where 'expid' is the name of a file. I want to take the file data and put it into a string. When I do so by naming the file in the script it works fine e.g. $fcontents = join ('', file ('myserbver/files/67.iq')); But when I do $fcontents = join ('', file ('myserver/files/$expid')); // where $expid = 67.iq I get the following errors --- Warning: file("myserver/files/$expid") - No error in c:\program files\apache group\apache\htdocs\sasdap\v5\files.php on line 4 Warning: Bad arguments to join() in c:\program files\apache group\apache\htdocs\sasdap\v5\files.php on line 4 --- I've also tried $file_location="myserver/files/$expid"; $fcontents = join ('', file ('$file_location')); I'm new to PHP and am so far only working with the online documentation. Can anyone help and/or explain the problem? Thanks in advance ;-) - Best regards, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] exit() summary
Hello, As Jani wrote in an earlier e-mail, we have a problem with exit(). If you pass it an integer, like exit(1), it will set the exit status to 1, and _print_ 1 to the output stream. Ok, that was the problem, this are the solutions: 1. We fix exit, so that it does not print the value if it is an integer 2. We add an extra argument to exit, which silences the output 3. We make exit understand @, like @exit(); 4. We add a new function Before hell breaks loose again, I don't want to hear comments on this, only reply's with those numbers in the subject. You can direct these votes to [EMAIL PROTECTED] regards, Derick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq))
Okay, I see the problem. No reply necessary. Cheers, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How should I do this site...?
Hi there Have you tried putting this into your '.htaccess' for each hierarchy, so that it will use a different 'master.inc' for each hierarchy ? Then you could divide the master.inc into three master.incs that could include the files they needed for each of the sections. .htaccess -- php_value include_path '.:/path/to/section1' -- On Wed, 19 Dec 2001, Martin Hughes wrote: > Heya, > > OK - I have a site I've been working on on and off for a while. It started > as a static page, then I changed it so it uses php. This was great - until I > started putting content in the design. I now have about 300 *.inc files for > the site, and updating them is a joke! > > The site is designed in a heirachical way: > > Top > Section 1 > id 1 > id 2 > id 3 > id 4 > Section 2 > id 1 > id 2 > id 3 > Section 3 > id 1 > id 2 > id 3 > id 4 > etc... > > I'm using 1 file for the code - index.php?sect=XX&id=XX and the nav menus > are dynamically generated and populated on the page along with the content > which is filled by an inc file in directory: root/php/"sectname"/"id".inc > where "sectname" is the name of a section defined in an array in index.php > (eg, section 6 is "synthesizers"). The images and headings on the page are > also dynamically generated (images have a number eg "2.jpg" for the heading > of section 2 etc.) > > In sections 6 though, ids 2-6 are based on one template, so i have 5 files: > 2.inc, 3.inc, ... 6.inc all exactle the same, just containing require_once('php/synthesizers/template.inc') ?> > This seems somewhat stupid. > > Oer X-Mas & New Year, I want to entirely recodethe site so it is more "user > friendly" for me to maintain. I am slowly getting better and better at php > so it should be good. > > Does ANYONE have any pointers as to how to start and do this thing. Any > ideas for how my site should be layed out (directory-wise etc - is it easier > to have 1 directory per section and hold everything in it - images included, > or is it best to have a separate img/ directory??). > > many thanks all - Seasons greets!! > > Martin > > > > -- Knut -- Knut H. Hassel Nielsen, [EMAIL PROTECTED] Principal Engineer, Office : ITS 204 IDI NTNU, Sem Saelands vei 7-9 N-7491 Trondheim, Norway Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35 "If debugging is the process of removing bugs, then programming must be the process of putting them in. -Dykstra" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] dns
Is there a way to set up a php page to act as a name server under windows? I dont have named etc on that OS. I was thinking of maybe having PHP read from the port used for DNS services and recording the MAC address of the machine in a dateabse for example and linking this to a name i.e. server.mydomain It would need to work on the Windows platform and be compatible with whaterver Windows uses for DNS stuff. The process would be as follows: 1: client tries to access server.mydomain in a browser window 2: a request is sent to the server asking it to find the IP address of the machine called server.mydomain 3: this IP address is then sent back to the client and connecting it to say 192.168.1.9 Do you think this could be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] addslash/stripslashes
On 19-Dec-2001 TD - Sales International Holland B.V. wrote: > On Wednesday 19 December 2001 13:12, you wrote: > > "test\"" === 'test"' evals true :-) > what I don't get however, the second the var is set like > $string = "escaping \" quotes"; > the backslash dissapears in the variable. The backslash is no longer there > thus so having the statement > > mysql_query("insert into table values(\"$string\")"); > would be interpreted: > mysql_query("insert into table values(\"test"\")"); > in which case the quote shouldn't appear in the database cause it will see > that as delimiter of the first one, however I think the mysql_query fixes > this by adding a backslash to it which is interpreted by mysql again cause > it > doesn't store the backslash. The only problem i still have is HTML. If i > insert quotes into a field and retrieve them for my form like this: > > the value will stop at the first quote in the string dropping the rest on > the > floor since it doesn't recognize is (most likely) as a tag. So there an > exploit there (only HTML/Javascript though not PHP) since you could insert a > field like > value"> here> > so i need to fix that. otherwise it goes fine. normally i'd understand this > perfectly but with all these magic quotes and the mysql functions > appearantly > adding the backslashes for escaping and PHP automatically type casting of > variables it has become vague as hell to me :/ > > thanks for the help so far people, the sky is finally clearing up :-) > Where possible, I'll use single quoting to avoid chasing down silly escape errors: mysql_query("insert into table values('$string')"); Try it. Makes life easier. Regards, -- Don Read [EMAIL PROTECTED] -- It is necessary for me to learn from others' mistakes. I will not live long enough to make them all by myself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help on dealing with arrays of HTTP_POST vars
Hello All, I have developed a system to retrieve data from a table. The interface is a dynamic list of orders created from a query on the database that shows all the new orders. Next to each is a checkbox. Each checkbox has as its value the order number and is called PED1, PED2, PED3,PEDn, depending on how many new orders are available. If the user wants to access these orders he has to check the orders he wants and click the submit button. Once it is submited, it searches all the PED# variables on the HTTP_POST_VARS and builds an array called $Orders. The $Orders array contains order numbers and is later used to query a different table. Ths code works almost great. But there is a problem, if the first checkbox, say PED1 field is not checked, and some of the other checkboxes are (say PED2, PED4), the $Orders array ends being empty. So, say that the form has 5 orders and the user selects orders 2, 4 and 5 and submit it. It does not work. But if he selects 1,2, 4 and 5 it works. It works only if the first checkbox is checked too. What I wonder is why this code does not work if PED1 checkbox is not checked. What if the user only wants other stuff but the first order PED1? Could you help me on this? Here's the code: This is a function that searches for variables called PED1, PED2, PED3 that are checkboxes on a submited form and have the order numbers. When this checkbox is checked, the ordernumber is saved on an Array $Orders that is later used to build a SQL statement. function SearchOrders() { global $Orders; global $HTTP_POST_VARS; $index = count($HTTP_POST_VARS); for($i=1; $i <= $index; $i++) { if (isset($HTTP_POST_VARS["PED$i"])) $Orders[] = $HTTP_POST_VARS["PED$i"]; } $index = count($Orders); return $index; } This is a function that retrieves the array values that are order numbers from the array $Orders and assembles a SQL statement $query. This will later retrieve data from a MySQL table; function MontarOrdRel() { global $Orders; $query = "SELECT * FROM tbl_Ord "; if (count($Orders) > 0) $query .= "WHERE "; for($index=0; $index < count($Orders); $index++) { if ($index < (count($Orders)-1)) { $query .="(NumPedido = '".$Orders[$index]."') OR "; } else { $query .="(NumPedido = '".$Orders[$index]."') "; } } // for loop $query .= "ORDER BY NumOrd"; Then $query is used to query a table. Thank you for your help, Carlos Fernando Scheidecker Antunes. Linux User #207984 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help on dealing with arrays of HTTP_POST vars
in your SearchOrder() function change the for() to a foreach() Jim - Original Message - From: "Carlos Fernando Scheidecker Antunes" <[EMAIL PROTECTED]> To: "PHP-GENERAL" <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 10:15 AM Subject: [PHP] Help on dealing with arrays of HTTP_POST vars > Hello All, > > I have developed a system to retrieve data from a table. The interface is a > dynamic list of orders created from a query on the database that shows all > the new orders. Next to each is a checkbox. Each checkbox has as its value > the order number and is called PED1, PED2, PED3,PEDn, depending on > how many new orders are available. If the user wants to access these orders > he has to check the orders he wants and click the submit button. Once it is > submited, it searches all the PED# variables on the HTTP_POST_VARS and > builds an array called $Orders. The $Orders array contains order numbers and > is later used to query a different table. > > Ths code works almost great. But there is a problem, if the first checkbox, > say PED1 field is not checked, and some of the other checkboxes are (say > PED2, PED4), the $Orders array ends being empty. So, say that the form has 5 > orders and the user selects orders 2, 4 and 5 and submit it. It does not > work. But if he selects 1,2, 4 and 5 it works. It works only if the first > checkbox is checked too. > > What I wonder is why this code does not work if PED1 checkbox is not > checked. What if the user only wants other stuff but the first order PED1? > > Could you help me on this? > > Here's the code: > > This is a function that searches for variables called PED1, PED2, PED3 that > are checkboxes on a submited form and have the order numbers. When this > checkbox is checked, the ordernumber is saved on an Array $Orders that is > later used to build a SQL statement. > > function SearchOrders() { > global $Orders; > global $HTTP_POST_VARS; > > $index = count($HTTP_POST_VARS); > > for($i=1; $i <= $index; $i++) { > if (isset($HTTP_POST_VARS["PED$i"])) > $Orders[] = $HTTP_POST_VARS["PED$i"]; > } > $index = count($Orders); > return $index; > > } > > This is a function that retrieves the array values that are order numbers > from the array $Orders and assembles a SQL statement $query. > This will later retrieve data from a MySQL table; > > function MontarOrdRel() { > global $Orders; > > $query = "SELECT * FROM tbl_Ord "; > > if (count($Orders) > 0) > $query .= "WHERE "; > > for($index=0; $index < count($Orders); $index++) { > > if ($index < (count($Orders)-1)) { > $query .="(NumPedido = '".$Orders[$index]."') OR "; > } > else { > $query .="(NumPedido = '".$Orders[$index]."') "; > } > } // for loop > $query .= "ORDER BY NumOrd"; > > Then $query is used to query a table. > > Thank you for your help, > > Carlos Fernando Scheidecker Antunes. > > > Linux User #207984 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] split/join error
Hi, I have saved an email as text-file, and want to get header and body out of the file! (header and body are seperated by the first empty line!) so I do: list($header,$body)=split("\n\n",join('',file($FILE)),2); then I need the body's lines as array: $body=split("\n",$body); but this line gives me a timeout for large files!!! (I also tried $x=split("\n",$body);$body=$x;) But I don't understand why!!! because file($FILE) doesn't return an error, although there are more array-elements created as with the split of $body! any ideas??? thanks -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Socket functions
I've been using them for months without any major problems. (There was a slight bug in socket_select() that caused some undesireable behaviour, as it wouldn't allow for indefinite blocking, but I submitted some patches and it was eventually fixed.) I have a search engine running that was built using these functions and it works fine, either on a TCP socket or locally on a UNIX domain socket. I don't know how well it works on Windows (I doubt the UNIX sockets would work, 'cause Windows uses named pipes or something like that rather than true UDS) but the TCP stuff probably works. J David wrote: > Hi, just wondering if anyone have tried the socket functions in php > http://www.php.net/manual/en/ref.sockets.php > > does it work on win32(apache)? i tried the simple TCP/IP example on that > page but it does\'nt work for me. I\'m using 4.1.0 and enabled that > entension already. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] $PHP_SELF not working -please help
Is the code below in a function? If so, you'll have to globalize $PHP_SELF: function your_function() { global $PHP_SELF; ... echo $PHP_SELF; .. } alternatively, you could do function your_function() { ... echo $GLOBALS['PHP_SELF']; .. } To the best of my knowledge, PHP_SELF is set regardless of the register_globals configuration setting, but I'm not 100% sure. -steve At 11:13 AM + 12/19/01, Caleb Carvalho wrote: >Hi there, > >I have created a script that is suppose to get some input from >user and display back, and i have the following method > > > >so i have a script that if login fails it will ask the user >to register, > > >if(!$username) { > session_unregister("userid"); > session_uregister("userpassword"); > echo "Authorisation Failed." . > "you must enter a valid credentials.". > "try again.\n"; >echo "Login"; >echo "If you're not a member please regsiter.\n"; >echo "Membership"; >exit; >} >else echo "welcome, $username!"; > > >Now for some strange reasons it tries to access my web direcorty >that does not contain any file, and i get the 404 page not found >error. > >any help would do, > >Thanks > >Caleb > -- ++ | Steve Edberg [EMAIL PROTECTED] | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | ++ | "Restriction of free thought and free speech is the most dangerous of | | all subversions. It is the one un-American act that could most easily | | defeat us."| | - Supreme Court Justice (1939-1975) William O. Douglas | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: How should I do this site...?
I just did this for a site awhile back. All the pages use the same template, but you could modify pretty easily.Build out an array like the one below that defines your entire site heirarchy. In my example, I set the url, title, alttext (for the image button), the image name (for javascript rollovers), urls to active/inactive states for the button, and an option image header. The example below would create a primary navigation consisting of "home" and "products" and products would have a sub nav of the latter three elements. You could easily add a "template" variable to control what template to use. Each of my pages then sets a variable for where it is (ie "/products/howitworks") which is passed to a function that builds the template, and the navigation, etc... works all right for me. $navAry['home']->url = "/"; $navAry['home']->title = "Foobar, LLC."; $navAry['home']->alttext = "Home"; $navAry['home']->imgname = "btn_home"; $navAry['home']->img_a = "/img/btn_home_a.gif"; $navAry['home']->img_i = "/img/btn_home_i.gif"; $navAry['products']->url = "/products/"; $navAry['products']->title = "Foobar | Products"; $navAry['products']->header = "/img/hdl_product.gif"; $navAry['products']->alttext = "The Product"; $navAry['products']->imgname = "btn_products"; $navAry['products']->img_a = "/img/btn_products_a.gif"; $navAry['products']->img_i = "/img/btn_products_i.gif"; unset($subAry); $subAry['howitworks']->url = "/products/howitworks.php"; $subAry['howitworks']->title = "Foobar | Products | How it Works"; $subAry['howitworks']->header = "/img/hdl_product_howitworks.gif"; $subAry['howitworks']->alttext = "How it Works"; $subAry['howitworks']->imgname = "btn_products_howitworks"; $subAry['howitworks']->img_a = "/img/btn_sub_howitworks_a.gif"; $subAry['howitworks']->img_i = "/img/btn_sub_howitworks_i.gif"; $subAry['security']->url = "/products/security.php"; $subAry['security']->title = "Foobar | Products | Security"; $subAry['security']->header = "/img/hdl_product_security.gif"; $subAry['security']->alttext = "Security"; $subAry['security']->imgname = "btn_products_security"; $subAry['security']->img_a = "/img/btn_sub_security_a.gif"; $subAry['security']->img_i = "/img/btn_sub_security_i.gif"; $subAry['isplicensing']->url = "/products/isplicensing.php"; $subAry['isplicensing']->title = "Foobar | Products | ISP Licensing"; $subAry['isplicensing']->header = "/img/hdl_product_isp.gif"; $subAry['isplicensing']->alttext = "ISP Licensing"; $subAry['isplicensing']->imgname = "btn_products_isplicensing"; $subAry['isplicensing']->img_a = "/img/btn_sub_isp_licns_a.gif"; $subAry['isplicensing']->img_i = "/img/btn_sub_isp_licns_i.gif"; $navAry['products']->sub = $subAry; On Wed, 19 Dec 2001, Martin Hughes wrote: > Heya, > > OK - I have a site I've been working on on and off for a while. It started > as a static page, then I changed it so it uses php. This was great - until I > started putting content in the design. I now have about 300 *.inc files for > the site, and updating them is a joke! > > The site is designed in a heirachical way: > > Top > Section 1 > id 1 > id 2 > id 3 > id 4 > Section 2 > id 1 > id 2 > id 3 > Section 3 > id 1 > id 2 > id 3 > id 4 > etc... > > I'm using 1 file for the code - index.php?sect=XX&id=XX and the nav menus > are dynamically generated and populated on the page along with the content > which is filled by an inc file in directory: root/php/"sectname"/"id".inc > where "sectname" is the name of a section defined in an array in index.php > (eg, section 6 is "synthesizers"). The images and headings on the page are > also dynamically generated (images have a number eg "2.jpg" for the heading > of section 2 etc.) > > In sections 6 though, ids 2-6 are based on one template, so i have 5 files: > 2.inc, 3.inc, ... 6.inc all exactle the same, just containing require_once('php/synthesizers/template.inc') ?> > This seems somewhat stupid. > > Oer X-Mas & New Year, I want to entirely recodethe site so it is more "user > friendly" for me to maintain. I am slowly getting better and better at php > so it should be good. > > Does ANYONE have any pointers as to how to start and do this thing. Any > ideas for how my site should be layed out (directory-wise etc - is it easier > to have 1 directory per section and hold everything in it - images included, > or is it best to have a separate img/ directory??). > > many thanks all - Seasons greets!! > > Martin > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-m
[PHP] RE: How should I do this site...?
Thank you! What is the point of using "unset" here (sorry - newbie question I know but I'm learning all the time :o)) Is it possible therefore to create more than 2 levels this way? If my heirachy goes 3 or 4 levels deep in some places? And could I also get a navbar to be generated dynamically from it (on my site the of the page, , the text for the heading image, and the nav bar entry will all be the same, with the exception of the also having the other levels in it, for example (3 levels deep): The Music of Les Miserables | Synthesizers | Korg Triton Thanks, Martin = Assistant Musical Director "Crazy For You" - February 2002 177 Hull Road, York YO10 3JY 07815 151 970 / 01904 427 537 [EMAIL PROTECTED] / [EMAIL PROTECTED] = -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: How should I do this site...?
unset will unset a varialbe. In the case I had I used to make sure that my $subAry was being unset before using it (I use it several places since several sections had sub sections). And yes, you can nest this as deep as you want since it is really just a tree. You start at the top and walk all the way down... And yes, you could generate a navbar (or breadcrumbing). As you walk the tree just append the name to say $breadcrumb and then you'd have it. -philip On Wed, 19 Dec 2001, Martin Hughes wrote: > Thank you! > > What is the point of using "unset" here (sorry - newbie question I know but > I'm learning all the time :o)) > > Is it possible therefore to create more than 2 levels this way? If my > heirachy goes 3 or 4 levels deep in some places? And could I also get a > navbar to be generated dynamically from it (on my site the of the > page, , the text for the heading image, and the nav bar > entry will all be the same, with the exception of the also having > the other levels in it, for example (3 levels deep): > The Music of Les Miserables | Synthesizers | Korg Triton > > Thanks, > > Martin > > = > Assistant Musical Director "Crazy For You" - February 2002 > 177 Hull Road, York YO10 3JY > 07815 151 970 / 01904 427 537 > [EMAIL PROTECTED] / [EMAIL PROTECTED] > = > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] regular expression: THANK YOU!!!!!!
Good day, There's a link on PHP's site to http://www.phpbuilder.com/columns/dario19990616.php3 . It looks pretty good. There are many other sites on the 'Net with regular expression references/tutorials. You can probably find some more with just a search engine. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Wakan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 10:21 AM To: Darren Gamble Subject: RE: [PHP] regular expression: THANK YOU!! If fact: that's the solution! It works. I don't know how to thank you. As have you surely notice, I'd need a good regexp (POSIX) manual. have you some good links?? Thanks very much again, Carlo (excuse my English too) At 09.10 19/12/2001 -0700, you wrote: >Good day, > >The problem here is with the .* expression, which matches any character, >including > . The regex is "greedy" and will try and match as much as it >possibly can. > >What you could do is change it so that it doesn't match > . Then, the > >will be matched later in the expression,, as you want. > >So, [^>]* instead of .* should do it, I believe. > > >Darren Gamble >Planner, Regional Services >Shaw Cablesystems GP >630 - 3rd Avenue SW >Calgary, Alberta, Canada >T2P 4L4 >(403) 781-4948 > > >-Original Message- >From: Wakan [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, December 19, 2001 9:08 AM >To: [EMAIL PROTECTED] >Subject: [PHP] regular expression > > >Hi, >Can you help me on this simple regexp? >I've this string: >$testata = "align=\"center\" height=\"11\">NEWS >A ROTAZIONEheight=\"11\" width=\"10%\">cancella"; > >and this eregi: >eregi("^(.*)$",$header,$regs); > >In this way I'd like to obtain the properties of the row >(ie: bgcolor=\"#FF9900\" valign=\"middle\") >and all the columns in the row (the content of each pair ...). > >I'm expecting to have this: >in $reg[1]: bgcolor=\"#FF9900\" valign=\"middle\" >in $reg[2]: align=\"left\" class=\"titoliblu\">NEWS A ROTAZIONEclass=\"titolipiccolibianchi\" align=\"center\" height=\"11\" >width=\"10%\">cancella > >Instead I''ve this: >$reg[1]: bgcolor=\"#FF9900\" valign=\"middle\">align=\"center\" height=\"11\">NEWS >A ROTAZIONEheight=\"11\" width=\"10%\">cancella >ie the last ">" was found, but I'd like the FIRST one!! > >Can someone give me a solution? >Thanks, Carlo > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: $PHP_SELF not working -please help
> Now for some strange reasons it tries to access my web direcorty that > does not contain any file, and i get the 404 page not found error. > check the source code of the html page. most likely you will see: . if not, it will still give you a hint about what's going wrong. are you constructing that form within a function? then you have to pull the $PHP_SELF variable into the local context. put 'global $PHP_SELF;' at the top of the form-outputting function. phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: session destroy ??
http://$SERVER_NAME";); ?> works for me. yes its stupid, but a session has to be started beore it can be destroyed. -- Chris Lee [EMAIL PROTECTED] "Olivier Masudi" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > In my online store i use session. > > I use a script to check that a user dont make 2 order during the same > session using the back button for that i put his sessionid in the db and > check it before processing the order. > > My probleme is how can i give a new session_id to the person when he goes > back to the home page of my site so he can do a new order ? > > I try session_destroy , session_unset > but the person have still the same session_id > > REMARK > > I always use the same string into session_name("abcdef") for all the user. > Is it a problem? > > > Thanks for your help > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sessions var
as long as your start the session on the new page everything will work. are your clients not using cookies? and you have trans-sid enabled? you'll need to pass the SID to the new page then obv. -- Chris Lee [EMAIL PROTECTED] "William Sanchez Sanchez" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > I need some help with sessions. I need to pass variables to a page that will > load > in a new browser window (window.open("",myWindow,"") and target="myWindow">). > I used session_register and I tried using start_session > and still no luck. Once I get the session vars registered, how do I > access them from the new window opened... > > > thanks in advantage... > > > > William. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Book.
Hi All, I have a good understanding of PHP. I like to read more documentation advanced PHP topics and also some more information on how to run PHP from Unix, as a cron job, how can PHP scripts be called from Shell Scripts etc... Any book or doc suggestions. Thanks, erisen. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: php telnet
if I nc to my server on port 23 I get the same thing. ie there is nothing wrong. your going to have to emulate the telnet protocal now, thats just the connect string. -- Chris Lee [EMAIL PROTECTED] "Kancha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > The following code generated garbase output. what is wrong ?? > >$sp = fsockopen("localhost", 23); > if(!$sp){ > echo "error"; > exit; > } > socket_set_blocking($sp, FALSE); > > function getLine(){ > global $sp; > > $op = fgets($sp, 1024); > while(empty($op)){ > $op = fgets($sp, 1024); > } > return $op; > } > > echo getLine(); > ?> > > The output was as follows: > > [root@ispms html]# php telnet.php > X-Powered-By: PHP/4.1.0 > Content-type: text/html > > ÿý?ÿý ÿý#ÿý'[root@ispms html]# > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: inscription
thanks for the inscription. here's mine. -- Chris Lee [EMAIL PROTECTED] "Sim/Haouhach" <[EMAIL PROTECTED]> wrote in message 58C7D97FA088D31190FD0090277B017502EA06DC@EXCHANGE">news:58C7D97FA088D31190FD0090277B017502EA06DC@EXCHANGE... Lynda Haouhach Ingénieur système SONATRACH Email :[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sessions var
One problem that I have with sessions it that if your login page is in www.yoursite.com and the you pop a page yoursite.com I think the Session is not recognized. just a hint. --- William Sanchez Sanchez <[EMAIL PROTECTED]> wrote: > > > I need some help with sessions. I need to pass variables > to a page that will > load > in a new browser window (window.open("",myWindow,"") and > target="myWindow">). > I used session_register and I tried using start_session > and still no luck. Once I get the session vars > registered, how do I > access them from the new window opened... > > > thanks in advantage... > > > > William. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: JavaScript & php question - mainly JS though so slightly OT but hep needed!!! :o)
thats exactly how you do it. foreach( $array as $pos => $val ) echo " $val "; -- Chris Lee [EMAIL PROTECTED] "Martin Hughes" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How could I write the function windowPopup(XX) where XX is a variable that > can change from link to link, for a popup info window to load a php file > with the variable XX in the url? > > So the link would look like: > Link Text > > and I want that link to open the page info.php?patch=XX in a new popup > window > > Do I do it something like this, or is there a faster/better way?? > > Cheers & Merry X-Mas! > > Martin > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] addslash/stripslashes
When putting strings into form values (and maybe other places too), I would advise wrapping the variable in: htmlentities(); so this: would become this: and magically watch all your troubles melt away - well maybe not ALL your troubles, but at least the trouble as mentioned below... If you want to add PHP strings to JavaScript code, use addslashes() instead - it's as easy as that... :) Martin -Original Message- From: TD - Sales International Holland B.V. [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 7:41 AM To: Don Read Cc: [EMAIL PROTECTED] Subject: Re: [PHP] addslash/stripslashes On Wednesday 19 December 2001 13:12, you wrote: "test\"" === 'test"' evals true :-) what I don't get however, the second the var is set like $string = "escaping \" quotes"; the backslash dissapears in the variable. The backslash is no longer there thus so having the statement mysql_query("insert into table values(\"$string\")"); would be interpreted: mysql_query("insert into table values(\"test"\")"); in which case the quote shouldn't appear in the database cause it will see that as delimiter of the first one, however I think the mysql_query fixes this by adding a backslash to it which is interpreted by mysql again cause it doesn't store the backslash. The only problem i still have is HTML. If i insert quotes into a field and retrieve them for my form like this: the value will stop at the first quote in the string dropping the rest on the floor since it doesn't recognize is (most likely) as a tag. So there an exploit there (only HTML/Javascript though not PHP) since you could insert a field like value">
Re: [PHP] sessions var
as long as the domain of the cookie is set to yoursite.com it will be readable from whateveryouwant.yoursite.com but if the domain is set to www.yoursite.com you won't be able to read it from yoursite.com Jim - Original Message - From: "Mehmet Kamil ERISEN" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 2:18 PM Subject: Re: [PHP] sessions var > One problem that I have with sessions it that if your login > page is in www.yoursite.com and the you pop a page > yoursite.com I think the Session is not recognized. > just a hint. > --- William Sanchez Sanchez <[EMAIL PROTECTED]> wrote: > > > > > > I need some help with sessions. I need to pass variables > > to a page that will > > load > > in a new browser window (window.open("",myWindow,"") and > > > target="myWindow">). > > I used session_register and I tried using start_session > > and still no luck. Once I get the session vars > > registered, how do I > > access them from the new window opened... > > > > > > thanks in advantage... > > > > > > > > William. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > = > Mehmet Erisen > http://www.erisen.com > > __ > Do You Yahoo!? > Check out Yahoo! Shopping and Yahoo! Auctions for all of > your unique holiday gifts! Buy at http://shopping.yahoo.com > or bid at http://auctions.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] sockets ??
have the below code.. and am having two issues.. the first is that str_read comes up with an error 'read() expects parameter 2 to be long, string given' - is this because i am recieving binary from host? the value returned is totally empty .. i know i need to hanshake and all but how do I work out what the server is asking so i can respond in kind? (yes i have read the rfc ..) ?? cheers brendan OK.\n"; } $in = ''; $out = ''; while (socket_read ($socket, $out, 1024)) { echo ord($out); } echo "sending guest login\n"; socket_write ($socket, $in, strlen ($in)); echo "OK.\n"; echo "Reading response:\n\n"; while (socket_read ($socket, $out, 2048)) { echo ord($out); } echo "Closing socket..."; socket_close ($socket); echo "OK.\n\n"; echo strlen($out); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Slash problem
I'm fairly new @ PHP, so forgive me if the answer is trivial ... In many cases, if I take in data from a form and the user uses an apostrophe, the data that is sent to me has a slash in it. For example: Jones\' Auto Repair Is there an easy fix? I'm not sure why this is occurring ... It\'s been quite a pain :) Adam
Re: [PHP] Slash problem
it is a thingy called magic quotes. setup in the php.ini file. turn it off and they will go away. or, if you can't add a stripslashes() to every variable that will passed this way. Jim - Original Message - From: "Evansville Scene" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 19, 2001 4:39 PM Subject: [PHP] Slash problem I'm fairly new @ PHP, so forgive me if the answer is trivial ... In many cases, if I take in data from a form and the user uses an apostrophe, the data that is sent to me has a slash in it. For example: Jones\' Auto Repair Is there an easy fix? I'm not sure why this is occurring ... It\'s been quite a pain :) Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Slash problem
either set "magic_quotes_gpc" to "off" in you .ini file - or use stripslashes() on the variable -Original Message- From: Evansville Scene [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:40 AM To: [EMAIL PROTECTED] Subject: [PHP] Slash problem I'm fairly new @ PHP, so forgive me if the answer is trivial ... In many cases, if I take in data from a form and the user uses an apostrophe, the data that is sent to me has a slash in it. For example: Jones\' Auto Repair Is there an easy fix? I'm not sure why this is occurring ... It\'s been quite a pain :) Adam
RE: [PHP] Slash problem
http://www.php.net/manual/en/function.stripslashes.php -Original Message- From: Evansville Scene [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 4:40 PM To: [EMAIL PROTECTED] Subject: [PHP] Slash problem I'm fairly new @ PHP, so forgive me if the answer is trivial ... In many cases, if I take in data from a form and the user uses an apostrophe, the data that is sent to me has a slash in it. For example: Jones\' Auto Repair Is there an easy fix? I'm not sure why this is occurring ... It\'s been quite a pain :) Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Slash problem
set_magic_quotes_runtime (false) bvr. On Thu, 20 Dec 2001 09:43:28 +1100, Martin Towell wrote: >either set "magic_quotes_gpc" to "off" in you .ini file - or use >stripslashes() on the variable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Book.
Hi, I think I'm misunderstood. I do not want to run in cgi mode. Thanks, Mehmet. --- Martín Marqués <[EMAIL PROTECTED]> wrote: > On Mié 19 Dic 2001 19:14, you wrote: > > Hi All, > > I have a good understanding of PHP. I like to read > more > > documentation advanced PHP topics and also some more > > information on how to run PHP from Unix, as a cron job, > how > > can PHP scripts be called from Shell Scripts etc... > > You need to compile PHP without web-server support, for > cgi. In that case you > will get a binary file, and you can use just like you use > perl or bash for > making scripts. > > For the developers: Is there a posibility of adding some > ability for > compilation of, for example, apache and binary stand > alone php? > > -- > Porqué usar una base de datos relacional cualquiera, > si podés usar PostgreSQL? > - > Martín Marqués | > [EMAIL PROTECTED] > Programador, Administrador, DBA | Centro de > Telematica >Universidad Nacional > del Litoral > - = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Book.
No not CGI, binary (instead of apache module). - Just leave out the --with-apache part when you do configure. by default 'make install' will put the php binary in /usr/local/bin - On top of your PHP script add the following line: #!/usr/local/bin/php - Make sure you don't use MS-DOS (but UNIX) style text files, PHP doesn't care but for that first line it may be important. - PHP open/close tags still apply bvr. On Wed, 19 Dec 2001 15:07:21 -0800 (PST), Mehmet Kamil ERISEN wrote: >Hi, >I think I'm misunderstood. I do not want to run in cgi >mode. >Thanks, >Mehmet. >--- Mart¡n Marqus <[EMAIL PROTECTED]> wrote: >> > information on how to run PHP from Unix, as a cron job, >> how >> > can PHP scripts be called from Shell Scripts etc... >> >> You need to compile PHP without web-server support, for >> cgi. In that case you >> will get a binary file, and you can use just like you use >> perl or bash for >> making scripts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Remote image
Is anyone familiar with the overhead that this type of system might create, as compared to a standard request/response to apache? That is, to have PHP intercept the request for an image, check HTTP_REFERER - if it is null or from the local server, open the file, redirect to browser, close file, if not serve a default error image. Also, would there be any danger (to the files in particular, but also with runaway processes or files left open) in using this method if a user cancels the request mid-stream? David -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 9:33 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Remote image how those remote servers destinguish where the images are coming from is from the Referr header. play around with getting the data manually using fopen()/fwrite()/fread() and your done. not so easy eh, well it works. -- Chris Lee [EMAIL PROTECTED] "Martin Kampherbeek" <[EMAIL PROTECTED]> wrote in message 001201c18290$60da3820$328078d9@cc16349a">news:001201c18290$60da3820$328078d9@cc16349a... Hi, I have a problem with a remote image. I hope someone can help me. People can post their link of their webpage at my site. I check if the file excists, fopen(). After that I scan the page for links. And the links for images. Then I would like to see the sizes of all those images. The problem is that there are servers that don't allow to brow straight to the images, it can only from the page self. So I look for something in php that surfs the the page en from that page to the links. I hope someone can help me. Cheers, Martin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Quanta IDE - PHP Highlighing for 4.0.1
Attached is a text file that will update Quanta IDE 2.0.1 syntax highlighting for PHP. Simply use your favourite text edit quanta/kwrite/highlight.cpp in your quanta-2.0.1 source tree, and paste the text from this attached file overtop of the phpKeywords and phpTypes variables. If anyone knows how I can make a real patch (diff or whatever) lemme know cuz I've never done it before. Also if you notice anything that shouldn't be a keyword, or is missing from either keywords or functions (currently there are 2499 functions defined in this file) let me know. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Quanta IDE - PHP Highlighing for 4.0.1
Shoot.. it didn't attach. That's probably a good thing. I'll put together a diff patch and put it somewhere for download. Mike Mike Eheler wrote: > Attached is a text file that will update Quanta IDE 2.0.1 syntax > highlighting for PHP. > > Simply use your favourite text edit quanta/kwrite/highlight.cpp in your > quanta-2.0.1 source tree, and paste the text from this attached file > overtop of the phpKeywords and phpTypes variables. > > If anyone knows how I can make a real patch (diff or whatever) lemme > know cuz I've never done it before. > > Also if you notice anything that shouldn't be a keyword, or is missing > from either keywords or functions (currently there are 2499 functions > defined in this file) let me know. > > Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Book.
On Mié 19 Dic 2001 19:14, you wrote: > Hi All, > I have a good understanding of PHP. I like to read more > documentation advanced PHP topics and also some more > information on how to run PHP from Unix, as a cron job, how > can PHP scripts be called from Shell Scripts etc... You need to compile PHP without web-server support, for cgi. In that case you will get a binary file, and you can use just like you use perl or bash for making scripts. For the developers: Is there a posibility of adding some ability for compilation of, for example, apache and binary stand alone php? -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? - Martín Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP 4.1.0 patch for Quanta IDE, The Sequel
http://sourceforge.net/tracker/index.php?func=detail&aid=495239&group_id=4113&atid=304113 Download the attached file, and run patch -p1 -i quanta-2.0.1-php-4.1.0.diff That will patch your source tree.. then just configure, make, install. I've actually tested this one, so go nuts people. :) Please let me know if you find any functions that should be keywords or keywords that shouldn't be keywords, or functions/keywords that just plain aren't in the list. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] temporary image
hallo, my applications generates a html-page, with a link to an image. this image is created by the application, and should exist only temporarily - so it can be deleted after being accessed by the html-page - any ideas how to implement this? is working with timetamps (microseconds) safe for creating the image's unique name? thanks michi -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Slash problem
This is done because magic_quotes_gpc is turned on. This makes it possible to just insert submitted data into a MySQL database, without preparing it first. You can turn it off if you have access to the server config, or.. you can do this: if (get_magic_quotes_gpc()) { foreach ($HTTP_POST_VARS as $key => $value) { // if you're into globals $$key = stripslashes($value); // otherwise -- not sure if this'll work or not // if $HTTP_POST_VARS is read-only then it won't. $HTTP_POST_VARS[$key] = stripslashes($value); } } At the beginning of your scripts. If you do that, don't forget to *not* use global values. Mike Evansville Scene wrote: > I'm fairly new @ PHP, so forgive me if the answer is trivial ... > > In many cases, if I take in data from a form and the user uses an apostrophe, the >data that is sent to me has a slash in it. For example: Jones\' Auto Repair > > Is there an easy fix? I'm not sure why this is occurring ... > It\'s been quite a pain :) > > Adam > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Slash problem
Hi set this in your php.ini file: magic_quotes_gpc = Off You'll have to use addslashes before you can store these variables with an ' in a database after turning it off. Tom At 10:39 AM 20/12/01, Evansville Scene wrote: >I'm fairly new @ PHP, so forgive me if the answer is trivial ... > >In many cases, if I take in data from a form and the user uses an >apostrophe, the data that is sent to me has a slash in it. For example: >Jones\' Auto Repair > >Is there an easy fix? I'm not sure why this is occurring ... >It\'s been quite a pain :) > >Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Slash problem
I disagree. That doesn't affect whether or not GPC variables are addslashes()'d. Mike Bas Van Rooijen wrote: > > set_magic_quotes_runtime (false) > > bvr. > > On Thu, 20 Dec 2001 09:43:28 +1100, Martin Towell wrote: > > >>either set "magic_quotes_gpc" to "off" in you .ini file - or use >>stripslashes() on the variable >> > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] outputting db content
> Does anyone have a quick example of how you would show X numbers of database records at a time from a query? (you know, list 25 of 400 records with next/previous navigation)... Feel free to rip the navigation out of phpLinks and use it: http://phplinks.org/ Have a look in functions.php, I think I named the function like 'nav' or something. Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] temporary image
Hi! You may want to check out the tempnam() function -- it's under filesystem functions in the downloadable documentation. Bogdan > hallo, > > my applications generates a html-page, with a link to an image. > this image is created by the application, and should exist only temporarily > - so it can be deleted after being accessed by the html-page - any ideas > how to implement this? is working with timetamps (microseconds) safe for > creating the image's unique name? > > thanks > michi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] temporary image
On the other hand if you want to keep track of the number of files generated you might want to try something like this: $i=1; $thePath=$temp_dir."/$fileprefix"; while (file_exists($thePath.$i)) { $i++; } $thePath.=$i; ($thePath stores a valid temp filename after that) Bogdan > hallo, > > my applications generates a html-page, with a link to an image. > this image is created by the application, and should exist only temporarily > - so it can be deleted after being accessed by the html-page - any ideas > how to implement this? is working with timetamps (microseconds) safe for > creating the image's unique name? > > thanks > michi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP & XML
Heya, Is it possible to integrate XML with PHP - ie get data out of an XML file and format it in html using php? Or alternatively, use php within an XSL file...? Cheers Mart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP & XML
Sorry - I should perhaps say that I'm only intending to code this site for IE(5/6) - there are too many issues with NetS - I **KNOW** that that's bad and lazy, but that's the way it's gonna be :o) M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re: [PHP] Re: Random
yeah, my linux(Mandrake 8, Apache 1.3.22, PHP 4.1.0) box also gives me a 6 digit integer each time too. but when i tried on my win32 (Win2k, Apache 1.3.22, PHP 4.1.0), it is limited to a max of 32767 as indicated with getrandmax(). the origional author of the problem probably using windows too :) >> should be because rand() can\'t generate such a large number for u. >> >> use $max_random_number = getrandmax(); to check >> >> http://sg.php.net/manual/en/function.getrandmax.php > >Hmmm... My webserver gives me no problems witht this at >all. >(Sun E250 with Solaris 8, Apache 1.3.20 and PHP4.6) >This : >$floor = 10; >$ceiling = 99; >srand((double)microtime()*100); >$random = rand($floor, $ceiling); >print $random; >?> >Gives me a 6-digit integer every time -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP & XML
For XML use parser: http://www.php.net/manual/en/ref.xml.php PHP in .xsl file is possible, edit your httpd.conf find this line: AddType application/x-httpd-php .phtml .php .php3 and add extensions that should be parsed by PHP, like so: AddType application/x-httpd-php .phtml .php .php3 .xsl be carefull, anything between will be executed by default. if this may conflict with the nature of the output (like .xml files) you can edit your php.ini to force long open tags Heya, > >Is it possible to integrate XML with PHP - ie get data out of an XML file >and format it in html using php? Or alternatively, use php within an XSL >file...? > >Cheers > >Mart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP & XML
Thanks! Much appreciated. M "Bas Van Rooijen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > > For XML use parser: http://www.php.net/manual/en/ref.xml.php > > PHP in .xsl file is possible, edit your httpd.conf > > find this line: > AddType application/x-httpd-php .phtml .php .php3 > > and add extensions that should be parsed by PHP, like so: > > AddType application/x-httpd-php .phtml .php .php3 .xsl > > be carefull, anything between will be executed by > default. if this may conflict with the nature of the output (like .xml files) > you can edit your php.ini to force long open tags > find this line: > short_open_tag = On > > change On to Off > > > bvr. > > On Thu, 20 Dec 2001 01:34:58 -, Martin Hughes wrote: > > >Heya, > > > >Is it possible to integrate XML with PHP - ie get data out of an XML file > >and format it in html using php? Or alternatively, use php within an XSL > >file...? > > > >Cheers > > > >Mart > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Book.
hmm, this how i use php for cron jobs: #!/usr/local/bin/php // location of php binary then just ask cron to run this script at your wish of time interval >I have a good understanding of PHP. I like to read more >documentation advanced PHP topics and also some more >information on how to run PHP from Unix, as a cron job, >how can PHP scripts be >called from Shell Scripts etc... > >Any book or doc suggestions. > >Thanks, >erisen. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP & XML (2)
and restart ofcourse ;) bvr. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Question: Should exit() print out the integer exit-status?
My 2 cents... I think "exit" should be fixed as you describe... And I think "die" should behave as it does in perl which is to print out whatever it is passed. -Garth --- Jani Taskinen - Question: Should exit() print out the integer exit-status? - Wed, 19 Dec 2001 01:38:39 +0200 (EET) background information: http://bugs.php.net/bug.php?edit=1&id=11008 http://bugs.php.net/bug.php?edit=1&id=14574 exit() function is broken. Fixing the broken behaviour is the only real solution, IMO. One solution: - When passed argument is string: print out this string - When passed argument is integer: Don't print it, use it as exit-status This is what is the expected behaviour is and I really can't think of any good examples where this would fail. Nobody ever gave any. And to get the REAL users (not only Zeev's opinion) I'm sending this also to php-general. >From manual: "The exit() function terminates execution of the script. It prints status just before exiting. If status is an integer, that value will be used as exit-status." This can be understood in many ways. If the status is integer, it is used as exit-status..but it's not clear that it's ALSO printed out which is simply buggy behaviour. Now, if general concencus amongs the users of PHP is that it should also print out the exit-status when it's an integer then 'shell_exit()' function should be added. --Jani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] socket read byte by byte
another question for the continuing saga .. I am trying to undertake a handshake with the telnet (tn3270) server .. using $get=socket_read($socket, 128, PHP_BINARY_READ ); i now need to step through $get byte by byte how do i do an equivilent fgetc? ie while (!feof($get)) { echo fgetc($iget); } but with the socket??? entire code below. ... cheers brendan --- \n"; } } return $bin_array; } $bin_array= makeChr(); $chr_array[0]="NUL"; /*NULL (NUL) 0 No Operation*/ $chr_array[1]="ARE"; //1 $chr_array[7]="BELL"; /* Produces an audible or visible signal (which does NOT move the print head).*/ $chr_array[7]="BS"; /*Moves the print head one character position towards the left margin. */ $chr_array[9]="HT"; /*Moves the printer to the next horizontal tab stop. It remains unspecified how either party determines or establishes where such tab stops are located. */ $chr_array[10]="LF"; /* Line Feed () Moves the printer to the next print line, keeping the same horizontal position. */ $chr_array[11]="VT"; /* Moves the printer to the next vertical tab stop. It remains unspecified how either party determines or establishes where such tab stops are located. */ $chr_array[12]="FF"; /*Moves the printer to the top of the next page, keeping the same horizontal position. */ $chr_array[13]="CR"; /* Carriage Return (CR) 13 Moves the printer to the left margin of the current line. */ $chr_array[29]="3270-REGIME"; /* Telnet 3270 Regime Option rfc http://www.ietf.org/rfc/rfc1041.txt */ $chr_array[240]="SE"; /* End of subnegotiation parameters. */ $chr_array[241]="NOP"; /* No operation. */ $chr_array[242]="Data Mark"; /* The data stream portion of a Synch.*/ /* This should always be accompanied */ /* by a TCP Urgent notification.*/ $chr_array[243]="Break";/* NVT character BRK.*/ $chr_array[244]="Interrupt Process"; /* The function IP.*/ $chr_array[245]="Abort output"; /* The function AO.*/ $chr_array[246]="Are You There";/* The function AYT.*/ $chr_array[247]="Erase character"; /* The function EC. */ $chr_array[248]="Erase Line"; /* The function EL.*/ $chr_array[249]="Go ahead"; /* The GA signal. */ $chr_array[250]="SB"; /* Indicates that what follows is subnegotiation of the indicated option. */ $chr_array[251]="WILL"; /* Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.*/ $chr_array[ 252]="WON'T"; /* Indicates the refusal to perform, or continue performing, the indicated option. */ $chr_array[253]="DO";/* Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option. */ $chr_array[254]="DON\'T"; /*Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option. */ $chr_array[255]="IAC"; //Data Byte 255. SET BINARY CODES # error_reporting (E_ALL); $port = '23'; $address = '202.14.186.30'; /* Create a
[PHP] How to open an existing Excel file(.xls) from PHP program
Hi, How to open an existing excel file(.xls) from PHP, and edit the contents of the particular cell. Thanks in advance Regards Balaji --- Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailto:[EMAIL PROTECTED] and delete this mail from your records. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]