[PHP] RE: Browser Detection without use of browsecap.ini file
$HTTP_ENV_VARS[HTTP_USER_AGENT] contains this info if it's been sent Tim Ward Internet Chess www.chessish.com http://www.chessish.com -- From: R'twick Niceorgaw [SMTP:[EMAIL PROTECTED]] Sent: 21 March 2002 17:06 To: [EMAIL PROTECTED] Subject: Browser Detection without use of browsecap.ini file Hi all, is there any way, I can detect the browser without using browsecap.ini file ? I'm simply interested to know if the user using netscape 4.x or earlier. I tried get_browser() function but it returns blank! after checking my server's configuration i found browsecap file setting in uninitialized. I'm not sure if my hosting company will setit up properly for me, but already contacted them and waiting to hear a response form them.. Any help will be much appreciated. R'twick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Net status and free memory on freebsd
Hey all, I'm working on porting a php app to freebsd. However, there is a problem. ;) in linux you can parse /proc/net/dev for all network statistics and make a call to free for available memory. How could you do the same thing in freebsd? I have looked at netstat -b -p ip -I ed0 but that outputs a huge page and you have to grep for a line just to get close. This means for each bit of info you have to make multiple calls or store the entire return which is a pain in the but. I can't believe that freebsd wouldn't offer a better solution to this. what were they thinking? any help greatly appreciated, chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression Problem
Hello, In PHP3, I am using code which using the regular expression capability of PHP. The code matches all occurences of string prefixed by __ (2 underscores) and having alphanumeric characters as well as _ (1 underscore) within it. The code is as follows: while (eregi(__([a-z0-9_]+)__, $ExpandedString, $Matches)) { } In PHP 4, the regular expression __([a-z0-9_]+)__ does not seem to work. I tried __([[:alnum:]_]+)__ also but that too did not work. Looks like the problem is with combining two ranges and a literal within the regular expression Any solution would be appreciated? With Regards, Sharat _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and xEmacs
Hi! Anyone in here who managed to get xEmacs working with psgml-html and php-mode combined? If yes, which php-mode did you use and what did you do? I use psgml-html and Turadg Aleahmad's php-mode 1.0.2 (I just tried it with Fred Yankowski, too, getting excactly the same results) and tried to combine both using mmm-mode 0.4.7. So far it does work, however I cannot indent the embedded php-code at all... :-( Pressing TAB in a line just causes its indentation to get lost, that is, the line starts at column 1, no matter if it's in a statemant block or somewhere else. Is there any solution to that problem or is there any preferable way to edit embedded PHP code with xEmacs? I'd really like to use psgml-html for the non-PHP-parts of the file as I really got used to it. Greetinx, Gunter Ohrner -- The Supreme Life President of Hell wrote: What business are we in??? He thought for a bit, and then carefully wrote, underneath: We are in the damnation business!!!-- (Terry Pratchett, Eric) -+-+-+-+-+- PDEPP Webserver: http://pdepp.SourceForge.net/ -+-+-+-+-+- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is the $this variable affectation authorized (clean enough)?
Hi, is the $this variable affectation authorized (clean enough)? It's works in 4.1.x, but next php versions... class X { function polymorph($class){ // Backup vars here $this=new $class(); // Restore vars here } } What is the usage? - A (MySQL) table - A class to manage the table - A class by record type $x=new X(); $x-read_record(12); switch($x-type){// Got by read_record case 'X1': case 'X2': $x-polymorph($x-type); break; default: exit(1); } $x-specific_method();// From X1 or X2 class ___ Do You Yahoo!? -- Une adresse yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Append to the beginning of a file...
Mauricio, If you are on a *nix computer, you could append to the end of the file, close it and then do a tail -n1 which will give you just the last line in the file. HTH. Regards Chris Mauricio Sthandier wrote: I guess I should do that. I need the plain file because is just a log of users registering in a Club, in a csv format. Using a database is just too much and not intended for this page... even when I would prefer using mysql. At least, I can handle that rather than the fopen and fwrite !. I could append but then I need to read the first 8 chars of the last line I appended... neither something I know how to do. If they were fixed I could... maybe I can fill it with blank chars the line until a given size ? Thanxs everyone for your replies. Miguel Cruz [EMAIL PROTECTED] escribi en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thu, 21 Mar 2002, Mauricio Sthandier wrote: I guess thist must be really silly... but how can I append text to the beginning of a file ??? I've been trying since a while... but all I get is overwriting !. Open a temporary file, write your new data to it, copy the old file on to the end of it, remove the old file, rename the temporary file with the old file's name. Obviously this is not very efficient. Explore whether you really need to prepend. Perhaps you can append and then read the file backwards a la tac? Or perhaps a database is more useful. Or multiple files. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_COOKIE_VARS
On Friday 22 March 2002 05:27, Max Mouse wrote: I've tried using $HTTP_COOKIE_VARS to get information about the cookie has been passed to the current script but I always get a cookie size of 1 containing no information. I have also tried using $_COOKIE but with no success. I'm running apache1.2.23 and php 4.1.2. Suggestions? With 4.1.2, $_COOKIE is the one to use. Do you have some code we could look at? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* /earth: file system full. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OpenDir
Hello: I would like to use opendir to open a network resource \\myserver\myresource , I use IIS, I think I have to give the user of IIS permissions to log on that machine, but do you know how could I do it?. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] comparisons
if (ereg(john,$jeff) ) { } ok or: if( strstr( $jeff, john) ) { } ok or: if( strpos( $jeff, john) ) { } error if (strpos($jeff, john) !== FALSE) Best regards, Andrey Hristov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] comparisons
Andrey, you are incorrect. From the manual on strpos(): int strpos (string haystack, string needle [, int offset]) If needle is not found, returns FALSE. -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 7:47 AM To: Rick Emery Cc: [EMAIL PROTECTED] Subject: Re: [PHP] comparisons if (ereg(john,$jeff) ) { } ok or: if( strstr( $jeff, john) ) { } ok or: if( strpos( $jeff, john) ) { } error if (strpos($jeff, john) !== FALSE) Best regards, Andrey Hristov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with strtotime() and 2002-03-31
-Original Message- From: John Clarke [mailto:[EMAIL PROTECTED]] Sent: 20 March 2002 00:40 I have used the following script successfully for a year now, but have just found a problem with the date 2002-03-31. Any ideas why this would be happening? function addDays($date,$nofdays) { $dd=strtotime($date); $dd2=$dd + (3600*24*$nofdays); return date(Y-m-d, $dd2); } $nd=addDays(2002-03-31,2); echo $nd This will be, indeed, an issue with the daylight-saving time transition which, at least hereabouts, occurs on 31-March/2002. But, since you're using strtotime anyway, why don't you just use its relative offset capabilities to do your conversion: function addDays($date,$nofdays) { $dd2 = strtotime(+$nofdays days, $date); return date(Y-m-d, $dd2); } Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A Newbie needs help with his first Class
The way that Warwick has it set up is fine as long as you create the new in the script that is being called by the browsers so that you can access the class variables...I do not see the need to change the function name unless it conflicts with any predefined variables. Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 6:57 AM To: 'Stampe, Lars'; 'Don'; php Subject: RE: [PHP] A Newbie needs help with his first Class Don's original declaration is correct. It refers to a constructor. Without a parameter, the new() will fail. -Original Message- From: Stampe, Lars [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 7:53 AM To: 'Don'; php Subject: RE: [PHP] A Newbie needs help with his first Class And then replace $global = new Globals(/staging_area/phase-2/); with $global = new Globals; $global-someting else(/staging_area/phase-2/); Lars -Original Message- From: Stampe, Lars [mailto:[EMAIL PROTECTED]] Sent: 22 March 2002 13:46 To: 'Don'; php Subject: RE: [PHP] A Newbie needs help with his first Class Hi, Try and rename the function in your class to something else that the class name, and let me know what happens! Lars -Original Message- From: Don [mailto:[EMAIL PROTECTED]] Sent: 22 March 2002 13:01 To: php Subject: [PHP] A Newbie needs help with his first Class Hi, I'm trying to write my first class. Here is the code contained in a file called globals.php: ?PHP class Globals { var $gDISPLAY = 1;/* Display graphic - no rollover */ var $gROLLOVER = 2; /* Display graphic with rollover */ var $root_path;/* Path to document root directory */ var $relative_path;/* Path from document root to relative root directory */ function Globals($start_dir) { if ( strlen($DOCUMENT_ROOT) == 0) { $this-$root_path = /; } else { $this-$root_path = $DOCUMENT_ROOT; } $this-$relative_path = $this-$root_path . $start_dir; } } $global = new Globals(/staging_area/phase-2/); ? Within my html page, I am tesing the class by trying the following: ?php require(globals.php); echo $global-root_path . br; echo $global-relative_path . br; ? However, nothing is being written to my browser. Is there a problem with the code? Thanks,. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] comparisons
From the docs : Note: It is easy to mistake the return values for character found at position 0 and character not found. Here's how to detect the difference: // in PHP 4.0b3 and newer: $pos = strpos($mystring, b); if ($pos === false) { // note: three equal signs // not found... } // in versions older than 4.0b3: $pos = strpos($mystring, b); if (!is_integer($pos)) { // not found... } Andrey - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Andrey Hristov' [EMAIL PROTECTED]; Rick Emery [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 3:58 PM Subject: RE: [PHP] comparisons Andrey, you are incorrect. From the manual on strpos(): int strpos (string haystack, string needle [, int offset]) If needle is not found, returns FALSE. -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 7:47 AM To: Rick Emery Cc: [EMAIL PROTECTED] Subject: Re: [PHP] comparisons if (ereg(john,$jeff) ) { } ok or: if( strstr( $jeff, john) ) { } ok or: if( strpos( $jeff, john) ) { } error if (strpos($jeff, john) !== FALSE) Best regards, Andrey Hristov -- 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] comparisons
ahhhinteresting. thank you for the clarification I stand humbled, head bowed... rick -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 8:03 AM To: Rick Emery Cc: [EMAIL PROTECTED] Subject: Re: [PHP] comparisons From the docs : Note: It is easy to mistake the return values for character found at position 0 and character not found. Here's how to detect the difference: // in PHP 4.0b3 and newer: $pos = strpos($mystring, b); if ($pos === false) { // note: three equal signs // not found... } // in versions older than 4.0b3: $pos = strpos($mystring, b); if (!is_integer($pos)) { // not found... } Andrey - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Andrey Hristov' [EMAIL PROTECTED]; Rick Emery [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 3:58 PM Subject: RE: [PHP] comparisons Andrey, you are incorrect. From the manual on strpos(): int strpos (string haystack, string needle [, int offset]) If needle is not found, returns FALSE. -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 7:47 AM To: Rick Emery Cc: [EMAIL PROTECTED] Subject: Re: [PHP] comparisons if (ereg(john,$jeff) ) { } ok or: if( strstr( $jeff, john) ) { } ok or: if( strpos( $jeff, john) ) { } error if (strpos($jeff, john) !== FALSE) Best regards, Andrey Hristov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: comparisons
Hi Warwick I'd suggest looking at the PHP manual, it is available at http://www.php.net. You can look for string functions in the manual. If you were looking for a case insensitive comparision you could use stristr, if you are looking for a case senstivie comparision you could use strstr. ?php // code to see if john is in the variable $jeff = 'my name is john'; if (stristr($jeff, 'john')) { print 'john is in the variable'; } else { print 'john is not in the variable'; } ? If you are trying to see if the variable is John then you could do this ? if ($jeff == 'John')) { print 'the variable is set to John'; } else { print 'the variable is not set to John'; } ? There are other ways to do this, this is just an example I created. Jason - Original Message - From: Warwick Berg [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 5:55 AM Subject: comparisons Hi Just learning php from the bottom. Can someone help with syntax please? Want to know about using ifs : If the string value john is present in the variable jeff then do, etc, etc. How do we see if a value is present in a string? Thanks Warwick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] converting a password database from perl to php
Hi all, I'm converting a site written in perl to php. It has a member section which is password protected. All the meber passwords are stored in a flat file with Perl's MD5 encryption algorithm. I'm planning to use MYSQL database to store the member info on the new site. However, I have to import the existing member information including their passwords to the new system. I was checking the md5() and crypt() functions of PHP but theydon't generate the same encrypted password as Perl md5(). Is there any way I can migrate these passwords to php without asking each user to update their password on the new system ? Regards R'twick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] copying and pasting bullets from Word to php/mysql
Hi - this is my first shift from happy and constructive lurking to a question. I am putting together a php/mysql set-up for jobs pages for a not-for-profit organisation. To make it easy for the hr manager, I want the form that enters the job details into the database to be able to have content copied and pasted into it from word documents. Using nl2br() is fine, but my big problem is bullet points. Many of the job specs use bullet points, and although I can replace the non-standard bullet character with a li I can't work out how to put in a piece of code that will put in the other tags to make it legal code. Getting a ul in front of the very first bullet is easy enough, but not getting /ul at the end, nor indeed spotting if there are two separate bullet lists and adapting the code accordingly. Any thoughts? - Many thanks - Mallen This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regular Expression Problem
__([a-z0-9][a-z0-9_]+)__ -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 4:22 AM To: [EMAIL PROTECTED] Subject: [PHP] Regular Expression Problem Hello, In PHP3, I am using code which using the regular expression capability of PHP. The code matches all occurences of string prefixed by __ (2 underscores) and having alphanumeric characters as well as _ (1 underscore) within it. The code is as follows: while (eregi(__([a-z0-9_]+)__, $ExpandedString, $Matches)) { } In PHP 4, the regular expression __([a-z0-9_]+)__ does not seem to work. I tried __([[:alnum:]_]+)__ also but that too did not work. Looks like the problem is with combining two ranges and a literal within the regular expression Any solution would be appreciated? With Regards, Sharat _ Chat with friends online, try MSN Messenger: http://messenger.msn.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] Netware version/port
I have heard rumours that a NW port of PHP is coming. Anyone else heard this? Any time frame? tia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: bigendian vs littleendian
On Thu, 21 Mar 2002, Mika Tuupola wrote: How can I make $double = pack(d, $val); to produce same value when run on bigendian host as what it would result when running in a littleendian host? Answering to myself here, strrev() is your friend ;) -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A Newbie needs help with his first Class
$DOCUMENT_ROOT inside a function, scope problems. Pass it as an argument or global, or use $_SERVER['DOCUMENT_ROOT']; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Don [EMAIL PROTECTED] wrote in message 000f01c1d1a1$9105c9a0$[EMAIL PROTECTED]">news:000f01c1d1a1$9105c9a0$[EMAIL PROTECTED]... Hi, I'm trying to write my first class. Here is the code contained in a file called globals.php: ?PHP class Globals { var $gDISPLAY = 1;/* Display graphic - no rollover */ var $gROLLOVER = 2; /* Display graphic with rollover */ var $root_path;/* Path to document root directory */ var $relative_path;/* Path from document root to relative root directory */ function Globals($start_dir) { if ( strlen($DOCUMENT_ROOT) == 0) { $this-$root_path = /; } else { $this-$root_path = $DOCUMENT_ROOT; } $this-$relative_path = $this-$root_path . $start_dir; } } $global = new Globals(/staging_area/phase-2/); ? Within my html page, I am tesing the class by trying the following: ?php require(globals.php); echo $global-root_path . br; echo $global-relative_path . br; ? However, nothing is being written to my browser. Is there a problem with the code? Thanks,. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tool to remove comments??
Hi Folks, does anybody know a tool for removing comments out of PHP scripts? I mean // this is a comment and /* this is also a comment */ it should also handle something like echo'http://somewher.somecom/somepage'; // this goes to somewhere and multiline comment like /* ..blah */ maybe anybody has an awk script, that he/she will share with me. TIA Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem passing variables
Hi, A friend of me use PHP4.1.2 on Linux+Apache Here is the problem : He pass a parameter using GET method : http://www.domain.com/test.php?TESTV=1234 test.php is : ?php echo $TESTV.BR; echo $HTTP_GET_VARS[TESTV].BR; phpinfos(); ? But in the script all variables are empty ($TESTV and $HTTP_GET_VARS[TESTV]). phpinfos() shows QUERY_STRING environment variable is empty... any idea ?? Thank you ! EuroVox 4, place Félix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange problem passing variables
Try using $_GET['varnamehere'] Ray Hunter -Original Message- From: Jean-Arthur Silve [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 8:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange problem passing variables Hi, A friend of me use PHP4.1.2 on Linux+Apache Here is the problem : He pass a parameter using GET method : http://www.domain.com/test.php?TESTV=1234 test.php is : ?php echo $TESTV.BR; echo $HTTP_GET_VARS[TESTV].BR; phpinfos(); ? But in the script all variables are empty ($TESTV and $HTTP_GET_VARS[TESTV]). phpinfos() shows QUERY_STRING environment variable is empty... any idea ?? Thank you ! EuroVox 4, place Félix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying data from db
Hi, I have several questions. First what would be the best solution to take the records from the database and display like 10 results per page? Another question, the same records from the database, but say I want to sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.. etc. And if I click 'a' I only get records with name starting with A. Is this possible? I am not necessarily asking for a complete code to reuse, just the logic, how it would work. Thanks in advance, Vlad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Displaying data from db
First what would be the best solution to take the records from the database and display like 10 results per page? Check the list archives and php.net. There are many examples of this functionality Another question, the same records from the database, but say I want to sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.. etc. And if I click 'a' I only get records with name starting with A. Is this possible? yes, it's possible. Use a drop-down list, radio buttons, or hyper-links mysql: SELECT * FROM mytable WHERE mydata LIKE $alpha% this assumes $alpha contains the single character you are searching for -Original Message- From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 9:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Displaying data from db Hi, I have several questions. First what would be the best solution to take the records from the database and display like 10 results per page? Another question, the same records from the database, but say I want to sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.. etc. And if I click 'a' I only get records with name starting with A. Is this possible? I am not necessarily asking for a complete code to reuse, just the logic, how it would work. Thanks in advance, Vlad -- 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] Session Varaible Problem
Are you calling session_start() on the subsequent pages you want to be part of the session? No I was not. That was the problem. Thanks Rasmus. -- Rp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Weird fsockopen behavior
Hi I'm using $fp=fsockopen($URL,80, $errno, $errstr,10); set_socket_blocking($fp,false); to get the HTML from a remote site and monitor how long it took me to DL the HTML. The next lines are like this : if ($fp) { $SendGetStart = getmicrotime(); fwrite($fp,GET / HTTP/1.1\r\n); fwrite($fp,Accept: */*\r\n); fwrite($fp,Accept-Language: en-us\r\n); fwrite($fp,Proxy-Connection: Keep-Alive\r\n); fwrite($fp,User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; COM+ 1.0.2204)\r\n); fwrite($fp,Host:$Host\r\n\r\n); .. While(!feof($fp)) {... The weird thing is that it seems the EOF comes in great delay. When I print the HTML I get from the remote site, the while loop continues for about 10-15 seconds after the last /HTML tag arrived. This is for any site I check so it's not something specific to the web server I'm testing. Anyone has any idea why? Thanks berber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CICS call?
Hey all, I was just curious if anyone knows how or even if PHP4 can make a CICS call to a mainframe system. I need to grab some data from a mainframe realtime. Thanks in advance. Batch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Weird fsockopen behavior - SOLUTION
I feel pretty sheepish but it always happens to me. I found this note in the manual and it seems to solve the problem. So if anyone has this problem. berber User Contributed Notes fsockopen [EMAIL PROTECTED] 08-Jan-2002 06:30 This is a gotcha that got me and discusses the careful use of HTTP/1.1 over HTTP/1.0 I had a script that suffered dreadful performance and return Hex values amongst the correct data. This was eventually traced to my inclusion of HTTP/1.1 in the line which read: -- CODE (watch wrap) -- $request = GET $document . ? . $query . HTTP/1.1\r\n; $request .= Host: $myServer\r\n\r\n; -- CODE -- By sending a HTTP/1.1 request it declares that it is willing to 'speak' HTTP/1.1, of course, but there are some aspects of HTTP/1.1 that make it necessary to handle the socket differently from HTTP/1.0. In the RFC 2616, Section 3.6 defines: [...] All HTTP/1.1 applications MUST be able to receive and decode the chunked transfer-coding, [...] This was the cause of the extraneous HEX values being displayed. Regards the loss of performance, this is also due to using HTTP/1.1, which defaults to having keepalive on until you tell it to close the connection, or it times out. Therefore the socket was being kept open by the script. Simply changing the line in the script to HTTP/1.0 completely fixed the problem. Speaking with one of the members in PHP-dev his words were: [Comment from Hartmut Holzgraefe] I stumbled over the same 'chunked' problem not to long ago as a rule of thumb: never use HTTP/1.1 unless you really know that you have to, claiming to be a HTTP/1.0 client is no problem. I have posted this as it was something I found very difficult to debug as there is actually nothing wrong with the script. This sort of problem often requires an in depth knowledge of an area that most developers would not have or consider. I would doubt that many, in any, who are reading this have ever read the HTTP RFC 2616 (I doubt also that it is a rivetting read :)) I hope this helps any future developers who are considering the use of high level socket connections with HTTP/1.1. -Original Message- From: Boaz Yahav Sent: Friday, March 22, 2002 5:49 PM To: PHP General (E-mail) Subject: [PHP] Weird fsockopen behavior Hi I'm using $fp=fsockopen($URL,80, $errno, $errstr,10); set_socket_blocking($fp,false); to get the HTML from a remote site and monitor how long it took me to DL the HTML. The next lines are like this : if ($fp) { $SendGetStart = getmicrotime(); fwrite($fp,GET / HTTP/1.1\r\n); fwrite($fp,Accept: */*\r\n); fwrite($fp,Accept-Language: en-us\r\n); fwrite($fp,Proxy-Connection: Keep-Alive\r\n); fwrite($fp,User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; COM+ 1.0.2204)\r\n); fwrite($fp,Host:$Host\r\n\r\n); .. While(!feof($fp)) {... The weird thing is that it seems the EOF comes in great delay. When I print the HTML I get from the remote site, the while loop continues for about 10-15 seconds after the last /HTML tag arrived. This is for any site I check so it's not something specific to the web server I'm testing. Anyone has any idea why? Thanks berber -- 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] Trap CR or Enter possible?
On Friday, March 22, 2002, at 12:11 AM, Jason Wong wrote: But, what are the undesirable effects of just pressing enter? I know that in IE pressing enter to submit a form is not the same as clicking on the submit button. If that is what you are referring to then it's very easy to code around that and thus would not require javascript. I have noticed that pressing enter in IE does achieve the same effect as pressing the submit button for my forms. But I have also heard that it's not really the same, especially if there are more than one submit-style inputs for the given form. What does Enter really do in IE? Side note to the original poster: in the script that is the target of the form you are writing, you may be able to test for the presence of the submit variable -- if this value is not present, then the user has not clicked the Submit button. I know that the value of a submit input is usually just used to label the button in some way (such as value=Click Here for Free Porn!), but you can actually test for this value if you have given the Submit input a name. I may be wrong about this, though. 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] converting a password database from perl to php
Show us an example Perl one. Chances are you can get the PHP crypt() function to do the right thing by feeding it the correct SALT. -Rasmus On Fri, 22 Mar 2002, R'twick Niceorgaw wrote: Hi all, I'm converting a site written in perl to php. It has a member section which is password protected. All the meber passwords are stored in a flat file with Perl's MD5 encryption algorithm. I'm planning to use MYSQL database to store the member info on the new site. However, I have to import the existing member information including their passwords to the new system. I was checking the md5() and crypt() functions of PHP but theydon't generate the same encrypted password as Perl md5(). Is there any way I can migrate these passwords to php without asking each user to update their password on the new system ? Regards R'twick -- 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] Weird error...
What does this error mean?? Fatal error: Allowed memory size of 8388608 bytes exhausted at zend_language_scanner.c:4248 (tried to allocate 9 bytes) in /blah/blah/afteradmin2.php on line 37 here is line #37... $usertemp = mysql_result($result_all, $i, username); THANKS!!!
Re: [PHP] converting a password database from perl to php
Hi Rasmus, Here's what used in the perl script. -- use Digest::MD5; use Digest::MD5 qw( md5_hex ); my $encrypt_password; my $digestObject = Digest::MD5-new(); $digestObject-add($password); $encrypt_password = $digestObject-digest(); Here's a sample result form it. text password : f0rget123 encrypted password: òOú«#7Fá73¯ Under PHP I'm getting a much bigger string with MD5() for the same clear password string. Thank you for helping me out with this. Regards R'twick - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: R'twick Niceorgaw [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 11:07 AM Subject: Re: [PHP] converting a password database from perl to php Show us an example Perl one. Chances are you can get the PHP crypt() function to do the right thing by feeding it the correct SALT. -Rasmus On Fri, 22 Mar 2002, R'twick Niceorgaw wrote: Hi all, I'm converting a site written in perl to php. It has a member section which is password protected. All the meber passwords are stored in a flat file with Perl's MD5 encryption algorithm. I'm planning to use MYSQL database to store the member info on the new site. However, I have to import the existing member information including their passwords to the new system. I was checking the md5() and crypt() functions of PHP but theydon't generate the same encrypted password as Perl md5(). Is there any way I can migrate these passwords to php without asking each user to update their password on the new system ? Regards R'twick -- 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] converting a password database from perl to php
text password : f0rget123 encrypted password: òOú«#7Fá73¯ Uh, that's not md5 at all. By definition md5 is 32 characters. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Phptriad
Hi, I´m new to php. I have installed phptriad in Windows2000 using also IIS5 as an alternative web server. I have tried to test some http authentication scritps but they don´t seem to work. (Using apache I got an internal error and using IIS, i sucessfully show the authentication dialog box, but later the server gets blocked) I have some questions: - does the phptriad install php as an apache module or as a cgi? How could I know the difference? - Using php as a cgi what kind of http authentication i should use? I have read that the http authentication could only be used when PHP is installed as a module. Also I have read that the IIS has a limitation with this. What would you recommend me? Any answer would be greatly appreciated. Kary - Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards®
[PHP] calculation based on checkbox
?php $ad = ereg_replace (\, q, $ad); # prevents an error when sending $ad through an HTML form $ad = ereg_replace (', a, $ad); # prevents a mysql error $ad = ereg_replace (%, p, $ad); #prevents a mysql error $ad = ereg_replace (, bs, $ad); #prevents a mysql error # splits the ad into an array called $words $words = split( , $ad); # counts the number of expressions in the array $num = count($words); # variable used to check how many of the expressions are really spaces $count2 = 0; for($i = 0; $i $num; $i++){ # determines if any variables are empty and if they are $count goes up one to determine how many spaces there are in the expressions if ($words[$count2] == ){ $count = $count + 1; } $count2 = $count2 + 1; } $num = $num - $count; #gets the new number of words $price = 5.00; if ($num 10) { # if the users ad has more than 10 words in it than $quarters = the extra words times .20 $subtractor = $num - 10; $quarters = $subtractor * .20; } $subtotal = $price + $quarters; # price plus the number of words over 10 $total = $papers * $subtotal; # new price multiplied by number of papers $total = $total * $weeks; # new new price multiplied by number of weeks $total = sprintf (%01.2f, $total); ? Here is part of my function thus far, and the output is a simple $$ based on the number of words, I just need to add an IF statement to determine whether or not I will need to subtract a certain amount if a checkbox is checked. I am assuming that the IF statement would be something like... IF $variable = 1; { $variable - $total = $total2 ) Else do the rest of the code... I am still a newbie to php so any help would be great. Thanks in advance, Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: RC4Crypt encryption opinions
Maxwell, I tried it out. The sample test crashed the PHP 4.0.5 CGI binary everytime on my winNT system. No script has ever /crashed/ the executable before, just might be worth note. Steve Friday, March 22, 2002, 12:45:11 AM, . wrote: I'm looking for opinions on RC4Crypt -- [EMAIL PROTECTED] ** http://mrclay.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] calculation based on checkbox
If your checkbox name was cbox setup as input type=checkbox name=cbox value=true you could check for it like this ?php // if you have PHP 4.1+ use this code if ($_REQUEST['cbox'] == 'true') { // do code } ? You could also just check to make sure that the box variable is set rather than comparing its value ?php if (isset($_REQUEST['cbox']) { // do code } ? Jason -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 21, 2002 10:23 PM To: [EMAIL PROTECTED] Subject: [PHP] calculation based on checkbox ?php $ad = ereg_replace (\, q, $ad); # prevents an error when sending $ad through an HTML form $ad = ereg_replace (', a, $ad); # prevents a mysql error $ad = ereg_replace (%, p, $ad); #prevents a mysql error $ad = ereg_replace (, bs, $ad); #prevents a mysql error # splits the ad into an array called $words $words = split( , $ad); # counts the number of expressions in the array $num = count($words); # variable used to check how many of the expressions are really spaces $count2 = 0; for($i = 0; $i $num; $i++){ # determines if any variables are empty and if they are $count goes up one to determine how many spaces there are in the expressions if ($words[$count2] == ){ $count = $count + 1; } $count2 = $count2 + 1; } $num = $num - $count; #gets the new number of words $price = 5.00; if ($num 10) { # if the users ad has more than 10 words in it than $quarters = the extra words times .20 $subtractor = $num - 10; $quarters = $subtractor * .20; } $subtotal = $price + $quarters; # price plus the number of words over 10 $total = $papers * $subtotal; # new price multiplied by number of papers $total = $total * $weeks; # new new price multiplied by number of weeks $total = sprintf (%01.2f, $total); ? Here is part of my function thus far, and the output is a simple $$ based on the number of words, I just need to add an IF statement to determine whether or not I will need to subtract a certain amount if a checkbox is checked. I am assuming that the IF statement would be something like... IF $variable = 1; { $variable - $total = $total2 ) Else do the rest of the code... I am still a newbie to php so any help would be great. Thanks in advance, Jas -- 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] Maillist
I need to send out several hundred, to several thousand emails out of our database. Now, before everyone starts telling me to use an actual MLM for this, let me explain what I need to do. I need to send a unique ID with each message, in the form of a URL. We want to make unsubscribing as easy as possible for our clients, so what I plan on doing is sending out a URL in the body of the message that contains a unique ID. When they click on that URL, it hits another script on our website which than takes that ID, searches for it in the database and flags that record (and returns a 'Thank you' page.) So, somehow, I need to generate a unique ID for each message send, stick that ID into the database with the corresponding email address that it was just sent to and thenwait. What's the best way to approach this? Should I generate IDs outside of the script, and then query the database for both the email and the ID and construct the message that way? Or should I dynamically generate an ID during the mailing process and shove it in the DB as the message goes out? Suggestions, criticism, comments...welcome. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Weird error...
I notice you're incrementing the row offset. You shouldn't use mysql_result() to extract multiple fields like that. It will be much faster using mysql_fetch_array() once and then extracting any data you need from the resulting associative array as many times as you need. Mysql_result() is intended to be used when you need to extract the data in one field in one column. I can only think it has something to do with your $results_all. Perhaps there is a max size that it will accept? Doesn't make sense though. I tried this and it worked fine: ?php // open dbase not shown $query = SELECT * FROM montileaux_events; $result = mysql_query ($query, $db); $num = mysql_num_rows($result); for ($i=0; $i$num; $i++) { echo mysql_result($result, $i, event_location) . br; } ? For extracting multiple sets of data you should be using one of the mysql_fetch_XXX() functions instead. Example.. $row = mysql_fetch_array($result); echo $row[event_location]. br; -Kevin -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 9:27 AM To: [EMAIL PROTECTED] Subject: [PHP] Weird error... What does this error mean?? Fatal error: Allowed memory size of 8388608 bytes exhausted at zend_language_scanner.c:4248 (tried to allocate 9 bytes) in /blah/blah/afteradmin2.php on line 37 here is line #37... $usertemp = mysql_result($result_all, $i, username); THANKS!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trap CR or Enter possible?
On Friday, March 22, 2002, at 12:29 PM, Jason Wong wrote: Side note to the original poster: in the script that is the target of the form you are writing, you may be able to test for the presence of the submit variable -- if this value is not present, then the user has not clicked the Submit button. I know that the value of a submit input is usually just used to label the button in some way (such as value=Click Here for Free Porn!), but you can actually test for this value if you have given the Submit input a name. I may be wrong about this, though. Thus if you relied upon testing for the value of the submit button to determine whether the form had been submitted (as opposed to being viewed for the first time) then you're going to get unexpected results. Right, but I was trying to come up with a way for the original poster to test to see if the user had simply hit enter or if they had actually hit the submit button (not as a test to see if the form was being viewed for the first time). IIRC he was having problems determining whether or not the user had hit enter or hit the submit button. 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] Weird error...
DOH!!! I didn't mean to email the first part of my response below. I wrote it and then realized that I was mistaken. I thought I'd erased it. It is perfectly valid to do what you want with mysql_result(); :) -Kevin -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 10:38 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Weird error... -- I notice you're incrementing the row offset. You shouldn't use mysql_result() to extract multiple fields like that. It will be much faster using mysql_fetch_array() once and then extracting any data you need from the resulting associative array as many times as you need. Mysql_result() is intended to be used when you need to extract the data in one field in one column. I can only think it has something to do with your $results_all. Perhaps there is a max size that it will accept? Doesn't make sense though. I tried this and it worked fine: ?php // open dbase not shown $query = SELECT * FROM montileaux_events; $result = mysql_query ($query, $db); $num = mysql_num_rows($result); for ($i=0; $i$num; $i++) { echo mysql_result($result, $i, event_location) . br; } ? For extracting multiple sets of data you should be using one of the mysql_fetch_XXX() functions instead. Example.. $row = mysql_fetch_array($result); echo $row[event_location]. br; -Kevin -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 9:27 AM To: [EMAIL PROTECTED] Subject: [PHP] Weird error... What does this error mean?? Fatal error: Allowed memory size of 8388608 bytes exhausted at zend_language_scanner.c:4248 (tried to allocate 9 bytes) in /blah/blah/afteradmin2.php on line 37 here is line #37... $usertemp = mysql_result($result_all, $i, username); THANKS!!! -- 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] converting a password database from perl to php
I'm sorry, I somehow missed few characters while copying form unix machine. The actual encrypted string is òOú«#µ7zFá73Y¯ (in hex it is 06 f2 4f fa ab 23 b5 7f 37 9e 46 e1 37 33 9f af) I have no idea about perl and so now I'm confused as in hte perl script I see it's using a digest::md5() object to encrypt the password and so thought it should be same md5() as in php. If you can guide me to some place where i can look for further info will be of much help to me. Thanks for your time Regards R'twick - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: R'twick Niceorgaw [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 11:46 AM Subject: Re: [PHP] converting a password database from perl to php text password : f0rget123 encrypted password: òOú«#7Fá73¯ Uh, that's not md5 at all. By definition md5 is 32 characters. -Rasmus -- 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] Desperate!!!!!!! Resource id #24 - error???????????
Hi guys, Thanks for reading this. I desperatley need help with this error. I just finished a huge project thats taken me months, my code works, but the code its attached to has an error. The project is due Monday and naturally enough the guy who wrote the code with the error is gone on holiday for the weekend- typical. Does anyone know what the hell Resource id's are, and why they are showing up in my array instead of good ol fashioned numbers? My array goes (correct)into a function looking like this : Array ( [0] = Array ( [0] = -1 [1] = 1 [2] = 1 [3] = 1 ) [1] = Array ( [0] = -2 [1] = 2 [2] = 2 [3] = 10 [4] = 2 ) [2] = Array ( [0] = -3 [1] = 3 [2] = 3 [3] = 9 ) ) Array ( [0] = Array ( [0] = -4 [1] = 4 [2] = 4 [3] = 4 ) [1] = Array ( [0] = -5 [1] = 5 [2] = 5 [3] = 5 ) [2] = Array ( [0] = -6 [1] = 6 [2] = 6 [3] = 6 ) ) and comes out looking like this: Array ( [0] = Array ( [0] = Resource id #5 [1] = Resource id #8 [2] = 1 [3] = 1 ) [1] = Array ( [0] = Resource id #16 [1] = Resource id #17 [2] = 2 [3] = 10 [4] = 2 [5] = ) [2] = Array ( [0] = Resource id #24 [1] = Resource id #25 [2] = 3 [3] = 9 ) ) Array ( [0] = Array ( [0] = Resource id #35 [1] = Resource id #36 [2] = 4 [3] = 4 ) [1] = Array ( [0] = Resource id #44 [1] = Resource id #45 [2] = 5 [3] = 5 ) [2] = Array ( [0] = Resource id #53 [1] = Resource id #54 [2] = 6 [3] = 6 ) ) The Resource id #'s only go into the first two places in the end(third) arrays. I'd really appreciate help with this Thanks a million _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to get server os?
Hello Friends Can any one tell me how can i get the server operating system, on which my php script is running ? and envermental variable or any other idea ... Bye, and Have a nice day. Prachait Saxena --- Phone :- +91 - 712 - 544476 Email :- [EMAIL PROTECTED] (Official) [EMAIL PROTECTED](Official) [EMAIL PROTECTED] (Personal) ICQ :- 71855637 MSN :- prachait Yahoo Messenger :- getprachait If you do for other's ! Other's will do for you !! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trap CR or Enter possible?
On 22-Mar-2002 Erik Price wrote: On Friday, March 22, 2002, at 12:29 PM, Jason Wong wrote: Side note to the original poster: in the script that is the target of the form you are writing, you may be able to test for the presence of the submit variable -- if this value is not present, then the user has not clicked the Submit button. I know that the value of a submit input is usually just used to label the button in some way (such as value=Click Here for Free Porn!), but you can actually test for this value if you have given the Submit input a name. I may be wrong about this, though. Thus if you relied upon testing for the value of the submit button to determine whether the form had been submitted (as opposed to being viewed for the first time) then you're going to get unexpected results. Right, but I was trying to come up with a way for the original poster to test to see if the user had simply hit enter or if they had actually hit the submit button (not as a test to see if the form was being viewed for the first time). IIRC he was having problems determining whether or not the user had hit enter or hit the submit button. If you use an image for your submit button, then you can test for $submit_x and $submit_y. -- Don Read [EMAIL PROTECTED] -- It is necessary for me to learn from others' mistakes. I will not live long enough to make them all by myself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to get server os?
Create a script that looks like this: ?php phpinfo(); ? and then look at the output of that for your operating system... odds are you'll find a $_SERVER variable that gives you what you want. On Fri, 22 Mar 2002, Prachait Saxena wrote: Hello Friends Can any one tell me how can i get the server operating system, on which my php script is running ? and envermental variable or any other idea ... Bye, and Have a nice day. Prachait Saxena --- Phone :- +91 - 712 - 544476 Email :- [EMAIL PROTECTED] (Official) [EMAIL PROTECTED](Official) [EMAIL PROTECTED] (Personal) ICQ :- 71855637 MSN :- prachait Yahoo Messenger :- getprachait If you do for other's ! Other's will do for you !! -- 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 get server os?
On Saturday 23 March 2002 02:22, Prachait Saxena wrote: Hello Friends Can any one tell me how can i get the server operating system, on which my php script is running ? and envermental variable or any other idea ... php_uname() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Never call a man a fool. Borrow from him. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Desperate!!!!!!! Resource id #24 - error???????????
On Saturday 23 March 2002 01:53, brendan conroy wrote: Hi guys, Thanks for reading this. I desperatley need help with this error. I just finished a huge project thats taken me months, my code works, but the code its attached to has an error. The project is due Monday and naturally enough the guy who wrote the code with the error is gone on holiday for the weekend- typical. Let's see the code that its attached to. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Slang is language that takes off its coat, spits on its hands, and goes to work. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cron with php as apache module
I want to run a php script via a crontab, (i can set up the crontab etc). this is a Linux server and php is installed as an apache module, is there any way to run the php script via cron. the build details are Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath' Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cron with php as apache module
yes, you can run PHP as a stand-alone interpreter -Original Message- From: Paul Roberts [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:00 PM To: [EMAIL PROTECTED] Subject: [PHP] cron with php as apache module I want to run a php script via a crontab, (i can set up the crontab etc). this is a Linux server and php is installed as an apache module, is there any way to run the php script via cron. the build details are Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath' Paul Roberts [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] cron with php as apache module
Good day, Most Linux packages also install the php binary as part of the distribution (I know Redhat does). Look in /usr/local/bin (or other common places) to see if the executable php has been installed. If it is, you're set. Just run the script as if it were a .cgi . Instructions are on php's site. On a sour note, FreeBSD's package does not include the executable.. =( Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Paul Roberts [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 12:00 PM To: [EMAIL PROTECTED] Subject: [PHP] cron with php as apache module I want to run a php script via a crontab, (i can set up the crontab etc). this is a Linux server and php is installed as an apache module, is there any way to run the php script via cron. the build details are Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath' Paul Roberts [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] Desperate!!!!!!! Resource id #24 - error???????????
Thank you for (mis)placing your faith in me. But if you want a better quality of help you should write to the list and not to any one individual. On Saturday 23 March 2002 02:44, brendan conroy wrote: OK here goes, Im pretty sure the error is in the monic function, thanks for your time on this ? function grobmonic($g) { for($c=0;$ccount($g);$c++) { $g[$c]=monic($g[$c]); } return $g; } ? ? function monic($p) { print_r($p); if(gmp_cmp($p[0][0],$p[0][1])!=0) { $temp[0]=$p[0][1]; $temp[1]=$p[0][0]; $p=prodmono($temp,$p); } return $p; } ? ? function prodmono($p1,$p2) { for($a=0;$acount($p2);$a++) { $num=gmp_mul($p1[0],$p2[$a][0]); $den=gmp_mul($p1[1],$p2[$a][1]); $g=gmp_gcd($num,$den); if(gmp_cmp($g,1)!=0) { $num=gmp_divexact($num,$g); $den=gmp_divexact($den,$g); } $res[$a][0]=$num; $res[$a][1]=$den; $k=$i=$j=2; while($icount($p1) $jcount($p2[$a])) { if($p1[$i]$p2[$a][$j]) { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]; $i=$i+2; } elseif($p1[$i]$p2[$a][$j]) { $res[$a][$k]=$p2[$a][$j]; $res[$a][$k+1]=$p2[$a][$j+1]; $j=$j+2; } else { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1]; $i=$i+2; $j=$j+2; } $k=$k+2; } while($icount($p1)) { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]; $i=$i+2; $k=$k+2; } while($jcount($p2[$a])) { $res[$a][$k]=$p2[$a][$j]; $res[$a][$k+1]=$p2[$a][$j+1]; $j=$j+2; $k=$k+2; } } return $res; } ? From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] Desperate!!! Resource id #24 - error??? Date: Sat, 23 Mar 2002 02:18:58 +0800 On Saturday 23 March 2002 01:53, brendan conroy wrote: Hi guys, Thanks for reading this. I desperatley need help with this error. I just finished a huge project thats taken me months, my code works, but the code its attached to has an error. The project is due Monday and naturally enough the guy who wrote the code with the error is gone on holiday for the weekend- typical. Let's see the code that its attached to. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Slang is language that takes off its coat, spits on its hands, and goes to work. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cron with php as apache module
Yeah, Compile php first as CLI, move the contents of the bin directory to where you want them, and then compile php again for the apache module. In the bin directory you will have a php executable file which you can use for your cli apps. In your php files that you want to run as crons then add this before the ?php #!/path to php/php Example on my system #!/usr/bin/php ?php Stuff here ? /* EOF */ Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Paul Roberts [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 12:00 PM To: [EMAIL PROTECTED] Subject: [PHP] cron with php as apache module I want to run a php script via a crontab, (i can set up the crontab etc). this is a Linux server and php is installed as an apache module, is there any way to run the php script via cron. the build details are Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath' Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forcing little endian with pack(d);
I have looked through the pack code in php-4.1.2. There appear to be no other options other than what is documented on the php.net pack function page. There appears to be no way of specifying endian-ness for floats or doubles using pack. They are copied to the output stream using a simple memcpy. I would need more details on what you are doing to be sure, but, is the format something you can worry about on the unpacking side? Usually, it is best to marshall the data in the native format of the machine doing the marshalling, and then convert the data (if needed) on the machine you are un-marshalling on. This usually makes debugging a whole heck of a lot easier. All you will have to do is store the endian-ness of the machine you are packing on with the data being packed. Of course, this only works if you are not unpacking with PHP... The code in pack.c for the pack function is pretty dang simple. It wouldn't take more than an hour or so to cut and paste a few sections of code to add the options you need. Could be good to have in future versions of php. Good Luck. // Mike Eynon // www.MikeEynon.com // 1366 Bulb Ave. // Santa Cruz, CA 95062 // 831.588.2388 -Original Message- From: Mika Tuupola [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 3:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Forcing little endian with pack(d); http://www.php.net/manual/en/function.pack.php The manual page describes format string d as: d double (machine dependent size and representation). Is there an easy way of forcing the binary to be representated little endian even with hosts which are big endian (undocumented format string for example?). -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- 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] Rollover not functioning
Does anyone have any idea why adding PHP into an HTML page would cause a rollover (not even within the PHP script) to not function? The thing is, I have done the same thing on various other pages, but this is the only page that does it. I tried removing the PHP script from the page, and the rollover works, but when I add the code back in, it doesn't. And if anyone has any ideas as how to minimize the code, they would be appreciated as well. Here is the code that was inserted within a cell in a table ..the rollover is in another cell: ?php $filename = contact.frm; if(empty($HTTP_POST_VARS[name]) empty($HTTP_POST_VARS[email]) empty($HTTP_POST_VARS[comments])) { @ $fp = fopen($filename, r); if(!$fp) { echo pbError:/b could not open b$filename/b for reading/p\n; exit; } $form = fread($fp, filesize($filename)); fclose($fp); $form = str_replace({name}, $HTTP_POST_VARS[name], $form); $form = str_replace({email}, $HTTP_POST_VARS[email], $form); echo $form; } elseif(empty($HTTP_POST_VARS[name]) || empty($HTTP_POST_VARS[email]) || empty($HTTP_POST_VARS[comments])) { echo p align='center'font color='#FF'bYou must fill out all information/b/font/p\n; @ $fp = fopen($filename, r); if(!$fp) { echo pbError:/b could not open b$filename/b for reading/p\n; exit; } $form = fread($fp, filesize($filename)); fclose($fp); $form = str_replace({name}, $HTTP_POST_VARS[name], $form); $form = str_replace({email}, $HTTP_POST_VARS[email], $form); echo $form; } else { $submit = 0; $name = $HTTP_POST_VARS[name]; $body = strip_tags(trim(stripslashes($HTTP_POST_VARS[comments]))); $body .= \n\nSent: .date(F j, Y g:i a).\nSender: $name; $to = [EMAIL PROTECTED]; $subject = Wild Zone web contact; $headers = From: .$HTTP_POST_VARS[email].\n; mail($to,$subject,$body,$headers); @ $fp = fopen($filename, r); if(!$fp) { echo pbError:/b could not open b$filename/b for reading/p\n; exit; } $form = fread($fp, filesize($filename)); fclose($fp); $form = str_replace({name}, , $form); $form = str_replace({email}, , $form); echo p align='center'font color='#FF'Your information has been successfully transmitted/font/p\n; echo $form; } ? -- Joshua E Minnie CIO [EMAIL PROTECTED] Don't work for recognition, but always do work worthy of recognition. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron with php as apache module
Even if you can't get, or don't want to bother getting, PHP as a standalone CGI type program, you can still execute via crontab. Make a web page that you want to have run, then put something along the lines of: lynx http://localhost/scriptname.php as the command in the crontab file. Do note, you'll likely need to take steps to protect the script from being run by people you don't want touching it. You could use SSL, cookies and REMOTE_ADDR, among other things to accomplish that. --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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forcing little endian with pack(d);
On Fri, 22 Mar 2002, Mike Eynon wrote: I have looked through the pack code in php-4.1.2. There appear to be no other options other than what is documented on the php.net pack function page. There appears to be no way of specifying endian-ness for floats or doubles using pack. They are copied to the output stream using a simple memcpy. The solution was much simpler than I though. Reversing the output with strrev() seems to do the job: $double = pack(d, $val); if ($bigendian) { $double = strrev($double); } Now the value of $double is the same in big and smallendian machines. So I suppose strrev() is binary safe. I would need more details on what you are doing to be sure, but, is the format something you can worry about on the unpacking side? I am writing a binary file (BIFF) whose specs state that the data needs to be written littleendian. The code in pack.c for the pack function is pretty dang simple. It wouldn't take more than an hour or so to cut and paste a few sections of code to add the options you need. Could be good to have in future versions of php. +1 for adding that to future versions. Don't talk C myself though ;) -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FAQ
Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FAQ
That's a FAQ (did you try the obvious? http://php.net/faq) On Fri, 22 Mar 2002, James Taylor wrote: Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] store locator/zip code question...
Hi folks, I've got a client that wants to show users dealers of their products based on mileage from their location. I've seen this done, and I assume it's based on either a database relating the zip info to miles, or to some kind of hash on the zipcode itself. Anyone have any experience with this? TIA, Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FAQ
You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Maillist
I think PHP's uniqid() will suit your purposes. Look in the Miscellaneous Functions section of the manual. -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 11:38 AM To: PHP-General List Subject: [PHP] Maillist I need to send out several hundred, to several thousand emails out of our database. Now, before everyone starts telling me to use an actual MLM for this, let me explain what I need to do. I need to send a unique ID with each message, in the form of a URL. We want to make unsubscribing as easy as possible for our clients, so what I plan on doing is sending out a URL in the body of the message that contains a unique ID. When they click on that URL, it hits another script on our website which than takes that ID, searches for it in the database and flags that record (and returns a 'Thank you' page.) So, somehow, I need to generate a unique ID for each message send, stick that ID into the database with the corresponding email address that it was just sent to and thenwait. What's the best way to approach this? Should I generate IDs outside of the script, and then query the database for both the email and the ID and construct the message that way? Or should I dynamically generate an ID during the mailing process and shove it in the DB as the message goes out? Suggestions, criticism, comments...welcome. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- 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] FAQ
I've been working on that at http://www.php-faq.com/ Want to help? -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FAQ
Yes, an FAQ would be nice...so would a Manual...Oh wait, there is one, but people just happen to overlook it most of the time :-) I apologize for the sarcasm, but it is Friday! Brian -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:50 PM To: [EMAIL PROTECTED] Cc: PHP List Subject: Re: [PHP] FAQ You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] FAQ
This one has been around for awhile, though I don't think its official. php.faqts.com Robert Zwink http://www.zwink.net/daid.php -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] FAQ
Yep good idea ! Oh and by the books - a couple of opinions wouldn't be bad either ! regards john I've been working on that at http://www.php-faq.com/ Want to help? -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] FAQ
I just don't see what the difference is. This is a PHP mailing list which supposedly gets questions about PHP. Why would the PHP FAQ not be the right place for this? -Rasmus On Fri, 22 Mar 2002, James Taylor wrote: You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] cron with php as apache module
ok for lynx, at the command prompt i get bash: lynx: command not found I've also looked in all the obvious places for php but can't find it. the server is a cobalt raq 3 and i have a virtual host account so i can't recompile php. maybe I'll rewrite it in Perl. Paul Roberts [EMAIL PROTECTED] - Original Message - From: Analysis Solutions [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Friday, March 22, 2002 7:26 PM Subject: Re: [PHP] cron with php as apache module Even if you can't get, or don't want to bother getting, PHP as a standalone CGI type program, you can still execute via crontab. Make a web page that you want to have run, then put something along the lines of: lynx http://localhost/scriptname.php as the command in the crontab file. Do note, you'll likely need to take steps to protect the script from being run by people you don't want touching it. You could use SSL, cookies and REMOTE_ADDR, among other things to accomplish that. --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 -- 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] IMAGE Manipulation
Hey, I'm not sure if anyone ever answered your question, but here's a little function I wrote for something similar to what you want to do and it doesn't require GD be installed. You need to modify the top portion, I just threw that in there to show you how it would work. $pic is the name of the image you want to display. $largestside is the largest width/height you'll want to be shown - So if the max height or width is supposed to only be 200, you'd set it to that, then it scales the other side so that it displays with the correct dimensions. This doesn't ACTUALLY resize the file, it just takes the image and then in HTML it sets the height and width. If you need to actually resize the file you will need GD to be installed. Hope this helps in some way! ?php $pic = image.jpg; $dimensions = resize($pic); echo img src=\$pic\ width=\$dimensions[0]\ height=\$dimensions[1]\ function resize($v_pic) { $largestside = 120; $size = GetImageSize ($v_pic); $width = $size[0]; $height = $size[1]; if ($width == $height) { $dimensions[0] = $largestside; $dimensions[1] = $largestside; } elseif ($width $height) { $divisor = $width / $largestside; $height = $height / $divisor; $dimensions[1] = intval ($height); $dimensions[0] = $largestside; } elseif ($width $height) { $divisor = $height / 120; $width = $width / $divisor; $dimensions[0] = intval ($width); $dimensions[1] = 120; } return $dimensions; } On Saturday 16 March 2002 04:56 am, you wrote: Hi, I'm trying to resize images from a big image to smaller image in dimension and also file size so that when a user upload an image into server, when a browser display the picture it desn't have to be as big. I hope my question make sense. I just don't know where to start. may be somebody could help me, please. thank you for reviewing my email. regards, Dani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sooo close - please help
Hi guys, Thanks for reading this. I desperatley need help with this error. I just finished a huge project thats taken me months, my code works, but the code it uses has an error. The project is due Monday and naturally enough the guy who wrote the code with the error is gone on holiday for the weekend- typical. To be so close to having it finished is sort of sickening.. Does anyone know what the hell Resource id's are, and why they are showing up in my array instead of good ol fashioned numbers? My array goes (correct)into a function looking like this : Array ( [0] = Array ( [0] = -1 [1] = 1 [2] = 1 [3] = 1 ) [1] =Array ( [0] = -2 [1] = 2 [2] = 2 [3] = 10 [4] = 2 ) [2] = Array ( [0] = -3[1] = 3 [2] = 3 [3] = 9 ) ) Array ( [0] = Array ( [0] = -4 [1] = 4 [2]= 4 [3] = 4 ) [1] = Array ( [0] = -5 [1] = 5 [2] = 5 [3] = 5 ) [2] =Array ( [0] = -6 [1] = 6 [2] = 6 [3] = 6 ) ) and comes out looking like this: Array ( [0] = Array ( [0] = Resource id #5 [1] = Resource id #8 [2] = 1[3] = 1 ) [1] = Array ( [0] = Resource id #16 [1] = Resource id #17 [2]= 2 [3] = 10 [4] = 2 [5] = ) [2] = Array ( [0] = Resource id #24 [1]= Resource id #25 [2] = 3 [3] = 9 ) ) Array ( [0] = Array ( [0] =Resource id #35 [1] = Resource id #36 [2] = 4 [3] = 4 ) [1] = Array ([0] = Resource id #44 [1] = Resource id #45 [2] = 5 [3] = 5 ) [2] =Array ( [0] = Resource id #53 [1] = Resource id #54 [2] = 6 [3] = 6 ) ) The Resource id #'s only go into the first two places in the end(third) arrays. Heres the other guys code, Im pretty sure the bug is in monic or prodmono as they're the functions that deal with the elements that are turned into Resource id #'s . I know this is an awful lot to ask,but like I said Im desperate ? function grobmonic($g) { for($c=0;$ccount($g);$c++) { $g[$c]=monic($g[$c]); } return $g; } ? ? function monic($p) { print_r($p); if(gmp_cmp($p[0][0],$p[0][1])!=0) { $temp[0]=$p[0][1]; $temp[1]=$p[0][0]; $p=prodmono($temp,$p); } return $p; } ? ? function prodmono($p1,$p2) { for($a=0;$acount($p2);$a++) { $num=gmp_mul($p1[0],$p2[$a][0]); $den=gmp_mul($p1[1],$p2[$a][1]); $g=gmp_gcd($num,$den); if(gmp_cmp($g,1)!=0) { $num=gmp_divexact($num,$g); $den=gmp_divexact($den,$g); } $res[$a][0]=$num; $res[$a][1]=$den; $k=$i=$j=2; while($icount($p1) $jcount($p2[$a])) { if($p1[$i]$p2[$a][$j]) { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]; $i=$i+2; } elseif($p1[$i]$p2[$a][$j]) { $res[$a][$k]=$p2[$a][$j]; $res[$a][$k+1]=$p2[$a][$j+1]; $j=$j+2; } else { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1]; $i=$i+2; $j=$j+2; } $k=$k+2; } while($icount($p1)) { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]; $i=$i+2; $k=$k+2; } while($jcount($p2[$a])) { $res[$a][$k]=$p2[$a][$j]; $res[$a][$k+1]=$p2[$a][$j+1]; $j=$j+2; $k=$k+2; } } return $res; } ? I'd really appreciate help with this Thanks a million _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron with php as apache module
On Friday, March 22, 2002, at 03:16 PM, Paul Roberts wrote: for lynx, at the command prompt i get bash: lynx: command not found I've also looked in all the obvious places for php but can't find it. the server is a cobalt raq 3 and i have a virtual host account so i can't recompile php. maybe I'll rewrite it in Perl. Try looking for links, it's basically the same thing (but don't tell the links people I said that! :) If not, why not just download and build links, and put it in your ~/bin directory or something? I don't believe it has to be admin-installed, does it? 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] FAQ
The PHP FAQ isn't really specific when it comes to most problems. The 'code' section has like 10 questions, the rest of the FAQ is mainly how to download/compile, what do these PHP errors mean, migration, etc. A FAQ that had answers to questions that people ask on this list on a frequent basis would be more helpful. On Friday 22 March 2002 12:05 pm, you wrote: I just don't see what the difference is. This is a PHP mailing list which supposedly gets questions about PHP. Why would the PHP FAQ not be the right place for this? -Rasmus On Fri, 22 Mar 2002, James Taylor wrote: You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] Maillist
Both php and MySQL support MD5(). Consider this: // Define a secret key $secret_key = ThisIsASecretKey123; // Take the user's current email address $email_address = [EMAIL PROTECTED]; // And create a unique ID $unique_id = md5($email_address.$secret_key); Stick this unique id in the email you send to you user. http://sitename.com/remove.php?unique_id=$unique_id Then when someone sends back the $unique_id by clicking on your link, you can instuct MySQL to disable the record: UPDATE users SET send_email = 'NO' WHERE MD5(email_address.'ThisIsASecretKey123')=$unique_id The $secret_key prevents someone from guessing an email address, MD5 them, and sending it to you script. They would also need to know the secret key to guess correctly. This way you also do not need to store the hash anywhere. You could also update the secret key from time to time for security. What do you think? Robert V. Zwink http://www.zwink.net/daid.php -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 12:38 PM To: PHP-General List Subject: [PHP] Maillist I need to send out several hundred, to several thousand emails out of our database. Now, before everyone starts telling me to use an actual MLM for this, let me explain what I need to do. I need to send a unique ID with each message, in the form of a URL. We want to make unsubscribing as easy as possible for our clients, so what I plan on doing is sending out a URL in the body of the message that contains a unique ID. When they click on that URL, it hits another script on our website which than takes that ID, searches for it in the database and flags that record (and returns a 'Thank you' page.) So, somehow, I need to generate a unique ID for each message send, stick that ID into the database with the corresponding email address that it was just sent to and thenwait. What's the best way to approach this? Should I generate IDs outside of the script, and then query the database for both the email and the ID and construct the message that way? Or should I dynamically generate an ID during the mailing process and shove it in the DB as the message goes out? Suggestions, criticism, comments...welcome. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- 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] FAQ
So add it those. On Fri, 22 Mar 2002, James Taylor wrote: The PHP FAQ isn't really specific when it comes to most problems. The 'code' section has like 10 questions, the rest of the FAQ is mainly how to download/compile, what do these PHP errors mean, migration, etc. A FAQ that had answers to questions that people ask on this list on a frequent basis would be more helpful. On Friday 22 March 2002 12:05 pm, you wrote: I just don't see what the difference is. This is a PHP mailing list which supposedly gets questions about PHP. Why would the PHP FAQ not be the right place for this? -Rasmus On Fri, 22 Mar 2002, James Taylor wrote: You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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] looking for tutorial on XML parsing of attributes...
I'm no expert on the XML functions, but post your code and maybe we can figure out what's wrong. Erik On Thursday, March 21, 2002, at 09:24 PM, Scott Brown wrote: Ok - first off, I've found a few... phpbuilder has a nice number of references. But every one I've tried has ignored attributes... either that, or I dont understand what I'm doing. I retrieve from a distant server an XML response to an inquiry: ?xml version=1.0 ? response version=1.0 requestid=some-request-identifier status code=some-numeric-code descriptionsometext/description /status domain fqdn=fqdn-identidier1 status code=some-numeric-code1 descriptionsometext1/description /status /domain domain fqdn=fqdn-identidier2 status code=some-numeric-code2 descriptionsometext2/description /status /domain domain fqdn=fqdn-identidier3 status code=some-numeric-code3 descriptionsometext3/description /status /domain /response BUT... when I parse this using xml_parse, all I'm getting out is: Name = RESPONSE -- Attributes = Array Name = STATUS -- Attributes = Array Name = DESCRIPTION -- Attributes = Array Name = DOMAIN -- Attributes = Array Name = STATUS -- Attributes = Array Name = DESCRIPTION -- Attributes = Array Name = DOMAIN -- Attributes = Array Name = STATUS -- Attributes = Array Name = DESCRIPTION -- Attributes = Array Name = DOMAIN -- Attributes = Array Name = STATUS -- Attributes = Array Name = DESCRIPTION -- Attributes = Array I cant seem to nail down how to pull the actual attribute values does anyone know of a tutorial that's going to teach me how to pull those attributes of fqdn and code? I've figured out how to get the DESCRIPTION... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 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] Hi!
Hi all! I'm quite new to PHP so I have two questions: How is possible to click on an image and run a php function? Also how is possible to pass some php vars to javascript vars? Makis Thessaloniki Greece -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sooo close - please help
It looks like gmp_divexact returns a resource which does not appear to be what you want. You may have to access the result somehow to see if it is giving you what you expect. Charles Killmer -- Original Message -- From: brendan conroy [EMAIL PROTECTED] Date: Fri, 22 Mar 2002 20:18:10 + Hi guys, Thanks for reading this. I desperatley need help with this error. I just finished a huge project thats taken me months, my code works, but the code it uses has an error. The project is due Monday and naturally enough the guy who wrote the code with the error is gone on holiday for the weekend- typical. To be so close to having it finished is sort of sickening.. Does anyone know what the hell Resource id's are, and why they are showing up in my array instead of good ol fashioned numbers? My array goes (correct)into a function looking like this : Array ( [0] = Array ( [0] = -1 [1] = 1 [2] = 1 [3] = 1 ) [1] =Array ( [0] = -2 [1] = 2 [2] = 2 [3] = 10 [4] = 2 ) [2] = Array ( [0] = -3[1] = 3 [2] = 3 [3] = 9 ) ) Array ( [0] = Array ( [0] = -4 [1] = 4 [2]= 4 [3] = 4 ) [1] = Array ( [0] = -5 [1] = 5 [2] = 5 [3] = 5 ) [2] =Array ( [0] = -6 [1] = 6 [2] = 6 [3] = 6 ) ) and comes out looking like this: Array ( [0] = Array ( [0] = Resource id #5 [1] = Resource id #8 [2] = 1[3] = 1 ) [1] = Array ( [0] = Resource id #16 [1] = Resource id #17 [2]= 2 [3] = 10 [4] = 2 [5] = ) [2] = Array ( [0] = Resource id #24 [1]= Resource id #25 [2] = 3 [3] = 9 ) ) Array ( [0] = Array ( [0] =Resource id #35 [1] = Resource id #36 [2] = 4 [3] = 4 ) [1] = Array ([0] = Resource id #44 [1] = Resource id #45 [2] = 5 [3] = 5 ) [2] =Array ( [0] = Resource id #53 [1] = Resource id #54 [2] = 6 [3] = 6 ) ) The Resource id #'s only go into the first two places in the end(third) arrays. Heres the other guys code, Im pretty sure the bug is in monic or prodmono as they're the functions that deal with the elements that are turned into Resource id #'s . I know this is an awful lot to ask,but like I said Im desperate ? function grobmonic($g) { for($c=0;$ccount($g);$c++) { $g[$c]=monic($g[$c]); } return $g; } ? ? function monic($p) { print_r($p); if(gmp_cmp($p[0][0],$p[0][1])!=0) { $temp[0]=$p[0][1]; $temp[1]=$p[0][0]; $p=prodmono($temp,$p); } return $p; } ? ? function prodmono($p1,$p2) { for($a=0;$acount($p2);$a++) { $num=gmp_mul($p1[0],$p2[$a][0]); $den=gmp_mul($p1[1],$p2[$a][1]); $g=gmp_gcd($num,$den); if(gmp_cmp($g,1)!=0) { $num=gmp_divexact($num,$g); $den=gmp_divexact($den,$g); } $res[$a][0]=$num; $res[$a][1]=$den; $k=$i=$j=2; while($icount($p1) $jcount($p2[$a])) { if($p1[$i]$p2[$a][$j]) { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]; $i=$i+2; } elseif($p1[$i]$p2[$a][$j]) { $res[$a][$k]=$p2[$a][$j]; $res[$a][$k+1]=$p2[$a][$j+1]; $j=$j+2; } else { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1]; $i=$i+2; $j=$j+2; } $k=$k+2; } while($icount($p1)) { $res[$a][$k]=$p1[$i]; $res[$a][$k+1]=$p1[$i+1]; $i=$i+2; $k=$k+2; } while($jcount($p2[$a])) { $res[$a][$k]=$p2[$a][$j]; $res[$a][$k+1]=$p2[$a][$j+1]; $j=$j+2; $k=$k+2; } } return $res; } ? I'd really appreciate help with this Thanks a million _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --
RE: [PHP] Re: Delete Confirmation
Do that with JavaScript Using JavaScript to show an OK/Cancel confirmation window http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1364 Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Daniel Negron/KBE [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 21, 2002 6:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Delete Confirmation Actually I have that working fine. I was just looking to add to the code a confirmation box of some sort. either typing in YES or clicking a YES NO BOX. Thanks for your post. **DAN** Matt Wallace phpnews@ender To: [EMAIL PROTECTED] .comcc: Subject: [PHP] Re: Delete Confirmation 03/20/2002 11:03 AM Daniel Negron/Kbe wrote: Does anyone have examples of record deletions from php to mysql Could you be more specific? $sql = DELETE from tablename where tablename_idx = $index; $result = mysql_query($sql); would be a very simple example of deleting a record from a hypothetical database with php, but I'm not sure if that's what you were really asking. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron with php as apache module
Are you specifying the full path in the crontab? If the raq 3 does not have lynx, you might be able to use wget. I'm not too familiar with wget, you may want to read the manpage. Here's how I run PHP scripts from cron, when PHP is compiled as a DSO: 0 8 * * * TERM=xterm; export TERM; /usr/bin/lynx -source http://your.server.address/phpscript.php; 1/dev/null 21 You can leave off the stdin and stdout redirects if you want an email that the script was run. HTH.. - Bruce Paul Roberts wrote: ok for lynx, at the command prompt i get bash: lynx: command not found I've also looked in all the obvious places for php but can't find it. the server is a cobalt raq 3 and i have a virtual host account so i can't recompile php. maybe I'll rewrite it in Perl. Paul Roberts [EMAIL PROTECTED] - Original Message - From: Analysis Solutions [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Friday, March 22, 2002 7:26 PM Subject: Re: [PHP] cron with php as apache module Even if you can't get, or don't want to bother getting, PHP as a standalone CGI type program, you can still execute via crontab. Make a web page that you want to have run, then put something along the lines of: lynx http://localhost/scriptname.php as the command in the crontab file. Do note, you'll likely need to take steps to protect the script from being run by people you don't want touching it. You could use SSL, cookies and REMOTE_ADDR, among other things to accomplish that. --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 -- 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] included files not reread by php when i edit the files
While editing pages, for some reason (default setting? / configuration problem?) the changes i make in included files (with sometimes quite some nesting) are not recognized when reloading a page. So i see errors that belong to the previous version. What setting could do this? I'm quite sure the browser is not caching the page. Win98 + 'foxserv', that is: apache, mysql. php, zend. Using: Postnuke 0.7.1 with sessions (it did not happen before the sessions, but cannot imagine the sessions do this.). I would suspect zend but it also happened with the normal php 4.06. cheers, Chris -- ! please check my email address ! ! only my email [EMAIL PROTECTED] works ! ! email [EMAIL PROTECTED] is a black hole since januari 2002 ! Chris Hayes - Droef 35 - Wageningen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hi!
How is possible to click on an image and run a php function? A href=./thescript.phpIMG src=image.jpg/A Also how is possible to pass some php vars to javascript vars? Can't do it directly. JavaScript is client-side. PHP is server-side. As you execute a PHP script, it will create the values for the JavaScript source that PHP is creating. -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:44 PM To: [EMAIL PROTECTED] Subject: [PHP] Hi! Hi all! I'm quite new to PHP so I have two questions: How is possible to click on an image and run a php function? Also how is possible to pass some php vars to javascript vars? Makis Thessaloniki Greece -- 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] T1lib configure broken?
Red Hat 7.2 t1lib installed in /usr/local I build --with-t1lib=/usr/local build fails saying it can't find /usr/lib/.libs/libt1.so Well, duh! It's in /usr/local/lib (as I specified in config w/ the =/usr/local flag) Anyway- that configure option worked perfect in php-4.0.5 What broke 4.1.2 from beig able to find my t1lib install? How can I fix it? I need t1lib- so I can't upgrade till I find how to fix. Please cc me in the reply (don't just reply to list) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron with php as apache module
wget http://your.server.address/phpscript.php did the trick thanks Paul Roberts [EMAIL PROTECTED] - Original Message - From: Bruce S. Garlock [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 8:55 PM Subject: Re: [PHP] cron with php as apache module Are you specifying the full path in the crontab? If the raq 3 does not have lynx, you might be able to use wget. I'm not too familiar with wget, you may want to read the manpage. Here's how I run PHP scripts from cron, when PHP is compiled as a DSO: 0 8 * * * TERM=xterm; export TERM; /usr/bin/lynx -source http://your.server.address/phpscript.php; 1/dev/null 21 You can leave off the stdin and stdout redirects if you want an email that the script was run. HTH.. - Bruce Paul Roberts wrote: ok for lynx, at the command prompt i get bash: lynx: command not found I've also looked in all the obvious places for php but can't find it. the server is a cobalt raq 3 and i have a virtual host account so i can't recompile php. maybe I'll rewrite it in Perl. Paul Roberts [EMAIL PROTECTED] - Original Message - From: Analysis Solutions [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Friday, March 22, 2002 7:26 PM Subject: Re: [PHP] cron with php as apache module Even if you can't get, or don't want to bother getting, PHP as a standalone CGI type program, you can still execute via crontab. Make a web page that you want to have run, then put something along the lines of: lynx http://localhost/scriptname.php as the command in the crontab file. Do note, you'll likely need to take steps to protect the script from being run by people you don't want touching it. You could use SSL, cookies and REMOTE_ADDR, among other things to accomplish that. --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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] included files not reread by php when i edit the files
how about giving an example of the error message(s)... - Original Message - From: Chris [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 22, 2002 12:59 PM Subject: [PHP] included files not reread by php when i edit the files While editing pages, for some reason (default setting? / configuration problem?) the changes i make in included files (with sometimes quite some nesting) are not recognized when reloading a page. So i see errors that belong to the previous version. What setting could do this? I'm quite sure the browser is not caching the page. Win98 + 'foxserv', that is: apache, mysql. php, zend. Using: Postnuke 0.7.1 with sessions (it did not happen before the sessions, but cannot imagine the sessions do this.). I would suspect zend but it also happened with the normal php 4.06. cheers, Chris -- ! please check my email address ! ! only my email [EMAIL PROTECTED] works ! ! email [EMAIL PROTECTED] is a black hole since januari 2002 ! Chris Hayes - Droef 35 - Wageningen -- 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] Jazz problem
template page at http://www.isbliss.co.nz/beta/mainpages/template.html disregard any linked pages. This will be the template for all the other pages. 1. Could you please tell me why when you hover off or anywhere on this page the hair salon button is highlighted. think I have done something to the: !-- #BeginEditable runembase -- section. 2. Also We want a background image for each flyover, will I have to create a separate style for each i.e. .flyoutable2 /.flyoutable2 p /.flyoutable2 a:active etc? 3. I get no Background image in NN4.7 4. Also since this page will be the template for the other pages, when I go to make it say the Face Body .html page trig two...how do I make it highlight that button. so you know that you are on that page. Cheers S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Automatic Language Detection
Hey! I want to have my website on English, Spanish and Norwegian so I want a PHP script that sends the user to the page on their language. I've seen some portals doing some PHP things, and sending the user to a 'fancy' URL with the Languange that their Borwser/OS is on. Can someone please tell me how it's done? Thanks for your support... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A Language Script?
Hey! I want to have my website on English, Spanish and Norwegian so I want to have a PHP script that sends the user to the page on their language. I've seen some portals doing some PHP things, and sending the user to a 'fancy' URL with the Languange that their Borwser/OS is on. Can someone please tell me how it's done? Thanks for your support... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A Language Script?
$HTTP_ACCEPT_LANGUAGE -Original Message- From: ::: rObEr2 ::: [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:59 PM To: [EMAIL PROTECTED] Subject: [PHP] A Language Script? Hey! I want to have my website on English, Spanish and Norwegian so I want to have a PHP script that sends the user to the page on their language. I've seen some portals doing some PHP things, and sending the user to a 'fancy' URL with the Languange that their Borwser/OS is on. Can someone please tell me how it's done? Thanks for your support... -- 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] GOOD PRACTICE (was: RE: [PHP] A Language Script?)
I've been watching the lists from time to time and I see a lot of requests for information like this floating around. I wonder if people know of the phpinfo() command... in my experience it's been an invaluable tool to help with little issues that pop up with 'where do I find out XXX about XXX' make a 3 line php script called info.php containing: ?php phpinfo(); ? And you then find yourself amongst a wealth of useful information. I apologize if this sounds patronizing - it most certainly is not delivered in such a tone... I really do think that people just don't know about this... Or they are too lazy to check it first... (hopefully more of the former rather then the later) Ok I'm done ranting.. Cheers everyone! -Original Message- From: ::: rObEr2 ::: [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:59 PM To: [EMAIL PROTECTED] Subject: [PHP] A Language Script? Hey! I want to have my website on English, Spanish and Norwegian so I want to have a PHP script that sends the user to the page on their language. I've seen some portals doing some PHP things, and sending the user to a 'fancy' URL with the Languange that their Borwser/OS is on. Can someone please tell me how it's done? Thanks for your support... -- 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] FAQ
Too often novices are expected to know how to find this information by mental telepathy because they either don't know the keywords to search for or don't realize that certain common resources exist. If the list administrators would simply compile a short email containing FAQ and RESOURCE links then have the system send it to php-general once a week, then they could reduce a great deal of these repetitious questions. IMHO, of course. -Kevin -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:25 PM To: Rasmus Lerdorf Cc: PHP List Subject: Re: [PHP] FAQ The PHP FAQ isn't really specific when it comes to most problems. The 'code' section has like 10 questions, the rest of the FAQ is mainly how to download/compile, what do these PHP errors mean, migration, etc. A FAQ that had answers to questions that people ask on this list on a frequent basis would be more helpful. On Friday 22 March 2002 12:05 pm, you wrote: I just don't see what the difference is. This is a PHP mailing list which supposedly gets questions about PHP. Why would the PHP FAQ not be the right place for this? -Rasmus On Fri, 22 Mar 2002, James Taylor wrote: You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FAQ
Hi, New poster, no need to flame unnecessarily... Following up on James' original posting, I took 2000 or so message headers from the archive and extracted (Perl, sorry) keywords for about 50% of the postings. This gave the following metrics on problems: 13 table 65 apache 70 array 17 authentication 19 browser 13 cgi 39 cookie 35 database 9 dates 2 debug 9 editor 7 eval 6 fields 140 file 25 include 33 install 9 ip address 14 javascript 4 jpg 15 ldap 12 login 91 mail 146 mysql 11 oracle 20 pdf 2 PostgreSQL 15 Regex 7 rpm 8 security 93 session 11 socket 50 upload 29 variables 14 while 7 win32 37 xml 10 xsl It seems like the hotspots are: Database / Mysql File handling Apache Arrays XML When James and I talked off list, he recommended: You're probably also going to be dealing with global built in vars, $_SESSION, $_POST, $_GET and older vars quite a bit as well. I'm willing to grovel through old messages and write this up. If anyone has any other common topics that I'm not finding, please email them to me. When its done, and useful, we can see about getting it auto posted (which is a _good_ idea). Thanks Scott J. Scott Johnson Virtual: * * * * * * * * * * * * * * * * * * * * * * * * * * [EMAIL PROTECTED] http://www.fuzzygroup.com/ Yahoo IM: fuzzygroup -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 5:24 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] FAQ Too often novices are expected to know how to find this information by mental telepathy because they either don't know the keywords to search for or don't realize that certain common resources exist. If the list administrators would simply compile a short email containing FAQ and RESOURCE links then have the system send it to php-general once a week, then they could reduce a great deal of these repetitious questions. IMHO, of course. -Kevin -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:25 PM To: Rasmus Lerdorf Cc: PHP List Subject: Re: [PHP] FAQ The PHP FAQ isn't really specific when it comes to most problems. The 'code' section has like 10 questions, the rest of the FAQ is mainly how to download/compile, what do these PHP errors mean, migration, etc. A FAQ that had answers to questions that people ask on this list on a frequent basis would be more helpful. On Friday 22 March 2002 12:05 pm, you wrote: I just don't see what the difference is. This is a PHP mailing list which supposedly gets questions about PHP. Why would the PHP FAQ not be the right place for this? -Rasmus On Fri, 22 Mar 2002, James Taylor wrote: You are correct sir. The purpose of the FAQ would be so that, like I said, similar questions that pop up say, once a week, could be answered in the FAQ instead of on the list - That way I won't get 300 messages a day :) On Friday 22 March 2002 11:36 am, you wrote: Despite what Rasmus just said, I think that you are saying a PHP Mailing List faq based on the q's that the mailing list gets, not the general PHP faq. Scott -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: [PHP] FAQ Has anyone given any thought to possibly maintaining a FAQ containing the answers to the most commonly asked PHP questions on this list? I notice duplicates roll through every couple of days, and it would probably be a really nice PHP resource. Or, does one already exist? Ha. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Drawing graphs - opinions
Hi, I see there a number of PHP scripts/libraries out there for the purpose of graphing data. Which one is considered to be the best, most powerful / easiest to use? I need to plot X/Y graphs for some data sets with vertical error margin lines going along the y-axis. Any recommendations? Cheers, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Database Development Price Inquiry?
Yeah, I've ran into a few of those customers. It's even worst when you find one that doesn't know what they want, yet have many, sometimes conflicting, restrictions. Thanks, Miles! -john On Fri, 22 Mar 2002, Miles Thompson wrote: It depends on the project. I generally charge $50/hr and bill on a two week cycle. Customers invariably want estimates, and I provide them, then warn when the requests for extra functionality start eating up the estimate. Generally they spring for the extra $$. Worst customers? The ones who don't know what they want, or give the vaguest direction, and then you iterate from there. Those bills are usually astronomical, in the sense that what they ended up with could have been reached with a little more work and commitment at their end. Regards - Miles Thompson At 10:24 PM 3/21/2002 -0800, Robin Chen wrote: We calculate the charge by $75-$150 per hour depending on complexity of the project, then quote customer the final price. On small projects, $5000, its usually half before project, and half after project. For project $5000, it's usually 30% up front, 30% when we have major features completed, 30% when delivered, last 10% when finalized. On even large projects $15k+, we usually go by phases. Robin [-^-!-%- wrote: Hello everyone, I'm in the process of revising my db development prices, and was wondering what the best practices were. I want to keep my prices low, but I often feel like I'm not charging close to what I should be charging. 1) What is the going rate for Database Development (MySQL+PHP or any other combo)? 2) What (or how) do you charge for MySQL+PHP database applications? 3) What do you factor into your pricing? We currently package our prices by the project. Example, we would charge one flat fee for an online database application. This would include everything from start to finish. Sometimes this works out, but other times it gets painful and tedious. I often feel like I'm not charging as much as I should be. 4) What is the best practice for db development pricing? Flat fee or hourly based? Do you charge based on the number of hours spent (anticipated) or by the project complexity and/or size? 5) Do you charge in stages or upon completion? For example, do you charge after the planning phase, development phase, etc. Or, after the project is complete? I'm especially interested in hearing from the West Coast (USA) developers. Any feedback would be greatly appreciated. Thanks. -john -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Drawing graphs - opinions
Lee P Reilly wrote: with vertical error margin lines going along the y-axis. Any recommendations? Ahem, the X axis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A Language Script?
http://vancouver-webpages.com/multilingual/ccodes.txt http://vancouver-webpages.com/multilingual/iso639a.txt This seems like useful information for this purpose... and so I've decided to forward it to the list as well... if this is considered spamming please let me know so that I can avoid it in the future. Thanks Cheers! -Original Message- From: ...:: Rober2 ::... [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 2:25 PM To: Demitrious S. Kelly Subject: Re: [PHP] A Language Script? Thanks!! BTW: do you know about any site that provides the e.g. en-us tag but for other languages? I've tried the W3 but no result... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Maillist
Robert V. Zwink wrote: Then when someone sends back the $unique_id by clicking on your link, you can instuct MySQL to disable the record: UPDATE users SET send_email = 'NO' WHERE MD5(email_address.'ThisIsASecretKey123')=$unique_id This works...with a small change (or is it a fix?): UPDATE users SET send_email = 'NO' WHERE MD5(concat(email_address,'ThisIsASecretKey123'))='$unique_id' Your example generates a syntax error. Thanks for the suggestion! PS: Alternatively, I just stuck '$secret_key' in the query line, this way I only have to change it in one location, and not have it hardcoded anywhere else. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable problem
I have a variable name in a print END and then some text after it. The thing is, php thinks that the text is part of the variable name, which makes the variable, and the text after it, not show up. But, if I put a space, it makes my html not work right. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Variable problem
show your code -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 5:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable problem I have a variable name in a print END and then some text after it. The thing is, php thinks that the text is part of the variable name, which makes the variable, and the text after it, not show up. But, if I put a space, it makes my html not work right. Any ideas? -- 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