Re: [PHP] Memory Size Help Please
Hi, Jay's comment was a fair one. It's not always possible to help without full info. You could try writing your data directly to disk instead of keeping them in memory as your code seems to be doing. In that case your regex function might need to go into the character data handler. Nick Wilson wrote: * and then Jay Blanchard declared Nope, not enough info to spot the problem. I could point you in a Spare me the sarcasm. Here's the code if anyone can help, thanks. ? $xml=file('http://www.weblogs.com/changes.xml'); $xml=implode(\n, $xml); // Pattern match string $urlpattern = '/((http|https|ftp):\/\/|www)[a-z0-9\-\._]+\/?[a-z0-9_\.\-\?\+\/~=#;,]*[a-z0-9\/]{1}/si'; $p=xml_parser_create(); xml_parse_into_struct($p, $xml, $vals, $index); xml_parser_free($p); print(h1Starting/h1); print(ol); foreach($vals as $key = $val) { /* if its the correct tag, do stuff... */ if($val['tag']==WEBLOG $val['attributes']['WHEN']120) { /* print the url so I can keep track */ print(li.$val['attributes']['URL']./li\n); /* Changed this from file() to fopen() to see... */ $pagehandle=fopen($val['attributes']['URL'],r); $page=fread($pagehandle,3); fclose($pagehandle); preg_match_all($urlpattern, $page, $matches); unset($page); foreach($matches[0] as $pageurl) { $parsedurl=parse_url($pageurl); if($parsedurl['host']=='amazon') { $urlfile=fopen('urls.txt',a); fwrite($urlfile,$pageurl.\n); fclose($urlfile); } } unset($matches); unset($pageurl); unset($parsedurl); } } print(/ol); print(h1Done!/h1); ? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file descriptor problem with tcpclient
Hi Bill, Bill of Bill's qmail toaster I presume.Your article was pretty good. I have seen a few cases where sessions gave problems when the session tmp dir wasn't set in php.ini Not sure if that's the cause of your problem though. Bill Shupp wrote: On Nov 17, 2003, at 4:49 PM, Bill Shupp wrote: Hello, I'm trying to use the program execution functions (like exec, system, passthru, etc) with tcpclient (from Dan Bernstein's ucspi-tcp command line tools), but get this error in the apache log with all of them: tcpclient: fatal: unable to set up descriptor 7: file descriptor not open Any idea why this descriptor is not accessible? Here's what I'm running: Apache/1.3.28 (Darwin) PHP/4.3.2 Ok, I have discovered that this ONLY occurs when I have started a session with session_start(). So, I'm assuming that session_start is using file descriptor 7. Is there a way to control this? Regards, Bill Shupp -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] An array as an element of a function
Hi, What do you mean by element of a function? usually functions take parametes (also known as arguments). elements are members of an array. In other words a collection of elements make up an array. Jeff McKeon wrote: Is it possible to pass an array as an elemtent of a function?? Something like this: $array1=array(1,2,3,4); $array2=array(a,b,c,d); Function Somefunction($var1,$var2) { someprocess using $array1 and array2; } Somefunction($array1,$array2); Or does something special have to be done? Thanks, Jeff -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays and performance
Hi, I belive PHP should be able to handle it but it's a bad idea. The reason being your app will not scale. Because if you script consumes 2mb of memory on average, 100 users accesing it at the same time will be 200Mb. Of course if you expect only a small number of users it does not matter. The biggest XML job i have handled with PHP is parsing the ODP RDF dump which is around 700MB. Obviously arrays are out of the question in such a scenario, even though only one user will be accessing the script at a given moment. the ODP dump has a couple of million records Kim Steinhaug wrote: Something Ive wondered about as I started working with XML. Importing huge XML files, and converting theese to arrays works indeed very well. But I am wondering if there are any limits to how many arrays the PHP can handle when performance is accounted for. Say I create an array from a XML with lots of childs, say we are talking of upto 10 childs, which would give 10 dimensional arrays. Say we then have 10.000 records, or even 100.000 records. Will this be a problem for PHP to handle, or should I break such a prosess into lesser workloads (meaning lesser depth in the array)? Anyone with some experience on this? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays and performance
hi, In fact i had to handle the ODP dump on two occaisions the first time the results went into a mysql db, the second time it went into a series of files. On both occaisions i used SAX parsers. DOM would just roll over and die with this much of data. I placed code in the end element handler that would either save the data into a db or would save it to a file. In either case i only kept the data in memory for a short period. ie from the time the start element was detected through the character data handling until the end element was detected. (Obviously i am not talking of the root node here :-)) During the whole process you barely noticed the memory usage, however the disk usage still went up of course. Reading from disk 1 and writing to disk 2 does wonders! please let me know if you need any further clarifications. Pablo Gosse wrote: Raditha Dissanayake wrote: [snip]The biggest XML job i have handled with PHP is parsing the ODP RDF dump which is around 700MB. Obviously arrays are out of the question in such a scenario, even though only one user will be accessing the script At a given moment. the ODP dump has a couple of million records[/snip] What was your solution for this, Raditha? How did you handle the parsing of such a large job? Cheers, Pablo -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql question
Creating new databases is usually done with the mysql root account. Bad idea to use this account in a php script. Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table, but I can not figure out how to do this with a whole db. I also know that I could do it using mysql dump, but I don't want to have to run a shell command. Please help, MIchael -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql question
Hi John, ASAIK you are right. Michael, if you use the root account in php you will be able to do what John says. John Nichel wrote: Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table, but I can not figure out how to do this with a whole db. I also know that I could do it using mysql dump, but I don't want to have to run a shell command. Please help, MIchael There may be a shorter way, but the only thing I can think of at the moment is to do this via multiple queries ie query to create new database query to read tables and structure in old db queries to create new tables in new db queries to dump data from old tables queries to load data to new tables You may want to try the mysql list to see if this can be done in one query. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unzip a file.
For anyone playing around with zip files on a web application i hope you have updated your zip libraries there were some vulnerabilities in it recently. Vincent M. wrote: Kim Steinhaug wrote: on phpclasses.org there is a ZIP class that does all you need to do. Havnt got the time to give you the url right now, but look there. All I found are classes to extract tar/gzip files: http://www.phpclasses.org/search.html?words=zipgo_search=1restrict=method=andsort=score Is there any I couldn't see ? Thanks, Vincent. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload file size
Gerard Samuel wrote: On Friday 14 November 2003 12:48 pm, joe wrote: is there a way to check the file size without fully uploading the file? No there isnt, well at least not via php... correct. There are two solutions you can upload with a java applet, the applet can be configured to lock the upload at a predefined limit. Would save you a lot of bandwidth. The second is to upload via perl script, which can check the Content-length header *before* processing the file upload and block it. In fact megaupload - the php upload progress bar that i did some time ago has this feature. sorry about the belated reply message had been stuck in a que.. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft .NET arguement
I have a friend who is has MCDBA, MCSE and MCSD he had 100% scores for a couple of exams! was a die hard fan of ASP.NET until recently when he discovered PHP. hasn't written any ASP.NET code since. That should tell us something :-) Mike R wrote: I have someone here at my desk arguing that Microsoft's .NET is better than PHP - faster to process, easier and quicker to program, etc. They also (claim) that Microsoft's SQL is much faster and such vs. MySQL. Any comments to help me defend PHP or to educate me? :) -Mike -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft .NET arguement
Dan Joseph wrote: Hi, From my experiences, your coworkers are somewhat correct. I found MySQL to be as fast in most cases, however in databases with millions of records, MySQL started slowing down before the MS SQL did. This is true for inserts but retrievals mysql would still be faster. As for PHP being slower to program, I disagree. Its about the same, and in some cases, PHP might have a few more shortcuts. Maybe they're using some visual editors to speed them up? -Dan Joseph -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft .NET arguement
but still keep HTTP open... and that's running the notorius IIS :-) Jason Wong wrote: On Tuesday 18 November 2003 00:27, Mike R wrote: Actually, their claim is that Microsoft environments are secure - you just need the proper firewall (that, basically, the problems with Windows boxes has to do with the firewall, not the OS). That one I laughed at. But it's true, you can solve most of the security problems by tightening up the firewall so that nothing goes in or out. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft .NET arguement
you can with myODBC Mike R wrote: You can't interface MySQL with ODBC? -Mike I agree. I've found MS SQL (and MS Access databases) to be extremely fast when well optimised, even with massive databases. As you can interface with them using ODBC I prefer to use MS database backends when my clients already have them installed alongside PHP for Win32. C Hi, From my experiences, your coworkers are somewhat correct. I found MySQL to be as fast in most cases, however in databases with millions of records, MySQL started slowing down before the MS SQL did. As for PHP being slower to program, I disagree. Its about the same, and in some cases, PHP might have a few more shortcuts. Maybe they're using some visual editors to speed them up? -Dan Joseph -Original Message- From: Mike R [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 11:07 AM To: [EMAIL PROTECTED] Subject: [PHP] Microsoft .NET arguement I have someone here at my desk arguing that Microsoft's .NET is better than PHP - faster to process, easier and quicker to program, etc. They also (claim) that Microsoft's SQL is much faster and such vs. MySQL. Any comments to help me defend PHP or to educate me? :) -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] corrupted attachvent by base64_encode
Hi, It's not a problem with the base64 encoding. When sending messages of this nature you have to create a certain set of headers. I am sorry i cannot remembers the exact RFC numbers involved (there are several) by 822 is a good place to start i think. Or if you like short cuts, you can send yourself the same file using your normal mail client, look at the headers and try to reproduce them with your php script. Oleg Borzenkov wrote: Hi, All! I have a problem with sending binary attachment with mail() function. To do so I use standart scheme: chunk_split(base64_encode(fread($f,filesize($filename. The system is FreeBSD4.7, Apache2, PHP 4.3.4 When the attachment is plain text file , it passes well. By when I use excell, zip and so on, the attachment is corrupted. I tried various scripts which I found in the internet, so I don't think that the problem is in my code. It's looks like the base64_code() function makes something wrong. Or something wrong is in my system tunes. Maybe php.ini. I sow in various forums questions like this one. But there was no answers on them. Please , explain me what I do wrong . Thank you. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Limiting repetitive file access
Hi, While your solution is feasible it would still consume processor and memory because you are doing this at a very high level, you will be better of solving this at a lower level by a proper use of a firewall. What you have described sounds like a kiddie script attempt at a denial of service or brute force cracking. Andre Dubuc wrote: Hi, Recently, a 'user' attempted to access a restricted area of my site repetitively (spanning five hours) entering the same url repetitively [probably by script]. A massive log file was generated. I would like to ban such behavior by limiting the number of successive 'get's a user can do (say 4 attempts) before an appropriate action is taken.. As a temporary measure (until I can figure a better way) the url in question was disabled. What I'd like to do, on a per-file basis using $_SESSION, is a combination of ipaddress perhaps with a counter that records the number of times that file was accessed, and limit the number of successive 'get's that can be done before the file is no longer accessible. In a script that checks for bad words, I have used: ?php if ($_SESSION['text'] = badwords){ $_SESSION['attempt'] = 1; header(location: unwanted.php); } [In the file unwanted.php I checked for $_SESSION['attempt'] = 1 and booted if the condition was met] However, using this approach I cannot augment this number without resorting to a file get/put schema. Is there a way around this? Is there a better approach? I've tried .htaccess but the user in question has a dynamic address. Any help appreciated. Tia, Andre -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP fopen function
Hi, fopen usually takes two arguments, the filenames is expected to be a string and check your register_globals settings. Sushmita Roy wrote: Hi, I am developing a web application using PHP and I am facing a funny kind of problem with the PHP fopen function. I have a webscript, which has a function in which a file has to be opened in the directory of the webserver. The function takes the file path as a parameter. The fopen function fails, when the parameter is passed into the fopen function, but when I hardcode the same file name, the fopen function succeeds. I am sure it is not a permission problem, because I can open the same file when I hardcode its path. The php error log file says PHP Warning: fopen(/usr/local/base/data/rawdata/batchdata/testhyb2/Slide1.gpr) [http://www.php.net/function.fopen]: failed to create stream: No such file or directory in /usr/local/base/include/classes/wizzzard.inc.php on line 566 I would appreciate any suggestions or thoughts. Thank you, Sushmita -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can I license a php script?
Hi Kim, You do raise a lot of valid points about protecting your software. However we must also keep in mind that over protection makes a software very difficult to use. Unless we balance the two there will not be any sales. Kim Steinhaug wrote: Robert has some interesting thoughts aswell here. I just wanted to complement the stuff about securing your scripts. Zend has Zend Encoder, rather expensive - and with windows GUI. IonCube also has encoder, much more affordable, CommandLine. www.zend.com The first encodes and optimizes your code, and your server has 2 have the Zend Optimizer installed on its system for it to run. This has shown in history to be complicated on some ISP, who never gets their finger out and can install this. But usually, 4/5 it goes well. www.ioncube.com / www.ioncube.co.uk This one compiles and encrypts and optimizes (I think). It requires a module installed on the server, but - It can also run on most modern apache systems where it installs on the fly (the decoder). Ive just purchased the licence for this product myself, and it looks really promising. Benchmarks on their page also shows that this software accually beats the Zend Encoder, and the price is far better to, :) If you are developing some sort of software, you should always protect it so that : 1) Your competitors / resellers doesnt fuck you over by selling without you knowing it, or fix your code to fit their needs without you getting credit /payd for it. 2) Your customers doesnt play developers and try jerking your scripts, which in the long run gives you alot of extra support time as the scripts go bugging out. Happy programming! -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Executing CRON from a WebForm..
Hi, reply without trying your code: You might need suexec to achieve this, else i don't belive one user can set the cron jobs for another user. Remember apache is usually running as a non privileged user. Andres Villalobos Camacho wrote: Sorry. The problem is that I cannot get the crontab command executed. I did try with the backsticks, but it didn't work either. I have different users, login in to the website using phpSecurePages, how can I let them change their crontab? Is my approach too wrong?? Any ideas?? Thanx.. On Fri, 2003-11-14 at 16:06, Chris Hayes wrote: At 22:52 14-11-2003, you wrote: Hi!!. I'm trying to give users the chance to modify its cron from a webform. The webform let's the users choose the day, month and minutes after hour, then, using PHP I made one long string and save it into a file ($tmpnam), it looks like this: $content = $min $hour $day * * /tmp/parse_maillog.sh; //I obtain $min $hour $day earlier in my webform $tmpfname = tempnam (/tmp/mail, $username_crontab.txt); $handle = fopen($tmpfname, w); fwrite($handle, $content); fclose($handle); system(crontab -u $username $username_crontab.txt); unlink($tmpfname); Debugging this part I found that the file is OK, the problem is with the system function, obviously a user problem, how can I fix it?? any ideas?? I use phpSecurePages as an authentication system. You forgot to tell what the problem is. Does the crontab command work when you try to parse it directly? Wasn't there something in the manual about using `bacticks` instead of quotes with the system command? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP fopen function
Hi, what's your register global settings? If this is off (which is the most likely) the parameters that you pass across may not be intepreted correctly. Are you by any chance on any of these virtual hosting schemes like cpanle or ensim? their handling of file paths are rather wierd and that too could be effecting your script. Sushmita Roy wrote: Yes, I am calling the fopen with two parameters. The filename is also a string. The problem is when I pass a string variable the fopen fails but succeeds when I pass a constant string. Raditha Dissanayake wrote: Hi, fopen usually takes two arguments, the filenames is expected to be a string and check your register_globals settings. Sushmita Roy wrote: Hi, I am developing a web application using PHP and I am facing a funny kind of problem with the PHP fopen function. I have a webscript, which has a function in which a file has to be opened in the directory of the webserver. The function takes the file path as a parameter. The fopen function fails, when the parameter is passed into the fopen function, but when I hardcode the same file name, the fopen function succeeds. I am sure it is not a permission problem, because I can open the same file when I hardcode its path. The php error log file says -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mulitpart form posts and mysql blobs
Hi, Haven't really done much work with blobs ( i always prefer to save just the file name in the databse) obviously this is a scenario where that approach is advantages. multipart/form-data isn't a very complex encoding scheme. Essentially what it does is combine all the files and other form fields together into a singe multipart message. Each file or data item has it's own headers. I recommend that you take a quick look at RFC 1867 and RFC 2616 If your server has perl you can very easily create a form handler that reads in from STDIN and writes to a file to see first hand what the multipart/form-data looks like. If you want i can give you such a script. John Ryan wrote: How are files encoded when theyre sent in mulitpart forms??? Is it the same as blob fields in mySQL databased when you use the LOAD_FILE() command?? If not, is it easy to convert from one to the other?? At the moment, Im taking the blob from mySQL and writing it to a file and then uploading that file through cURL! Very messy. TIA -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DB] Re: [PHP] Mulitpart form posts and mysql blobs
Hi John, Your new information does make my previous post redundant :-) However I disagree when you say. cURL can send files when given the filename, so I have to write the filename from the database and then give cURL the path. But thats messy IMHO this is a lot less messier than the current approach . You have to also keep in mind that using blobs puts just a wee bit more load on the database server. Getting back to the problem at hand how about invoking one of the curl binaries and piping output from your blob into it? best regards John Ryan wrote: Sorry, I should have said. Im trying to send this file to an external multipart form script which converts the file to the desired format. Im using cURL to do this. cURL can send files when given the filename, so I have to write the filename from the database and then give cURL the path. But thats messy I want to be able to get the BINARY data from mySQL and send it via cURL directly. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP not using resolv.conf
Hi, What exactly do you mean using the DNS server in the hostname? AFAIK name resolution is done by the underlying system and not directly controllable by PHP - unless of course you are writing some specialized networking program. Anyway i think you will need to provide more details on your setup. Luke van Blerk wrote: Hi Our PHP installation is not using the nameservers in resolv.conf but instead using the dns server on the hostname. Does anyone know why this is and how to change it? Thanks Luke -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] wiki
wikipedia.org - their sourcecode is available as a sourceforge.net project Dennis Gearon wrote: I need a wiki, VERY simple. BUT OTOH, it'd be nice if it had the ability to display, or attache a picture to a topic. Any good stuff known to exist? MySQL background. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_globals security
Hi, There is also a $_REQUEST variable. At the risk of starting another flame war: IMHO switching off register globals and relying on $_POST etc can lull you into a false sense of security. Fernando Melo wrote: Thanks. I don't see how this makes it more secure though? The values are still picked up the same way from a URL -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 13:28 To: [EMAIL PROTECTED] Subject: Re: [PHP] register_globals security Hi Fernando, I have a PHP application that passes variables (values) from a form. I get these using $_POST However I do also post some variables via a link. Which ofcourse requires register_globals to be ON. Do you mean variables in a URL, like this: www.example.com/index.php?foo=1bar=2 If so you can access these via the $_GET array and leave register_globals turned off. Cheers Jon -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_globals security
Hi, Jay and Eugene have already made very good suggestions. To add to that you can always try filtering your variables with strip_tags(), htmlspecialchars(), addslashes() etc to protect against attacks. all the best Fernando Melo wrote: Yup I still don't see how it improves anything with regards to security. -Original Message- From: Raditha Dissanayake [mailto:[EMAIL PROTECTED] Sent: 13 November 2003 15:24 To: [EMAIL PROTECTED] Subject: Re: [PHP] register_globals security Hi, There is also a $_REQUEST variable. At the risk of starting another flame war: IMHO switching off register globals and relying on $_POST etc can lull you into a false sense of security. Fernando Melo wrote: Thanks. I don't see how this makes it more secure though? The values are still picked up the same way from a URL -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php echo in php-only file
Hi, At first glance it looks like you are trying to 'push' is it what you really want? Thomas Lanphier wrote: First, the situation: After executing php commands in an html file that provides room in the html for nice echo outputs to screen, I pass control to another php-only (no html) file. The question: Can I use echo statements in the php-only file, and have the results display in the html file that I expect is still on-screen in the user's browser? Thanks for any help! -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php echo in php-only file
Hi Thomas, looks like you have sent the exact message that you sent to chris to me as well. As chris has pointed out you could just as easily have sent it to the list. Chris Shiflett wrote: --- Thomas Lanphier [EMAIL PROTECTED] wrote: Do you have an answer to my question? When I posed the question in the newsgroup, I tried very hard to not get bogged down in nonessential details and asked the actual question I had. Please feel free to ask me for something specific, if it would help. I'm 90% sure I could answer your question, whatever it is. However, you should always ask to the entire list, as there you have the chance to see many answers, different perspectives, etc. No one can answer your question with any degree of accuracy if you do not provide any details. That's the point I originally tried to make. If you can't think of a way to explain what you are doing in detail, showing a small example with some code can help do that for you. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() in windows (again!)
that the mail() functions uses the sendmail aplication. I've also heard this 'sendmail' won't work with windows (Windows rulez!(just to piss those linux guys off!)). If you were on linux you wouldn't have to send this mail. What you can do is to use your ISP's mail server. (which is most probably running linux :-) ) edit your php.ini file and set that as your smtp server. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Share Folder...
what os? D. Jame wrote: Hi, I have three machine 1, 2, 3. all online have unique IP. one of them (no. 3) running web server which configured with PHP, now my problem is I want to show share directory on Web page to my users. when they enter IP of machine 1 or 2... anyone to know...plz help me.. jame -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Quick answer: as others before me have also mentioned this cannot be done. Martin Helie wrote: Here's a quick one: has anyone found a way to keep a resource handle alive between page loads? For example, I open a socket with fsockopen, and I'd like the handle to survive page loads. As you know, there's not much point storing it in a session (or its parent object)... Any ideas? Tx, Martin -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resource handle - keeping alive?
Hi Martin, This is unfortunately not something that has an easy work around. I have seen a post by Dan Joseph with what looks like a good suggestion. If my understanding of J2EE is correct, i believe you will be able to persist connections between two different pages if you use java servlets. all the best Martin Helie wrote: Hi Chris, yes, that's precisely my problem (I had read the notes). This seems like something people would want to do, so I'm surprised no one's found some workaround. Any other ideas? Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Martin Helie [EMAIL PROTECTED] wrote: no, unfortunately, that doesn't work; it creates a permanent socket on the server, but between page reads, php still loses its resource id, and can't communicate with the socket... The last two user notes on this page seem relevant: http://www.php.net/pfsockopen Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reply to a email with PHP
Hi, You probably didn't find anything in the imap api because mail reply is handled by SMTP. You can use the IMAP library to read your mail, however you need to use either the simple old mail() function or one of the more sophisticated MIME mail classes available to send replies or new messages. all the best [EMAIL PROTECTED] wrote: Hi folks, What I would like to do in PHP is the following: * read my mailbox on the server * select some mails * reply to theses mails. I have looked among the PHP imap API, and I did not found any like imap_reply. What should I do? Many thanks for helping. Paul BELAVAL -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whats wrong with this query?
Hi Dave, I could be wrong cause i am answering without running your code : 1) your mysql user account probably does not have grant privileges. good thing too. It's very dangerous to just run a grant query like this because it can so easily be abused by a malicious user. (of course you might have security measures in place which are not obvious to us because you have not posted that part of the code). 2) your variables should in the strictest sense be $_POST['f2'] etc. all the best Dave Carrera wrote: $addamysqluser = mysql_query(grant select,insert,drop,update,delete,create,index,alter on $_POST[f2] to [EMAIL PROTECTED] IDENTIFIED by $_POST[f3]); What is wrong with the above php based mysql_query ? I am trying to add a user to mysql granting just the specified rights to table defined by the $_POST[f2] which is both the table and username and the password is defined by $_POST[f3]. This has been baffleing me for a couple of days now and any help given is very much appreciated. Thank you in advance. Yours Dave C -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help create community newbie guide to security
Nice work chris, you have left precious little for the others to comment on :-) 10. Use htmlentities() on data that will be put through a SQL query to prevent XSS attacks. http://php.net/htmlentities This is a nice suggestion. While htmlentities() cannot be guaranteed to defend against all XSS vulnerabilities, I would bet that most XSS vulnerabilities are due to a complete lack of filtering logic. If a developer doesn't even bother using htmlentities(), neglect is the best word to describe his/her approach to developing. In some cases, the developer may want certain HTML elements interpreted rather than escaped in this way. Perhaps you could mention that something like str_replace() can be used to convert specific HTML entities back to their original form. This method should filter any unwanted elements. but i would still like to add 2c by saying there is also the option of strip_tags which does a more drastic sanitization by removing anything that smells of html. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Password Function
Hi, it's very simple intead of using insert into users set userPassword='123'; you say insert into users set userPassword=password('123'); Shaun wrote: Hi, I am trying to make my site more secure, can anyone suggest a tutorial on using the mySQL password function with PHP. I can't find anything through google... Thanks for your help -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Building PHP source for Linux / Unix.
Hi, Compiling stuff from source is one of the fun things that you get to do on linux. As with most things it takes a while to aquire the taste though. The best place to start usually is the README and INSTALL scripts that you tend to find with almost everything distributed as source. You will also find ./configure --help to be quite usefull. Before you compile PHP you might want to try your hand and apache, which is a lot easier to compile and which you need anyway (unless you plan to run comand line only) have fun. Ananth Kesari wrote: Hi, I am a beginner to building PHP source code for Linux / Unix. I am looking for a document that takes me through a step-by-step guidelines of doing this. Can someone point to a link for this? Thanks, Ananth. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Password Function
Hi, Oh, and this will do almost NOTHING to make your site more secure. Why do you think it will? ---John Holmes... You are partly right about this we had a nice flame war about this very issue couple of weeks ago on the jabber lists. Anyone interested in the nitty gritty can google on the jabber archives. I still use the password() function whenever i can cause i only have to type in about 10 keystrokes anyhow, the reason is that it will keep other users of the database from accidentaly seeing passwords that they shouldn't. Since this is one way hashes it cannot be decoded. Almost any argument that applies for/against /etc/password would apply to mysql password() as well. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sockets - fine tunning
Hi, I think curt is right about transfer encoding being a problem, however i feel it may not be 'the' problem. This timing issue looks like you are running into a 'blocking' kind of situation. Cosmin, Have you tried the 'Connection: close' header? Getting back to transfer encoding you might want to look at the RFC - http://www.w3.org/Protocols/rfc2616/rfc2616.html where they explain how it's to be handled. all the best Curt Zirzow wrote: * Thus wrote Cosmin ([EMAIL PROTECTED]): On Sun, 2003-10-26 at 15:30, Raditha Dissanayake wrote: are you getting any 1xx status codes from the web server? here are the full headers: Transfer-Encoding: chunked This is probably the problem. If you inspect your data, you'll notice that it has extra characters in it right now. You can change your protocol version to HTTP/1.0 or send a header to tell the server you don't want chuncked (don't know that off hand). Curt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] keyword search syntax
If you put up a full text index on it you can do searches that smell like a primitive search engine. best regards Robb Kerr wrote: On Tue, 28 Oct 2003 02:09:06 +, David Otton wrote: Personally, I'd normalize that into a keyword table, a record table and a joining table. However, the SQL keyword you're looking for is LIKE WHERE field LIKE '%$variable%' I agree. I'd structure the data quite differently. But, I've got the data from a client and at this point I don't have the authority to restructure the database. Thanx for the tip on the LIKE command. Robb -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing specific portions of XML files
Hi, You cannot parse a specific section only, the parser will go through the whole document. What you can do is to skip the section that does not interest you. I have seen two good suggestions that both smell of DOM (xslt has dom under the hood). With SAX you can just have a simple string comparision in the start_element handler that watches out for the node that interests you and then set a flag. If you could post a short sample of your xml someone might be able to help you more. best regards Ryan Thompson wrote: I'm stumped. I think it's just the logic I can't figure out. I have a file formatted for Docbook in XML. I'm trying to figure out a way to parse a specifice portion of an itemizedlist. It's for a change log. I want users to be able to view changes made to just one version and possibly for all. I can't use multiple change logs cause it the same file is used to make the text version that goes into the release documentation. Anyone got any ideas that can give me a push in the right direction. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sockets - fine tunning
are you getting any 1xx status codes from the web server? Cosmin wrote: I'm trying to make an application using XML-RPC, and I have the following problem: I use fsockopen() to simulate a POST to my local web-server. All goes very well except it's very very slow. Here is my code maybe someone could tell me what I'm doing wrong: = $url= parse_url($this-serverURL); $requestString= POST .$url['path']. HTTP/1.1\r\nHost: .$url['host'].\r\nContent-type: application/x-www.form-urlencoded\r\nContent-length: .strlen($this-requestData).\r\n\r\n.$this-requestData;; $fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5); if ($fp) { //make the request to the xml-rpc server fputs($fp, $requestString); //gets the result while (!feof($fp)) { $response .= fgets($fp, 1024); } fclose($fp); $this-rawResponse=$response; $this-error=false; } else { $this-error=true; $this-errorMessage=$err_msg; } This is the slowest part of my script(about 16 seconds). The server's execution time is only 0.00064206123352051 seconds. I don't know why it takes so much to write a string to the socket and then to read the response. Here are the execution times: Server StartServer Stop 1067090777.5339 1067090777.5346 Client StartClient Stop 1067090777.5303 1067090794.5286 If someone knows a way on how to speed this up please tell me how to do it. Thank you for your time -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CURL remote server get data back
What kind of server? Dan McCullough wrote: I have an install script that verifies someones registration key and information against my client database and installs or patches, or whatever else. I'm new with CURL but is there away to get back a response from the server that your are querying back through CURL? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CURL remote server get data back
What i meant was Web , ftp, ssh, telnet, jabber, imap, pop, smtp etc or proprietory? :-) if you are talking about a web server, there were two threads on POST to a web serving using PHP this week. You might find them usefull. You might be interested to know that fopen can also work with urls Dan McCullough wrote: Linux box to Linux box. Running PHP 4.1+ The script its connecting to would reside on one of my servers. -Original Message- From: Raditha Dissanayake [mailto:[EMAIL PROTECTED] Sent: Sunday, October 26, 2003 8:32 AM To: Dan McCullough Cc: [EMAIL PROTECTED] Subject: Re: [PHP] CURL remote server get data back What kind of server? Dan McCullough wrote: I have an install script that verifies someones registration key and information against my client database and installs or patches, or whatever else. I'm new with CURL but is there away to get back a response from the server that your are querying back through CURL? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML/MySQL
Hi, As Ray has also mentioned sprintf() is the best approach. I would also like to point out that you would be doing three iteration over your data so please make sure that your queries are not just 'select * from customers' but 'select * from customers where something=something' all the best Ian Williams wrote: Apologies to anyone also subscribed to php.xml.dev, who will have read this earlier, but it doesn't seem as frequently read as this news group... so I am reposting... Hi I want to write a function that will take any SQL query as a parameter, and generate XML that represents the recordset. e.g. SELECT * FROM Customers returns: recordset record id=1 name=Mr Smith purchases=2/ record id=2 name=Mr Jones purchases=25/ record id=3 name=Mr Davis purchases=7/ /recordset There are two approaches I think. One is to use the XML DOM, the other is simply to join lots of strings together. What is the best approach? Thanks (and this is my first post to a newsgroup, and my first post to this one, so excuse me if I've missed something vital!) cheers ian ;-) -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with JAVA
Hi, For this scenario, Ray's suggestion of SOAP is IMHO the best option. But just out of curiosity why do you want to mix the two languages? If you are familiar with java you might be better off doing your server side stuff using J2EE. Then you might be able to use Object Streams for your communications or RMI. Then there is the XMLEncoder class that was made availble with 1.4 better stop before someone shoots me down this is a PHP list after all :-) Matt Palermo wrote: I have been searching the web for ways to execute remote PHP files through the use of JAVA code, but I haven't had any luck. I have found many ways to call JAVA functions from a PHP script, but not the other way around. What I'm trying to accomplish is I want to build a JAVA application that will be run from a users local computer after installation and this JAVA program will connect to a url on my server (a url to a PHP script). This PHP script will be used to connect to the server's MySQL database and send some retrieved information back to the JAVA application on the users machine. I have been searching the web for hours trying to find a tutorial, or advice on how to accomplish this, but so far I have had no luck. If anyone has any advice or suggestions please let me know. Thanks, Matt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .htaccess question protect my php test environment
Hi, It's htpasswd and not passwd. As many others on this group i don't use the redhat config system it's lame. You will be better off editing httpd.conf and adding an AllowOverrides directive. best regards Frank Tudor wrote: I have to apologies about this posting in advance so please don't flame me too bad for being off topic. Question: I want to create an .htaccess file to protect my files I did the passwrd -c /directory/file frank the set a password and then confirmed the password I created a .htaccess file with vi and put this in it. AuthName restricted stuff AuthType Basic AuthUserFile /var/password/frank require valid-user then in the redhat http server utitily under server settings I went tot he virtual directory section and created a new virtual dir called virtual 0 and check marked the box at the bottom for .htaccess protection. I restart the server and then go to another computer and put in the URL and no password box comes up. :( __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with JAVA
hi, Great to hear that PHP is your language of choice. There are several SOAP libraries available and they come with good docs. However if you are building an image gallery type application, you will be able to do mos of the work just by using java.net package has has been pointed out. all the best Matt Palermo wrote: I don't neccessarily WANT to mix the 2 languages. I just have an application on my webserver that uses MySQL databases and the script is all written in PHP (which I am pretty good at). The only reason I want to use JAVA is so a user can download and install a program that I write (since JAVA is platform independant) that they can run on their local computers. This JAVA program will connect to the server (PHP files) and send back all the information to the JAVA app. This way, the user doesn't even have to go to the website for this script. They can just open the JAVA program and it will be passed all the neccessary information. I'm just a beginner in JAVA, so it will probably take me quite a while to figure out how to build a whole program like this. Eventually, I want it to be similar to the Gallery Remote program (found at: http://gallery.menalto.com/) for a PHP image gallery. I got a long way to go before I will have this created though, since I'm very new to JAVA (I'm much stronger in PHP). Anyway, I'm sure you get the idea. Matt Raditha Dissanayake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, For this scenario, Ray's suggestion of SOAP is IMHO the best option. But just out of curiosity why do you want to mix the two languages? If you are familiar with java you might be better off doing your server side stuff using J2EE. Then you might be able to use Object Streams for your communications or RMI. Then there is the XMLEncoder class that was made availble with 1.4 better stop before someone shoots me down this is a PHP list after all :-) Matt Palermo wrote: I have been searching the web for ways to execute remote PHP files through the use of JAVA code, but I haven't had any luck. I have found many ways to call JAVA functions from a PHP script, but not the other way around. What I'm trying to accomplish is I want to build a JAVA application that will be run from a users local computer after installation and this JAVA program will connect to a url on my server (a url to a PHP script). This PHP script will be used to connect to the server's MySQL database and send some retrieved information back to the JAVA application on the users machine. I have been searching the web for hours trying to find a tutorial, or advice on how to accomplish this, but so far I have had no luck. If anyone has any advice or suggestions please let me know. Thanks, Matt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_uploaded_file() security
I don't think so. Test this, but I think you can just type /etc/passwd into the file name box (instead of using the browse button) and have that value submitted in the form. May be dependent upon the browser on how it's handled, though. This does not work with multipart/form-data you need www-urlencoded (or just don't set an enctype attribute in your form) Either way, I can still construct a POST to your site using cURL or something to simulate sending you a file with a name of a file on your server. So, validate that the file is actually an uploaded file and not a path to something else. That's why the functions exist. ---John Holmes... -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsock sending bad request
hi, deo $header.= $req\n; Tom is right but as usual IIS is wrong and expects it :-( so better to use it anyway. deo $fp = fsockopen(host, 80, $errno, $errstr, $timeout = 30); errno and errstr will not be set unless you pass it by reference. deo $header.= Host: host\r\n; Host header is usually used only with HTTP/1.1 all the best [EMAIL PROTECTED] wrote: $req = field=1; its the data i need to post Hi, Thursday, October 23, 2003, 7:58:19 AM, you wrote: deo Hi there the following code doesnt seem to work, i am getting a bad request deo sent back from the server, what could be the problem of something so deo simple ? deo $header .= POST test.php HTTP/1.0\r\n; deo $header.= Host: host\r\n; deo $header .= Content-Type: application/x-www-form-urlencoded\r\n; deo $header .= 'Content-Length: ' . strlen($req) . \n\n; deo $header .= Connection: close\n\n; deo $header.= \r\n; deo if (!$fp) { deo // ERROR deo echo $errstr ($errno); deo } else { deo //put the data.. deo fputs ($fp, $header . $req); deo while (!feof($fp)) { deo //read the data returned... deo $res = fgets ($fp, 1024); deo echo $res; deo } deo fclose ($fp); deo } you probably don't need this in the header $header.= $req\n; but I have no idea what $req contains -- regards, Tom -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_uploaded_file() security
Hi, Multipart/form-data sends the entire file, if you don't use that enctype yes, just the file name is sent. best regards Alexander Mueller wrote: Raditha Dissanayake wrote: This does not work with multipart/form-data you need www-urlencoded (or just don't set an enctype attribute in your form) What would happen in this case? The given filename would be passed to the script?! Alexander -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_uploaded_file() security
hi, I think marek's recent message has answered this already, but i also believe that even in the older system where you have form fields like input type=file name=userfile result in global variables like userfile_name etc the global variables don't get populated unless you send the correct enctype. best regards Alexander Mueller wrote: Raditha Dissanayake wrote: Hi, Multipart/form-data sends the entire file, if you don't use that enctype yes, just the file name is sent. best regards I see, but then $_FILES is probably not set. So it wouldnt be necessary to use is_uploaded_file() if one solely uses $_FILES (but should probably nevertheless for any possible bugs - as Marek mentioned). Did I miss anything? Alexander -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array of java-objects
Hi, please post your full code Helke Schröder wrote: Hi, I'm trying to use our java-code in php. But strange things happens Maybe I did a simple mistake.. $MyInf=new Java(myUtil.myInfo); This is inside of a loop through 3 items: $MyAttributes=array(); $MyAttributes=$MyInf-MyAttrReader($v, ,, $item); $c=null; $c=count($MyAttributes); so far ok, $c shows the correct number but when doing this : reset($MyAttributes); $sa=$MyAttributes[0]; /* I can use 0 because there are always more than one elements inside*/ var_dump($sa); it comes up with a java-object only for the first entry object(java)(1) { [0]= int(4) } int(20) int(36) And then of course it's impossible to call methods on the objects because they are no objects Fatal error: Call to a member function on a non-object Every hint woul'd be appreciated thanks, Helke -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Images being uploaded in ASCII format
Hi Pablo, Could you explain what exactly you mean by transferred in ASCII mode? do you find that cr/lf combinations are translated (there by corrupting your image) or some other corruption takes place? Have you opened the files with a hex editor to see the contents? I am sorry if you have mentioned these before, i don't have the older messages in this thread. Pablo Gosse wrote: Hi Tom. make sure you have ENCTYPE=multipart/form-data in the form tag Thanks for the tip, but that's not the problem. My code is below, and as you can see there is nothing in the code that would be causing this. It has to be something in the server, and while there have been a few posts to these lists about this problem, never a resolution for the problem. Here's the code: ?php function handleupload() { if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { $realname = $_FILES['userfile']['name']; if(copy($_FILES['userfile']['tmp_name'], '/path/to/file/'.$realname)) { echo 'br /'.$realname.' uploaded/font'; } else { echo 'br /'.$realname.'could not be uploaded/font'; } } else { echo 'br /Possible file upload attack: filename '.$_FILES['userfile']['name'].'.'; } } ? html head titleFile Upload/title /head body ?php if (isset($_POST['method']) $_POST['method'] == 'upload') handleupload(); ? form ENCTYPE=multipart/form-data method=POST action=?php echo $_SERVER['PHP_SELF']; ? input type=hidden name=method value=upload File:input type=file name=userfile size=35 input type=submit value=upload name=submit /form /body /html This is very standard code, yet the images are uploaded in ascii format. Does anyone have any idea why this is happening? How can I for the http uploads to auto-detect? I've looked through the entire php.ini and httpd.conf files and I can't seem to find anything, and as I mentioned above none of the previous posts on this topic have been resolved. Anyone? Thanks much in advance, Pablo Thursday, October 23, 2003, 4:05:13 AM, you wrote: PG Hi all. I'd like to take a brief sentence to introduce myself first. PG My name is Pablo Gosse, and I've just recently joined the php-general PG list. I've been using PHP since early 2000, and work as webmaster PG at the University of Northern British Columbia. PG I'm running into a problem with file uploads being handled in ascii PG rather than binary format. PG I've been writing a CMS for the past few months and the wysiwyg editor PG we're integrating has a very nice image manager built in PG (www.devedit.com). However, the uploads are being transferred in ascii PG format instead of binary (or auto-detect) which is mangling all the PG images. PG I've done a lot of research into this but can't seem to pin down the PG problem. I've looked through both my php.ini and httpd.conf and can't PG seem to find anything there that would remedy this problem. PG Does anyone have any advice as to where I should be looking to fix this PG problem? PG Thanks much in advance. PG Cheers, PG Pablo -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsock sending bad request
Hi hey Curt, I missed that one. Daniel have you looked at RFC 2616? Curt Zirzow wrote: * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): Hi there the following code doesnt seem to work, i am getting a bad request sent back from the server, what could be the problem of something so simple ? $header .= POST test.php HTTP/1.0\r\n; $header.= Host: host\r\n; $header .= Content-Type: application/x-www-form-urlencoded\r\n; $header .= 'Content-Length: ' . strlen($req) . \n\n; $header .= Connection: close\n\n; $header.= $req\n; $header.= \r\n; The last two lines should be: $header.= \r\n; $header.= $req; #Note, no \n Make sure all your headers have \r\n endings. Technically the $req is not part of the headers but the actual content to be sent. Curt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Images being uploaded in ASCII format
Hi Pablo Pablo Gosse wrote: Hi Raditha. Thanks very much for your reply. I've not been having much luck with this one. welcome This is how the images should appear: http://web.unbc.ca/~gossep/sample_images/1.gif http://web.unbc.ca/~gossep/sample_images/nav-02.jpg And here is how they appear after being uploaded: http://web.unbc.ca/~gossep/sample_images/1_uploaded.gif http://web.unbc.ca/~gossep/sample_images/nav-02_uploaded.jpg 1.gif and 1_uploaded.gif differ by much as 4Kb in length! and the first difference occurs at byte number 1276. (I used cmp) The results to me seem the same as if an image were FTPed in ascii mode instead of binary mode (or auto-detect which would ultimately set the mode to binary). Though the output might look like that it's misleading because you are using HTTP post. Unfortunately PHP does not allow access to raw POST data, else this can be debugged by looking at that data. I will mail you (offlist) a small perl script that you can use to write out the POST to a temp file and may be help you get to the bottom of this. I just downloaded the XVI32 hex editor, but what should I be looking for when I open the files and examine the contents? Khexedit might be installed by default. all the best -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ways to break up XML into Arrays????
While it's possible to process XML using regular expression. The whole point of using XML is that you wouldn't have to use hacked solutions like that :-) Scott Fletcher wrote: Hi Fellas! I don't want to use the PHP's XML feature at this moment because I found out that I need to recompile PHP with the XML support which I can't do at this moment. So, instead of recompiling, does anyone know of a good sample coding or class out there on the Internet that would work I'm looking for something similiar like this... Problem is I don't have good scripts that can handle the quote or double quote without missing up the XML data and PHP Array... --snip-- //Individual FirstNameBill/FirstName LastNameClinton/LastName GenderM/Gender FavoratePetDog/FavoratePet //Joint FirstNameHillary/FirstName LastNameClinton/LastName GenderF/Gender FavoratePetCat/FavoratePet //This would be return in array like... echo $XML_Tag['FirstName'][0]; //Output would be Bill... echo ; //Whitespace... echo $XML_Tag['LastName'][0]; //Output would be Clinton... echo 's favorate pet is a ; echo $XML_Tag['FavoratePet']; //Output would be Dog... echo and his wife name is ; echo $XML_Tag['FirstName'][1]; //Output would be Hillary... echo ; //Whitespace... echo $XML_Tag['LastName'][1]; //Output would be Clinton... --snip-- Just something like that... Thanks!!! Scott F. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Using two XSLT stylesheets
Hi, Catching up with my list mails. As Ray has pointed out you can only do one transformation with one instance. That's because the underline parsers are good for one transformation only. Maybe if you would post your xml and xsl we could give it a shot. BTW: OT: if you are ok with perl, doing this with perl is a heck of a lot easier. rich wrote: OK, This is my latest idea to try and do this: $xh = xslt_create(); parse_str($_SERVER['QUERY_STRING']); $params = array(keywords = $keywords); $results = xslt_process($xh, 'library.xml', 'simple-search.xsl', NULL, NULL, --$params); $f = fopen('results.xml','w'); fwrite($f, $results); fclose($f); $data = xslt_process($xh, 'results.xml', 'display-results.xsl', NULL, NULL, --NULL); echo $data; xslt_free($xh); But, of course, it just throws up messages saying I can't write to results.xml! See http://www.cursus.uea.ac.uk/cdlib/ for error messages in action (search terms which will find records include 'Boulez', 'Messiaen'). Does anyone know why: xslt_process($xh, 'sample.xml', 'sample.xsl', 'result.xml') doesn't work? (lifted straight from the manual) Cheers, Rich -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i print out the files in a directory?
hi please see if this is what you need: http://www.raditha.com/php/dir.php Bas wrote: How can i print out all of the files in a directory? I want some output as this: index.php login.php image1.gif image2.jpg -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP_POST_RAW_DATA problem
Hi, You will most probably need to send a content type other than mulitpart/form-data for it to work. When you do you will find that the variables may not be populated. Manuel Vázquez Acosta wrote: Oh! Thanks, I'm using cURL to send the post, I will check if I send a content-type header. Manu. Raditha Dissanayake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, RAW_POST_DATA does not get populated for known content types. That's why i got a little help from perl when building the megaupload progress bar. Manuel Vázquez Acosta wrote: Hello: I'm running into a problem when trying to get $HTTP_POST_RAW_DATA; it always returns NULL althought my php.ini always_populate_raw_post_data is set to On. My env: Windows XP-Pro; Apache 1.3.24/PHP module 4.3.3 Any ideas? Manu. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP_POST_RAW_DATA problem
Hi, RAW_POST_DATA does not get populated for known content types. That's why i got a little help from perl when building the megaupload progress bar. Manuel Vázquez Acosta wrote: Hello: I'm running into a problem when trying to get $HTTP_POST_RAW_DATA; it always returns NULL althought my php.ini always_populate_raw_post_data is set to On. My env: Windows XP-Pro; Apache 1.3.24/PHP module 4.3.3 Any ideas? Manu. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Detecting devices i.e. PDA, Mobile
As Tom has said you are going back to square one. If you can spend the effort to make XHTML you can just as easily create an XSL Shaun wrote: Justin, Thank you for you replies, I have decided to convert the whole site to XHTML, for compatability. However, I am unable to view the site through my phones WAP browser, does this mean XHTML is only compatible with PC's and PDA's? I have validadted the code at http://validator.w3.org ... Thanks for your help Justin French [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday, October 12, 2003, at 07:46 PM, Tom Rogers wrote: From my experience css is even more unreliable than user agent being set and all browser producers seem to have their own idea of what a standard is supposed to look like as well. At least with table layouts most of the current desktop browsers will make a half decent try. With companies like Netscape and Microsoft providing browsers you should stay away from strict anything is my advice :) It depends what you're aiming for. If you're aiming for pixel perfect display on the usual browsers, great -- go for tables and the usual hacks. But in the meantime you're sacrificing forwards compatibility for backwards compatibility, making your site hugely inaccessible, causing huge ongoing development costs (update the hacks to support newer browsers and devices), etc etc. What's the point in developing three or more sites (WAP, PDA, Desktop) when one can do the same, with a few SMALL sacrifices. As a bonus, you're developing HTML for EVERYONE, not turning away ANYONE, and you're saving your client some money. Anyway, this is getting a little OT :) You're entitled to do things your way, and so am I... the $'s and accessibility are making my decisions for me. The ideal way of detecting a wap browser is through the accepted mime types from the request header but I am not sure if that info is passed on by PHP. You could try ? $headers = width: 300px;; print_r($headers); ? and see what is supplied under accept with various devices You need to look for something like this: text/vnd.wap.wml for .wml files (WML source files) application/vnd.wap.wmlc for .wmlc files (WML compiled files) text/vnd.wap.wmlscript for .wmls files (WMLScript source files) application/vnd.wap.wmlscriptc for .wmlsc files (WMLScript compiled files) image/vnd.wap.wbmp for .wbmp files (wireless bitmaps) Nice idea! Justin -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_connect() issues
easiest way i know to debug FTP is with good old telnet. just type telnet yourserver.com 21 If there is a firewall in the way you will get a time out. If not you can login with user youname pass your pass btw if you have access to the FTP server's log file that will probably tell you what's happening or not happening. all the best Phil Ewington - 43 Plc wrote: I can still connect to the ftp server from my client machine using any number of FTP apps, I also created an ftp test tool, on the same server as I am currently having problems, that lets you enter an ftp host, username password to see if it can connect and login. I can login to other ftp servers just not the one I want to. Strangely I managed to get a connection to the suspect ftp server a couple of times then nothing again. Seems to be an intermittent problem, but it would be nice to know whether it was a connection that was being dropped by the remote server or whether there were network issues that stopped the request reaching the target server. Phil. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: 10 October 2003 17:51 To: [EMAIL PROTECTED] Subject: Re: [PHP] ftp_connect() issues On Saturday 11 October 2003 00:01, Phil Ewington - 43 Plc wrote: A script that has been running successfully for over 18 months has suddenly stopped working due to ftp_connect() failing. I have been assured that nothing has changed on the ftp server so now need to try and find out why this is happening. And have you verified that you can still connect to the ftp server via other means? And have you verified that the script can connect to other ftp servers? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Connecting to Linux server from windows
SOAP Binay wrote: Hi all ! I have PHP (4.3.2) running on windows 2k. Now i want to connect to a Linux Server and execute some commands and get the results back to win2k server. How can i achiece this. Please help me out. Thanks in advance Binay -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing variables between pages
Hi, You need to use sessions. Please refer session handling functions in the manual. Having said that it's a bad idea to put username in a session. You need to have some kind of association between session ids and username's in app. The most common way this is done is with a two column table. all the best Rashini Jayasinghe wrote: Hi, I want to pass a variable between three pages. I tried to get a username from the first page through a form. Use that username in a select statement in the second page to query a table.Everything is fine up to that point. now I want to pass the same username to the third page where I have to use it to select a table name by that username and it doesn't work. I tried $_POST['username'] and the value is not passed to the third page. Is there a way of doing this? Please help. Thank You. Rashini -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Detecting devices i.e. PDA, Mobile
Hi Justin et al, Yes you are right that user agent field is not always reliable but 98% of the time you will be able to tell if it's a mobile or a pc. That's good enough. If someone fakes the header they will just get a wrong content type and no harm done. I first did a wap site with php using this method way back in 2000. Unidentified browsers were given html. As for a detailed list of various mobile browers, it's impossible to maintain this list. That's why there is a sourceforge project that does it and we can all benefit. did i mention xslt? Justin French wrote: On Sunday, October 12, 2003, at 12:02 PM, Manuel Vázquez Acosta wrote: Take a look at what is printed by: var_dump($_SERVER); Maybe the HTTP_USER_AGENT can lead you to somewhere out of this problem. Manu. Shaun [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have created an online system, and have created a WAP version, and am currently crreating a PDA version. What I wuold like to to do is give out the same URL instead of domain.com for normal use, domain.com/wap/ or domain.com/pda/. Is there a way of detecting what device is loading the site and redirect them accordingly? Thanks for your help Manuel, Shaun, $_SERVER['HTTP_USER_AGENT'] (just like anything else from the client side) can't be trusted to either exist, or to be correct. Some user agents don't set this value, and it's quite easy for it to be faked. More to the point, there's no way you can possibly account for all possible user agents out there... perhaps only the popular ones. So, $_SERVER['HTTP_USER_AGENT'] is a good starting point or method for guessing where to send people, but it's not fail safe AT ALL. I think the fail safe way is to create pages which are standards compliant (XHTML strict) and use CSS for all styling/presentation, which means your pages will accessible via the largest possible number of viewing devices, like PDA, WAP, text-to-speech, desktop browsers, Web TV, etc. The move away from table based layouts and poorly accessible webpages is a big one, but not THAT big :) Justin -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detecting devices i.e. PDA, Mobile
The easiest is to detect the browser because this is what really matters. Then the dimensions of the display come into the picture. There is a db of these browser capabilities and detecting and using them etc in a sourceforge project call wurlf all the best Shaun wrote: Hi, I have created an online system, and have created a WAP version, and am currently crreating a PDA version. What I wuold like to to do is give out the same URL instead of domain.com for normal use, domain.com/wap/ or domain.com/pda/. Is there a way of detecting what device is loading the site and redirect them accordingly? Thanks for your help -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML / XLS application
Very true curt, since he the message seems to be about XSL and not about XLS (which i understand to be a ms excel file format) Orlando, head off to w3schools where you will find a map :-) Curt Zirzow wrote: * Thus wrote Ray Hunter ([EMAIL PROTECTED]): So what is your questions concerning php? I think he's lost. Curt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [xml] character data
What Tom has to say + you should note that character data may be called more than once for each call to startElement. Tom Rogers wrote: Hi, Saturday, October 11, 2003, 6:26:01 AM, you wrote: DA I do not understand why this line does not work : DA $info[$element] = $content; DA but yet this works: echo $content; DA why? what is the trick? DA -- DA $xml_comment_file = basename($svg_file, '.svg.xml') .'.info.xml'; DA if (file_exists($xml_comment_file)) { DA $file = $xml_comment_file; DA $info = array(); DA $element = null; DA function startElement($parser, $name, $attrs) { DA global $element; DA $element = $name; DA } DA function endElement($parser, $name) { DA print ; DA } DA function characterData($parser, $content) { DA global $info; DA global $element; DA $info[$element] = $content; DA //$info[$element] = sprintf(%s, $content); DA } DA $xml_parser = xml_parser_create(); DA xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, FALSE); DA xml_set_element_handler($xml_parser, startElement, endElement); DA xml_set_character_data_handler($xml_parser, characterData); DA if (!($fp = fopen($file, 'r'))) DA die(could not open XML input\n); DA while ($data = fread($fp, 4096)) DA if (!xml_parse($xml_parser, $data, feof($fp))) DA die(sprintf(XML error: %s at line %d, DAxml_error_string(xml_get_error_code($xml_parser)), DAxml_get_current_line_number($xml_parser))); DA xml_parser_free($xml_parser); DA print_r($info); DA } DA /* DA # the output is without $content : DA Array DA ( DA [info] = DA [file] = DA [orig-file] = DA [orig-author] = DA [bitmap-src] = DA [orig-date] = DA [svg-date] = DA ) DA */ the function characterData can be called with whitespace which is probably overwriting your content try this $content = trim($content); if(!empty($content)) $info[$element] = $content; -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload meter
Hi, These guys have done a good job and I think it's planned to be included in V5. Till then i invite you to take a look at http://www.sourceforge.net/projects/megaupload/ where you can download a system that works without PHP having to be patched. best regards raditha. Steve Murphy wrote: David Enderson also developed an upload meter and contacted PHP about including it. http://www.mail-archive.com/[EMAIL PROTECTED]/msg02155.html Long and short, PHP never included it. This functionality is requested and can be included easily. I'm in the process of developing documentation and rpm packaging for Dave's meter and I've already had 7 clients call me about it, (IMO) I think its time more projects like this are needed and PHP should do a better job of incorporating them and less time holding conferences. Murph Oh go here (http://www.pfohlsolutions.com/projects/upload) to see what's available (not much right now) from Enderson's project. Note this is not the official site. -Original Message- From: Hardik Doshi [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 9:47 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] File upload meter Hi Group, It's really nice to see the file upload meter developed by Doru Theodor Petrescu (http://pdoru.from.ro/). He did a nice job. He created serveral patches for the php 4 to enable the file upload meter. I was just wondering what will happen to the file upload meter once the php 5.0 will release? Is PHP community planning to put file upload meter code permanently in every distributions of the php? Please let me know about my queries. I really want to use this feature but worrying for the future php releases. Thanks Regards, Hardik Doshi __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] do I need a database
How about XML ? But seriously flat files or databases would be better if this is a simple set up. If you plan to do a lot of writing and very little reading flat files are a hell of a lot of faster. If you use flatfiles though you have to forget about searching through it (unless you plan to write a few thousand lines of code). Sudheer Palaparambil wrote: Hi, I am planning a static site. But I need to capture some data (username, address, telephone and email only), do I need a database for recording this data ? Or is there any other way to record this data ? The volume may be high. Thank you. Sudheer _ Get Married! http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Search from 7 lakh Brides Grooms. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP CSS
Couple of days of ago we had a nice thread on the use of XSLT. This is a situation where XSLT would be an ideal solution. Raquel Rice wrote: On Tue, 7 Oct 2003 17:06:13 -0500 erythros [EMAIL PROTECTED] wrote: you probably just want what everyone wants... a seperation of design from content. as for applying the variables to the style sheet it depends on what youre trying to do. what are the variables for? to request a specific css file? or are they to supplement the ccs file (ie: use value x for width of div), or are they to override the css file? i may have it wrong but what it sounds like is that you want to have a default css file then allow the user to make changes via the ini file. is this what youre after? Well, yes ... in a way. The plan is to have a main site, where users can have a subsite off the main site. I want to give the users the ability to customize, to an extent, their own subsite if they wish, while the main site retains the look I give it. -- Raquel I am only one; but still I am one. I cannot do everything, but still I can do something; I will not refuse to do the something I can do. --Helen Keller -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Use XML...
Hi, I do believe sudheer's requirement would call for the searching to be done on the server side. Personally i don't use XML when searching is involved. If you use a DOM based solution all your servers memory just gets sucked up. If you use plain old sax you have to do a lot of coding yourself (though you can get the result much faster). But i do think it's just about the best thing when it comes to sequential reading of records. Russell P Jones wrote: Use XML to store all your data, and if you want an xml search mechanism, I have a quick and dirty answer that runs client-side so you dont have to worry about wearing down your server... russ jones -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload meter
Hi I remembers seeing something about this in Zend.com sometime back but sadly i have forgotten which one it was. I can assure you it most certainly isn't my progress meter because the architecture is different :-) best regards Hardik Doshi wrote: Hi Radhitha, Can you please let me know which file upload meter code (the one i mentiond or megaupload) will be included in the V5? Thanks Hardik --- Raditha Dissanayake [EMAIL PROTECTED] wrote: Hi, These guys have done a good job and I think it's planned to be included in V5. Till then i invite you to take a look at http://www.sourceforge.net/projects/megaupload/ where you can download a system that works without PHP having to be patched. best regards raditha. Steve Murphy wrote: David Enderson also developed an upload meter and contacted PHP about including it. http://www.mail-archive.com/[EMAIL PROTECTED]/msg02155.html Long and short, PHP never included it. This functionality is requested and can be included easily. I'm in the process of developing documentation and rpm packaging for Dave's meter and I've already had 7 clients call me about it, (IMO) I think its time more projects like this are needed and PHP should do a better job of incorporating them and less time holding conferences. Murph Oh go here (http://www.pfohlsolutions.com/projects/upload) to see what's available (not much right now) from Enderson's project. Note this is not the official site. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP CSS
Hi David, I think he's suggesting parsing and rewriting the CSS files - treating them as INI files. Nopes definitely not. Personally, I think XSLT os overkill for this, but then I think it's a pig's ear fullstop. Yes everyone is entitled to his opinion. :-) Write a script that opens your CSS file, parses the current CSS settings out of it, and displays them as a form. The user then updates and submits new values, and the script writes the new values the the CSS file. I'd bet money that a PHP class for reading and writing CSS files already exists, too. I would agree with you that there are ways in which you can dynamically generate CSS etc with PHP. I have been down that road three four years back. But raquel wants to separate these things out. First there was barly and hops, then someone made a better way of consumin it - beer. best regards. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get an attached file from a POP3 mail
It might interest you to know that the php imap library works with pop as well. can't figure out for the life of me why people use pop3 though :-)) all the best Javier Tacon wrote: Hi, Anyone knows how to get an attached file from a POP3 mail? I can logon, read the headers and body with Net_POP3 pear module, but I don't know how to process the mail to extract attached files .. Exists libraries that can do that? Javier Tacón - Developer Private Media Group, Inc. www.prvt.com (Nasdaq: PRVT) -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (native) linux-php-editor with some advanced features?
Quanta is not an IDE but it has excellent support for php. Thomas Seifert wrote: Hey folks, I know this topic comes up again and again but I couldn't find any usefull php-editor for linux which is NOT written in java AND has some advanced features like a file navigation (listing all functions in a file with direct jump to them) or tooltips with the function definition or similar. I liked the features of the Zend IDE but its just to aching slow on linux (don't know why, but its much faster on windows), while other native editors are not made for php or just contain its syntax-highlightning without any further special features. Did I miss one of the available editors which provides these features? Thanks, Thomas -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NEW: XML Application Objects
Hi Terrence The only thing that disagree with in your whole post is 'XSLT is a pain in the butt' far from it. I aint no master either but i really like it. XSLT is a pain in the butt if you want to master it - particularly if you're going from imperative programming to declarative (maybe XPath is functional, but declaring templates is definately declarative) as many PHP developers would be. It took me a good twelve months to get it (eg. use XPath filters and not xsl:if/). That didn't stop me from churning out some production applications using XSLT. You can learn the basics without mastering it and still find it plenty useful. I would argue that my XSLT skills still leave a lot to be desired, but mastery of it is still worthwhile persuing. Quite simply, XSLT has a lot of depth. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP EJB
Hi Alec, I have dabbled with php and java combinations at various times as well. But IMHO combining PHP with EJB would be like combining the 'simplest approach to solving a problem' with the 'most complicated approach' to solving a problem. :-) best regards Alec wrote: Hi, Though I have used PHP with Java Objects for sometime, I am keen to know whether anyone has tried using PHP to communicate with Enterprise JavaBeans?? Thanks -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [AWF-TOPIC] Create from PHP on the Fly???
I hear you robert. I will be shot down for saying the following but here goes: The GPL tends to scare people who are not very familiar with open source. They believe GPL and Open Source are synonyms which obviously isn't true. Unfortunately this is what most people (outside the open source community) i have spoken to on the subject seem to think. best regards Robert Cummings wrote: On Fri, 2003-10-03 at 07:58, Jay Blanchard wrote: [snip] I think Jay probably understands, but for those who don't, http://www.gnu.org/philosophy/free-sw.html Quite frankly i don't mind people using anything that i open source in commercial applications. When i do mind i don't release it as open source :-) [/snip] ***applause*** Well said! (I wanted to say other stuff here, but I just couldn't say it well this morning. I will say that there is no shame in profiting from commercial use projects). Perhaps I've been a little misunderstood. I love the whole open source movement, I love that code can be shared, and I was happy to release my own code as open source. I only have issues with the GPL, and licenses like it, that seem to me to cause the developer to relinquish all control of their work. Cheers, Rob. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NEW: XML Application Objects
Hi Terence, I am equally puzzled as to why people are using all sorts of crappy proprietory template systems instead of XSLT. It's particularly useful when dealing with WAP. I suspect the reason could well be the inconsistencies in compiling php with XSLT support. compiling the Sablatron module for perl on the other hand is a breeze and over the last year or so whenever i did anything with xslt it's always been with perl. Can i contribute to your project? Terence wrote: I've just released the first distribution for an open-source project called XML Application Objects (XAO). It's the result of working with XML/XSLT in PHP for a couple of years now. Although this is an alpha release, the concept itself has gone through a lot of refinement and is now ready for prime time. The publication of the project itself was partially motivated by the discussions that took place in this thread (A Complete List of PHP Template Engines?) which basically sees me arguing for the usage of standards (XSLT) rather than having to learn a proprietary new templating system every time you work on someone elses PHP app. This project is the result of much blood, sweat, and tears so I hope someone out there finds it useful. I have made documentation a paramount considderation for the XAO API because I'm keen for it to be another PHP success story. The website has a tonne of information so I'm not gonna try and promote XAO in this message. Please check it out... http://xao-php.sourceforge.net/ cheers. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NEW: XML Application Objects
Hi, Please give it a shot, it's real easy. far easier than any of the lame php template systems i have seen. The beauty is that the same XML/XSL combo can be used with PHP, perl, JSP/Servlets, C++, VC++,VB,C,C# and the list goes on and on. Disclaimer: I have never written a single line of VB ,VC++ or C# code and don't intend to do so in the future. Robert Cummings wrote: On Fri, 2003-10-03 at 07:21, Terence wrote: The publication of the project itself was partially motivated by the discussions that took place in this thread (A Complete List of PHP Template Engines?) which basically sees me arguing for the usage of standards (XSLT) rather than having to learn a proprietary new templating system every time you work on someone elses PHP app. XSLT is itself yet another language to learn. Albeit a standard, it is much heavier than using simple XML tags or macros with PHP code. personally I never cared much for XSLT, but I imagine that goes back to my not liking LISP either -- which is a case of not liking functional languages versus procedural languages. Cheers, Rob. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NEW: XML Application Objects
The ones I tried were lame. Haven't studied your engine yet so i have yet to decide whether it's lame or not ;-) best regards Robert Cummings wrote: On Fri, 2003-10-03 at 11:30, Raditha Dissanayake wrote: Hi, Please give it a shot, it's real easy. far easier than any of the lame php template systems i have seen. The beauty is that the same XML/XSL combo can be used with PHP, perl, JSP/Servlets, C++, VC++,VB,C,C# and the list goes on and on. Disclaimer: I have never written a single line of VB ,VC++ or C# code and don't intend to do so in the future. I have used XSLT before and can't say I particularly liked it. I have my own lame (as you put it ;) php templating system which I prefer much more. Mind you, in all honesty, XSLT support can be plugged into my templating engine if I wanted without any adaptation to the engine itself. Cheers, Rob. Robert Cummings wrote: On Fri, 2003-10-03 at 07:21, Terence wrote: The publication of the project itself was partially motivated by the discussions that took place in this thread (A Complete List of PHP Template Engines?) which basically sees me arguing for the usage of standards (XSLT) rather than having to learn a proprietary new templating system every time you work on someone elses PHP app. XSLT is itself yet another language to learn. Albeit a standard, it is much heavier than using simple XML tags or macros with PHP code. personally I never cared much for XSLT, but I imagine that goes back to my not liking LISP either -- which is a case of not liking functional languages versus procedural languages. Cheers, Rob. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] method to prevent multiple logons of same account
Hi, I am in 100% agreement with mark. But if you want to go ahead with this it can be done easily with the proper use of mysql indexes. Assuming you are storing user information in the mysql db. If you reply back saying you store the userid in the session my reply is going to be. OUCH you have an insecure site. best regards Marek Kilimajer wrote: This has been discused several times befor and the conclusion is that these obstructions are wrong. What if the user loses its credentials and he is still considered loged in. He cannot log in again. If you bind the session to a IP address then you create problems for users behind proxy farms. Your option (b) is virtualy the same as doing nothing about it at all. Chris W. Parker wrote: Hi. Ok I've got the logging in of customer accounts settled but what I need to work into the system is that of preventing more than one instance of the same account. If I logon right now as testuser1 on ComputerA and then go to ComputerB and login as testuser1 it'll work just fine. What I want to do is one of the following: (a) prevent the second instance of testuser1 from succeeding, (b) logoff the first instance of testuser1 when the second instance authenticates. I know I'll have to keep a database and store the following: username (or user id), session id, time of login, and/or time of last action. Option A is very easy. I can easily look in the database and see if that person is already logged in. If they are found in the db I just refuse the second login attempt. Option B on the other hand seems a little more difficult. As far as I've thought it out so far I'll have to check the db on each page request to see if the user is still valid. That is to say, if the second attempt is allowed to login I would have to change the users session id from the first instance to the second instance. Then when the first instance goes to a new page the application would say Hey wait a minute buddy! Your session id is different than the one in the database. You've either timed out or someone else has logged in with the same username. Am I thinking this through correctly? Comments? Chris. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too many connections fix?
pconnect vs connect: Isn't it what the apache project calls the 'stampeding herd' problem? original question: Nicole one of the simplest, cheapest and best solutions is to put your log files on a separate hard disk. you will be amazed by the result. You would ofcouse get even better results if you switched to RAID. (assuming of course that you haven't done so already) Curt Zirzow wrote: * Thus wrote Chris Shiflett ([EMAIL PROTECTED]): --- Nicole [EMAIL PROTECTED] wrote: Originally, I used pconnect for a while. Then I learned that with high traffic site, that's not the best idea. Where did you learn this? I disagree with that notion. This may be debatable, which is better? php searching through a pool of 1000 connections for a free one or the overhead of opening a new resource to the database each request. Curt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too many connections fix?
Hi, Pardon me, looks like i haven't answered the original question after all. Need coffee. Here is another attempt. Have you considered mysql replication? this is an easy way of building both a fail safe system as well as to balance the load. the drawback is that you need to pay for an extra server. best regards. raditha Raditha Dissanayake wrote: pconnect vs connect: Isn't it what the apache project calls the 'stampeding herd' problem? original question: Nicole one of the simplest, cheapest and best solutions is to put your log files on a separate hard disk. you will be amazed by the result. You would ofcouse get even better results if you switched to RAID. (assuming of course that you haven't done so already) Curt Zirzow wrote: * Thus wrote Chris Shiflett ([EMAIL PROTECTED]): --- Nicole [EMAIL PROTECTED] wrote: Originally, I used pconnect for a while. Then I learned that with high traffic site, that's not the best idea. Where did you learn this? I disagree with that notion. This may be debatable, which is better? php searching through a pool of 1000 connections for a free one or the overhead of opening a new resource to the database each request. Curt -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multi uploads permissions
Hi, you can either use the chown function in php syntax: |int chown|(string filename, mixed user); or use backticks (`) to call the system chown executable. The simplest way however might be to ask your sysadmin to set the umask for you. best regards Cameron Metzke wrote: Hi all, I have a multi upload script, which works, but the end result is that the files that are uploaded are set to permissions of 600. Im think this is because they have a tmp name then are written to the uploads folder so in effect they are written by another system user? (lol ok so im new to php not sure if i followed that myself). well here is the script. ---Start Code-- $where_to_go = $path./home/user/uploader/originals/; //with trailing slash if (!$Submit) { while (list ($key, $value) = each ($_FILES['file']['tmp_name'])) { umask(000); $ok = (move_uploaded_file($_FILES['file']['tmp_name'][$key], $where_to_go . $_FILES['file']['name'][$key])); --End Code--- is there anyway to set the permissions to 777 as i would like to further manipulate the images? and is that a good idea? or would it be better to chown them, (which i have no idea how to do via php). Or does anyone have any other ideas im completely stumped. Thankyou Cam -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create from PHP on the Fly???
how many glasses of beer? apples or oranges? is it raining out side? you are welcome. Jeffrey Fitzgerald wrote: Can this be done? How much $$$? Quality of PDF?? Thanks very much... -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [AWF-TOPIC] Create from PHP on the Fly???
Hi, Robert Cummings wrote: On Thu, 2003-10-02 at 14:48, Evan Nemerson wrote: I think Jay probably understands, but for those who don't, http://www.gnu.org/philosophy/free-sw.html The problem with this kind of freedom (puts fiery backdraft gear on) is that it enables an entity with more resources than the original developer(s) to usurp the entire project. It also provides no incentive for anyone to ever help support the developer(s). I believe in free as in open source, free as in non-commercial use, but as soon as someone profits from the work, there should be some kind of compensation for the time and effort. Opinion: Well Robert, there's no way that it can be controlled. And controlling how you distribute / use your open source stuff would pretty much go against the idea of free software. Having said that i have always believed that GPL doesn't really give you any freedom. That's why i don't release anything under that particular licence and use JOSL ,BSD or something similar. Quite frankly i don't mind people using anything that i open source in commercial applications. When i do mind i don't release it as open source :-) best regards Cheers, Rob. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File question
Hi Edwin, Didn't you read the disclaimer? you could be in serious trouble. - Edwin - wrote: Hi, I'm no genius ;) but... ketvin [EMAIL PROTECTED] wrote: Dear geniuses, A simple question here, i have a file, says, list.txt it is a simple text file and simple field like: aa , bb , cc , dd now i want to use php script to read that list.txt file, and put the data in an array, is there any simple way i could do that ? ...maybe you're looking for this: http://www.php.net/fgetcsv Or, just check the other (file) functions here: http://www.php.net/manual/en/ref.filesystem.php - E - __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nonblocking socket causes 100% cpu usage
Hi, I don't think i saw your mail getting answered. This is unusual cause sockets taking up processor is something that i normaly associate with windows. Maybe if you could post a bit of your code we might be able to get a better idea about what's happening. Joe wrote: I have a commandline php script, which opens a nonblocking socket to a server. Inside the message loop, where it polls the socket to determine whether there is any data to read/write, I've been running into problems, where the application takes as much CPU time as it can (80%, 90%, sometimes 99%, etc)... Normally, using socket_select() with a timeout should allow allow it to poll the socket without using all the cpu time, but it isn't working. I've tried with timeouts of 15ms, 100ms, 200ms, 500ms, 1sec, and it's still using 100% cpu time. Even adding sleep() and usleep() calls will not relieve the system load that the script causes. For now, I've fixed the problem temporarily by not setting the socket in nonblocking mode (so it blocks when reading), but the reason I need to use nonblocking is that I'm adding more to it that will require that the script can respond to events *between* reading from the socket. Can anyone explain why socket_select and other timeout function calls would still cause it to use 100% cpu time? If it makes a difference, the script is on gentoo linux, and it includes a fork() call, to fork into the background (though this shouldn't make a difference). Is it possible that socket_select() ignores the timeout values, if the sockets are nonblocking? Or would I be able to use socket_select() on a blocking socket, to simulate the effect of a nonblocking socket (so that I would only call socket_read() IF socket_select() indicates that there is data waiting.) Thanks Joe -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I auto upload a file to the server?
CPT John W. Holmes wrote: From: Raditha Dissanayake [EMAIL PROTECTED] My Impression from Jane's mail was that she was thinking of using a PHP script on the client side and not the server side. Am i correct jane? If so there would not be security concerns. Obviously as john has so rightly pointed out php on the server side cannot access local files. True, kind of, and that's how I understood it also. But, as we all know, PHP doesn't run client side, so she'd have to turn her computer into a web server or run PHP from the command line. There still isn't a way to automatically submit a file over HTTP using either method, though. FTP would work, though... ---John Holmes... Sorry about the late reply, i have been out of town. One further assumption that i made was that jane would have the php command line version installed. Then php would indeed run on the client side. -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I auto upload a file to the server?
Hi John, Yops you are very right, this is only a few lines of visual basic or java code. John W. Holmes wrote: Mike Migurski wrote: The only part i am having trouble with is making the remote script automatically look into the local computer's hard drive and grab the .txt file. snip The problem with the code above is the path to the file does not show up in the input type='file', and the user would still need to click on the 'submit button' to upload the file. You're out of luck - for security reasons, the file input widget is intentionally resistant to scripting/styling. Like I said, find another method. Try writing a batch file that will FTP them to your server and have a cron script process them. -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I auto upload a file to the server?
Hi John, My Impression from Jane's mail was that she was thinking of using a PHP script on the client side and not the server side. Am i correct jane? If so there would not be security concerns. Obviously as john has so rightly pointed out php on the server side cannot access local files. The only effective way then would be to use signed java applets (which contrary to popular belief can access local files if you give it the right permissions) John W. Holmes wrote: jane wrote: I have a .txt file on my local Windows 2000 box that i want uploaded to a remote L.A.M.P. server with only one click. I want to have a link (shortcut) on my desktop when clicked it launches a web browser loaded with a remote .php script that automatically goes into C:\data\upload_me.txt and uploads upload_me.txt I know how to upload files using php with a browse to file html form, but i want to skip the form and have the file just upload automatically when the script is loaded. I don't know how to make the .php script automatically grab the file from my local box and upload it without any user intervention. You can't. That would be a horrible security violation. Think of a different method. -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] when clients go bad
Hi Jay and everyone, Sorry about the belated reply but i do believe that Work product for the customer belongs to the customer unless specifically stated differently in the contract does not apply to source code. Obviously we are all programmers and not lawyers in this group but i stand by this (until a lawyer corrects me ;-) ) Jay Blanchard wrote: [snip] ... [/snip] Work product for the customer belongs to the customer unless specifically stated differently in the contract. It is their intellectual property. I have coded both as an employee contractor for several years and it is always understood (unless the contract states differently) that the customer owns the work product. I have a couple of tools which I have developed over time, and I specifically exclude these from the work product in the contract if I expect to use them. If the customer chooses to argue on those I just do not use them on their project. Have you done anything special with regards to their site that you should have copyrighted? -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I auto upload a file to the server?
Hi, The exact mechanism you mentioned cannot be easily created with php. What you can do is the install PHP command line version on your system and upload directly with that using a php script completly bypassing the browser. In that case though you will need to create write the post data using your own script. In other words your php script opens the upload_me.txt files, opens an http connection to the server and writes the contents of the file as multipart/form-data. The browser does not come into the picture. all the best jane wrote: I have a .txt file on my local Windows 2000 box that i want uploaded to a remote L.A.M.P. server with only one click. I want to have a link (shortcut) on my desktop when clicked it launches a web browser loaded with a remote .php script that automatically goes into C:\data\upload_me.txt and uploads upload_me.txt I know how to upload files using php with a browse to file html form, but i want to skip the form and have the file just upload automatically when the script is loaded. I don't know how to make the .php script automatically grab the file from my local box and upload it without any user intervention. Any suggestions? Thanks for you help, cheyrl. -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] non-php issue
You can fix all of your problems by formatting your computer and installing a linux distribution. Wang Feng wrote: hi everyone, could someone recommend a security mailing list, please? or you may like to answer my question below: i'm currently using outlook express 6 on WinXP Pro, and something strange happened: everytime when i start the computer, some messages pop up and attempts to sending the replies of the emails (in the inbox) in behalf of me. my anti-virus software doesn't work at all. what's the problem. how can i fix it? please help cheers, feng -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Q on class failure...
hi, It's generaly considered that constructors are supposed return an instance of that class. Use a factory instead if you want to return nulls; jsWalter wrote: I found this in the docs... If you want your constructor to possibly not create the object class A { function A() { // ... // some error occurred $this = null; return; } } I tested it, it works great. Then I read on... Setting $this to null isn't available in PHP 4.3.3R3 anymore. Maybe in version below also. Great! :/ I have 4.3.2, so I guess it would work for me. If this feature has been removed, can someone show me a good way to indicate a failure on object instantiation? Thanks Walter -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] non-php issue
relax guys, I have been dying to say You can fix all of your problems by formatting your computer and installing a linux distribution. On this list for ages :-) but the fact remains that an out of the box installation of any of the linux distros are far more secure than anything putout by that redmond company. Peter James wrote: You guys running Linux sure are cocky about these sorts of things. I have no doubt that Linux' time will come, and then it will be the MacOS X users, or FreeBSD users, or [insert random-os-that-still-remains-under-the-radar here] users that think they are untouchable. If Linux enjoyed the same type of (often less-than-computer-literate) user base that Windows does, there'd be plenty for virus writers and vulnerability exploiters to do. Linux is not necessarily more secure... just not a honeypot of large numbers of gullible users. But that's just my 2 cents (for which I will almost certainly earn the title of troll). - Original Message - From: andu [EMAIL PROTECTED] To: Raditha Dissanayake [EMAIL PROTECTED] Cc: Wang Feng [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, September 21, 2003 10:46 PM Subject: Re: [PHP] non-php issue -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie Guide] RTFM, STFW, and STFA
Jay, Thank you very much for bringing this up. I think if people cannot be curteous and cannot obey maliling list rules and etiquette they don't deserve replies. Jay Blanchard wrote: I just had to get it out of my system this morning. No offense intended to anyone, and not directly aimed at anyone. Just had to get it off of my chest because there have been so many times that it could have been used since we had that conversation a few weeks ago. *grumble* more coffee needed, may need to start smoking again... *weak smile* j/k of course...lighten up and as always BTW, thanks to the guy who is periodically posting the newbie guide. It may be paying dividends, but then again I did see a post with a title IN ALL CAPS WITH NO DETAILS! and another that just said Help Have a pleasant, productive, and educational day. *snicker* feeling better already -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Possible Bug With $_FILES Global
HI, Te first time i switched from $userfile_** to $_FILES i spent hours pulling my hair out trying to figure out why my arrays were not getting populated. I too felt like reporting it but decided against is because someone is sure to say 'this is a feature not a bug' :-)) Nathan Taylor wrote: Hey Guys, I discovered a possible bug with the $_FILES super global and thought I'd pass it along to you guys to double check the accuracy of this being a bug before I reported it to the PHP team. So here goes.. The default format for $_FILES is $_FILES['variable']['element'] which of course works fine, following this format I would assume that the format for a variable inside an array would be $_FILES['array']['variable']['element'] but on the contrary it is in fact $_FILES['array']['element']['variable']. Somehow this doesn't seem quite right to me. Granted, it still works just as well but it sort of breaks the traditional naming structure for an array and really jumbles the logical flow of things. Do you think this is worth reporting? Regards, Nathan Taylor -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php