Re: [PHP] Server Setup
I have never used a binary version (rpm or tar) as I use slackware. Both PHP and Mysql have been recently added to the distribution.So I have been using src all the time. U'll certainly have some performance gain by compiling the src. But the default Redhat 7.1's php distribution is very good. It is ready out of box for every thing. GD, Mysql, IMAP etc. You don't just have to configure anything. /Chandu I am working on setting up a Red Hat Linux Web Server. Is there a benefit to installing PHP/MySQL/Apache by compiling them from source vs. installing these using RedHat's Binary/RPM distributions? What are the pro's and con's of these two methods? Can anybody suggest any pointers considering stability, efficiency, and easy upgrades? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] The future of PHP or my 2 cents
Although Fred's comments appear rhetorical, the suggestion has some merit. Anyone have a feel for how many PHP devotees are out there? How many people subscribe to this list? Do these numbers make it feasible to ask for a $1-10 contribution? How about $0.02 from each of the 7 million domains running PHP? There, that was my 2 cents worth. Or was that a 2 bit opinion? (I'll leave the next joke to the group) Also, I'll be proactive. Send all monies to me ;) Matthew A. Schneider - Original Message - From: Frederick L. Steinkopf [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 5:55 AM Subject: Re: [PHP] The future of PHP Manuel, Rather than whining about the future of PHP, why don't you be proactive and take on the goal of raising the $100,000 for the project? Fred Steinkopf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Checksum Question
no idea! try using md5() instead, Rm [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In php cr32 will create a checksum number, 10 digits, in linux cksum will create one of 9 digits and sum linux will generate a 5 digit number. We use these numbers in a db field to determine if a file has changed and needs to be reviewed, redone, whatever...rather than keep the orginal file on hand. Given the task at hand and given I'm confused about why there are different length numbers, is there one particular option that allows for better change checking..or is it simply a matter of longer is better...I mean the longer the checksum number the better. rm __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: install error
from this line, i guess that Apache is not installed? apxs:Warning: /usr/bin/httpd not found or not executable Joseph Bannon [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What does this mean? make[1]: Entering directory `/home/php-4.0.6' /home/php-4.0.6/build/shtool mkdir -p /usr/lib/apache /usr/sbin/apxs -S LIBEXECDIR=/usr/lib/apache -i -a -n php4 libs/libphp4.so apxs:Warning: /usr/bin/httpd not found or not executable apxs:Warning: Continuing anyway... apxs:Warning: No shared object support for Apache apxs:Warning: available under your platform. Make sure apxs:Warning: the Apache module mod_so is compiled into apxs:Warning: your server binary `/usr/bin/httpd'. apsx:Warning: Continuing anyway... apxs:Error: Unknown option: S Usage: apxs -g -n modname apxs -q query ... apxs -c [-o dsofile] [-D name[=value]] [-I incdir] [-L libdir] [-l libname] [-Wc,flags] [-Wl,flags] files ... apxs -i [-a] [-A] [-n modname] dsofile ... make[1]: *** [install-sapi] Error 1 make[1]: Leaving directory `/home/php-4.0.6' make: *** [install-recursive] Error 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Send mail via exact account
Hi, I want to send mail via exact account ( i.e. [EMAIL PROTECTED] ). can I do it with php ? Thanks Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Send mail via exact account
I want to send mail via exact account ( i.e. [EMAIL PROTECTED] ). can I do it with php ? Yes, in future please check the PHP manual before asking, as the manual entry for mail() specifically mentions this purpose. mail([EMAIL PROTECTED], subject, mail, From: [EMAIL PROTECTED]\nReply-to: [EMAIL PROTECTED]\n); -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT Work now, freak later! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mysql database has gone away
There is a Mysql error that is driving me mad. My ISP won't claim resposibility for it and it tells me it is a scrpting error. I don't agree with them. The error number is 2006, and it seems to restart the database every now and then. Please advice me as to what may be causing this problem. The error message is sent before the headers and it generates an error that stops script execution. Maybe I can trap the error so the script can continue. Pleas help. -- Ivan R. Quintero E.* (507)228-3477 Aptdo 1263 * (507)228-9105 Balboa, Ancon * 612-1103 Republic of Panama * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] If i use preg_match() how can i preg_match next?
Hello. If i have this string: 1 2 3 4 5 6 7 no more! and this regular expression: ([0-9]+) now how can i run preg_match to get result by result until no results are returned? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: install error
it usually means the apache httpd wasn't found in /usr/bin Some distributions throw things in wierd places do a 'locate httpd' (quicker) or 'find \ -name httpd' (longer) to find out where its situated then configure paths accordingly. Remember if you are going to use dso's apache must be compiled to use them that way. Lawrence -Original Message- From: _lallous [mailto:[EMAIL PROTECTED]] Sent: August 30, 2001 4:19 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: install error from this line, i guess that Apache is not installed? apxs:Warning: /usr/bin/httpd not found or not executable Joseph Bannon [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What does this mean? make[1]: Entering directory `/home/php-4.0.6' /home/php-4.0.6/build/shtool mkdir -p /usr/lib/apache /usr/sbin/apxs -S LIBEXECDIR=/usr/lib/apache -i -a -n php4 libs/libphp4.so apxs:Warning: /usr/bin/httpd not found or not executable apxs:Warning: Continuing anyway... apxs:Warning: No shared object support for Apache apxs:Warning: available under your platform. Make sure apxs:Warning: the Apache module mod_so is compiled into apxs:Warning: your server binary `/usr/bin/httpd'. apsx:Warning: Continuing anyway... apxs:Error: Unknown option: S Usage: apxs -g -n modname apxs -q query ... apxs -c [-o dsofile] [-D name[=value]] [-I incdir] [-L libdir] [-l libname] [-Wc,flags] [-Wl,flags] files ... apxs -i [-a] [-A] [-n modname] dsofile ... make[1]: *** [install-sapi] Error 1 make[1]: Leaving directory `/home/php-4.0.6' make: *** [install-recursive] Error 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] The future of PHP or my 2 cents
In article 010001c1311e$d86ebb40$[EMAIL PROTECTED], [EMAIL PROTECTED] (Matthew A. Schneider) wrote: Rather than whining about the future of PHP, why don't you be proactive and take on the goal of raising the $100,000 for the project? Although Fred's comments appear rhetorical, the suggestion has some merit. Anyone have a feel for how many PHP devotees are out there? How many people subscribe to this list? Do these numbers make it feasible to ask for a $1-10 contribution? How about $0.02 from each of the 7 million domains running PHP? To continue this (speculative) train of thought: Would it be feasible to collect some kind of contest entry fee, either instead of or in addition to donations toward the prize? If maximum participation were the goal (and I'm not sure that it would/should be, but for the sake of argument...), it might be a way to get entrants intestered in recruiting more entrants by reminding them that more developers in the contest, the bigger the reward to be won by one of them... As for collecting funds for such an endeavor, FWIW I (and presumably others) would be more likely to give if it were through the PHP.net group or Zend than through any third-party. At least then if the contest were to fall through, I'm confident that the money would still be well-spent on furthering PHP development/marketing. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: If i use preg_match() how can i preg_match next?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (_lallous) wrote: If i have this string: 1 2 3 4 5 6 7 no more! and this regular expression: ([0-9]+) now how can i run preg_match to get result by result until no results are returned? http://php.net/preg_match_all -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] 2nd Pass of array empty
I have some code which loops through a n array using a for loop. This works fine but if I try to loop through the array again in the same script the array seems to be empty (i,e, the loop douse not do any interations). Do I need to reset the array pointer at the begining? Is there something else I need to do? Regards, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Crashing IIS?
I've developed an intranet running on win2k adv server/IIS and it sets lots of cookies... it hasn't crashed until now. But then again, microsoft's random crash feature which they implement into all of their programs might have just gotten hold of you ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] vanishing variable
I've gotten the year from the following code on page one: date_array=getdate(); / / today's date info foreach ($date_array as $key=$val) { $key=$val; } $current_year=$date_array[year]; I've used the $current_year variable throughout a form on the first page and the variable is picked up without problem everywhere it's used. I've brought in stored data to display on this same page using $php_self in a select box, and the $current_year variable still works fine. Finally, I've got another select box which calls a new page using get (I tried post, and it didn't work either), and the $current_year disappears never to be seen again. Perplexing, no?
Re: [PHP] Re: if statement and imageline()
Richard, I let this problem sit for awhile, did some other work, and looked at it again. This time, I printed out all the values and found that some values =INF. No wonder it died. Since I'm making a log-normal chart, occasionally I'm trying to calculate the log of zero--an infinitely small number which can't be calculated! I did try the error_log statement but my ISP puked on the syntax. - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: Hugh Danaher [EMAIL PROTECTED] Sent: Wednesday, August 22, 2001 1:21 PM Subject: Re: [PHP] Re: if statement and imageline() No. 150 lines is chump change. See if you can get ImageLine to work in a simpler fashion. Also, try adding: error_log(ImageLine: $start_x $start_y $x $y, E_NOTICE); And then look at your Apache logs. You'll at least be able to see if the program is getting there while it tries to draw stuff. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Hugh Danaher [EMAIL PROTECTED] To: Richard Lynch [EMAIL PROTECTED] Cc: Php-General [EMAIL PROTECTED] Sent: Wednesday, August 22, 2001 3:50 AM Subject: Re: [PHP] Re: if statement and imageline() Richard, No, the code was cut from the php file and displayed as is in my e-mail. I also tried to see if I could declare the two suspect variables in another IF() statement before the IF() statement that's fouling the execution of the .jpg construct, but no luck there too. Could I just be overburdening the program? I've got a lot of code (about 150 lines) in the .jpg construct. Cheers, Hugh - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: Hugh Danaher [EMAIL PROTECTED] Sent: Wednesday, August 22, 2001 12:18 AM Subject: Re: [PHP] Re: if statement and imageline() Hmm. Are you sure you didn't have: if ($year = $startyear) *THAT* would assign 1996 over and over to $year, after the ++, so it would never move forward, and the script would time out... Not sure what else could be wrong, if it's *JUST* the if part you are adding... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Hugh Danaher [EMAIL PROTECTED] To: Richard Lynch [EMAIL PROTECTED] Cc: Php-General [EMAIL PROTECTED] Sent: Wednesday, August 22, 2001 1:05 AM Subject: Re: [PHP] Re: if statement and imageline() Richard, Without the code below, I get a good .jpg file and it displays nicely. But, with the IF statement in, I get a time out error message Execute time exceeds 30 seconds... I think it is because two of the variables are declared after the IF statement, even though they aren't being used on the first loop. I'll try to declare them before the FOR loop and see if that works. As you might tell from my code, the only software course I ever had, was in college 20 years ago, and it was in BASIC language (with line numbers!). However, I find php easy to work with, and have done some amazing things with it in the last 2 months. With your help and the help of others, I'll certainly make progress. Thanks, Hugh - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 21, 2001 5:16 PM Subject: [PHP] Re: if statement and imageline() What are you getting? An image at all? Broken image? Try getting rid of the header(image/jpeg) or whatever, and see if you have some error message. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Hugh Danaher [EMAIL PROTECTED] Newsgroups: php.general To: Php-General [EMAIL PROTECTED] Sent: Tuesday, August 21, 2001 1:16 AM Subject: if statement and imageline() help, I am trying to set up a .jpg file to graph the earnings per year of a company. I can generate a log-normal graph, can get it to display the earnings per year as circles on the graph, but I can't get the if () statement to work. I know I am setting two of the variables in the if statement after the if statement executes once, but these variables won't be used until after the for () loops once, and therefore should be available for use in imageline() on the second loop
[PHP] session and global
Hi folks I just wonder as I saw someone useing session with global and some don't. What is the reason to use session together with global? Like this: session_start(); global $test session_register('test'); I look up in manual using keyword global, but could not find anything near this. Jack
Re: [PHP] 2nd Pass of array empty
On Thu, 30 Aug 2001 17:33, [EMAIL PROTECTED] wrote: I have some code which loops through a n array using a for loop. This works fine but if I try to loop through the array again in the same script the array seems to be empty (i,e, the loop douse not do any interations). Do I need to reset the array pointer at the begining? Is there something else I need to do? Regards, Ben Reset the array pointer before the second any any subsequent iteration. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA If cats have kittens, do bats have bittens? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] AW: HELP : How to suggest a download-filename for IE on MAC
Thanks David That behavior is the best i could acomplish be header() also. But i found another way : 1. I link to a nonexiting directroy: http://www.mydomain.de/pdfs/test.pdf 2. i catch 404s by htaccess redirection 3. i parse the REDIRECT_URI if the request is for a pdf in that vitual directory 4. if true and the file exists i include the downloadscript, which checks for authorisation 5. else raise either authentication of 404 6. works on all browsers thanks for your suggestions Sebastian -Ursprungliche Nachricht- Von: David Minor [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 30. August 2001 07:11 An: Sebastian Stadtlich Betreff: re: HELP : How to suggest a download-filename for IE on MAC I just submitted my results from a download script test. You can see the full results in the archive search force download. The short version is: IE for Mac users must click and hold the link until the contextual menu appears and choose the option Download Link to Disk. This is not what I was wanting either, but alas ... I put up a javascript pop up window with instructions for IE for mac users. Not the best news, but hope this helps. David Minor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sessions in classes dosn't work!?
How come that I cannot store a varible in the session when I do this from within another object? This is my code: ?php session_start(); class MyClass { function MyClass($state) { if($state == page2) { print([ . $foo . ]); session_destroy(); } else { session_register(foo); $foo = Hello World!; print(a href=\?state=page2\Click here/a\n); } } } new MyClass($state); ? /watson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sessions in classes dosn't work!?
This is because $foo is local to the member functions of the class. declare global $foo at the start of every function. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: Thomas Watson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 12:10 PM Subject: [PHP] Sessions in classes dosn't work!? How come that I cannot store a varible in the session when I do this from within another object? This is my code: ?php session_start(); class MyClass { function MyClass($state) { if($state == page2) { print([ . $foo . ]); session_destroy(); } else { session_register(foo); $foo = Hello World!; print(a href=\?state=page2\Click here/a\n); } } } new MyClass($state); ? /watson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session and global
if global $var; is called from within a function and $var exist outside the nested function then the $var will be available to the function. example $var = hello world; function say_hello() { global $var; echo $var; } will echo hello world while $var = hello world; function say_hello() { echo $var; } wont echo hello world -- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 http://sites.canaan.co.il -- - Original Message - From: jacky [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 11:40 AM Subject: [PHP] session and global Hi folks I just wonder as I saw someone useing session with global and some don't. What is the reason to use session together with global? Like this: session_start(); global $test session_register('test'); I look up in manual using keyword global, but could not find anything near this. Jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GUI for PHP
Although. PHAKT is an addon to Macromedia Ultradev that handles PHP in a GUI environment. If you do a search for PHAKT on http://askhiran.com you should find the relevant links. As with most GUI scripting tools, a good deal more code is written than is needed and I would have to agree with Matthew that hand coding is the way forward. I use PrimalScript. Its pretty nifty and you can store your own code snippets to speed up coding. Plus it has intellisense style help while writing your code which comes in handy. Hope that helps Nic Skitt http://ultradevfaq.com Matthew A. Schneider [EMAIL PROTECTED] wrote in message 00a001c13106$a13bcc20$[EMAIL PROTECTED]">news:00a001c13106$a13bcc20$[EMAIL PROTECTED]... As someone who has little programming experience I'd have to say jump right in and forget the GUI (I'm not aware of any IDE for PHP). PHP is pretty easy (to learn, becoming a master is something else I suspect) and there is always outstanding support either by reading this newsgroup's archive or posting a question if you don't find an answer. I've been dabbling for close to a year now and have yet had a need to post any questions. I have invariably found the solution after a quick search. There are a number of good books as well. For the novice (I speak with some authority here) try Julie C. Meloni's PHP Essentials. If you're looking for an editor try PHPEd, http://www.soysal.com/PHPEd/index.php3 And listen to what the experts (not me) have to say. Good luck, Matt - Original Message - From: Eric [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 6:12 PM Subject: [PHP] GUI for PHP Does anyone have any suggestions for GUI PHP programming software. I am new the PHP and would like to make the learning experience as quick and simple as possible. Thanks for your help, Eric JT Harlow www.sisgrate.com Phone: 360 891 6991 Fax: 360 891 6865 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: 2nd Pass of array empty
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Ben Edwards) wrote: I have some code which loops through a n array using a for loop. This works fine but if I try to loop through the array again in the same script the array seems to be empty (i,e, the loop douse not do any interations). Do I need to reset the array pointer at the begining? Is there something else I need to do? Yes, a reset sounds like the likely solution. http://php.net/reset If that's not it, then repost with a code example. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: If i use preg_match() how can i preg_match next?
I don't really get it! in preg_match_all() the $matches array what will it contain? i mean $matches[0] is the whole match, and every $match[0][1] $match[0][2] $match[0][n] is my subexpression. now what does the $match[1] have? or $match[2] ? I usually use these modifiers: /is Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (_lallous) wrote: If i have this string: 1 2 3 4 5 6 7 no more! and this regular expression: ([0-9]+) now how can i run preg_match to get result by result until no results are returned? http://php.net/preg_match_all -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: 2nd Pass of array empty
Use foreach and there will not be a need of reset because foreach is not moving the internal array pointer. foreach ($somearray = $value){ } foreach ($somearray as $key = $value) { } Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: CC Zona [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 12:42 PM Subject: [PHP] Re: 2nd Pass of array empty In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Ben Edwards) wrote: I have some code which loops through a n array using a for loop. This works fine but if I try to loop through the array again in the same script the array seems to be empty (i,e, the loop douse not do any interations). Do I need to reset the array pointer at the begining? Is there something else I need to do? Yes, a reset sounds like the likely solution. http://php.net/reset If that's not it, then repost with a code example. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Locale Month Name
Hello ! Please help me, How to get Month name according to server's locale setings ? I tryed to use: setlocale("LC_ALL", "LT"); $month = strftime("%B", mktime(0,0,0,$m,1,$y)); But I get message: Warning: Passing locale category name as string is deprecated. Use the LC_* -constants instead. in (My PHP runes on Windows Server) Thank You. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Headers already sent....
Hi all, I have a bit of a confusing one here. I have two enviroments: 1) Live server -PHP Version 4.0.3pl1 - Nov 21 2000 -Apache/1.3.12 Cobalt (Unix) -Linux 2) Local development -PHP Version 4.0.6 -Apache/1.3.20 (Win32) -Windows 2000 Pro Now on the live server everything works fine but on my dev server, certain scripts return errors claiming that Cannot add header information - headers already sent by... Both servers have output_buffering set to off. The pages where the issue seems to arise contain session handling code and location headers eg: ? session_start(); $sid=session_id(); $uid=$HTTP_SESSION_VARS[userid]; if (!$uid){ header(location:client-login.php?validate=1); exit(); } ? Anyone any ideas?? I am clean out. Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: If i use preg_match() how can i preg_match next?
It depends of the last parameter to preg_match_all. PREG_PATTERN_ORDER and PREG_SET_ORDER. One of these is the default value. |a (.*?)(.*?)/a| PREG_PATTERN_ORDER : Orders results so that $matches[0] is an array of full pattern matches, $matches[1] is an array of strings matched by the first parenthesized subpattern, and so on. Using above pattern if we have some links in text to search for matches then $matches[1][0],$matches[1][1] will contain the params of a . $matches[2][0],$matches[2][1] will contain the link text. PREG_SET_ORDER : Orders results so that $matches[0] is an array of first set of matches, $matches[1] is an array of second set of matches, and so on. Using above pattern $matches[1][0] will be te params for fist matched link. $matches[1][1] link text. $matches[2][0] params of second matched a, $matches[2][1] link text ...and so on. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: _lallous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 1:40 PM Subject: [PHP] Re: If i use preg_match() how can i preg_match next? I don't really get it! in preg_match_all() the $matches array what will it contain? i mean $matches[0] is the whole match, and every $match[0][1] $match[0][2] $match[0][n] is my subexpression. now what does the $match[1] have? or $match[2] ? I usually use these modifiers: /is Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (_lallous) wrote: If i have this string: 1 2 3 4 5 6 7 no more! and this regular expression: ([0-9]+) now how can i run preg_match to get result by result until no results are returned? http://php.net/preg_match_all -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Headers already sent....
See if there is any symbol before ?php open tag. Also this seems bad : $uid=$HTTP_SESSION_VARS[userid]; may be: $uid=$HTTP_SESSION_VARS[userid]; Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: Nic Skitt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 12:50 PM Subject: [PHP] Headers already sent Hi all, I have a bit of a confusing one here. I have two enviroments: 1) Live server -PHP Version 4.0.3pl1 - Nov 21 2000 -Apache/1.3.12 Cobalt (Unix) -Linux 2) Local development -PHP Version 4.0.6 -Apache/1.3.20 (Win32) -Windows 2000 Pro Now on the live server everything works fine but on my dev server, certain scripts return errors claiming that Cannot add header information - headers already sent by... Both servers have output_buffering set to off. The pages where the issue seems to arise contain session handling code and location headers eg: ? session_start(); $sid=session_id(); $uid=$HTTP_SESSION_VARS[userid]; if (!$uid){ header(location:client-login.php?validate=1); exit(); } ? Anyone any ideas?? I am clean out. Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
Original message From: Gerard Samuel [EMAIL PROTECTED] Date: Wed, Aug 29, 2001 at 09:58:12PM -0400 Message-ID: [EMAIL PROTECTED] Subject: Re: [PHP] strings in a function return I found an error, but it didn't do me any good. I tried this, any tips... Thanks function assign() { global $adminurl, $string; top(); if ($string) { $data = explode (|, $string); foreach ($data as $foo) { echo $foo[0]; } } form $array = array($new_cat,$assigned_to,$job,$assigned_by); $string = implode(|,$array); return $string; } The variables that form $array are from the form /Original message Reply Why use array($new_cat,...,$assigned_by); Loose the quotes: array ($new_cat,...,$assigned_by); You don't need to use implode(). Just return the array. In the calling function you can then get the results in two ways: $results = assign(); /* $results is an array */ or list ($new_cat,...,$assigned_by) = assign(); If you want a better answer on what is going wrong, you'll need to send some more code. Eg the code that you've now replaced by form. It might just be that the error is in that part. /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Headers already sent....
Hi all, I have a bit of a confusing one here. I have two enviroments: 1) Live server -PHP Version 4.0.3pl1 - Nov 21 2000 -Apache/1.3.12 Cobalt (Unix) -Linux 2) Local development -PHP Version 4.0.6 -Apache/1.3.20 (Win32) -Windows 2000 Pro Now on the live server everything works fine but on my dev server, certain scripts return errors claiming that Cannot add header information - headers already sent by... Both servers have output_buffering set to off. The pages where the issue seems to arise contain session handling code and location headers eg: ? session_start(); $sid=session_id(); $uid=$HTTP_SESSION_VARS[userid]; if (!$uid){ header(location:client-login.php?validate=1); exit(); } ? Anyone any ideas?? I am clean out. Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTML mail
Hi, how can I send HTML mail via mail() function ? I readed the tutorial, but can someone write me example ? Thanks, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML mail
you add this into your header bit: $headers .= Content-Type: text/html; charset=iso-8859-1\n; HTH Jack - Original Message - From: Rosen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 5:18 PM Subject: [PHP] HTML mail Hi, how can I send HTML mail via mail() function ? I readed the tutorial, but can someone write me example ? Thanks, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sessions in classes dosn't work!?
This is because $foo is local to the member functions of the class. declare global $foo at the start of every function. Ok thnx... it worked... but how do you then explain this?: *** ?php class TestClass { var $foo; function setFoo($bar) { $this-foo = $bar; } function getFoo() { return $this-foo; } } class TestClass2 { function TestClass2($state) { global $obj; if($state == page2) { print(TYPE: . gettype($obj) . br /\n); print($obj-getFoo()); session_destroy(); } else { session_register(obj); $obj = new TestClass(); $obj-setFoo(Hello World!); print(TYPE: . gettype($obj) . br /\n); print(a href=\?state=page2\Click here/a\n); } } } session_start(); new TestClass2($state); ? *** When I on page1 print(TYPE: . gettype($obj) . br /\n); I get this output: TYPE: object When I on page2 print(TYPE: . gettype($obj) . br /\n); I get this output: TYPE: NULL (and the linie saying print($obj-getFoo()); generates an error: Fatal error: Call to a member function on a non-object in /home/httpd/html/test/save_objects.php on line 27 (just so you know: I have no problems saving an object in the session when it's done outside a class. It's when I do this from within a class that the problem occurs) /watson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] The future of PHP or my 2 cents
I think with everyone replying to The future of PHP e-mails and putting in their two cents, we're eventually going to raise that $100,000 in no time. g Navid -Original Message- From: CC Zona [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 30, 2001 3:08 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] The future of PHP or my 2 cents In article 010001c1311e$d86ebb40$[EMAIL PROTECTED], [EMAIL PROTECTED] (Matthew A. Schneider) wrote: Rather than whining about the future of PHP, why don't you be proactive and take on the goal of raising the $100,000 for the project? Although Fred's comments appear rhetorical, the suggestion has some merit. Anyone have a feel for how many PHP devotees are out there? How many people subscribe to this list? Do these numbers make it feasible to ask for a $1-10 contribution? How about $0.02 from each of the 7 million domains running PHP? To continue this (speculative) train of thought: Would it be feasible to collect some kind of contest entry fee, either instead of or in addition to donations toward the prize? If maximum participation were the goal (and I'm not sure that it would/should be, but for the sake of argument...), it might be a way to get entrants intestered in recruiting more entrants by reminding them that more developers in the contest, the bigger the reward to be won by one of them... As for collecting funds for such an endeavor, FWIW I (and presumably others) would be more likely to give if it were through the PHP.net group or Zend than through any third-party. At least then if the contest were to fall through, I'm confident that the money would still be well-spent on furthering PHP development/marketing. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML mail
Try this : ?php $EMAIL = array( 'plain' = Haha hoho hehe , 'html' = htmlfont size=3Haha hoho hehe/font/html ); $headers='From: [EMAIL PROTECTED] Mime-Version: 1.0 Content-Type: multipart/alternative; boundary==_4195058==_.ALT '; $message = ' --=_4195058==_.ALT Content-Type: text/plain; charset=us-ascii; format=flowed '.$EMAIL['plain'].' --=_4195058==_.ALT Content-Type: text/html; charset=us-ascii '.$EMAIL['html'].' --=_4195058==_.ALT--'; mail([EMAIL PROTECTED], $subject, $message, $headers); ? Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: Rosen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 1:18 PM Subject: [PHP] HTML mail Hi, how can I send HTML mail via mail() function ? I readed the tutorial, but can someone write me example ? Thanks, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GUI for PHP
PHP is the cooolest language i have ever came across. If u have a least knowledge with C u can rule over it in a few days. And moreover what for v r all here ? if u have any problem just drop in a post u'll have ur inbox full of solutions from all over the world. this in one of (no not one of the) the best mailing lists. ok have a great programming, /sagar - Original Message - From: Matthew A. Schneider [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Php-General (E-mail) [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 9:18 AM Subject: Re: [PHP] GUI for PHP As someone who has little programming experience I'd have to say jump right in and forget the GUI (I'm not aware of any IDE for PHP). PHP is pretty easy (to learn, becoming a master is something else I suspect) and there is always outstanding support either by reading this newsgroup's archive or posting a question if you don't find an answer. I've been dabbling for close to a year now and have yet had a need to post any questions. I have invariably found the solution after a quick search. There are a number of good books as well. For the novice (I speak with some authority here) try Julie C. Meloni's PHP Essentials. If you're looking for an editor try PHPEd, http://www.soysal.com/PHPEd/index.php3 And listen to what the experts (not me) have to say. Good luck, Matt - Original Message - From: Eric [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 6:12 PM Subject: [PHP] GUI for PHP Does anyone have any suggestions for GUI PHP programming software. I am new the PHP and would like to make the learning experience as quick and simple as possible. Thanks for your help, Eric JT Harlow www.sisgrate.com Phone: 360 891 6991 Fax: 360 891 6865 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP and PWS
put the entire php in c:\php then intall it from there so that it'll be installed there only. check out for readme.txt or install.txt. it will contain the instructions. you have to put a file like browscap.ini (or dll) in c:\windows\system and the php.ini must be in c:\windows now edit the php.ini to your needs. this file contains the root directory of the php where u have to put the path to C:\php hope this will help u, /sagar - Original Message - From: frank clarke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:09 AM Subject: [PHP] PHP and PWS I downloaded and installed PHP 4.06. The readme file says that the auto install prog setsup PHP to work with PWS and sets up php.ini. However, when I look at php.ini, there are no entries for these two parameters ; The root of the PHP pages, used only if nonempty. doc_root= ; The directory under which PHP opens the script using /~usernamem used only ; if nonempty. user_dir= is that good? I put in c:\inetpup\wwwroot for doc root, but it's still not working. Is there somethin I'm missin? thanx franx __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP and PWS
put the entire php in c:\php then intall it from there so that it'll be installed there only. check out for readme.txt or install.txt. it will contain the instructions. you have to put a file like browscap.ini (or dll) in c:\windows\system and the php.ini must be in c:\windows now edit the php.ini to your needs. this file contains the root directory of the php where u have to put the path to C:\php hope this will help u, /sagar - Original Message - From: frank clarke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:09 AM Subject: [PHP] PHP and PWS I downloaded and installed PHP 4.06. The readme file says that the auto install prog setsup PHP to work with PWS and sets up php.ini. However, when I look at php.ini, there are no entries for these two parameters ; The root of the PHP pages, used only if nonempty. doc_root= ; The directory under which PHP opens the script using /~usernamem used only ; if nonempty. user_dir= is that good? I put in c:\inetpup\wwwroot for doc root, but it's still not working. Is there somethin I'm missin? thanx franx __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GET/POST name=value query var convention?
this might be u r asking for while(list($key,$value)=each($HTTP_POST_VARS)) { echo($key . = . $value); } this should be in the page to where the variables r posted /sagar - Original Message - From: Scott Thomason [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, August 03, 2001 4:48 AM Subject: [PHP] GET/POST name=value query var convention? Does anyone know of a more-or-less authoritative source that states that the common convention for HTTP GET/POST queries is a series of name=value pairs joined by characters? I know I'm not just making this up, but I need to persuade someone that it is a commonly-accepted practice. Before you look... it's not in the HTTP RFCs. Also...would it be accurate to say that life as a PHP and/or ColdFusion programmer is easier if the aforementioned HTTP GET/POSTs are performed in this manner? I know as a frequent user of Perl's CGI.pm module that I take this convention for granted. ---scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GET/POST name=value query var convention?
this might be u r asking for while(list($key,$value)=each($HTTP_POST_VARS)) { echo($key . = . $value); } this should be in the page to where the variables r posted /sagar - Original Message - From: Scott Thomason [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, August 03, 2001 4:48 AM Subject: [PHP] GET/POST name=value query var convention? Does anyone know of a more-or-less authoritative source that states that the common convention for HTTP GET/POST queries is a series of name=value pairs joined by characters? I know I'm not just making this up, but I need to persuade someone that it is a commonly-accepted practice. Before you look... it's not in the HTTP RFCs. Also...would it be accurate to say that life as a PHP and/or ColdFusion programmer is easier if the aforementioned HTTP GET/POSTs are performed in this manner? I know as a frequent user of Perl's CGI.pm module that I take this convention for granted. ---scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Count
can do another way $sql = select count(fieldname) from Products; $result=mysql_query($sql); $myrow=$mysql_fetch_row($result); $countrows = $myrow[0]; ( or might be $myrow[1] check out) will do the job /sagar - Original Message - From: David Robley [EMAIL PROTECTED] To: Kevin P [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 6:06 AM Subject: Re: [PHP] Count On Thu, 30 Aug 2001 08:16, Kevin P wrote: Hi I have counted some rows in MySQL and I need to know how to pull out the number of rows. SELECT COUNT(*) AS myCount FROM Products Thanks Kevin $query = SELECT COUNT(*) AS myCount FROM Products; $result = mysql_db_query($database, $query); $row = mysql_fetch_array($result); extract($row); echo $myCount; might do the trick; unless I've left a syntax error in there :-) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I'm so broke, I can't even pay attention. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fw: [PHP] GET/POST name=value query var convention?
- Original Message - From: sagar [EMAIL PROTECTED] To: Scott Thomason [EMAIL PROTECTED] Cc: php [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 4:22 PM Subject: Re: [PHP] GET/POST name=value query var convention? this might be u r asking for while(list($key,$value)=each($HTTP_POST_VARS)) { echo($key . = . $value); } this should be in the page to where the variables r posted /sagar - Original Message - From: Scott Thomason [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, August 03, 2001 4:48 AM Subject: [PHP] GET/POST name=value query var convention? Does anyone know of a more-or-less authoritative source that states that the common convention for HTTP GET/POST queries is a series of name=value pairs joined by characters? I know I'm not just making this up, but I need to persuade someone that it is a commonly-accepted practice. Before you look... it's not in the HTTP RFCs. Also...would it be accurate to say that life as a PHP and/or ColdFusion programmer is easier if the aforementioned HTTP GET/POSTs are performed in this manner? I know as a frequent user of Perl's CGI.pm module that I take this convention for granted. ---scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fw: [PHP] Count
- Original Message - From: sagar To: php Sent: Thursday, August 30, 2001 4:22 PM Subject: Re: [PHP] Count can do another way $sql = select count(fieldname) from Products; $result=mysql_query($sql); $myrow=$mysql_fetch_row($result); $countrows = $myrow[0]; ( or might be $myrow[1] check out) will do the job /sagar - Original Message - From: David Robley [EMAIL PROTECTED] To: Kevin P [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 6:06 AM Subject: Re: [PHP] Count On Thu, 30 Aug 2001 08:16, Kevin P wrote: Hi I have counted some rows in MySQL and I need to know how to pull out the number of rows. SELECT COUNT(*) AS myCount FROM Products Thanks Kevin $query = SELECT COUNT(*) AS myCount FROM Products; $result = mysql_db_query($database, $query); $row = mysql_fetch_array($result); extract($row); echo $myCount; might do the trick; unless I've left a syntax error in there :-) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I'm so broke, I can't even pay attention. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Headers already sent....
Sagar, Thanks but there isnt any spaces or HTML. The code on the page starts with the PHP tags and nothing else. Nic Sagar [EMAIL PROTECTED] wrote in message 00c001c13141$cd995d60$5bed7ccb@ravella">news:00c001c13141$cd995d60$5bed7ccb@ravella... This will not work even if the code is like this html ? your php ? remaining html see that theres no spaces till the php code starts. the code must be like html ? php code ? remaining html /sagar - Original Message - From: Nic Skitt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 3:20 PM Subject: [PHP] Headers already sent Hi all, I have a bit of a confusing one here. I have two enviroments: 1) Live server -PHP Version 4.0.3pl1 - Nov 21 2000 -Apache/1.3.12 Cobalt (Unix) -Linux 2) Local development -PHP Version 4.0.6 -Apache/1.3.20 (Win32) -Windows 2000 Pro Now on the live server everything works fine but on my dev server, certain scripts return errors claiming that Cannot add header information - headers already sent by... Both servers have output_buffering set to off. The pages where the issue seems to arise contain session handling code and location headers eg: ? session_start(); $sid=session_id(); $uid=$HTTP_SESSION_VARS[userid]; if (!$uid){ header(location:client-login.php?validate=1); exit(); } ? Anyone any ideas?? I am clean out. Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sessions in classes dosn't work!?
Hmmm, it seems that obj is not saved to the session file. I don't thik that before new is needed. Also may the problem is in that you use the class contructor. When objects are saved in session, and on other page you want to wakeup them you must provide two methods for the class: function __sleep(){ return array(r,l,p,m_id); } function __wakeup(){ $this-res_id=mysql_connnect(user,pass,host); } __sleep() (double under) is called before wrinting in session file. it returns names (as strings) of variables which have to be saved. Why not all, because you can have a $res_id of db_link which is meaningless to save. __wakeup() is called when the object is restored in memory. If you have $res_id you have to create it here, so the persistent object after restoring to be as before saving. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: Thomas Watson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 2:18 PM Subject: Re: [PHP] Sessions in classes dosn't work!? This is because $foo is local to the member functions of the class. declare global $foo at the start of every function. Ok thnx... it worked... but how do you then explain this?: *** ?php class TestClass { var $foo; function setFoo($bar) { $this-foo = $bar; } function getFoo() { return $this-foo; } } class TestClass2 { function TestClass2($state) { global $obj; if($state == page2) { print(TYPE: . gettype($obj) . br /\n); print($obj-getFoo()); session_destroy(); } else { session_register(obj); $obj = new TestClass(); $obj-setFoo(Hello World!); print(TYPE: . gettype($obj) . br /\n); print(a href=\?state=page2\Click here/a\n); } } } session_start(); new TestClass2($state); ? *** When I on page1 print(TYPE: . gettype($obj) . br /\n); I get this output: TYPE: object When I on page2 print(TYPE: . gettype($obj) . br /\n); I get this output: TYPE: NULL (and the linie saying print($obj-getFoo()); generates an error: Fatal error: Call to a member function on a non-object in /home/httpd/html/test/save_objects.php on line 27 (just so you know: I have no problems saving an object in the session when it's done outside a class. It's when I do this from within a class that the problem occurs) /watson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GUI for PHP
htmlkit rule :) and it for free to. it have all what editor need + an ftp client build in which make life very easy. -- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 http://sites.canaan.co.il -- - Original Message - From: Nic Skitt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 12:23 PM Subject: Re: [PHP] GUI for PHP Although. PHAKT is an addon to Macromedia Ultradev that handles PHP in a GUI environment. If you do a search for PHAKT on http://askhiran.com you should find the relevant links. As with most GUI scripting tools, a good deal more code is written than is needed and I would have to agree with Matthew that hand coding is the way forward. I use PrimalScript. Its pretty nifty and you can store your own code snippets to speed up coding. Plus it has intellisense style help while writing your code which comes in handy. Hope that helps Nic Skitt http://ultradevfaq.com Matthew A. Schneider [EMAIL PROTECTED] wrote in message 00a001c13106$a13bcc20$[EMAIL PROTECTED]">news:00a001c13106$a13bcc20$[EMAIL PROTECTED]... As someone who has little programming experience I'd have to say jump right in and forget the GUI (I'm not aware of any IDE for PHP). PHP is pretty easy (to learn, becoming a master is something else I suspect) and there is always outstanding support either by reading this newsgroup's archive or posting a question if you don't find an answer. I've been dabbling for close to a year now and have yet had a need to post any questions. I have invariably found the solution after a quick search. There are a number of good books as well. For the novice (I speak with some authority here) try Julie C. Meloni's PHP Essentials. If you're looking for an editor try PHPEd, http://www.soysal.com/PHPEd/index.php3 And listen to what the experts (not me) have to say. Good luck, Matt - Original Message - From: Eric [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 6:12 PM Subject: [PHP] GUI for PHP Does anyone have any suggestions for GUI PHP programming software. I am new the PHP and would like to make the learning experience as quick and simple as possible. Thanks for your help, Eric JT Harlow www.sisgrate.com Phone: 360 891 6991 Fax: 360 891 6865 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] The future of PHP
Can small business live from e-commerce today? What is the relevance of your question? Do businesses live from their telephone? Whether they do or not, they need it in either case. AFAIK, it costs a lot more money to have any start and operate a e-commerce business than a telephone. Actually... If you are starting a *SMALL* e-commerce business, you can probably start it up for about the same as a phone installation... :-) Shared web-server: $35 setup + $20/month (or less) Registration: $10/year CCNow or similar processing: very small setup fee, moderate cut of each transaction. Telephone setup, in Chicago at least, is quite expensive, and probably is more than that. At least, it was 15 years ago when I moved in :-) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Reading php source code?
Another user on the same shared server can probably work at it and manage to read anything in your web-tree... Stuff like database passwords should be moved to a directory not in your web tree, and change your include_path to reach it -- It's still readable by somebody who works at it, but not as easy. If you have an algorithm that *MUST* stay secret, re-code it in C and compile it into PHP, or use the Zend Encoder off-line to make a binary. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Seb Frost [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 7:56 PM Subject: Reading php source code? How hard is it for someone to somehow read the source code out of my php files on my isp hosted website. They use linux apache php 4.0.6. I ask because in my logfile it seems someone accessed a uniquely named not-guessable folder in my web root. It is mentioned in my source code. I use imagecreatefromjpeg on files in this directory. How can someone see my folders if not by viewing my source code? - seb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Images Download
Read their HTML file with fopen (or Snoopy, whatever that is). Then figure out what you want, and go read that with fopen. It's just a URL, and PHP doesn't really care whether it's HTML or what that you read. Snoopy might even be able to do it. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Pereira Romulo [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Saturday, August 25, 2001 10:58 AM Subject: Images Download Hello, I want to create a script that would read the contents of an HTML file (I can use Snoopy class for that) and then, download some respective type of files from a page (let's say .zip files)... Any ideas how do I start or if anyone create something like that? Thank you and please, reply to [EMAIL PROTECTED] Rom __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP auth logout
Thanks for all the answers to this question but hitting the back button will work, no authorization required to see the pages all over. You need to get those pages to not be cached by the browser. http://php.net/header Repost problem: I'm having a PHP based auth. It seems that unset($PHP_AUTH_USER) or unset($PHP_AUTH_PW) doesn't work. The *BROWSER* re-sends those variables, so your unset() has no meaning on the next page. Also, 401 Unauthorized header does not work also. What you need to do is re-send the challenge headers, *ONLY* with a new *REALM*. IE, keep track of what realm each user is in, and change it when you want them to be logged out. Is there a way to logout and no back button or the user just have to close his browser in order to accomplish this? Closing the browser is the best answer. You'll never get 100% no back button caching on every single minor browser release. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP Install Problem - Please Help
To Install PHP I have done this ( ihave specified the location of apxs as Suse Installed an Apache server also, but I want the one I've installed to /usr/local/apache): It's better to specify exactly where apxs is anyway, just so you know for sure you don't get the wrong one. ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs Syntax error on line 236 of /usr/local/apache/conf/httpd.conf: API module structure `php4_module' in file /usr/local/apache/libexec/libphp4.so is garbled - perhaps this is not an Apache module DSO? libphp4.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not stripped Well, it's a DSO, but it got broken somehow when you built it... I mean, a car that you build from scratch with no carbuerator is still gonna look like a car, but it ain't gonna run too good. :-) SoCan anybody Help ??? I don't have MySQL installed yet - do I need to have that first ??? YES! (Technically, in some situations, no... But for now, just go with YES! as the answer.) If you don't have MySQL installed, PHP has to use its built-in version. This built-in version has a rather low chance of matching up with the version you are actually running. In some instances, I conjecture that it might also conflict with a version that Apache is *already* using with mod_auth_mysql or some other nifty Apache module I've never heard of that uses MySQL... But I dunno for sure about that part. Anyway, if the versions are far enough off, your PHP and your MySQL won't talk to each other, or will talk, but some functions won't work right, or PHP itself won't even be able to be loaded. At any rate, get MySQL, install it, and be sure to use --with-mysql=/path/to/mysql when you re-compile to get the right stuff. *ALSO* -- You have to watch what goes by during configure. Some errors are printed but aren't big enough to stop the configure script. Alas, they are, in some cases, big enough to make your PHP non-functional, or at least not having all the features you asked for. You can check the files left behind from configure name config.log and config.cache. They're just text files. A little digging in there may help you figure out what exactly went wrong. WISH LIST: config.log doesn't seem to record the Yes/No answer to what happened... -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: last bit of help ....
I need to output an array to a text file, now I have created the text file now I just need to write to it, well I need to get the output of the browser to this text file. HOw can i do this, oh and return each line ... $file = fopen($new_file_name, 'w') or die(Could not open $new_file_name); # loop through lines/rows/whatever # For each field, do: $field = str_replace('', '\\', $field); $field = '$field'; fputs($file, $field,$field2,$field3); # end loop. http://php.net/fopen http://php.net/fputs Oh yeah: You probably don't need the touch stuff... If you can do all that, you probably have permission to just create the file using fopen. heres the code that gets the output array1.php ? // Mail text file extractor. // Written to extract out certain parts of the file and output in a csv friendly format. // Dan McCullough include(functions.php); if ($submit) { $extract = eXtractor1($file_name,$tmp_file_name,$new_file_name); if ($extract) { file://here goes, get the parsed file from the output of the grep command. file://read the file and output $fcontents = file(/tmp/$tmp_file_name, r); // run this funtion to format and display the file in a certain output. function GetField($offset) { global $fcontents; global $new_file_name; return trim(substr($fcontents[$offset], strpos($fcontents[$offset], ))); } for($i = 0, $count = sizeof($fcontents); $i $count; $i += 6) { // Make the numbers 1-6 constants if desired echo GetField($i + 1) . , . GetField($i + 2) . , . GetField($i + 3) . , . GetField($i) . , . GetField($i + 5) . , . GetField($i + 4) . ,yesbr\n; } exit;} } ? html head titleExtractor/title /head body form method=post action=? echo $PHP_SELF; ? Please input the name of the text file.brbr File to extract: input type=text name=file_namebr Temp file name: input type=text name=tmp_file_namebr CSV File Name: input type=text name=new_file_namebr input type=submit name=submit value=submit /form /body /html function.php function eXtractor1($file_name,$tmp_file_name,$new_file_name) { global $file_name; global $tmp_file_name; global $new_file_name; $filename = /tmp/$tmp_file_name; $newfilename = /tmp/$new_file_name; if (!file_exists($filename)) touch($filename); // Create blank file touch($newfilename); chmod($filename,0777); chmod($newfilename,0777); $command = cat /home/sites/projects/web/extractor/$file_name | egrep 'State:|Name:|Address:|City:|e-mail:|Zip:'$filename; system($command); ## nothing worked for me until I added this next line. system(exit(0)); } return $tmp_file_name; return $new_file_name; } ? anythoughts would be appreaciated dan = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP as an Apache module
Odds are good the Module version is not looking for your php.ini in the same place as where the CGI version is... Using the Module version, where does it *think* php.ini is? It should be listed in phpinfo. You'll have to copy your php.ini file there for the Module version. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Chris [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Sunday, August 26, 2001 2:35 AM Subject: PHP as an Apache module I have PHP 4.06 and using it as an Apache module, but for some reason I cannot get my changes to take effect after I change something in the PHP.ini file. I've tried to restart Apache, restart Windows98, nothing. But if I run as a CGI, the changes are there in the phpinfo()! Any help with this would be great... Thanks, Chris Irwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: How to create thumbnails?
I think you just described this: http://php.net/manual/en/function.imagecopymerge.php -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Jan [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Sunday, August 26, 2001 12:22 PM Subject: How to create thumbnails? For thumbnail creation I would need to know how I scale a loaded image or better: How do I copy a scaled version of an image created with imagecreatefromjpeg onto a background I have previously created? Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Generating Variables
You probably need http://php.net/stripslashes somewhere. Also, this is not a very secure way to do this... Somebody could easily alter the HTML source of your hidden var_list_1 and alter whatever columns they wanted. It would be better to pass each value separately. And, finally, you could put all of this in one file with a couple of if() statements, instead of spread out over three files, and probably make life much easier on yourself. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: P.Agenbag [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 2:51 PM Subject: Generating Variables Hi I am trying to auto generate some sql strings. The resulting string should look like this: update $table_name set var1='$var1', var2='$var2' . where id=$id I used a foreach loop to get the keys from a table and in each foreach loop I tried the following. foreach($myrow as $key=$val) { $var_list .= $key = '\$$key', ; } The first php page is the table generator; VIEW_ALL.PHP ?php $username_1 = user; $password_1 = password; $db_name = test; $table_name = users_db; $link = mysql_connect(localhost,$username_1,$password_1); mysql_select_db($db_name,$link); $sql = select * from $table_name; $result = mysql_query($sql); $result_2 = mysql_query($sql); echo table border=\1\; $myrow = mysql_fetch_assoc($result); echotr bgcolor=\#CC\; foreach($myrow as $key=$val) { echo tdb$key/b/td; } echo/tr; $count = 2; while($myrow_2 = mysql_fetch_assoc($result_2)) { $id = $myrow_2[id]; if ($count == 2) { $bgcol = #FF; $count = $count - 1; } else { $bgcol = #EFEFEF; $count = $count + 1; } echotr bgcolor=\$bgcol\; foreach($myrow_2 as $key=$val) { echotd$val/td; } echotda href=\edit.php?id_1=$idtable_name=$table_namedb_name=$db_nameusername_1= $username_1password_1=$password_1\Edit/a/td; echo/tr; } echo/table; ? Goes through to EDIT.PHP ?php $link = mysql_connect(localhost,$username_1,$password_1); mysql_select_db($db_name,$link); $sql = select * from $table_name where id=$id_1; $result = mysql_query($sql); $myrow = mysql_fetch_assoc($result); $count_fields = 0; echoform name=\form_1\ method=\post\ action=\update.php?username_1=$username_1password_1=$password_1db_name=$d b_nametable_name=$table_name\; echotable border\1\; foreach($myrow as $key=$val) { echotr bgcolor=\#CC\td$key/tdtdtextarea name=\$key\$val/textarea/td/tr; $var_list_1 .= $key = '\$$key',; $count_fields = $count_fields + 1; } echo/table; $count = strlen($var_list); $new_count = $count - 1; $var_list_1[$new_count] = ; echoinput type=\hidden\ name=\var_list\ value=\$var_list_1\; echoinput type=\submit\ value=\submit\ name=\submit\; echo/form; ? And this goes to UPDATE.PHP ?php $link = mysql_connect(localhost,$username_1,$password_1); mysql_select_db($db_name,$link); $sql_1 = update $table_name set $var_list where id=$id; $result = mysql_query($sql_1); echo Your data has been updated!br; echo $sql_1 br; echo result: $resultbr; ? This is where the problems comes in, the SQL is not brought over correctly, rather is written as-is with the single quotes \-ed out, can someone plz help me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Cookieless =(
You're using HTTP_COOKIE_VARS, all CAPS, right? Did you declare it global inside any functions where you use it? Does phpinfo() show HTTP_COOKIE_VARS? Perhaps you have track_vars turned off. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Andy Ladouceur [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 12:40 AM Subject: Cookieless =( I love cookies. I hate it when they dont work. I was previously accessing cookies by just using their name (I had global_vars turned on), I recently decided to turn it off(for security reasons) and I can no longer even set cookies? Yes,cookies are enabled and everything..in fact,I never even touched any of the cookie functions.. thats what I dont get... anyone have any ideas on what could be wrong? (And yes, im using $HTTP_Cookie_VARS[cookiename]; to access (try and access, that is) them now.. Anyone know what might be wrong? Any helps appreciated, thanks. -Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] The future of PHP
(Even though I didn't understand quite how shared objects work. g ) Like, I only did it once, and it was GD, and about 80% of the time it puked trying to display an image, but... Basically, if you compile using --with-apxs in the first place, and then you re-compile from source using that --with-apxs thingie again only you add more --with-foobar options, you get these .so files in the libs directory that you can just http://php.net/dl into your script rather than install the whole new PHP binary. More importantly, you could compile them on a different machine (same hardware with all the same versions of everything) and then put them onto a server that ain't got those toys. (In my case it was about not altering the main PHP binary and making it non-standard from the other 7 boxes for what was just a test run of something I wanted to play with for a day...) Or, at least, that's how my vague memory of stumbling through this once goes... Now if somebody more organized than me (most of you, I imagine) wants to try that and turn it into a HowTo to add to the PHP site, that would be pretty nifty :-) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: path error while calling files
I think you want require 'daten/menu.data'; No, you can't go up two directories and back down, or you'd be able to go down into other people's web-sites, and that would be bad. You can go up only as far as your own site. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Carsten Weber [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 11:11 AM Subject: path error while calling files Hello. I am reading in text files in a php-script and am getting path errors. I have set the php-path in php.ini to /home/web/public_html/cgi-bin/chanet/ and am trying to call a file in /home/web/public_html/cgi-bin/chanet/daten/. I use the path ../../cgi-bin/chanet/daten/ to call the files (the reason for leaving the directory twice is that I have another place where my webpage is running with a different structure). I get the following error: Warning: Failed opening '../../cgi-bin/chanet/daten/menu.dat' for inclusion (include_path='.:/usr/share/php:/home/web/public_html/cgi-bin/chanet') in /home/web/public_html/inhalt/chanet.php4 on line 80 However, when I set the php-path just to /home/web/public_html/cgi-bin/ and call the files with ../cgi-bin/chanet/daten/, it works. I have to test set all the rights in public_html to 777, so I don't think it's a rights problem. Am I not allowed to call up directories which require me to go up two directories?? Thanks for any help! Carsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: I need some help with this code
You may want to use: http://php.net/chown http://php.net/umask http://php.net/chmod -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Javi - Neodigit [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Sunday, August 26, 2001 6:03 AM Subject: I need some help with this code I'm using copy() and the final owner is nobody, I'm opening a socket connection with fsockopen() so I have a validate user. I want the validated user to be the owner of the new file That`s de code: - open the socket - validate user - change dir chmod so we can write - write the file (with nobody owner and I need the user owner) - change back dir chmod - close connection -- $tftp = fsockopen(ftp.dominio.com, 21, $errno, $errstr, 60) or die(Fallode Conexión); socket_set_blocking($tftp, false); fputs($tftp, user $login\n); fputs($tftp, pass $password\n); $ruta = /www/.$direc; fputs($tftp, SITE chmod 0777 $ruta\n); copy (file1.php, file2.php); fputs($tftp, SITE chmod $perm $ruta\n); sleep(1); fclose($tftp); Thanks for helping Javi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] The future of PHP
This has strayed off-topic a bit. Unless you're into music and/or business planning for e-commerce, you probably should hit delete now... How about this one, doing *EXTREMELY* well selling CDs online: http://CDBaby.com/ Of course, that has almost nothing to do with his choice of PHP (the language he could understand the easiest) and everything to do with intelligent business decisions on the back-side. No VC. No we'll make money later. Just great service at a fair price. I'm sure there are others out there. *CAN* it be done? Sure. Can the idiots who invested millions in companies with a business plan that involved *NO* revenue model make it? No. What is doing extremely well? Do you know that from facts or you have just been told? Number 1 volume seller of CDs on the 'net? Amazon.com Number 2: CDBaby.com Reference: http://musicians.about.com/library/sellcds/blcdbaby.htm (Follow Back to Retailers Index to read about his few competitors that are still around) And is Amazon even making money yet? Last I heard, they were going to lose only a few million this year. :-^ I would say that being #2 behind Amazon that's spent a bazillion dollars promoting themselves and has lost money year after year that amounts to more than the GNP of small countries is pretty good, wouldn't you? And he doesn't even accept major label music -- only indie. So, like, how does he get to be #2? He works his ass off and has a savvy business plan that's good for his vendors (the musicians), and fair to his customers. Just in case that's not enough, here are some more reasons that I know it's successful. #1. He has grown the company slowly from him and a friend part-time to six (6) full-time employees. Wanna see a picture of them? It's on the site or the companion site http://cdbaby.ORG (.ORG is for musicians behind-the-scenes info) Meanwhile, his competitors (now defunct) spent VC money to hire 120 people to do the same job... Hmmm. VC to hire 120 people overnight, or grow slowly to 6. Which one was the good business plan? #2. He's been around for several years, survived all the dot-bombs, and has (I think) acquired the content/inventory of a former competitor or two and cut a deal to sell CDs for a complementery web-site (http://garageband.com). #3. His competitors have almost all folded or laid off 80% of their staff. He's had no layoffs. #4. He sells ~10,000 CDs per month (more near Xmas). He gets $4 a CD. You do the math. #5. I've done some work for him. #6. Never met a dissatisfied vendor, and I'm in contact with hundreds of them. #6b. Most of his competitors have many, many dissatisfied vendors, and I'm in contact with them. :-| You can review archives from just about any music-related mailing list, and look for CDBaby, Amazon, The Orchard, and CDStreet and so on. I'll tell you now which one is always recommended by virtually everybody. #7. He has a chart online from his accountant of what he sold. Some doofus tried to sue him for false advertising. He sent his books to the judge, and the case was thrown out. So that chart showing his sales of 10K units a month is almost-for-sure not fake, eh?... #8. I'm a satisfied vendor and customer. #9. He's routinely invited to speak at music conferences, so I'm not alone in my assessment. #10. You can estimate what he spends on bandwidth etc, and employees, and work it all out. He ain't wealthy (yet), but his business is healthy. #11. Visit the site. You'll figure out why he's successful. There's no BS or huge over-blown hype. Just CDs for sale. Hell, find a CD you like and buy it. You'll understand even better why it's successful :-) Try mine first: http://cdbaby.com/rosner http://cdbaby.com/jademaze #12. One of the artists (Of A Revolution) that was listed on the cover of Performing Songwriter a few months ago derived much of their success and sales from his site. Getting your band name listed on the cover of Performing Songwriter is not trivial. Getting it there without major label support is phenomenol. #13. He *UNDERSTANDS* his vendors, because he got started by needing a site to sell his CDs. He's the *ONLY* one who passes on the contact info for the purchaser to the artist. His TCO to get started as a vendor is minimal ($35+ 5CDs). The $35 covers him scanning the artwork and RealAudio encoding the songs, cuz he knows not every musician can do that easily/correctly. His forms to fill in to sell a CD are designed for anybody to figure out. I actually could go on with a lot more little stuff, but I reckon that's more than enough :-) If they are really doing so well because they have a business plan with a revenue model, why do they succeed when others that also have a business plan with revenue model don't? Which dot-bomb had a business plan, with a revenue model, which did *NOT* involve going into heavy debt and blowing huge piles of VC money for several years in a market-share grab on the
[PHP] Re: dose some one know of a scrip that will .......
Move your images out of your web-tree. Write a display.php script that use http://php.net/header and http://php.net/readfile to serve them up. Log each IP and $HTTP_USER_AGENT into MySQL with a timestamp. $query = select count(*) from piclog where thetime + '35 seconds' = now() and ip = '$REMOTE_ADDR' and browser = '$HTTP_USER_AGENT'; If that count is too high, do whatever. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Danial [EMAIL PROTECTED] Newsgroups: php.general,php.windows To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 27, 2001 1:46 AM Subject: dose some one know of a scrip that will ... dose some one know of a scrip that will stop someone from leeching my images.. like. if someone downloads 4 picturs in 35 sec. he will be and for 60 sec. im looking for something that will stop ppl for useing things like http://www.quadsucker.com/quadweb/ (( QuadSucker-Web )) - witch says to the server it is a Mozilla/4.0 browser -to download my hole website it kills my server when 2 or 3 ppl start to do it... I Could use ? $browser = array (Wget, EmailSiphon, WebZIP,MSProxy/2.0,EmailWolf,webbandit,MS FrontPage); $punish = 0; while (list ($key, $val) = each ($browser)) { if (strstr ($HTTP_USER_AGENT, $val)) { $punish = 1; } } if ($punish) { echo head titleAccess Denied/title /head pWe're sorry. The software you are using to access our website is not allowed. Some examples of this are e-mail harvesting programs and programs that will copy websites to your hard drive. If you feel you have gotten this message in error, please send an e-mail addressed to admin. Your I.P. address has been logged Thanks./p BR -Yourname BR /body ; exit; } ? But dont do any good if the USER_AGENT stats it is a Mozilla/4.0 any help would be cool thanks danial lee smith Danial, HTTP://WWW.CYBERHOTIES.COM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: A Separate Process?
You could just log the IP into a database, and then look it up later in another script in a cron job. You'll need PHP installed as a stand-alone binary (aka CGI) and you'll want to read: man 5 crontab You could use select distinct and then would only need to look up each IP once for a user that viewed many pages. If you wait too long, though, the IPs will change on you for DHCP clients. Still the same country probably though. To answer your original question :-) what you are talking about is called fork (like a fork in the road) and you do it something not unlike this: exec(/path/to/some/other/script , $results, $errorcode); echo implode(BR\n, $results); if ($errorcode){ echo OS Error: $errorcode. Usually path/permissions. man errnoBR\n; } It's the symbol that tells the shell to fork. The other script in question has to, e, I forget exactly, but I think it has to *NOT* bind up stdin, stdout, or stderr, because then Apache and PHP are waiting for that output... Search the archives for fork and and exec and you should find more posts. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Jordan Pickup [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 4:03 PM Subject: A Separate Process? Is there any way to make a separate process in PHP? I do real-time stats collection on my site and one of the things I collect is the domain of the user (to get their country). Sometimes getting the domain name takes a few seconds to come back and the user has to wait for that time before their page displays. Is there any way to split of a separate process - that doesn't end when the current process ends - to do the stats collecting so that the user doesn't have to wait? Or, if not, is there some way to tell the browser that it has all the data (so that it will finish rendering the page and run my javascript) and the script can continue running and do the ns lookup? I'm sorry if this question has been asked and answered before but I couldn't find an answer anywhere else... and the archive for this list seems to be down. Jordan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Update 2 documents with only 1 POST?
Is there a smart way, that I have overseen, to update/download 2 (or more) PHP-docs with only one POST/GET instruction ? I do not want to use either javascript or cockies! I don't really understand the question: What are you actually trying to do, and why? An HTTP POST, by definition, returns one, and only one, HTML document to the browser. Within your PHP script, you can alter whatever you want. If you want to have a download as a result of a POST, I guess you could Zip two files up and download that. Is that what you mean? -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: javascript code beautification
exec(indent $source, $result, $errorcode); http://php.net/exec -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 9:24 AM Subject: javascript code beautification Does someone know of a PHP-function to reformat Sources of C-like langs? I need to generate syntactically uniform Javascripts independent of the specific user input. Thanks, D. Alvarez Arribas [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: payflow pro hosed
If you can't alter php.ini to load the extension, you might be able to using .htaccess or http://php.net/dl -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Dan Harrington [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 5:12 PM Subject: payflow pro hosed Hello, I am having a problem with an ISP that has installed the payflow pro (top of phpinfo shown) and yet it keeps showing up as an unknown function. PHP Fatal error: Call to undefined function: pfpro_init() in /. PHP Fatal error: Call to undefined function: pfpro_process() in /. I noticed its compiled as --with-pfpro=shared,/usr/local/payflow and in /usr/local/payflow are found the following files: /usr/local/payflow/bin/pfpro.c /usr/local/payflow/bin/pfpro.h /usr/local/payflow/bin/pfpro /usr/local/payflow/bin/pfpro-file /usr/local/payflow/lib/libpfpro.so Anyone care to share their configuration options, phpinfo, hints, tips? I'm at a loss, it looks like everything is setup correctly, but it still doesn't work. Thanks Dan Harrington PHP Version 4.0.6 System Linux www.foobar.com 2.2.14-5.0smp #1 SMP Tue Mar 7 21:01:40 EST 2000 i686 unknown Build Date Aug 20 2001 Configure Command './configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-config-file-path=/etc/httpd' '--enable-save-mode' '--with-zlib' '--enable-debugger' '--enable-magic-quotes' '--enable-track-vars' '--with-xml' '--with-ftp' '--with-mysql=/usr' '--with-gd=/usr/local' '--with-png-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-pfpro=shared,/usr/local/payflow' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /etc/httpd/php.ini ZEND_DEBUG disabled Thread Safety disabled This program makes use of the Zend scripting language engine: Zend Engine v1.0.6, Copyright (c) 1998-2001 Zend Technologies -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: session.use_cookie
You are correct. The point is you can turn it OFF to force cookies to *NOT* be used, and use PHP_SESSID in the URL instead. Thus, you don't even present the user with a cookie to deny/accept/whatever. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Richard Baskett [EMAIL PROTECTED] Newsgroups: php.general To: PHP General [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 1:49 AM Subject: session.use_cookie Could someone tell me how session.use_cookie works? To me it seems that if this is enabled and the user has cookies off.. then sessions will not work period. Any help on this would be appreciated :) Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: remote hosts
You'd have to fake out GeoCities into believing PHP is a real browser by sending all the headers a real browser sends such as HTTP_USER_AGENT etc... Be easier to just let users upload photos or just tell GeoCities people to move to a real server :-) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Joseph Bannon [EMAIL PROTECTED] Newsgroups: php.general To: PHP (E-mail) [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 9:59 AM Subject: remote hosts I run a community website with a bulletin board which I wrote in PHP. Each member gets a profile and can submit a picture with it. However, those members with pictures on geocites are having problems. Seems their server denies remote hosts. Is there a way with PHP to tell their server to let images be viewed on my website? Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP on Win NT , IIS
You may want to try [EMAIL PROTECTED] What web server is better on NT with PHP? I prefer Apache. http://apache.org What PHP installation mode performs better i.e. CGI, SAPI Module , build or not build etc ? ISAPI will be faster, but not as stable for *SOME* of the DLLs that have not yet been field-repaired for thread-safe running. CGI will be slower, but very stable. (Well, as stable as anything on Windows gets...) If you are planning on heavy traffic, not so good... What 'S' in SAPI? Server? Any suggestions on PHP configuration for Oracle, IIS, and LDAP? Oracle has a bunch of environment variables in Un*x that you have to set. No idea how you do that in Windows, or if it's even needed, or what. LDAP -- dunno how many Windows users use LDAP... Also I am planning to use PHP scripts to run some jobs from scheduler. Is it a bad idea? If not what need to be considered while installing PHP. Not a bad idea at all. You'll still use the php.exe file for the scheduler, even if you use the ISAPI php.dll Once you've converted to PHP and Apache, the next step is to move to Linux and you'll have a really stable setup :-) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mkdir failed
Are you sure it's ../tmp and not just /tmp?... See if you can do opendir and readdir on ../tmp -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Christian Darsow [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 2:11 PM Subject: mkdir failed hi everybody! i have an account at strato (german provider) who hosts my php-scripts. now i want to make a dir with mkdir(../tmp/$id, 0777) it doesn't work at all eventhough the rights of tmp are set to 777. the script also doesn't alert anything, not a failed or anything.. does anybody know where the problem may be thank you so much. christian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: HELP : How to suggest a download-filename for IE on MAC
Change the URL to read: www.myserver.de/securedownload.php/checkliste3.pdf?pdfdownload=checkliste3.p df Yes, it looks funky... But everybody but IE5 on the Mac will ignore that extra stuff between / and ?, and IE will use that as the filename prompt now. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Sebastian Stadtlich [EMAIL PROTECTED] Newsgroups: php.general To: 'Php-General (E-Mail) [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 10:12 AM Subject: HELP : How to suggest a download-filename for IE on MAC HELP i'm desperate I try to write a downloadskript, which results in the fillowing URL : http://www.myserver.de/securedownload.php?pdfdownload=checkliste3.pdf yes you guessed right : securedownload does some auth-stuff it works on win2000 IE 6.0,5.5 NE 6.0 AND 4.76. it also works well on MAC when used with Netscape 4.5 but not when used with IE 5. it always suggests 'securedownload.php' as the filename, which of cause sucks I tried EVERY combination of the suggested headers at www.php.net/header , but can't get it to work. here is what i use : . header( Content-type: application/download\n ); header( Content-Disposition: filename=$download ); header( Content-Description: PHP3 Generated Data ); set_time_limit(0); readfile('/home/path/to/myfiles/securepdfs/'.$download); Anyone ever found a solution for MAC ?? ( i hate Mac, but my boss uses one, so ... ) Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: line by line
http://php.net/fopen http://php.net/fgets Call fopen. Call fgets 3 times. Call fread($file, 100) to get the rest. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Gary [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 4:10 PM Subject: line by line Hi All, I need to get info from a flat file line by line. What I need to do is get 3 separate lines and then a paragraph. Can someone point me to a tutorial or info on the subject. TIA Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: perl-esque data parsing for hex post variables
I'm guessing that you have to swap every other byte as Windows is the other-endian... I don't really know for sure though... You could just use: exec(/path/to/sox $infile $outfile, $results, $errorcode); echo implode(BR\n, $results); if ($errorcode){ echo OS Error $errorcode. Usually path/permission. man errnoBR\n; } -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Jason Mercer [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 9:13 PM Subject: perl-esque data parsing for hex post variables I can't get the php to convert audio data to nicely formed binary wav format. For instance, in perl you simply do a $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; and you're done with it. In php, there are two problems: 1. no existence of a handy builtin hex2bin() function (though many have been written, such as function hex2bin($hex_str) for ($i = 0; $i strlen($hex_str); $i += 2) $bin_str .= chr(hexdec(substr($hex_str, $i, 2))); } return $bin_str; } which seems to get the case done, 2. But the real problem is that doing a straight hex2bin conversion is not what that beautiful little perl script does. The part that confuses me is the hash oriented piece /%([a-fA-F0-9][a-fA-F0-9])/ -- what exactly is it doing? Is it just stepping through the string two characters at a time and comparing them? Or is it doing something more ambitious and arcane that I'm not really grasping. I tried to emulate it with the following php workaround, but come up short... for ($i = 0; $i strlen($hex_str); $i += 2) $newdata =. preg_replace(/[a-fA-F0-9][a-fA-F0-9]/,pack(C,hexdec(substr($hex_str, $i, 2))),$hex_str); } Any help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: HTTP 500 server error
Try to change PWS so you are running as a CGI first. Then move up to ISAPI. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Web User [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 8:49 AM Subject: HTTP 500 server error It always gets HTTP 500 server error, when I try to run the php scripts on Windows98 SE + PWS4.0. THE PHP installed is Ver 4.06 -win32, as a server module. However I get a screen full of html codes when I run c:\php\php.exe -i in MS-DOS command line So what's problem with the installation or configuration? Thanks BAKER -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP Article... Comments??
Read the archives. Also read php-dev archives. You'll find plenty of thoughts. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 12:55 PM Subject: PHP Article... Comments?? Hi I had this article sent to me on another list I am subscribed to, just wondered what other people thought of it :-) http://www.securereality.com.au/studyinscarlet.txt Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Using PHP to move a row of information to another table
You probably want to wrap this in a transaction... $query = insert into foo select * from bar; #Execute that. $query = delete from foo; #Execute that. Add lots of error-checking and a begin and end (or rollback for an error) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Brandon Orther [EMAIL PROTECTED] Newsgroups: php.general To: PHP User Group [EMAIL PROTECTED] Sent: Monday, August 27, 2001 4:33 PM Subject: Using PHP to move a row of information to another table Hello, In MSSQL: I want to take one row of information from one table and put it into another row. Does anyone know of an easy way? Or do I have to go column by column copying each column into the new table? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: overlaying alpha channel png over jpeg
If I were doing this, I would attempt to un-set the PNG transparency right after loading in the PNG... But I wouldn't know an alpha channel if it bit me :-) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Vahan Yerkanian [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, August 27, 2001 6:40 AM Subject: overlaying alpha channel png over jpeg I hope someone has got solution for this: I'm trying to write a script which will watermark a jpeg file with png logo, and output the resulting jpeg to a file. Unfortunately, whatever I do, I'm unable to get transparent color in png to disappear, by any means. the png file is 8bit, jpeg is true color; Am I doing something wrong? have a look: ? $sourcefile=test2.jpg; $insertfile=peoplestamp.png; $targetfile=test.jpg; $transition=50; $insertfile_id = imageCreateFromPNG($insertfile); $sourcefile_id = imageCreateFromJPEG($sourcefile); $sourcefile_width=imageSX($sourcefile_id); $sourcefile_height=imageSY($sourcefile_id); $insertfile_width=imageSX($insertfile_id); $insertfile_height=imageSY($insertfile_id); $dst = imageCreateTrueColor($sourcefile_width,$sourcefile_height); imagealphablending($dst,TRUE); imagecopy($dst,$sourcefile_id,0,0,0,0,$sourcefile_width,$sourcefile_height); $aaa=imagecolorresolvealpha($insertfile_id,255,255,255,255); imagecolortransparent($insertfile_id,$aaa); imageCopyMerge($dst, $insertfile_id,0,0,0,0,$insertfile_width,$insertfile_height,$transition); imagepng ($dst,$targetfile); ? img src=?=$targetfile? border=0 Best regards, -- Vahan Yerkanian [EMAIL PROTECTED] Vice President, Design Development Website @ http://www.abideweb.com/ AbideWeb Technologies, LLC Phone +3741 238650 | Mobile +3749 416358 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: unset($PHP_AUTH_USER, $PHP_AUTH_PW)
After you unset them, the *BROWSER* re-presents the values that it has... You can only change the REALM out from under the browser to get a new dialog. Keep track of a dynamic range of realms to present, and who's in which realm etc. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Jason Bell [EMAIL PROTECTED] Newsgroups: php.general To: PHP Users [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 4:06 PM Subject: unset($PHP_AUTH_USER, $PHP_AUTH_PW) anyone know why this isnt working for me? if (isset($PHP_AUTH_USER) isset($PHP_AUTH_PW)) { CheckCredentials($PHP_AUTH_USER,$PHP_AUTH_PW); unset ($PHP_AUTH_USER, $PHP_AUTH_PW); } else if ($AuthAction) { auth($AuthAction); }; If someone submits false credentials, the page keeps $PHP_AUTH_USER and $PHP_AUTH_PW, and won't allow another login attempt until the browser is closed. Is there another way to effectively unset the variables? Thanks, Jason Bell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP and PWS
use / not \ And spell inetpub correctly :-) -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Frank Clarke [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 4:39 PM Subject: PHP and PWS I downloaded and installed PHP 4.06. The readme file says that the auto install prog setsup PHP to work with PWS and sets up php.ini. However, when I look at php.ini, there are no entries for these two parameters ; The root of the PHP pages, used only if nonempty. doc_root= ; The directory under which PHP opens the script using /~usernamem used only ; if nonempty. user_dir= is that good? I put in c:\inetpup\wwwroot for doc root, but it's still not working. Is there somethin I'm missin? thanx franx __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Headers already sent....
Thanks Andrey but that still hasnt fixed it. The full error I am getting is: Cannot add header information - headers already sent by (output started at c:\apache\apache\htdocs\client-secure.php:11) in c:\apache\apache\htdocs\client-secure.php on line 18 Line 11 refers to: $uid=$HTTP_SESSION_VARS[userid]; Now I cant understand why PHP thinks this has written to headers. Surely it is simply reading. And more to the point, why does this work on the live server but not on my dev box? Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Associative arrays (names and strings)
Anyway to do this fast: $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); It's not that I want to access $arr like: echo $arr['set1'] I also want to access it as: echo $arr[1] (and it must be equal to $arr['set1']; and It seems i can't do this: $arr = array(set1, 1 = array(1, 2, 3, 4), set2, 2 = array(11, 22, 33, 44), set3, 3 = array(111, 222, 333, 444)); any suggestion to get an array associated by both number and string keys? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Associative arrays (names and strings)
?php $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); $a=array_keys($arr); var_dump($a); // var_dump(array_keys($arr)[set1]); not possible ? Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: _lallous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:00 PM Subject: [PHP] Associative arrays (names and strings) Anyway to do this fast: $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); It's not that I want to access $arr like: echo $arr['set1'] I also want to access it as: echo $arr[1] (and it must be equal to $arr['set1']; and It seems i can't do this: $arr = array(set1, 1 = array(1, 2, 3, 4), set2, 2 = array(11, 22, 33, 44), set3, 3 = array(111, 222, 333, 444)); any suggestion to get an array associated by both number and string keys? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Socket Server
Dear all, This is my quandry... I am trying to build a socket server to transfer simple information, more of a monitoring tool. But after about 14+ hours it just kicks out, without rhyme or reason. No errors, no nothing... I was curious if anyone could see big gaping holes in my code that would allow for this, it's being run on Linux via the command: /web/sockets/socketserver 2 /web/sockets/logs/error.log Same for the client piece.. and the code in each is as follows, the client is: #!/scs/pkg/bin/php ? set_time_limit (0); error_reporting (E_ALL); echo TCP/IP Connection @ ; echo exec('date'); echo \n; $address = mymain.server.net; $port = 4001; do { exec('/usr/bin/uptime /tmp/uptime'); exec('/bin/date /tmp/uptime'); exec('/usr/bin/top -bn1 /tmp/proc'); exec('df -k /tmp/dfk'); $sock = @socket_create(AF_INET,SOCK_STREAM,0) or die(Can't create socket.\n); echo Socket created, [$sock].\n; socket_setopt($sock, SOL_SOCKET, SO_REUSEADDR, 1); echo Attempting to connect to '$address' on port '$port'...; $result = @socket_connect($sock,$address, $port) or die(connect() failed.\n Reason: . socket_strerror($result) . \n); echo Connection established.\n; $in = file('/tmp/uptime'); $inb = file('/tmp/proc'); $inc = file('/tmp/dfk'); $out = ''; $clear = new\n; $ret = @socket_read($sock, 4096, PHP_NORMAL_READ); socket_write ($sock, $clear, strlen($clear)); sleep(5); if($ret == Ready\n) { echo Sending file...\n ; $num = 0; $numb = 0; $numc = 0; for($num; $num != count($in); $num++) { socket_write($sock, $in[$num], strlen($in[$num])); usleep(5); } echo OK...\t; for($numc; $numc != count($inc); $numc++) { socket_write($sock, $inc[$numc], strlen($inc[$numc])); usleep(5); } echo OK...\n; } else { echo Sleeping for Retry\n; socket_write ($sock, quit\n, 5); @socket_close ($sock); sleep(10); continue; } echo \nClosing socket... ; socket_write ($sock, quit\n, 5); echo \nOK. Socket Closed @ ; echo exec('date'); echo \n\n; @socket_close ($sock); sleep(70); $ret = ; exec('rm -rf /tmp/uptime /tmp/dfk'); # /tmp/proc'); } while (true); ? And the main server code is as follows: #!/scs/pkg/bin/php ? set_time_limit (0); $address = mymain.server.net; $port = 4001; $sock = @socket_create(AF_INET,SOCK_STREAM,0) or die(Can't create socket.\n); echo Socket created, [$sock].\n; socket_setopt($sock, SOL_SOCKET, SO_REUSEADDR, 1); if(!@socket_bind($sock,$address,$port)) { @socket_close($sock); die(Can't bind to port $port, exiting.\n); } echo Socket binding successful on $address:$port @ ; echo exec('date'); echo \n; if (@socket_listen($sock,10) 0) { @socket_close($sock); die(Can't setup socket for listening.\n Reason: . socket_strerror($sock) . \n); } echo Socket is now listening for connection requests...\n\n; do { if(!$msgsock = @socket_accept($sock)) { echo Can't accept connection.\n Reason: . socket_strerror($msgsock) . \n; break; } @socket_getpeername($msgsock,$remote_host,$remote_port); echo Accepted socket connection for $remote_host:$remote_port [$msgsock]\n; do { @socket_write($msgsock,Ready\n,6); if(!$ret = socket_read($msgsock,4096)) { echo Error reading output, possible broken connection.; break; } if ($temp) { $ret .= $temp; $mylength = strlen($ret); $offset = strpos($ret, \n); if ($offset === false) { $temp = $ret; continue; } else { # String Slice $cmd = substr($ret, 0, $offset); if ($cmd != $ret) { $temp = substr($ret, $offset+1); } else { $temp = ; } } } elseif ($ret == \n) { $cmd .= $ret . \n; } else { $ret .= $temp; $mylength = strlen($ret); $offset = strpos($ret, \n); if ($offset === false) {
[PHP] Referrer
Hi all, What is the server variable for referrer? Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sessions in classes dosn't work!?
Hmmm, it seems that obj is not saved to the session file. I don't thik that before new is needed. This is weird :) It worked when I removed the (thought that I tried that ;). Now I just can't remember why I put it there in the first place. I hope it wasn't importent ... well I will proboply find out when some of the code dosn't work. Also may the problem is in that you use the class contructor. When objects are saved in session, and on other page you want to wakeup them you must provide two methods for the class: function __sleep(){ return array(r,l,p,m_id); } function __wakeup(){ $this-res_id=mysql_connnect(user,pass,host); } __sleep() (double under) is called before wrinting in session file. it returns names (as strings) of variables which have to be saved. Why not all, because you can have a $res_id of db_link which is meaningless to save. __wakeup() is called when the object is restored in memory. If you have $res_id you have to create it here, so the persistent object after restoring to be as before saving. I knew about the __sleep() and __wakeup() but not about the returning of an array containing the names of the varibles that needs to be stored. Cool feature - Thanks for the tip :) /watson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Referrer
Original message From: Nic Skitt [EMAIL PROTECTED] Date: Thu, Aug 30, 2001 at 12:25:44PM +0100 Message-ID: [EMAIL PROTECTED] Subject: [PHP] Referrer Hi all, What is the server variable for referrer? Cheers Nic /Original message Reply $HTTP_SERVER_VARS[HTTP_REFERER] Check phpinfo() next time... ;) /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Referrer
or $GLOBALS[HTTP_REFERER]; Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: Nic Skitt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 2:25 PM Subject: [PHP] Referrer Hi all, What is the server variable for referrer? Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Referrer
D'oh! New it would be something simple. Cheers lads. Nic Andrey Hristov [EMAIL PROTECTED] wrote in message 029b01c13148$1bcb01e0$0b01a8c0@ANDreY">news:029b01c13148$1bcb01e0$0b01a8c0@ANDreY... or $GLOBALS[HTTP_REFERER]; Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: Nic Skitt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 2:25 PM Subject: [PHP] Referrer Hi all, What is the server variable for referrer? Cheers Nic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Reg-Session problem
Helo techies , Iam getting the following error .Any help is appreciated. Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition user of the object you are trying to operate on was loaded _before_ the session was started in theme.inc on line 6 Thanks in advance, Senthilvellan.
[PHP] Asynchronous SNMP?
I'm working on a project that involves a lot of SNMP data gathering. I was wondering if it's possible to have a multi-threaded PHP script. Basically the SNMP queries I'm running are taking a long time to complete (several seconds). However I found that running multiple at the same time does not slow down the response time of any of the others. So I was wondering how easy it would be to get 5 or 6 SNMP queries running at the same time. If PHP is unable to, I'm going to have to write a C/C++ app, that will do it, then insert the results into a database. Then the PHP script will grab from there. Any suggestions? -- Robert Schultz - [EMAIL PROTECTED] Knowledge Engineer - Adelphia Communications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Associative arrays (names and strings)
not what I want! i want something like this when you do mysql_fetch_array() don't you get a reference to your columuns via fieldname or array index? ie. $row = mysql_fetch_array($result_set); echo $row['name']; or echo $row[0]; same return same value! I want something like it with my initial post. Andrey Hristov [EMAIL PROTECTED] wrote in message 027101c13145$a7e2af00$0b01a8c0@ANDreY">news:027101c13145$a7e2af00$0b01a8c0@ANDreY... ?php $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); $a=array_keys($arr); var_dump($a); // var_dump(array_keys($arr)[set1]); not possible ? Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: _lallous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:00 PM Subject: [PHP] Associative arrays (names and strings) Anyway to do this fast: $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); It's not that I want to access $arr like: echo $arr['set1'] I also want to access it as: echo $arr[1] (and it must be equal to $arr['set1']; and It seems i can't do this: $arr = array(set1, 1 = array(1, 2, 3, 4), set2, 2 = array(11, 22, 33, 44), set3, 3 = array(111, 222, 333, 444)); any suggestion to get an array associated by both number and string keys? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Reg-Session problem
May be you save as session variable a object and try to recreate in another script. But in this second script you don't include/require the script with definition of the class. If this definition is in the first script cut it from there and paste into a new file save it using some name and include()/require() in every file which uses sessions. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: senthilvellan [EMAIL PROTECTED] To: Richard Lynch [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:51 PM Subject: [PHP] Reg-Session problem Helo techies , Iam getting the following error .Any help is appreciated. Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition user of the object you are trying to operate on was loaded _before_ the session was started in theme.inc on line 6 Thanks in advance, Senthilvellan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Quick TXT document stuff
Ok im like in a realy hurry here, so can someone please tell me (or show) how i make a script read the first (top) 1 or 5 lines from a text document? Thanks! -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
Re: [PHP] Associative arrays (names and strings)
The return value of mysql_fetch_array is something strange. You receive into the array data copied to times. 0 is no alias to 'name' for example. If you want this behaviour do that: $arr=array_merge_recursive($arr,array_values($arr)); now do what you want to do Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: _lallous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 4:10 PM Subject: Re: [PHP] Associative arrays (names and strings) not what I want! i want something like this when you do mysql_fetch_array() don't you get a reference to your columuns via fieldname or array index? ie. $row = mysql_fetch_array($result_set); echo $row['name']; or echo $row[0]; same return same value! I want something like it with my initial post. Andrey Hristov [EMAIL PROTECTED] wrote in message 027101c13145$a7e2af00$0b01a8c0@ANDreY">news:027101c13145$a7e2af00$0b01a8c0@ANDreY... ?php $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); $a=array_keys($arr); var_dump($a); // var_dump(array_keys($arr)[set1]); not possible ? Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: _lallous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:00 PM Subject: [PHP] Associative arrays (names and strings) Anyway to do this fast: $arr = array(set1 = array(1, 2, 3, 4), set2 = array(11, 22, 33, 44), set3 = array(111, 222, 333, 444)); It's not that I want to access $arr like: echo $arr['set1'] I also want to access it as: echo $arr[1] (and it must be equal to $arr['set1']; and It seems i can't do this: $arr = array(set1, 1 = array(1, 2, 3, 4), set2, 2 = array(11, 22, 33, 44), set3, 3 = array(111, 222, 333, 444)); any suggestion to get an array associated by both number and string keys? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: If i use preg_match() how can i preg_match next?
Thanks alot Andrey. Andrey Hristov [EMAIL PROTECTED] wrote in message 017a01c13139$e1bb2600$0b01a8c0@ANDreY">news:017a01c13139$e1bb2600$0b01a8c0@ANDreY... It depends of the last parameter to preg_match_all. PREG_PATTERN_ORDER and PREG_SET_ORDER. One of these is the default value. |a (.*?)(.*?)/a| PREG_PATTERN_ORDER : Orders results so that $matches[0] is an array of full pattern matches, $matches[1] is an array of strings matched by the first parenthesized subpattern, and so on. Using above pattern if we have some links in text to search for matches then $matches[1][0],$matches[1][1] will contain the params of a . $matches[2][0],$matches[2][1] will contain the link text. PREG_SET_ORDER : Orders results so that $matches[0] is an array of first set of matches, $matches[1] is an array of second set of matches, and so on. Using above pattern $matches[1][0] will be te params for fist matched link. $matches[1][1] link text. $matches[2][0] params of second matched a, $matches[2][1] link text ...and so on. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message - From: _lallous [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 1:40 PM Subject: [PHP] Re: If i use preg_match() how can i preg_match next? I don't really get it! in preg_match_all() the $matches array what will it contain? i mean $matches[0] is the whole match, and every $match[0][1] $match[0][2] $match[0][n] is my subexpression. now what does the $match[1] have? or $match[2] ? I usually use these modifiers: /is Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (_lallous) wrote: If i have this string: 1 2 3 4 5 6 7 no more! and this regular expression: ([0-9]+) now how can i run preg_match to get result by result until no results are returned? http://php.net/preg_match_all -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Quick TXT document stuff
ok i have this code to do whats below, but its not working ?php $fp = fopen(meh.txt,r); for($i=0;$i2;$i++) { print $fp[$i]; } ? -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 - Original Message - From: Kyle Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 1:15 PM Subject: [PHP] Quick TXT document stuff Ok im like in a realy hurry here, so can someone please tell me (or show) how i make a script read the first (top) 1 or 5 lines from a text document? Thanks! -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Fw: Variable is not showing up in the print string
- Original Message - From: Girish P To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 6:10 PM Subject: Variable is not showing up in the print string Hi, I am passing a value fromone php page(FirstB.php ) to another php page (Sql.php) with ina link. a href="Sql.php?ws=100" /a.. When try to print the value $ws .. its empty.. Am i missing something ?? I am using apache 1.3.12 on Winnt.. Both the files are attached. TIA Girish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Quick TXT document stuff
change the first line to $fp = file(meh.txt); - Tim On Thu, 2001-08-30 at 16:31, Kyle Smith wrote: ok i have this code to do whats below, but its not working ?php $fp = fopen(meh.txt,r); for($i=0;$i2;$i++) { print $fp[$i]; } ? -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 - Original Message - From: Kyle Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 1:15 PM Subject: [PHP] Quick TXT document stuff Ok im like in a realy hurry here, so can someone please tell me (or show) how i make a script read the first (top) 1 or 5 lines from a text document? Thanks! -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Quick TXT document stuff
Fast and dirty: function readnlines($filename, $count) { return array_slice(file($filename), 0, $count); } readnlines('file.txt', 5); should work, Kyle Smith [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Ok im like in a realy hurry here, so can someone please tell me (or show) how i make a script read the first (top) 1 or 5 lines from a text document? Thanks! -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Vairable is not showing up in the print string
Hi, I am passing a value fromone php page(FirstB.php ) to another php page (Sql.php) with ina link. a href="Sql.php?ws=100" /a.. When try to print the value $ws .. its empty.. Am i missing something ?? I am using apache 1.3.12 on Winnt.. Both the files are attached. TIA Girish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]