[PHP] How to Config PHP to run snmp in php script?
Dear All, I am using RedHat Linux 7.2, PHP4.1 and its buitd-in apache, I had tested that the php run correctly with apache. According to the documentation of www.php.net, As shown below: # XCIII. SNMP functions In order to use the SNMP functions on Unix you need to install the UCD SNMP package. On Windows these functions are only available on NT and not on Win95/98. Important: In order to use the UCD SNMP package, you need to define NO_ZEROLENGTH_COMMUNITY to 1 before compiling it. After configuring UCD SNMP, edit config.h and search for NO_ZEROLENGTH_COMMUNITY. Uncomment the #define line. It should look like this afterwards: #define NO_ZEROLENGTH_COMMUNITY 1 If you see strange segmentation faults in combination with SNMP commands, you did not follow the above instructions. If you do not want to recompile UCD SNMP, you can compile PHP with the --enable-ucd-snmp-hack switch which will work around the misfeature. I had successfully complie PHP with the --enable-ucd-snmp-hack switch but I can not find the file called config.h to edit. Finally, My question is WHERE is the file?? and IS THERE any points/steps need to look at in order to configure PHP to run snmp in PHP script?? Thx All.
[PHP] [ANN] session_pgsql 0.2 (alpha) released
Hi all, session_pgsql version 0.2 (beta) is released. New: - Auto global variable $_APP is added. It's a application scope variable. You can share values in the same application. It uses session name for application name. Feature: - More than 2 times faster than 'user' save handler and PostgreSQL. - Automatic session and applicaton variable table creation. - Time based GC. - Don't read expired session data. - Since it uses PostgreSQL, you can query session and application data whatever you want. - Multiple web servers shares session. Manual: http://pear.php.net/manual/en/pecl.session-pgsql.php (a little old...) Download: http://sf.net/projects/phpform-ext/ Read README file for details. Enjoy! -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mass mail
I've users in a database classified by differnet catagories. Now based on category I need to send mail to all the users in a category. Calling mail() function in a loop would be a kill for the server as there are more than 1000 users in each category. Is there any way of doing this ?? Creating a mailing list is not possible. __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] mass mail
hi. maybe you put the first user into the to-field and all others into field blindcopy... you will need one mail and send it to all. but i don't know if there is a limit ... greetz -Ursprungliche Nachricht- Von: Kancha . [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 20. Februar 2002 13:01 An: [EMAIL PROTECTED] Betreff: [PHP] mass mail I've users in a database classified by differnet catagories. Now based on category I need to send mail to all the users in a category. Calling mail() function in a loop would be a kill for the server as there are more than 1000 users in each category. Is there any way of doing this ?? Creating a mailing list is not possible. __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] novice question -- array_push($real[$i][$j],$s[$j]);????????
Hi, thanks for reading this, Iam trying to push elements into a two dimentional array, but I cant find the proper syntax, I'd be grateful if someone could email me the proper method. Iam using the normal method, which worked fine for a one dimentional array, but when I use it for a two dimentional array, it doesnt seem to recognise that is an array, even though I initialized the array with $real[0][0] = 0;. Thanks a million for your time, Bren _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Crashing a webserver
Thank you all, let's see how good the machine will do... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mass mail
yas, but that way they all end up in junk filters. Dont use bcc to send you mailing list - Original Message - From: Norbert Eder [EMAIL PROTECTED] To: Kancha . [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 20. veljaèa 2002 13:10 Subject: AW: [PHP] mass mail hi. maybe you put the first user into the to-field and all others into field blindcopy... you will need one mail and send it to all. but i don't know if there is a limit ... greetz -Ursprungliche Nachricht- Von: Kancha . [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 20. Februar 2002 13:01 An: [EMAIL PROTECTED] Betreff: [PHP] mass mail I've users in a database classified by differnet catagories. Now based on category I need to send mail to all the users in a category. Calling mail() function in a loop would be a kill for the server as there are more than 1000 users in each category. Is there any way of doing this ?? Creating a mailing list is not possible. __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] xbithack causes parsing of html-files by PHP instead SSI
Hi! Problem: see subject I posted the problem to php's bug-db but [EMAIL PROTECTED] answered: The bug system is not the appropriate forum for asking support questions. For a list of a range of more [...] With xbit hack, you are supposed to parse by PHP. BUT: On our old server-install (PHP 4.0.4pl1, Apache 1.3.19 xbithack on), all .html-files with xbit were SSI-parsed. Now, on our new server install (PHP 4.1.1, Apache 1.3.20 xbithack on), all .html-files with xbit are PHP-parsed! In Apache's documentation one can read that xbithack should enable SSI (and not PHP). If I follow [EMAIL PROTECTED]'s answer, it should be normal that the files are PHP-parsed. First question: If this behaviour is normal, why didn't I found anything about it in the PHP-docs? Have I overread that part? Second question: If this behaviour is normal, why were the files on our old server SSI-parsed and now PHP-parsed? How can I change this behaviour (to enable SSI-parsing)? Thanks for your help. Tobias Wiersch from germany -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] gmp installation win32
Has anybody installed the gmp library or know of any well documented ways of doing so I really need some help with this one. I am using win32 and I need to get it running asap. I have already installed the gmp library using cygwin but I can't get php to configure with gmp and make it gives a warning about a missing separator. Cheers Muz
[PHP] php-general-unsubscribe@lists.php.net
[EMAIL PROTECTED] -Original Message- From: Tobias Wiersch [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 8:04 AM To: [EMAIL PROTECTED] Subject: [PHP] xbithack causes parsing of html-files by PHP instead SSI Hi! Problem: see subject I posted the problem to php's bug-db but [EMAIL PROTECTED] answered: The bug system is not the appropriate forum for asking support questions. For a list of a range of more [...] With xbit hack, you are supposed to parse by PHP. BUT: On our old server-install (PHP 4.0.4pl1, Apache 1.3.19 xbithack on), all .html-files with xbit were SSI-parsed. Now, on our new server install (PHP 4.1.1, Apache 1.3.20 xbithack on), all .html-files with xbit are PHP-parsed! In Apache's documentation one can read that xbithack should enable SSI (and not PHP). If I follow [EMAIL PROTECTED]'s answer, it should be normal that the files are PHP-parsed. First question: If this behaviour is normal, why didn't I found anything about it in the PHP-docs? Have I overread that part? Second question: If this behaviour is normal, why were the files on our old server SSI-parsed and now PHP-parsed? How can I change this behaviour (to enable SSI-parsing)? Thanks for your help. Tobias Wiersch from germany -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how the ticks works?
I don't understand how the 'ticks' works: please help me. pre ?php // A function that records the time when it is called function profile ($dump = FALSE) { static $profile; // Return the times stored in profile, then erase it if ($dump) { $temp = $profile; unset ($profile); return ($temp); } $profile[] = microtime (); } // Set up a tick handler register_tick_function(profile); // Initialize the function before the declare block profile (); // Run a block of code, throw a tick every 2nd statement declare (ticks=2) { for ($x = 1; $x 50; ++$x) { echo similar_text (md5($x), md5($x*$x)), lt;brgt;; } } // Display the data stored in the profiler print_r (profile (TRUE)); ? /pre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to Config PHP to run snmp in php script?
Raymond, Here is the break down: 1. Download ucd-snmp tar.gz file. 2. Download openssl tar.gz file. You will need openssl for snmp v3 for the security stuff. Uninstall ucd-snmp if it is installed on your system. Uninstall openssl on your system. 3. Untar the files... 4. In the ucd-snmp directory find the file config.h and locate the NO_ZEROLENGTH_COMMUNITY and uncomment the line if commented and set to 1. 5. Configure, make, make install the ucd-snmp 6. Configure, make, make install the openssl ***NOTE: Do a make clean in the php directory. Then remove the config.cache file from the php directory.*** 7. Configure php with snmp Example: ./configure --prefix=/usr/local/php --with-snmp=/usr/local/snmp --with-openssl=/usr/local/openssl --with-apxs=/usr/bin/apxs make make install This should work for you. ***NOTE: THINGS I HAVE TRIED*** 1. I have tried to compile php with the openssl and snmp rpms. However, php chokes on the openssl rpm. 2. If you want to try it with your already installed rpms, here is the configuration that I have tried. ./configure --prefix=/usr/local/php --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --oldincludedir=/usr/include --with-config-file-path=/etc --with-apxs=/usr/sbin/apxs --with-pear --enable-sigchild --enable-magic-qoutes --enable-libgcc --enable-bcmath --enable-calendar --enable-ctype --enable-dbx --enable-ftp --enable-gd-native-ttf --enable-trans-sid --enable-shmop --enable-ucd-snmp-hack --enable-sockets --enable-wddx --enable-yp --enable-inline-optimization --with-xml --disable-debug --enable-pic --enable-shared --with-regex=system --with-gettext --with-gd --with-jpeg-dir=/usr --with-zlib --enable-safe-mode --enable-sysvsem --enable-sysvshm --enable-debugger --with-gdbm --with-db2 --with-db3 --with-png --with-openssl=/usr/include/openssl The problem that I faced here is that php chokes on finding the evp.h header file in the openssl direcory. I look in the directory and it is there. Let me know if I can help you further. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Raymond Mak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 3:24 AM To: [EMAIL PROTECTED] Subject: [PHP] How to Config PHP to run snmp in php script? Dear All, I am using RedHat Linux 7.2, PHP4.1 and its buitd-in apache, I had tested that the php run correctly with apache. According to the documentation of www.php.net, As shown below: # XCIII. SNMP functions In order to use the SNMP functions on Unix you need to install the UCD SNMP package. On Windows these functions are only available on NT and not on Win95/98. Important: In order to use the UCD SNMP package, you need to define NO_ZEROLENGTH_COMMUNITY to 1 before compiling it. After configuring UCD SNMP, edit config.h and search for NO_ZEROLENGTH_COMMUNITY. Uncomment the #define line. It should look like this afterwards: #define NO_ZEROLENGTH_COMMUNITY 1 If you see strange segmentation faults in combination with SNMP commands, you did not follow the above instructions. If you do not want to recompile UCD SNMP, you can compile PHP with the --enable-ucd-snmp-hack switch which will work around the misfeature. I had successfully complie PHP with the --enable-ucd-snmp-hack switch but I can not find the file called config.h to edit. Finally, My question is WHERE is the file?? and IS THERE any points/steps need to look at in order to configure PHP to run snmp in PHP script?? Thx All.
[PHP] Get an application/octet-stream from a java applet
Hi all, I'm trying to make a script to get application/octet-stream datas from a java applet. The method used by the applet is POST and I tried to use $HTTP_RAW_POST_DATA like this ? if (isset($HTTP_RAW_POST_DATA)) { $contentlength = strlen($HTTP_RAW_POST_DATA); $buffer = $HTTP_RAW_POST_DATA; } ...? but $HTTP_RAW_POST_DATA is not set and $buffer stills empty. The size of the data sent by the applet is 860bytes and the applet works fine if I use a C++ CGI instead of PHP. Does someone have an idea ? Thanks a lot ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] Get an application/octet-stream from a java applet
AFAIK 4.0.6 is weird in the process of HTTP_RAW_POST_DATA generation. I used this var successfully on 4.0.0, when tried to upgrade to 4.0.6 there was a problem. After an investigation I found that if the submited POST has known by Apache Content header then the var is empty. I think it is fixed in 4.1.0 at least in a CVS 4.1.0-pre version. Try with 4.1.x Best regards, Andrey Hristov - Original Message - From: Nicolas BOUTET [EMAIL PROTECTED] To: Andrey Hristov [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 3:57 PM Subject: RE: [PHP-DEV] Get an application/octet-stream from a java applet I'm using php4.06. Thanks. I ask it on php-general. -Message d'origine- De : Andrey Hristov [mailto:[EMAIL PROTECTED]] Envoye : mercredi 20 fevrier 2002 14:33 A : Nicolas Boutet; [EMAIL PROTECTED] Objet : Re: [PHP-DEV] Get an application/octet-stream from a java applet Which version of PHP? Ask this on php-general. php-dev is for coders of core functionality. Best regards, Andrey Hristov - Original Message - From: Nicolas Boutet [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 3:24 PM Subject: [PHP-DEV] Get an application/octet-stream from a java applet Hi all, I'm trying to make a script to get application/octet-stream datas from a java applet. The method used by the applet is POST and I tried to use $HTTP_RAW_POST_DATA like this ? if (isset($HTTP_RAW_POST_DATA)) { $contentlength = strlen($HTTP_RAW_POST_DATA); $buffer = $HTTP_RAW_POST_DATA; } ...? but $HTTP_RAW_POST_DATA is not set and $buffer stills empty. The size of the data sent by the applet is 860bytes and the applet works fine if I use a C++ CGI instead of PHP. Does someone have an idea ? Thanks a lot ;-) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_shutdown_function vs require (with pseudocode example)
Hi, No one has any idea on this topic? Or the question wasn't clear? Thanks, Arpi Hi again, I read my email back and found a little hard to understand :)), so I thought a code exmplae might help. It's just pseudo code for explaining how my cache works: //simplified main code if page is in cache { deliver the old one register_shutdown_function(regenerate) } else { regenerate() deliver } //registered shutdown function function regenerate() { if it's locked by another process { return } else { lock require_once(...); require_once(...); require_once(...); require_once(...); require_once(...); creation of many classes calling of many methods (the code is approx 1,6Megs) store unlock } } The main code delivers the page and reigsters the regenerate() function, and that's all what it should do. It takes about 0.04s, but this time unfortunately depends on what the regenerate() function does. If the page is locked then it finishes quickly (the overall time is 0.04s again), but when it can be regenerated it takes 0.25s. By the way the whole page regeneration takes 1.1s, that's why I really don't understand the 0.25s. I hope it was clearer with the two mails :)), and someone has an idea of whats happening here. Thanks for your help, Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HT access
Yow I've a question, :-) I'm using ht access to protect a Directory with CGI in that I need use on my website. The htaccess uses the password file of my Linux to authenticate one. Now I want to keep the ht access but when I login via another login script a want my ht access to be filled in automatic so that I don't have to type my login and pwd again. Does anybody have an Idea Thanks
RE: [PHP] Don't Know how to Set the include Path
Do you need to use an include path? Why not just use the include() function? Also, what are the contents of constant.inc? Perhaps the problem lies there. -Original Message- From: Jack [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 2:03 AM To: [EMAIL PROTECTED] Subject: [PHP] Don't Know how to Set the include Path Dear all I had create a file called contant.inc. What i want to do is to use the require function() to point to this file, but when i test it, it says: Warning: Failed opening 'constant.inc' for inclusion (include_path='') in C:\InetPub\wwwroot\php study\General News\news.php on line 17 Then, i go to PHP.ini from C:\winnt and find the row which got the include_path=. What i did is i had type in the path like this format below : include_path = c:\inetpub\wwwroot\php study; UNIX: /path1:/path2 Windows: \path2 actually i just type the c:\inetpub\wwwroot\php study but not the ;UNIX: '/path1:/path2 Windows:: \path2, that is there by default. Then i test again from my web, it remains the same error!! So could someone pls tell me how i should set the include_path, would be great if you could provide EXAMPLES! Thx a lot Jack [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] doskey and Mysql with Win9x?
How come doskey doesnt seem to work under Mysql running in Win9x? Is there an alternative instead of endless repetitve typing and quickly disintegrating wrists? Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Timed Jobs.
Hi: I was wondering if it is posible to make in PHP a cron job, that will trigger an event (i.e. send an e-mail) long after the process of the data has taken place, like programming an e-mail to go out, on an specified date. My question is, since the script is run and triggered by the user, how can u trigger the later sending of the mail? Thanks.
Re: [PHP] Difference between two dates
Uma Shankari T. [EMAIL PROTECTED] wrote: If i gave the str date as 31-01-2001; and $str1=04-02-2001; then it is displaying the wrong result Plz tell me how can i rectify this problem... Uma, I wrote a function last year that calculates the time between 2 dates in whatever unit is preferred (everything from seconds to years). My function expects the date in a slightly different format, but it would be trivial to switch the order of the date parts in one line and hard-code something for the hours, minutes and seconds it expects in the date format. It wouldn't matter what you hardcode them as since it would use the same time of day for both dates. http://www.befriend.com/code_gallery/php/get_elapsed_time/ -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 20 Feb 2002 14:55:11 -0000 Issue 1183
php-general Digest 20 Feb 2002 14:55:11 - Issue 1183 Topics (messages 85485 through 85533): Re: Difference between two dates 85485 by: Rasmus Lerdorf 85487 by: Steven Walker 85502 by: Uma Shankari T. 85533 by: Steve Werby Re: Weather Scripts 85486 by: Shannon Doyle 85493 by: Gary 85494 by: Gary 85505 by: Rasmus Lerdorf Re: HTTP REFERER 85488 by: Bharath Bhushan lohray gzdoc 85489 by: Steven Walker Re: problem with mail()/html/outlook 85490 by: Bharath Bhushan lohray 85491 by: Jason Murray Re: really hopelessly stuck on this problem! 85492 by: hugh danaher search results - details 85495 by: mm fernandez 85496 by: Martin Towell test 85497 by: Jack What is the different between Apache and IIS? 85498 by: Jack 85499 by: NDPTAL85 85507 by: Nick Wilson 85511 by: Ben Turner 85512 by: Ben Turner Need to-do list for my web site 85500 by: Michael Zornek PHP Developers in Melbourne, Australia 85501 by: Jason Murray argh! 85503 by: Richard Baskett 85504 by: Weston Houghton 85508 by: CC Zona exec()/PGP: long file names, hanging. 85506 by: Analysis and Solutions Re: PHP 4.1.1, c-client-2001a and cyrus-imapd 85509 by: 2147483647 Don't Know how to Set the include Path 85510 by: Jack 85530 by: Rick Emery Re: Timing Sessions Out 85513 by: Phillip S. Baker How to Config PHP to run snmp in php script? 85514 by: Raymond Mak 85525 by: Hunter, Ray [ANN] session_pgsql 0.2 (alpha) released 85515 by: Yasuo Ohgaki mass mail 85516 by: Kancha . 85517 by: Norbert Eder 85520 by: Rambo Amadeus novice question -- array_push($real[$i][$j],$s[$j]); 85518 by: brendan conroy Re: Crashing a webserver 85519 by: Ruben Vermeersch xbithack causes parsing of html-files by PHP instead SSI 85521 by: Tobias Wiersch gmp installation win32 85522 by: Murray Chamberlain [EMAIL PROTECTED] 85523 by: wkelleher.aaservicesltd.com how the ticks works? 85524 by: bob Get an application/octet-stream from a java applet 85526 by: Nicolas Boutet Re: [PHP-DEV] Get an application/octet-stream from a java applet 85527 by: Andrey Hristov Re: register_shutdown_function vs require (with pseudocode example) 85528 by: Arpad Tamas HT access 85529 by: Sven Jacobs doskey and Mysql with Win9x? 85531 by: Simon De Deyne Timed Jobs. 85532 by: webmaster mbtradingco Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- This will give you the difference between the two dates in seconds: $diff = strtotime(str_replace('-','/',$str1)) - strtotime(str_replace('-','/',$str)); -Rasmus On Wed, 20 Feb 2002, Uma Shankari T. wrote: Hello, How can i find out the difference between two dates. I am having the date like this $str=10-01-2001; $str1=01-02-2002; I need to find out the difference between the date,month and year. If anyone know the solution for this problem plz tell me -Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- You can convert the time into seconds using mktime(), subtract one from the other, and then reformat it using gmstrftime: //int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst]) //string gmstrftime ( string format [, int timestamp]) ? $time1 = mktime (0,0,0,12,32,1997); $time2 = mktime (0,0,0,12,31,1995); $dif = $time1 - $time2; $new_time = gmstrftime(%b %d %Y, $dif); echo $time1br; echo $time2br; echo $difbr; echo $new_timebr; ? The output looks like this: 883641600 820396800 63244800 Jan 03 1972 Of course you will have to get the date out of the current format you have it, but that shouldn't be too hard using explode() and implode(); Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Tuesday, February 19, 2002, at 06:51 PM, Uma Shankari T. wrote: Hello, How can i find out the difference between two dates. I am having the date like this $str=10-01-2001; $str1=01-02-2002; I need to find out the difference between the date,month and year. If anyone know the solution for this problem plz tell me -Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- If i gave the str
RE: [PHP] Crashing a webserver
Pull the plug? :) -Original Message- From: Chris Lott [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 1:28 PM To: Ruben Vermeersch Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Crashing a webserver I have got the task to down our webserver, to see how stable she is, and how easy/hard it is to get it on it's knees ;) Does anyone have some ideas how to do it? There are various useful torture scripts floating around the web that you can use to create heavy, somewhat radom loads on a server, as well as to send large chunks of random data, etc... a few quick links that might help: http://stein.cshl.org/~lstein/torture/torture.html http://stein.cshl.org/~lstein/talks/perl_conference/cute_tricks/torture1.htm l http://www.hpl.hp.com/personal/David_Mosberger/httperf.html http://www.softwareqatest.com/qatweb1.html#LOAD c -- Chris Lott http://www.chrislott.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timed Jobs.
Argh! Please drop the purple bakground from your email. HTML email is bad enough since many of us use mail readers that can't read it, but black on purple is just plain hard to look at! webmaster mbtradingco [EMAIL PROTECTED] wrote: I was wondering if it is posible to make in PHP a cron job, that will trigger an event (i.e. send an e-mail) long after the process of the data has taken place, like programming an e-mail to go out, on an specified date. I recommend inserting the data into a database (perhaps MySQL) which includes the email data, recipients and date/time to send. Then setup a cron job which to run every X minutes which checks for pending emails, runs them after the date/time has been reached and either deletes the records when complete, moves them to a different table or changes a status flag so the next query won't process the same records. Personally, I'd install PHP as a CGI to do it, but if you can't or want to avoid that you could use wget or lynx to call the script over the web (of course you could always use perl or your favorite scripting language). If you do that, you should consider password protecting the script so others can't access it. Others accessing it may not be a security risk, but it could add load you don't want. Both lynx and wget allow you to pass a HTTP user/password. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help for passing variable to all pages
change: a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a to: a href=?php print \welcome.php3?dbcnxid=$dbcnx\; ?test link/a -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 5:30 PM To: PHP List Subject: [PHP] Help for passing variable to all pages Hi All, I am new to PHP and learning as I go by reading many of the tutorials around. I have however come up against a problem that I can't seem to solve of find any other references to. I need to make some information available to every page and one of the series of articles by Kevin Yank which talks about PHP and MySql seemed to suggest how to do exactly what I wanted but I can't get it to work. His suggestion was to do something like A HREF=newpage.php?name=?php echo($myvar); ? A link /A I think my problem is in the ...A LINK.. bit - what exactly should go here? I tried some code to see if it worked and this is what I did: in login.html html head titleDMS Login/title ?php $dbcnx=@mysql_connect(localhost,DMS,); echo ( P Connection established on $dbcnx/P); if (!$dbcnx) { echo( PUnable to connect to MySql Server at this time./P}; exit(); } if (! @mysql_connect_db(DMS, $dbcnx) ) { echo( PUnable to connect to DMS database at this time./P}; exit(); } ? a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a FORM ACTION=welcome.php3 METHOD=GET First name: INPUT TYPE=TEXT NAME=firstnameBR Last Name: INPUT TYPE=TEXT NAME=lastname INPUT TYPE=SUBMIT VALUE=GO /FORM br br In the welcome.php3 file I have HTML HEAD TITLEToday's Date/TITLE /HEAD BODY PToday's date (according to this server) ?php echo( date(l, F dS Y.) ); echo (Welcome to our web site $firstname $lastname $dbcnxid ); echo ( $dbcnxid); echo ( $QUERY_STRING); ? /BODY /HTML What I get is on login page - the texttest linkin blue (i.e. a link?) and the login prompts. On the welcome page I get the firstname and lastname ok, but the other parameter is not in the $QUERY_STRING Does anyone have any ideas as to what I am doing wrong? Maybe there is a better way to have some information, that will be retrieved from the DB available to all pages in the session. We are not actually going to have all the users with logins to the DB - but have our own internal table of users, password and rights information, thus the userid form this table needs to be available to all pages. Many Thanks in advance for your help Janet Cook Software Engineer IT CM CSDD NEC Australia Pty Ltd Ph +613 9264 3813 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mass mail
Kancha . [EMAIL PROTECTED] wrote: I've users in a database classified by differnet catagories. Now based on category I need to send mail to all the users in a category. Calling mail() function in a loop would be a kill for the server as there are more than 1000 users in each category. Is there any way of doing this ?? Creating a mailing list is not possible. You may want to use a PHP class that uses SMTP directly. There's one Manuel Lemos has written one which is available at http://phpclasses.upperdesign.com/. Another option is to write the emails and recipients to a database and use a cron job to query the db every X minutes and deliver the messages Y recipients at a time until complete. You'd just need to flag the messages and recipients after they've been processed or delete them. I discussed the solution in a reply to a poster with a slightly different problem just a few minutes ago under the subject Timed Jobs. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: novice question -- array_push($real[$i][$j],$s[$j]);????????
Array_push() takes an array as it's first parameter. In your case you have an array of arrays (NOT a 2 dimensional array) and to add an element on to the end of one of them you need to pass the name of the element of the top level array you want to add an element to into the function. I.e. if you have $fred[0] = array(1,2,3); $fred[1] = array(4,5,6); array_push($fred[1], 7) will leave $fred[0] = array(1,2,3); $fred[1] = array(4,5,6,7); or array_push($fred[0], 7) will leave $fred[0] = array(1,2,3,7); $fred[1] = array(4,5,6); Tim Ward www.chessish.com http://www.chessish.com -- From: brendan conroy [SMTP:[EMAIL PROTECTED]] Sent: 20 February 2002 12:27 To: [EMAIL PROTECTED] Subject: novice question -- array_push($real[$i][$j],$s[$j]); Hi, thanks for reading this, Iam trying to push elements into a two dimentional array, but I cant find the proper syntax, I'd be grateful if someone could email me the proper method. Iam using the normal method, which worked fine for a one dimentional array, but when I use it for a two dimentional array, it doesnt seem to recognise that is an array, even though I initialized the array with $real[0][0] = 0;. Thanks a million for your time, Bren _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Timing Sessions Out
Right you are, seconds. -Original Message- At 03:21 PM 2/19/2002 Tuesday, Johnson, Kirk wrote: See session.gc_maxlifetime in php.ini. Kirk I assume that the value given is in seconds. Correct?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help for passing variable to all pages
a href=welcome.php3?dbcnxid=?php echo($dbcnx); ?test link/a You can't pass resource types like database connection IDs in URLs as they are only relevant for the instance of the script in which they are created. The same goes for things like file identifiers (from fopen) and other stuff like that. Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XP + IIS + PHP - Error 405
Anyone know why someone would get a 405 Resource not allowed error while trying to input to a PHP script from a form, using Windows XP, IIS 5 and PHP 1.1.1 (CGI Ver.) _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Timed Jobs.
Suggestion: - When the user triggers the event, store their user name, email or whatever along with a timestamp in your site's database (if it has one) or in some text file some place. - Write a cron script that runs every five minutes, every minute, every hour, whatever. When this script runs, it reads the aforementioned database, text file, etc. and checks the timestamps and the user data. - If the data found by the above script (the timestamp and the user data) matches a certain criteria (i.e. the timestamp is 5 hours old, or whatever your delay is) and sends out the email appropriately, then deletes or otherwise updates that record, so it doesn't try again when it runs the next time. J Webmaster Mbtradingco wrote: Hi: I was wondering if it is posible to make in PHP a cron job, that will trigger an event (i.e. send an e-mail) long after the process of the data has taken place, like programming an e-mail to go out, on an specified date. My question is, since the script is run and triggered by the user, how can u trigger the later sending of the mail? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fdisk?
Anyone know what fdisk stands for? I've heard both fixed disk and format disk, I always thought the later Sorry for for the OT post. -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fdisk?
It depends on who you are talking too... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Brian V Bonini [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 9:12 AM To: PHP Lists Subject: [PHP] fdisk? Anyone know what fdisk stands for? I've heard both fixed disk and format disk, I always thought the later Sorry for for the OT post. -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fdisk?
I would say it stands for fixed disk - it really doesn't format anything anyway, it is for partitions. A paste from the man page: NAME fdisk - create or modify fixed disk partition table Jeff At 11:11 AM 2/20/2002 -0500, Brian V Bonini wrote: Anyone know what fdisk stands for? I've heard both fixed disk and format disk, I always thought the later Sorry for for the OT post. -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Retaining data across multiple sites
I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not pass the information on every link Any suggestions? -- Ben Sinclair -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not pass the information on every link Any suggestions? Need to store it server side somehow. Perhaps a global database? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
I could do that, but how would I keep track of the users? I don't think IP addresses are reliable. I would also prefer to limit my database access. -- Ben Sinclair - Original Message - From: Chris Boget [EMAIL PROTECTED] To: Ben Sinclair [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 10:37 AM Subject: Re: [PHP] Retaining data across multiple sites I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not pass the information on every link Any suggestions? Need to store it server side somehow. Perhaps a global database? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Retaining data across multiple sites
Write it to a database from one server, and then read it from another? webserver 1 -- db server -- webserver 2 HTH Jon -Original Message- From: Ben Sinclair [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 16:25 To: [EMAIL PROTECTED] Subject: [PHP] Retaining data across multiple sites I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not pass the information on every link Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
I could do that, but how would I keep track of the users? I don't think IP addresses are reliable. I would also prefer to limit my database access. Are you using sessions? If so, you can keep track of users that way. I believe this would be the only solution available to you. I am not sure that multiple domains can access server side variable space. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using a mysql data base and cookie to log a person in
Hello, I loosely understand how I can have a person login to a system by giving them a cookie with a certain amount of time with a encrypted code. And save that same encrypted code in the database for a certain amount of time. I am looking for a tutorial on how to do this so I can wrap my mind around it a little better. If anyone knows a good tutorial on how to log people into your site using a userser database please hook me upZ wiT da Inf0z Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com
RE: [PHP] Retaining data across multiple sites
They can... i've used the same code and the same database server for two domains with no prob's. The problem is cookies (as was mentioned previously) If domainx.com writes a cookie, then no other domain can (theoretically) access it. -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 11:43 AM To: Ben Sinclair; [EMAIL PROTECTED] Subject: Re: [PHP] Retaining data across multiple sites I could do that, but how would I keep track of the users? I don't think IP addresses are reliable. I would also prefer to limit my database access. Are you using sessions? If so, you can keep track of users that way. I believe this would be the only solution available to you. I am not sure that multiple domains can access server side variable space. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using a mysql data base and cookie to log a person in
Have you considered PHPLIB? http://phplib.sourceforge.net/ http://sourceforge.net/projects/phplib http://www.sanisoft.com/phplib/manual/ The docs'll give you an idea of how they did it. The code is pretty complex, though, but it does a lot. I'd suggest using this as a base, if PHP4's session handling isn't sufficient. I use it, with my own hacks for my authorization needs. -steve At 8:38 AM -0800 2/20/02, Brandon Orther wrote: Hello, I loosely understand how I can have a person login to a system by giving them a cookie with a certain amount of time with a encrypted code. And save that same encrypted code in the database for a certain amount of time. I am looking for a tutorial on how to do this so I can wrap my mind around it a little better. If anyone knows a good tutorial on how to log people into your site using a userser database please hook me upZ wiT da Inf0z Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- ++ | 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, visit: http://www.php.net/unsub.php
Re: [PHP] Weather Scripts
On Tuesday, February 19, 2002, at 08:13 PM, Shannon Doyle wrote: Hi People, I have been looking around the web lately and have noted a number of sites are running what appears to be php scripts that parse their local weather information and display it on their wesite. Well, I want to do the same, however I have been searching and found nothing that does what I want it to do. The only ones that I can find are either the output style of weather.com (ie all or nothing) or use their own graphics etc to display the data. All I want to be able to do is give the current conditions (ie partly cloudy) and the current temperature. I haven't decided if I then want to use this info to create an image or if I will display it as straight text. This is the beauty of XML... It's usually done using something called XML-RPC. There's a nice O'Reilly introduction to the topic, at xml.com, and I'm sure that after reading this you'll be better-prepared to search for scripts that do this for you. http://www.xml.com/pub/a/1999/08/rpc/ Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
Ben Sinclair wrote: I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not pass the information on every link Any suggestions? I've been thinking about this recently and here's what I came up with: Have a domain or subdomain dedicated souly to user sessions, for example: session.yourdomain.com Whenever a user visits a page on ANY of your domains (currentdomain.com in this example), check if they have a cookie set. If they don't: 1. Create a session for that user with a unique session ID 2. Send them a page which includes a single pixel gif image looking like this: img src=http://session.yourdomain.com/pixel.php?s=zs9s0a8fs6fudisdfsf8dfdfsfsdomain=currentdomain.com; width=1 height=1 ( Remember - session.yourdomain.com has access to ALL cookies set for session.yourdomain.com ) 3. session.yourdomain.com CHECKS to see if this user has a cookie set. If they DO then they are already known to session.yourdomain.com - session.yourdomain.com records the fact that this user is logged on to currentdomain.com as zs9s0a8fs6fudisdfsf8dfdfsfs in a shared database. 4. If session.yourdomain.com does NOT find a cookie then it means this is a new user who is not known to the system yet. session.yourdomain.com creates a cookie recording the user, and notes that the user is also logged in to currentdomain.com with whatever session ID was set over there. This is all pretty complicated but the end result is that the session.yourdomain.com domain knows about every user, and a shared database (accessible by all of your domains) maintains a record of each unique user (as according to the session.yourdomain.com cookie) and what their session is for each of the different domains. Final note: http://session.yourdomain.com/pixel.php needs to actually send a pixel to the client browser - this can be done with the following code in the zend code library: http://www.zend.com/codex.php?id=193single=1 Cheers, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
On Wed, 20 Feb 2002, Ben Sinclair wrote: I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not One way I handle this ... it's a work-around, so it's not all that pretty: In the doc root on all the domains, I keep a script which just prints out the cookie names values for any cookies accessible by the domain ... as JavaScript variables. Then that script can be used as the src in a script on any of your other domains. BINGO ... you've got cookies! Want milk? On domain_A, have this script (let's call it A_cookies.php): while( list( $key, $val ) = each( $HTTP_COOKIE_VARS ) ){ print( var $key = \$val\;\n ); } On domain_B, in an HTML document, use some JavaScript: script src=http://domain_A/A_cookies.php;/script The pitfalls: - not useful with users whom have JavaScript or cookies disabled - now you have to do all cookie data handling on the client side - this is a third-party activity[1] which more secure-minded people and browsers will disallow. (IE6, as a P3P-enabled user agent, is a prime example.) I only do this for data which makes the user experience better between two sites. It's one of those bells and whistles kind of deals. When it doesn't work as desired, the sites still function properly. If I were to try this to track data on a particular user between sites, I'd store only a session ID in a cookie (a la PHP sessions), use the above method to get the session ID data into a javascript variable and source it across sites, then use custom session handlers to put session data into a single database, with the data associated to the session ID. The same pitfalls apply ... so you'd lose track of some visitors when they switch sites. I don't consider this a big deal, because this is just how the Internet is evolving. g.luck ~Chris [1] Having a file from domain_B referenced from within a document on domain_A renders the file from domain_B a third-party document. There are inititives to control third-party cookie reading/writing, like banner ads, and they affect this method of cookie reading too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
These are all workable solutions, but I also have to worry about https sites. If I link to hidden images on non-secure servers, the browser will display a warning. I'm also trying to avoid buying multiple certificates when all I want to do is brand a site. -- Ben Sinclair - Original Message - From: Christopher William Wesley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Ben Sinclair [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 11:27 AM Subject: Re: [PHP] Retaining data across multiple sites On Wed, 20 Feb 2002, Ben Sinclair wrote: I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not One way I handle this ... it's a work-around, so it's not all that pretty: In the doc root on all the domains, I keep a script which just prints out the cookie names values for any cookies accessible by the domain ... as -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text files instead of mySQL
Hi Is it possible to convert a PHP script that writes and pulls data from a mySQL database to use text files / database instead. Thanks in advance Mohamed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get an application/octet-stream from a java applet
Grab a recent PHP release and in your php.ini file add: always_populate_raw_post_data = On -Rasmus On Wed, 20 Feb 2002, Nicolas Boutet wrote: Hi all, I'm trying to make a script to get application/octet-stream datas from a java applet. The method used by the applet is POST and I tried to use $HTTP_RAW_POST_DATA like this ? if (isset($HTTP_RAW_POST_DATA)) { $contentlength = strlen($HTTP_RAW_POST_DATA); $buffer = $HTTP_RAW_POST_DATA; } ...? but $HTTP_RAW_POST_DATA is not set and $buffer stills empty. The size of the data sent by the applet is 860bytes and the applet works fine if I use a C++ CGI instead of PHP. Does someone have an idea ? Thanks a lot ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text files instead of mySQL
M.E. Suliman wrote Is it possible to convert a PHP script that writes and pulls data from a mySQL database to use text files / database instead. Yes it is but you could have a job on your hands depending on the complexity of the script. Personally I favour PHP's serialization capabilities for flat file work - you can take pretty much any object or array (or an array of objects, you can nest them as much as you like) and use serialize() to turn it into a string. You can then save the string in a text file, and later on re-read it and unserialize it to get your original data structure back. However, if the script you are investigating makes heavy use of SQL join syntax you could have a very nasty job on your hands coming up with data structures that can be queried in the same way without performance becoming an issue. Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
Hey Ben: Ben Sinclair wrote: These are all workable solutions Not really. JavaScrap and cookies are not a solution. They're a quick answer which doesn't work 100% of the time. *IF* you're going to use sessions, use a URL based session ID, which will work in 100% of browsers. Not all browsers have cookies and/or JavaScrap eneabled, let alone have the capacity in the first place. If I link to hidden images on non-secure servers, the browser will display a warning. I'm also trying to avoid buying multiple certificates when all I want to do is brand a site. What EXACTLY do you want to track? User movement patterns? Hit counts? Ad clickthroughs? Ad impressions? The proper solution to the problem depends on what the goal is. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Chatroom sounds
Hello This my first post and I hope I can understand any replies :-) I download a chatroom from webscriptsworld.com very nice it is as well. What I would achieve is to make a sound when someone enters and when someone leaves. I'd also like to to replace some words with sounds. I was hoping there might be some code I can add to achieve this? Sorry in advance for any lack of tech speak Mick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Don't Know how to Set the include Path
Dear Jack, I had create a file called contant.inc. What i want to do is to use the require function() to point to this file, but when i test it, it says: Warning: Failed opening 'constant.inc' for inclusion (include_path='') in C:\InetPub\wwwroot\php study\General News\news.php on line 17 Then, i go to PHP.ini from C:\winnt and find the row which got the include_path=. What i did is i had type in the path like this format below : include_path = c:\inetpub\wwwroot\php study; UNIX: /path1:/path2 Windows: \path2 actually i just type the c:\inetpub\wwwroot\php study but not the ;UNIX: '/path1:/path2 Windows:: \path2, that is there by default. Then i test again from my web, it remains the same error!! So could someone pls tell me how i should set the include_path, would be great if you could provide EXAMPLES! Spelling difference: contant.inc and constant.inc? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining data across multiple sites
On Wed, 20 Feb 2002, Ben Sinclair wrote: These are all workable solutions, but I also have to worry about https sites. I called it a work-around rather than a solution on purpose :) The only real solution is to collapse the different sites into one domain. If I link to hidden images on non-secure servers, the browser will display a warning. I'm also trying to avoid buying multiple certificates when all I want to do is brand a site. There's another pitfall. More users want better privacy and security ... they'll get it, some day. Like I said before, this is just how the Internet is evolving. As you're doing, the functionality being provided has to be judged against the practicality of its implementation. g.luck, ~Chris - Original Message - From: Christopher William Wesley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Ben Sinclair [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 11:27 AM Subject: Re: [PHP] Retaining data across multiple sites On Wed, 20 Feb 2002, Ben Sinclair wrote: I want to retain some data across my sites, which have different domain names. I can't use cookies because they rely on the domain name, and I'd rather not One way I handle this ... it's a work-around, so it's not all that pretty: In the doc root on all the domains, I keep a script which just prints out the cookie names values for any cookies accessible by the domain ... as -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading the value in a cookie
Hello, I know how to set a cookie. How do I read the value of that cookie the next time that person returns to my website? Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com
Re: [PHP] Reading the value in a cookie
http://www.php.net/manual/en/function.setcookie.php Also, read up on any other cookie related functions linked from that page. On Wednesday 20 February 2002 10:04 am, you wrote: Hello, I know how to set a cookie. How do I read the value of that cookie the next time that person returns to my website? Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] textarea form input converting lt; and gt; to
Hello, I have a few forms that are used to input html. We have run into a problem of lt; and gt; getting turned into and when you hit submit, Or if you hit submit more than once. I have attached a sample form. The major problem here is that some times we want lt; and some times we want to input html tags. Has any one else run into this problem maybe even found a solution. Any help would be appreciated. Thanks Byron html head titletest form/title /head body form method=post TEXTAREA NAME=test rows=10 cols=50? echo $test; ?/textarea br INPUT TYPE=submit NAME=submitaction VALUE=Submit /form br what you typed br ? echo $test; ? /body /html -- Byron Albert[EMAIL PROTECTED] System Engineer Internet.com a Division of INT Media Group 203-662-2848 Engineering does not require science. Science helps a lot but people built perfectly good brick walls long before they knew why cement works. -Alan Cox -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading the value in a cookie
Brandon, There are a few things about cookies that are not completely. I may be wrong about this, but this is what I've found: When a cookie is set, it must be passed before any other headers or tags. But the cookie is not actually available to the page it was set on. If the user reloads the page, or goes to another link, the cookie can then be read. When you put setcookie() in a PHP file, the cookie will be created every time the page is loaded. This will overwrite any previous cookie info stored. To overcome this, you can use conditional statements that test for the cookie. Just be sure that any code before setcookie does not create output (ie echo). Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Wednesday, February 20, 2002, at 10:04 AM, Brandon Orther wrote: Hello, I know how to set a cookie. How do I read the value of that cookie the next time that person returns to my website? Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chatroom sounds
Mick Fitzpatrick [EMAIL PROTECTED] wrote: This my first post and I hope I can understand any replies :-) I download a chatroom from webscriptsworld.com very nice it is as well. What I would achieve is to make a sound when someone enters and when someone leaves. I'd also like to to replace some words with sounds. I was hoping there might be some code I can add to achieve this? Sorry in advance for any lack of tech speak Well, tech speak isn't the problem. It sounds like you need a solution that uses JavaScript or Flash, not PHP. You'll probably get better help if you post a URL to the specific chatroom script you're talking about and post to a list that deals with JavaScript or Flash. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getenv $REMOTE_ADDR
Does anybody know why the predefined variable $REMOTE_ADDR would be null, while getenv(REMOTE_ADDR) works fine? Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying special characters on the web
After much trial and error, I've learned what it takes to display special characters (such as em or en dashes and curly quotes etc.) reliably on practically any browser. My recommended steps are: - Save the content in your database and XML files as UTF-8 - Don't announce your charset as UTF-8 in either the HTTP headers or a META tag. This will break your pages badly in Netscape Navigator 4 and Internet Explorer 5.0. - Convert the Unicode characters that HTML knows about to numeric character references. Here's how you do just that in PHP. This example is copied verbatim from http://homepage.mac.com/marko/ (wink wink, nudge nudge), and requires PHP to be compiled with --enable-mbstring: $f = 0x; $convmap = array( /* !ENTITY % HTMLlat1 PUBLIC -//W3C//ENTITIES Latin 1//EN//HTML %HTMLlat1; */ 160, 255, 0, $f, /* !ENTITY % HTMLsymbol PUBLIC -//W3C//ENTITIES Symbols//EN//HTML %HTMLsymbol; */ 402, 402, 0, $f, 913, 929, 0, $f, 931, 937, 0, $f, 945, 969, 0, $f, 977, 978, 0, $f, 982, 982, 0, $f, 8226, 8226, 0, $f, 8230, 8230, 0, $f, 8242, 8243, 0, $f, 8254, 8254, 0, $f, 8260, 8260, 0, $f, 8465, 8465, 0, $f, 8472, 8472, 0, $f, 8476, 8476, 0, $f, 8482, 8482, 0, $f, 8501, 8501, 0, $f, 8592, 8596, 0, $f, 8629, 8629, 0, $f, 8656, 8660, 0, $f, 8704, 8704, 0, $f, 8706, 8707, 0, $f, 8709, 8709, 0, $f, 8711, 8713, 0, $f, 8715, 8715, 0, $f, 8719, 8719, 0, $f, 8721, 8722, 0, $f, 8727, 8727, 0, $f, 8730, 8730, 0, $f, 8733, 8734, 0, $f, 8736, 8736, 0, $f, 8743, 8747, 0, $f, 8756, 8756, 0, $f, 8764, 8764, 0, $f, 8773, 8773, 0, $f, 8776, 8776, 0, $f, 8800, 8801, 0, $f, 8804, 8805, 0, $f, 8834, 8836, 0, $f, 8838, 8839, 0, $f, 8853, 8853, 0, $f, 8855, 8855, 0, $f, 8869, 8869, 0, $f, 8901, 8901, 0, $f, 8968, 8971, 0, $f, 9001, 9002, 0, $f, 9674, 9674, 0, $f, 9824, 9824, 0, $f, 9827, 9827, 0, $f, 9829, 9830, 0, $f, /* !ENTITY % HTMLspecial PUBLIC -//W3C//ENTITIES Special//EN//HTML; %HTMLspecial; */ /* These ones are excluded to enable HTML: 34, 38, 60, 62 */ 338, 339, 0, $f, 352, 353, 0, $f, 376, 376, 0, $f, 710, 710, 0, $f, 732, 732, 0, $f, 8194, 8195, 0, $f, 8201, 8201, 0, $f, 8204, 8207, 0, $f, 8211, 8212, 0, $f, 8216, 8218, 0, $f, 8218, 8218, 0, $f, 8220, 8222, 0, $f, 8224, 8225, 0, $f, 8240, 8240, 0, $f, 8249, 8250, 0, $f, 8364, 8364, 0, $f); echo mb_encode_numericentity($html, $convmap, UTF-8); ...I just thought I'd share! --Marko -- Difficult to see, it is... always in motion is the future. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] about socket_set_timeout
I have windows 98 sr 2 and php 4.1.1 installed. When i call the function socket_set_timeout, i got a socket_set_timeout supported in this php build. What am i supposed to do ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] zend encoder
hey, Any ideas on how one can encode multiple files on a windows machine?? Regards, Kunal Jhunjhunwala Minds think with ideas, not information. No amount of data, bandwidth, or processing power can substitute for inspired thought. - Clifford Stoll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_replace(/^\//.. doesnt work?
Im having a weird regexp problem in PHP that I think is correct but it doesnt appear to work. The code is this: $a = /test/; preg_replace(/^\//, , $a); echo $a; I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? Im using: PHP Version 4.1.1 Configure Command: './configure' '--with-mysql=/usr/local/mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-db2--disable-debug' '--disable-static' '--enable-sockets' '--with-yp' '--with-zlib' Regex Library: Bundled library enabled PCRE (Perl Compatible Regular Expressions) Support: enabled PCRE Library Version: 3.4 22-Aug-2000 Please CC me since Im not a member of this maillinglist. -- * John Ericson [EMAIL PROTECTED] * ICQ: 7325429 JID: [EMAIL PROTECTED] * web: http://john.pp.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: preg_replace(/^\//.. doesnt work?
$a = /test/; $a = preg_replace(/^\//, , $a); echo $a; Notice the difference in the second line... On Wed, 20 Feb 2002, John Ericson wrote: Im having a weird regexp problem in PHP that I think is correct but it doesnt appear to work. The code is this: $a = /test/; preg_replace(/^\//, , $a); echo $a; I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? Im using: PHP Version 4.1.1 Configure Command: './configure' '--with-mysql=/usr/local/mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-db2--disable-debug' '--disable-static' '--enable-sockets' '--with-yp' '--with-zlib' Regex Library: Bundled library enabled PCRE (Perl Compatible Regular Expressions) Support: enabled PCRE Library Version: 3.4 22-Aug-2000 Please CC me since Im not a member of this maillinglist. -- * John Ericson [EMAIL PROTECTED] * ICQ: 7325429 JID: [EMAIL PROTECTED] * web: http://john.pp.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace(/^\//.. doesnt work?
try: $a = preg_replace(/^\//, , $a); On Wednesday 20 February 2002 12:25 pm, you wrote: Im having a weird regexp problem in PHP that I think is correct but it doesnt appear to work. The code is this: $a = /test/; preg_replace(/^\//, , $a); echo $a; I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? Im using: PHP Version 4.1.1 Configure Command: './configure' '--with-mysql=/usr/local/mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-db2--disable-debug' '--disable-static' '--enable-sockets' '--with-yp' '--with-zlib' Regex Library: Bundled library enabled PCRE (Perl Compatible Regular Expressions) Support: enabled PCRE Library Version: 3.4 22-Aug-2000 Please CC me since Im not a member of this maillinglist. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to pass variable and an internal link
Hi I've encountered a little (I hope) problem I can put an anchor on a page to create an internal link writing a name=my_anchor and then reach it with a normal link writing echo a href=\page.php#my_anchor\go to my_anchor/a; but to me is necessary to add a variabale to this link usually I write somthing like this: echo a href=\page.php?variable= . $my_variable . \go to/a; how can I pass either the internal anchor and the variable in the url? I tried in many ways echo a href=\page.php#my_anchor?variable= . $my_variable . \go to/a; echo a href=\page.php?variable= . $my_variable . #my_anchor\go to/a; but nothing to do; can someone help me? Many thank in advance Sergio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: preg_replace(/^\//.. doesnt work?
thanks! On Feb 20 11:55, Philip Hallstrom wrote: $a = /test/; $a = preg_replace(/^\//, , $a); echo $a; Notice the difference in the second line... On Wed, 20 Feb 2002, John Ericson wrote: Im having a weird regexp problem in PHP that I think is correct but it doesnt appear to work. The code is this: $a = /test/; preg_replace(/^\//, , $a); echo $a; I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? Im using: PHP Version 4.1.1 Configure Command: './configure' '--with-mysql=/usr/local/mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-db2--disable-debug' '--disable-static' '--enable-sockets' '--with-yp' '--with-zlib' Regex Library: Bundled library enabled PCRE (Perl Compatible Regular Expressions) Support: enabled PCRE Library Version: 3.4 22-Aug-2000 Please CC me since Im not a member of this maillinglist. -- * John Ericson [EMAIL PROTECTED] * ICQ: 7325429 JID: [EMAIL PROTECTED] * web: http://john.pp.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- * John Ericson [EMAIL PROTECTED] * ICQ: 7325429 JID: [EMAIL PROTECTED] * web: http://john.pp.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: preg_replace(/^\//.. doesnt work?
Also note: ^ matches the beginning of the string, so ^\/ will only match a / at the beginning of the string (not the first occurence of /) -Original Message- From: Philip Hallstrom [mailto:[EMAIL PROTECTED]] Subject: [PHP] Re: preg_replace(/^\//.. doesnt work? $a = /test/; $a = preg_replace(/^\//, , $a); echo $a; On Wed, 20 Feb 2002, John Ericson wrote: I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: preg_replace(/^\//.. doesnt work?
Err, that's what he wanted On Wednesday 20 February 2002 12:13 pm, you wrote: Also note: ^ matches the beginning of the string, so ^\/ will only match a / at the beginning of the string (not the first occurence of /) -Original Message- From: Philip Hallstrom [mailto:[EMAIL PROTECTED]] Subject: [PHP] Re: preg_replace(/^\//.. doesnt work? $a = /test/; $a = preg_replace(/^\//, , $a); echo $a; On Wed, 20 Feb 2002, John Ericson wrote: I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] preg_replace(/^\//.. doesnt work?
Good day, The first argument should just be a normal regular expression, not a replacement regular expression. I'm not at my server right now, but I would guess that it'll work once you get rid of the last / in the first expression. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: John Ericson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:25 PM To: [EMAIL PROTECTED] Subject: [PHP] preg_replace(/^\//.. doesnt work? Im having a weird regexp problem in PHP that I think is correct but it doesnt appear to work. The code is this: $a = /test/; preg_replace(/^\//, , $a); echo $a; I want preg_replace to replace the first '/' in $a with '' so that the echo function echoes test/, but instead it echoes /test/ as if preg_replace didnt worked? What am I doing wrong? Im using: PHP Version 4.1.1 Configure Command: './configure' '--with-mysql=/usr/local/mysql' '--with-apxs=/usr/local/apache/bin/apxs' '--with-db2--disable-debug' '--disable-static' '--enable-sockets' '--with-yp' '--with-zlib' Regex Library: Bundled library enabled PCRE (Perl Compatible Regular Expressions) Support: enabled PCRE Library Version: 3.4 22-Aug-2000 Please CC me since Im not a member of this maillinglist. -- * John Ericson [EMAIL PROTECTED] * ICQ: 7325429 JID: [EMAIL PROTECTED] * web: http://john.pp.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to pass variable and an internal link
Hey Sergio: Jena wrote: how can I pass either the internal anchor and the variable in the url? I tried in many ways echo a href=\page.php#my_anchor?variable= . $my_variable . \go to/a; echo a href=\page.php?variable= . $my_variable . #my_anchor\go to/a; This URL works for me: http://66.39.64.134/teams.htm?LeagueID=ncaab#d27 So, your second attempt should work. Personally, I'd rewrite your line as this: echo a href=\page.php?variable=$my_variable#my_anchor\go to/a\n; If this doesn't working for you, there's something wrong with the HTML in page.php or with your browser. Most likely, you haven't set the name/id anchor correctly. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getenv $REMOTE_ADDR
Hi Steven: Steven Walker wrote: Does anybody know why the predefined variable $REMOTE_ADDR would be null, while getenv(REMOTE_ADDR) works fine? Put register_globals on via your php.ini or .htaccess file. In php.ini, change register_globals = Off to register_globals = On Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: preg_replace(/^\//.. doesnt work?
that's probably what he meant... but what he asked for was how to replace the first '/' in $a if you have $a=abc/def, the regex ^/ will not replace the first / in your string, which was my point :-) -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Subject: Re: [PHP] Re: preg_replace(/^\//.. doesnt work? Err, that's what he wanted On Wednesday 20 February 2002 12:13 pm, you wrote: Also note: ^ matches the beginning of the string, so ^\/ will only match a / at the beginning of the string (not the first occurence of /) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getenv $REMOTE_ADDR
On Wed, 2002-02-20 at 12:26, Analysis and Solutions wrote: Hi Steven: Steven Walker wrote: Does anybody know why the predefined variable $REMOTE_ADDR would be null, while getenv(REMOTE_ADDR) works fine? Put register_globals on via your php.ini or .htaccess file. In php.ini, change register_globals = Off to register_globals = On Enjoy, --Dan Better: avoid globals and use $_SERVER['REMOTE_ADDR']. -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea form input converting lt; and gt; to
Hi Byron: Byron Albert wrote: The major problem here is that some times we want lt; and some times we want to input html tags. The solution depends on what you're trying to do. What's your goal. Are you using the text area to store full web pages, or examples of how to write HTML, or See you, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unicode TTF Font wingding's just don't cut it!
Does anyone know where I can get a simple symbol font which is .ttf and unicode compatible. Seems that my php graphic program is very sensitive to ttf problems. It'll take one or two wingdings in imagettftext() before it up and dies. Your help will be greatly appreciated. Dies? How so? Is it a segfault? If so, please get me a backtrace. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getenv $REMOTE_ADDR
What is the difference between $_SERVER and getenv()? Why should one be more reliable/better than the other? Better: avoid globals and use $_SERVER['REMOTE_ADDR']. Sorry, if I'm asking you to repeat yourself... the documentation doesn't relate the two. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question
In php for windows, you can use the printer_open() function found in the php_printer.dll. Unfortuantly, I run a Red hat/Apache web server and this won't work. Do you know of any method/package out there that I could install on my linux machine that will all me to print data to a printer? Thanks for the help. Matthew Berwald __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF Fonts Files
You need to sit through my PDF/PHP talk where I go through all this. See conf.php.net/paris2 specifically slides 7 and 8 In particular see the example: http://conf.php.net/pres/slides/intro/pdf_font_ex2.php the code for which is on slide #8. This example shows how to use each of the built-in fonts, a couple of AFM (Adobe Font Metric) fonts and also a couple of TTF fonts all on the same PDF page. -Rasmus On Mon, 18 Feb 2002, Richard Lynch wrote: Please Cc: me on replies... I recently installed PHP 4.1.0 + PDF 4.0.1 on my development box. I can't seem to get the PDF fonts to work properly at all... Here are a lot of details about things I understand, and a lot of remarks about what I half-understand. Note that, as a rule, font technology seems to be such a morass that I don't really understand it as a whole, even after reading all the HowTos and explanations. There are just too many players, and too many variables involved for my poor little brain... I grok all the little pieces and even some of the big-picture stuff okay, but when it comes time to actually use them all, I feel like I need eight brains to track it all... At any rate, I'm afraid this post goes on quit a bit to explain all the things I've tried, and it would be a lot shorter if I was smarter, but I'm not. :-v To paraphrase Blaise Pascal: I'm sorry this post is so long, I didn't have the brains to make it short. :-) Okay, enough apologies: I'm using pdf_set_parameter($pdf, resourcefile, /home/www/pdffonts/pdflib.upr); and I can muck with that pdflib.upr file and screw it up to cause different error messages, so I'm reasonably certain it's getting read. :-) However, my choices for http://php.net/pdf_findfont seem to be using host fonts, not checked (0) -- so they get rendered by the client at the time of drawing (more on *that* later), or using winansi and checked (1) or host and checked (1) in which case I get my choice of error messages like: Can't find Outline Font data for Helvetica Can't find Font Metrics for Helvetica Those are paraphrases, but I could get the precise messages if you really need 'em... And I can't remember which message goes with which combination of host/winansi, checked/unchecked, but does it really matter? It can't find the damn Helvetica.afm file, as near as I can figure. And I've tried some of the other 14 built-in fonts, even ones that would be unacceptable in the end, just to see. No joy in Mudville. Oh, and using builtin instead of host or winansi didn't work. Not sure I even understand the difference between builtin and host anyway... I forget exactly which of the not-working states it generated, but it was the same as one of the ones described herein, so let's just skip that for now, okay? I get these differences based on my inputs to http://pdf_findfont and by altering the pdflib.upr file as noted in the comments within that. I've tried so *many* things, none of which work, so I can't be sure, but I don't think the path entry in pdflib.upr has any effect whatsoever... Actually, I think I can break it badly enough to get a different error message about an invalid pdflib.pdr file (something about not finding the FontAFM section, which comes right after the path entry), but any parse-able pathname at all seems to be just as good, or should I say just as bad, as the actual path to my fonts directory. Currently, it's set at: //home/www/pdffonts which is, indeed a valid directory with all my fonts and the pdflib.upr file in it, which, as noted above, seems to be getting read in. NOTE: The docs in pdflib.upr say that the extra leading / for path entry is required by PDF, and that there should be no trailing / Honest. If you're on a Mac, you'd be using : instead of / for all but the first /. So, of course, I already tried it without either or both extra front and trailing / and it doesn't work. Doesn't make it any worse, but it didn't help either. :-) Point is, I'm pretty sure that that entry is correct syntactically. I've also tried everything up to, and including, chmod 777 on the font files and their enclosing directory. Naturally, after that failed, I set them back to something sensible like 664 and owned by www:www, the PHP User in httpd.conf who should be the user attempting to read these files, right? Or does PDFlib actually do chroot or whatever that's called?... This is behind a firewall, not a real web-server, so I could live with making these files even root executable and world writable it if would just make the darn thing work. No, it didn't help to make them root-owned and chmod 777. Yes, I was desperate enough to try. Yes, I put them back to something sensible. I've even tried swapping in the font files from a PHP-4.2.0-dev + PDF 3.x server where it works just fine (http://uncommonground.com/events.pdf) for my font files, since there are minor differences -- CR/LF line
RE: [PHP] question
A work around is using the one of the system commands and print that way. Check here for the program execution functions: http://www.php.net/manual/en/ref.exec.php Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Matthew Berwald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:48 PM To: [EMAIL PROTECTED] Subject: [PHP] question In php for windows, you can use the printer_open() function found in the php_printer.dll. Unfortuantly, I run a Red hat/Apache web server and this won't work. Do you know of any method/package out there that I could install on my linux machine that will all me to print data to a printer? Thanks for the help. Matthew Berwald __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: question
Matthew Berwald [EMAIL PROTECTED] wrote: Do you know of any method/package out there that I could install on my linux machine that will all me to print data to a printer? Thanks for the help. $lp = popen(lpr, w); fwrite($lp, stuff to print); pclose($lp); this uses the unix-standard 'lpr' utility. jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class question
I'm still kind of new when it comes to dealing with classes. I'm curious, is it accepted practice for member functions of your class to: * access global variables * use non member, user defined functions Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: textarea form input converting lt; and gt; to
Byron Albert [EMAIL PROTECTED] wrote: I have a few forms that are used to input html. We have run into a problem of lt; and gt; getting turned into and when you hit submit, Or if you hit submit more than once. I have attached a sample form. The major problem here is that some times we want lt; and some times we want to input html tags. Has any one else run into this problem maybe even found a solution. when you re-display user input in a textarea (or as the value attribute of a text input field), you should use the htmlentities() function. so, from your code: TEXTAREA NAME=test rows=10 cols=50? echo $test; ?/textarea should be: TEXTAREA NAME=test rows=10 cols=50? echo htmlentities($test); ?/textarea (you could also probably use CDATA sections and avoid calling htmlentities(). i haven't tried it, and am skeptical that the various browsers all get that right. i've never had a problem using htmlentities() in this manner.) jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Class question
The whole idea with object-oriented programming is polymorphism and encapsulation. You do not want your classes to access global variables but access that information through objects and messaging between objects. If you are referring to the use of non-member as being outside of the class, then again you want to use objects. As for practice, it is up to you. For me, no... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:58 PM To: PHP General Subject: [PHP] Class question I'm still kind of new when it comes to dealing with classes. I'm curious, is it accepted practice for member functions of your class to: * access global variables * use non member, user defined functions Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getenv $REMOTE_ADDR
On Wed, 2002-02-20 at 12:42, Steven Walker wrote: What is the difference between $_SERVER and getenv()? Why should one be more reliable/better than the other? Better: avoid globals and use $_SERVER['REMOTE_ADDR']. Sorry, if I'm asking you to repeat yourself... the documentation doesn't relate the two. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] Sorry, I meant that $_SERVER is better than using register_globals=on, not that it's better than getenv(). Anyway, getenv() just gets a variable value from the environment, and $_SERVER contains a hash of server variables. -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class question
Well, I guess many things are accepted now, but here's my two cents: I wouldn't access global variables, instead you should pass everything you need as parameters. Using global variables can come back to bite you occasionally because you may think you are changing a local variable at one point, but you actually change a global variable, and then who knows what will happen when you try to access the global variable later in your code expecting an int, for example, and it is suddenly a string... As for using other user defined functions from elsewhere in your code, I think it depends on the context... But think about what if you want to use this class elsewhere, then you will always need to copy over whatever file contains your other functions. In that case it would obviously make more sense to contain whatever functions are needed inside of the class. Hope that gives you some ideas. Jeff At 02:58 PM 2/20/2002 -0600, Chris Boget wrote: I'm still kind of new when it comes to dealing with classes. I'm curious, is it accepted practice for member functions of your class to: * access global variables * use non member, user defined functions Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] question
I'm not sure from your question whether or you understand that the PHP printer functions only work with printers connected directly to the server. They're not for client side printing. And there are no equivalent functions for non-Windows platforms. However I do recall coming across a Javascript that could open the printer dialog box in the browser automatically. A quick search on Usenet should turn up something. I'm afraid this about as automated as you're going to get. -Kevin -Original Message- From: Matthew Berwald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:48 PM To: [EMAIL PROTECTED] Subject: [PHP] question In php for windows, you can use the printer_open() function found in the php_printer.dll. Unfortuantly, I run a Red hat/Apache web server and this won't work. Do you know of any method/package out there that I could install on my linux machine that will all me to print data to a printer? Thanks for the help. Matthew Berwald __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What Do You Think?
Richard Crawford [EMAIL PROTECTED] wrote in message 1013802064.4935.5.camel@mossroot">news:1013802064.4935.5.camel@mossroot... I'd be much more interested in microbreweries, though. Most commercial breweries like Anheuser Busch and Coors don't brew beer. Send some of their product to a lab, and the results will say something like, Your horse has diabetes. Hmm. I'd also be interested in a Guinness Finder site. Plug in your zip code, and you get a list of all of the pubs and bars in your area that serve draft Guinness. I could support a site like that, or help build one. As it happens, I'm building a site that (among other things) will be a directory of breweries, micorbreweries, brewpubs, etc.-- all in a PHP app framework I'm developing. The site is still highly in beta though, with several design possibilities and data being entered. If anyone's interested, though, I could send a link. -- Jon Abernathy - [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array session variable problem (register_global=off)
Hi All, I have register_global = off and I have problem retrieving array session variable. For example; Page1.php ?php $name = array(); session_register (name); $name[first] = First Name; $name[last] = Last Name; ? Page2.php ? session_start(); echo $_SESSION[name['first']]; echo $_SESSION[name][first]; ? None of these works. The session file does registered the array and variables. I can retrieve the array with the register_global on. Any ideas? Thanks, Harry __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] array session variable problem (register_global=off)
The code in the first file is correct if register_globals is on. Since it is off, remove the call to session_register() and just assign values directly to $_SESSION, e.g., $_SESSION[name['first']] = 'First Name'; Kirk -Original Message- From: Harry Yu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 2:12 PM To: [EMAIL PROTECTED] Subject: [PHP] array session variable problem (register_global=off) Hi All, I have register_global = off and I have problem retrieving array session variable. For example; Page1.php ?php $name = array(); session_register (name); $name[first] = First Name; $name[last] = Last Name; ? Page2.php ? session_start(); echo $_SESSION[name['first']]; echo $_SESSION[name][first]; ? None of these works. The session file does registered the array and variables. I can retrieve the array with the register_global on. Any ideas? Thanks, Harry __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form submission error trapping
Okay... I messed around with things a bit and moved the php stuff to the top as you suggested. I have part of the validation working however if more than 1 error exists, it still only prints the 1st one. Below are 2 example places where there would be an error... if I leave them both blank, they should both give an error message. $error=array(); if (strlen($username) 3) { $error['username']=Username must be more than 3 characters; } elseif (strlen($password) 3) { $error['password']=Password must be more than 3 characters; } input type=text name=username value=?=$username;? ? if ($error['username']) echo br.$error['username'];? input type=text name=password value=?=$password;? ? if ($error['password']) echo br.$error['password'];? Am I assigning errors to the array incorrectly? Thanks for your help :) Jason -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: February 18, 2002 9:19 AM To: Matt; [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] form submission error trapping Why do not you all just put all your PHP logic, db access, etc at the TOP of the script. Once you have your results and variables created, then start into html. This method produces MUCH cleaner scripts, and there is a very minimal amount of PHP interspersed within the HTML. Also, you have time to bail out, or redirect, etc... ? Connect to DB Are we to process the form? Yes: Validate fields Generate Error Messages break; No Error Messages? Update the DB Header(Location: bla.php?NEWID=$NEWID); exit; ? html Firstname: ? if(error) echo(error message); ?br input type=text name=txtFIRSTNAME value=?= htmlspecialchars($txtFIRSTNAME); ?br br Lastname: ? if(error) echo(error message); ?br input type=text name=txtLASTNAME value=?= htmlspecialchars($txtLASTNAME); ?br br /html At 08:35 AM 2/18/2002 -0500, Matt wrote: I think that mixing of html and php is too complex and leads to hard to maintain scripts. I find it extremely difficult to understand a scripts logic when it's spread out over hundreds of lines of php/html. I use EasyTemplates that came in Web Applications Development with PHP 4.0 by Tobias Ratschiller and Till Gerkin. It looks like the source is copyrighted and you have to buy the book to get it. But it says it's based on FastTemplates. The book itself is at http://www.amazon.com/exec/obidos/ASIN/0735709971/ You can see a sample of the method here http://marc.theaimsgroup.com/?l=php-generalm=101371611609042w=2 Notice that the form action handler is the same as the original form. This is a simple example, but it does remember user input as you want. I wrote a couple of helper functions that accept db names to build select boxes and radio buttons. They return strings of the html with the selected value, and I just put them in a template container reserved for them (the {TEMPLATE_ITEM} in the sample). For tables with unknown number of rows, I have one template of the main page, one for the table container, and one for each row itself. I loop on the row, using the row template and concatenate all of the rows of html into a string. I take that string and stick it into the table template, and finally stick the table into the page template. Very smooth, easy to read, and no trouble with headers() since all output is done on the last statement. You have complete control over the script until then, and can bail out to another page, or decide to use other templates and output something else. As for errors, I build an array of the messages such as: if (!empty($thatsThere)) { $errors[] = Don't put $thatsThere in there; } if (empty($userName)) { $errors[] = Username must be supplied; } Then you can tell if all is okay, with if (is_array($errors)). If it is an array, then something is wrong, so I append the array contests into html like this: foreach($errors as $value) { $errorMsgs = $value . br\n; } and then put $errorMsgs into the page template container you've reserved for it. - Original Message - From: Jason Dulberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] I am working on some error trapping for several forms on my site. After visiting a bunch of websites, I've noticed 2 common methods of displaying error messages. 1. display an error box on a new page and force the user to hit the back button 2. display the form again with appropriate error text and pre-filled fields. I have part of the error on the new page working but I'm running into the infamous no contents in the form after going back. There are some useability issues with forcing the user to hit the back button -- some
[PHP] dealing with MSWord curly quotes in text
im having a problem with text being submitted to my site through forms into the database, where the text has been edited in MSWord and the quotes that it uses get turned into question marks. does anyone know a way to convert these MSWord quotes to normal marks? -- austin swinneyET-Arrr [EMAIL PROTECTED] pirates of programming -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Removing every thing between ( )
In article 001901c1ba5d$634e3840$89010a0a@bpaulson, [EMAIL PROTECTED] (Brian Paulson) wrote: What would the regular expression be to remove all the text between ( ) $string = This is a (001 Test) and (002 Test); $string=preg_replace(/\(.+\)/U,'',$string); Note that leading/trailing spaces are left in, and the parens are dropped, so you may want to adjust it a bit. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing every thing between ( )
Hello, What would the regular expression be to remove all the text between ( ) $string = This is a (001 Test) and (002 Test); The numbers always change but the word stays the same Any help would be appreciated. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] monitoring banwith used by a script
is there a way to monitor bandwidth use of a script any ideas welcome. Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Removing every thing between ( )
Great, Thanks for the help, worked like a charm Brian -Original Message- From: CC Zona [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Removing every thing between ( ) In article 001901c1ba5d$634e3840$89010a0a@bpaulson, [EMAIL PROTECTED] (Brian Paulson) wrote: What would the regular expression be to remove all the text between ( ) $string = This is a (001 Test) and (002 Test); $string=preg_replace(/\(.+\)/U,'',$string); Note that leading/trailing spaces are left in, and the parens are dropped, so you may want to adjust it a bit. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing every thing between ( )
On Wednesday, February 20, 2002, at 05:24 PM, Brian Paulson wrote: What would the regular expression be to remove all the text between ( ) $string = This is a (001 Test) and (002 Test); The numbers always change but the word stays the same preg_replace(/(\()\d{3,3} Test(\))/, \1\2, $string); That will leave your string looking like This is a () and (). Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how can you tell the url of a remote script?
I have a script, which is called by scripts located on other sites. Is it possible to tell the url of the remote script that is calling my script? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hyperlinks vs Buttons
Is there a way to regular hyperlinked text to submit a form? For example, rather than having a button that says [Login], I just want underlined text: Login Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED]
[PHP] Pulling Variables from URL
Is there an easy way to pull all the variables after the URL? Let use say that the page I am looking at is this. www.somewhere.com/pages.php?id=27color=redbgcolor=green Now on the page I want a link to have the 3 variables from above. I know I can do this. a href=another_page.php?id=?php echo $id ?color=?php echo $color ?bgcolor=?php echo $bgcolor ?Click Here/a But I am wondering if there is a basica funciton or call I can use to pull all the values and variables. So the code might be as simple as a href=another_page.php??php call_to_some_function(); ?Click Here/a And get the same result. Thanks all Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hyperlinks vs Buttons
Is there a way to regular hyperlinked text to submit a form? For example, rather than having a button that says [Login], I just want underlined text: Login You can use JavaScript on that link. An onClick event which triggers document.formname.submit() would work, but then you lose backward compatibility (and thus accessibility) with non-JavaScript browsers. Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT Work now, freak later! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php