[PHP] fsocketopen questions
Dear All, I write a php scripts to use the function of fsocketopen to gather some data on the web, everything is perfect when I test the scripts on the apache server installed in my pc. But when I upload the codes to the server I hosted, I always got a time out error, even after I enlarge the time out setting to 180 secs. Could you tell me why it happen and how to figure it out? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I fake a FORM submission with POST Mothed from PHP
Hi , guys How can I POST a submit to a webserver and get the response content in PHP script? And if it must use CURL how can i add this module? i configure PHP without --with-curl ,:( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsocketopen questions
On Monday 08 December 2003 13:23, David wrote: I write a php scripts to use the function of fsocketopen to gather some data on the web, everything is perfect when I test the scripts on the apache server installed in my pc. But when I upload the codes to the server I hosted, I always got a time out error, even after I enlarge the time out setting to 180 secs. Could you tell me why it happen and how to figure it out? Check whether the firewall is blocking whatever it is you're trying to access. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You know, Callahan's is a peaceable bar, but if you ask that dog what his favorite formatter is, and he says roff! roff!, well, I'll just have to... */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] goto label
Hi all, I was wondering, if there's any way to achieve 'goto label:' using PHP Thanx for ur time Nitin
RE: [PHP] goto label
[snip] I was wondering, if there's any way to achieve 'goto label:' using PHP [/snip] Are you trying to go to a section of code to perform some operations on current variables? If so use functions http://us3.php.net/manual/en/ref.funchand.php . If you have some sort of decisive mechanism use switch http://us2.php.net/switch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] functions for predict satellites
Hello, anyone knows PHP-source(functions) for predict satellites (NORAD SGP4/SDP4)? Greetings, Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need PHP consulting - $!
I need some consulting assistance with a project. Complete information about what I need is on this page - http://www.briandunning.com/php-help.shtml THANK YOU!!! - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Maximum execution time
Thanks for the help, everyone. -John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I fake a FORM submission with POST Mothed from PHP
--- leon [EMAIL PROTECTED] wrote: How can I POST a submit to a webserver and get the response content in PHP script? You can do it manually: http://shiflett.org/hacks/php/http_post Other options are cURL and various PEAR classes. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: password protection/encryption
Chris Mach wrote: Greetings, I'm working on a project that involves a password protected area of a website. Some one also involved brought up the point that this area should be secure (Whit the lock icon indicating it is encrypted). In this particular project the password protected area will be a quote generating system for a company. Users would log in and choose the products they are interested in purchasing and the site would generate a quote depending on what they selected from the list of products. So my question is.. At what point is encryption necessary? I've always thought encryption was only needed when dealing with stuff like credit card information, am I wrong? if you are sending passwords over the internet, then they can be sniffed in transit, it depends on how paranoid / how important the information is. Unless you encrypt them before sending (client side), but this is quite complicated You probably should just use https to do the encryption, it works the same as normal, the HTTP layer deals with all the encryption for you How secure is a password protected page done with just PHP? over http, with no encryption - not very secure over https - as secure as anything is on the internet Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: write failed
Dan McCullough wrote: Just wanted to see if this was correct. To me this is saying that /tmp cannot be written to as there is no space left on device. Warning: Unknown(): write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 looks like it... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP eregi filtering problem
Purpleonyx schrieb: Greetings all, I ran into a problem today and was hoping someone could provide an answer. I am fetching a web page, and attempting to parse certain variables from it. I've done this plenty of times in the past with no problem. The only difference this time is the file that I am parsing is much larger. The HTML file is about 42kb in size (usually I only parse ~4kb worth). In the web browser, the script seems to just shut down, but reports no errors, not even to the web server logs. Is there some specific max size that it can accept or a setting in php.ini I need to modify? Thanks hi, i don't think, that 42k is too much for the size of your file. mut maybe php simply times out while parsing? there is a php.ini-parameter max_execution_time and a runtime-function set_time_limit(). try set_time_limit(0) at top of your script fo debugging. also take a look at preg_* functions instead of ereg_*. they are said to be much faster. hth SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 8 Dec 2003 17:10:00 -0000 Issue 2461
php-general Digest 8 Dec 2003 17:10:00 - Issue 2461 Topics (messages 172139 through 172155): Re: getimagesize() MySQL Image Storage (Running functions on contents of variables) 172139 by: Tom Rogers Re: Not able to execute Linux binary 172140 by: Jason Wong 172141 by: Jerry M. Howell II fsocketopen questions 172142 by: David 172144 by: Jason Wong How do I fake a FORM submission with POST Mothed from PHP 172143 by: leon 172151 by: Chris Shiflett goto label 172145 by: Nitin 172147 by: Jay Blanchard developing website in hindi language 172146 by: Nitin functions for predict satellites 172148 by: tobias.kaboth.materna.de Need PHP consulting - $! 172149 by: Brian Dunning Re: Maximum execution time 172150 by: John J Foerch Re: password protection/encryption 172152 by: Mike 172153 by: Mike Re: write failed 172154 by: Mike Re: PHP eregi filtering problem 172155 by: Sven Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi, Sunday, December 7, 2003, 6:38:13 PM, you wrote: G I'm using a MySQL database to store images as BLOBs. I know how to G handle all the MySQL stuff, it's easy, and really makes keeping track G of files nice an clean. No permissions, no risk of getting things out G of sync, finding stuff is as easy as SQL. G My question is about handling stuff once you pull it out of the G database. When I store images in the database, I currently stash the G format and the resolution in the database, which works but is a bit G messy. I can't find any easy way to run getimagesize on the contents of G a variable, not a file. I could write the image to a file if I needed G to, but that can be slow and rather inelegant, I'd rather store the G values in the DB. Any ideas on how I could use getimagesize or similar G function to determine the format and resolution of the image in a G variable? G I have had a similar problem with ftp uploading. There was no way to G upload the contents of a variable, so I had to write everything to the G disk, kind of annoying when I have 1,000 files. The script wasn't a G very heavily used script nor could the public execute it, but it bugged G me to no end. I think there are some other functions that also only G operate on files and I've fought with them too. G Is there any kind of generic solution for this? Some kind of wrapper I G could use to make a variable act like a reference to a file but G actually be in memory only? G If this seems totally pointless, please tell me. But it seems like G there should be a way for almost any function that runs off a file to G run off the contents of a variable, it's just binary data. G Thanks, G Galen Do the get sizes while it is still as a file after upload then save the size info with the file in the db or use unpack to get the size from the raw data, it is usually in the header somewhere. -- regards, Tom ---End Message--- ---BeginMessage--- On Monday 08 December 2003 12:56, Karam Chand wrote: I think there is some problem with the permission. Even if I execute a command like - echo ( start ); exec ( pwd ); echo ( end ); the output is - startend shouldnt be pwd showing the present working directory to me. Yes, but exec() itself does NOT output anything. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Every recipe ever written includes one ingredient that you do not have in your kitchen -- Murphy's Food Laws n5 */ ---End Message--- ---BeginMessage--- On Mon, Dec 08, 2003 at 01:28:11PM +0800, Jason Wong wrote: On Monday 08 December 2003 12:56, Karam Chand wrote: I think there is some problem with the permission. Even if I execute a command like - echo ( start ); exec ( pwd ); echo ( end ); the output is - startend shouldnt be pwd showing the present working directory to me. Yes, but exec() itself does NOT output anything. If there is a beter way, someone reply but I beleave the command you are looking for is system() -- Jerry M. Howell II ---End Message--- ---BeginMessage--- Dear All, I write a php scripts to use the function of fsocketopen to gather some data on the web, everything is perfect when I test the scripts on the apache server installed in my pc. But when I upload the codes to the server I hosted, I always got a time out error, even after I enlarge the time out
Re: [PHP] Problem With Apache / PHP Installation
Shaun schrieb: Ajai Khattri [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sat, Dec 06, 2003 at 07:46:07PM -, Shaun wrote: I have installed PHP and Apache but when i try to view a PHP file i.e. http://127.0.0.1/hello.php i get a dialog box asking me if i want to open or save the file? Any ideas why this is happening? Assuming, your Apache is configured to load the php module: Your Apache is not configured to handle .php files. You need to add directives in httpd.conf for PHP files. See PHP installation docs. -- Aj. Sys. Admin / Developer Thanks for your reply, I have added the following lines to the beginning of httpd.conf LoadModule php4_module c:/php/sapi/php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php But am still unable to view php files... Any ideas? hi, did you install apache 1.x or 2.x? does http://127.0.0.1 or http://localhost show your apache-startpage? did you stop and restart apache after changing httpd.conf? did you copy php4ts.dll to one of the dirs as said in the manual? just some thoughts from me. every time i install a new envionment i make a file to '/htdocs'-dir called 'phpinfo.php' with the following: ?php phpinfo(); ? i call this file for testing: 'http://localhost/phpinfo.php'. this file will also be vey useful when developing new scripts. hth SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fedora and Firebird
I am using Fedora Core 1 and I downloaded the php source(php-4.3.3-6.src.rpm). If I add --with-interbase=shared,/opt/firebird/lib/ I get the error that it cannot find libgds or libib_util. libib_util.so is in /opt/firebird/lib/. There is no libgds after installing Firebird. What am I missing? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to use PHP to view the file permision???
Hi Everyone! Looked up on the manual about the chmod() function for PHP, nice but it wouldn't work if the ownership file permission is set, so that bring up a question. How do I view the file permission or folder permission to see if it have the neccessnary permission before proceeding. That way, I can halt the script if there is no write permission or something. Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to use PHP to view the file permision???
On Tuesday 09 December 2003 02:19, Scott Fletcher wrote: Looked up on the manual about the chmod() function for PHP, nice but it wouldn't work if the ownership file permission is set, so that bring up a question. How do I view the file permission or folder permission to see if it have the neccessnary permission before proceeding. That way, I can halt the script if there is no write permission or something. manual Filesystem functions is_*(), lstat() -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* QOTD: Sure, I turned down a drink once. Didn't understand the question. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to use PHP to view the file permision???
Looked up on the manual about the chmod() function for PHP, nice but it wouldn't work if the ownership file permission is set, so that bring up a question. How do I view the file permission or folder permission to see if it have the neccessnary permission before proceeding. That way, I can halt the script if there is no write permission or something. Maybe this help: http://br.php.net/manual/en/function.fileperms.php http://br.php.net/manual/en/ref.filesystem.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, XML, UTF-8
Im storing a lot of user-entered data in XML files but i have a problem with folks submitting stuff just by copying and pasting from microsoft word. Smart Quotes and other awkward text then gets submitted and ruins the xml, meaning i am searching and replacing item by item to replace stuff. Does anyone know how I could do this automatically, as in is there anything that will convert a string to UTF-8 automatically ideally $fixed = convert-to-utf($oldmessedupstring) any ideas? Will CDATA sections allow non UTF-8 text? Russ Jones -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP, XML, UTF-8
Hello, On 12/08/2003 04:37 PM, Russell P Jones wrote: Im storing a lot of user-entered data in XML files but i have a problem with folks submitting stuff just by copying and pasting from microsoft word. Smart Quotes and other awkward text then gets submitted and ruins the xml, meaning i am searching and replacing item by item to replace stuff. Does anyone know how I could do this automatically, as in is there anything that will convert a string to UTF-8 automatically ideally $fixed = convert-to-utf($oldmessedupstring) any ideas? Will CDATA sections allow non UTF-8 text? There is the function utf8_encode() but if you want to generate XML, you may also want to try this class that performs whatever conversions you need: http://www.phpclasses.org/xmlwriter -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can I request ?
Playerfr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am using a PHPBB to have forum and site in php and i need a little script , can i request it here or do you know an otehr group where i can request it. Thnaks If it is a script relating to the forum, you can find many pre-made modifications from the phpBB forum: http://www.phpbb.com/phpBB/. You might be able to find one that does close to what you want, and modifying something that is most of the way there is a lot easier than writing your own script from scratch :o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST upload script timeout
Eric Bolikowski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ini_set('max_execution_time', '3600'); Thankyou very much, it works fine now! :o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP to HTML
Greetings! Is there a way to have PHP write an HTML file? What I would like to do is have a user fill out a form, then have the information write an HTML file and then save the file either for the first time, or overwrite the existing one. I hope this makes sense. Can anyone help? -- Steve Marquez Marquez Design [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP to HTML
Steve Marquez mailto:[EMAIL PROTECTED] on Monday, December 08, 2003 12:28 PM said: Greetings! Hi. Is there a way to have PHP write an HTML file? Yes. Start here http://us2.php.net/manual/en/function.fwrite.php. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP to HTML
--- Steve Marquez [EMAIL PROTECTED] wrote: Is there a way to have PHP write an HTML file? Sure. This is no different from writing any other file. If you want it to write a file instead of outputting the content, a convenient way (my opinion) of doing this is to use ob_start() at the top of your script, and then do something like this at the very end: $html = ob_get_contents(); $fp = fopen('./foo.html', 'w'); fwrite($fp, $html); fclose($fp); Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I apt-get newer php4 cgi with mysql on debian?
I am setting up a Soekris box (256MB CF card) that needs a newer PHP with mySQL support. I followed some instructions I googled and finally got a v4.1.2 of PHP that has mysql working even though phpinfo() says '--without-mysql' (?!). But this is a pretty old version of PHP. I do NOT need the webserver and all that overhead as this is simply going to connect to another remote DB (via PHP). I don't have the tools to compile it on there either, nor do I want them. Please tell me how to apt-get a newer version of the CGI PHP with mySQL support. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_match and regular expression
Hi I have problems with a regular expression. I have a html file like this: body divHello/div br br divsomthing/div br /body And i want to use preg_match to get a list of all the div tags in the file: result: $list[0] = divHello/div $list[1] = divsomthing/div I have tryed this: preg_match('/.*(\div\.*\\/div\).*/', $contents, $list); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_match and regular expression
Hi I have problems with a regular expression. I have a html file like this: body divHello/div br br divsomthing/div br /body And i want to use preg_match to get a list of all the div tags in the file: result: $list[0] = divHello/div $list[1] = divsomthing/div I have tryed this: preg_match('/.*(\div\.*\\/div\).*/', $contents, $list); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to use PHP to view the file permision???
Um, not sure what this meant with the fileperms() function. I have file permission as -rw-r--r-- or 644 and when using hte fileperms() funciton, it spitted a result as 33188. If you know what it is then I'm all ear! Don't know what the hell is 33188 stand for, so will stick to easier functions, is_writeable() and is_readable(). Thank for the response! Scott F. Marcos Thiago Merschamnn Fabis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Looked up on the manual about the chmod() function for PHP, nice but it wouldn't work if the ownership file permission is set, so that bring up a question. How do I view the file permission or folder permission to see if it have the neccessnary permission before proceeding. That way, I can halt the script if there is no write permission or something. Maybe this help: http://br.php.net/manual/en/function.fileperms.php http://br.php.net/manual/en/ref.filesystem.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to use PHP to view the file permision???
Um, not sure what this meant with the fileperms() function. I have file permission as -rw-r--r-- or 644 and when using hte fileperms() funciton, it spitted a result as 33188. If you know what it is then I'm all ear! 33188 (base 10) == 0x100644 (base 8). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to use PHP to view the file permision???
What's the function for converting it to base 8 ??? Thanks Roger B.A. Klorese [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Um, not sure what this meant with the fileperms() function. I have file permission as -rw-r--r-- or 644 and when using hte fileperms() funciton, it spitted a result as 33188. If you know what it is then I'm all ear! 33188 (base 10) == 0x100644 (base 8). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to use PHP to view the file permision???
Alright found it. it is base_convert, just use ... --snip-- echo base_convert($filename,8,10); --snip-- Cheer! Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What's the function for converting it to base 8 ??? Thanks Roger B.A. Klorese [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Um, not sure what this meant with the fileperms() function. I have file permission as -rw-r--r-- or 644 and when using hte fileperms() funciton, it spitted a result as 33188. If you know what it is then I'm all ear! 33188 (base 10) == 0x100644 (base 8). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP My SQL vs ASP.NET SQL 2000 Server
Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative. Thanks.
[PHP] Re: preg_match and regular expression
Fred wrote: Hi I have problems with a regular expression. I have a html file like this: body divHello/div br br divsomthing/div br /body And i want to use preg_match to get a list of all the div tags in the file: result: $list[0] = divHello/div $list[1] = divsomthing/div I have tryed this: preg_match('/.*(\div\.*\\/div\).*/', $contents, $list); Your regex is matching EVERYTHING before and after the div. It's also matching the maximum of content between the div tags. Here's a better one: /(div.*?\/div/i 1) You don't need to escape the and . 2) The ? after .* makes it match a minimum of content between the div tags. 3) the /i matches case insensitive, meaning that DIV will be matched as well Note that this won't work quite right on nested div tags. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP My SQL vs ASP.NET SQL 2000 Server
Ryotaro Ishikawa Md wrote: Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative. Thanks. The short answer is yes, PHP is used in many production environments and is very stable and featureful. There is a large developer community which creates lots of extensions. One of the largest and best written sets is PEAR (http://pear.php.net). As for mysql, it also is used in many production environments. If you feel that normal mysql doesn't have enough enterprise features, you could use the InnoDB table type, which supports foreign keys and such. If that still doesn't satisfy you, you can use PostgreSQL, which is another open-source database system, but has more enterprise like features. If even that isn't enough, you can always use Oracle or another database system that you have to pay for. The long answer is: get ready for a holy war. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading email from sendmail
Good afternoon, all!! Is there a function or series of functions in PHP that will allow a PHP package to read email from a sendmail account, look for a specific information in the subject line, then be able to resend that email to a group of users?? I know mail can be used to send email but reading from sendmail???... Any information is greatly appreciated and profoundly useful. Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Reading email from sendmail
Robin Kopetzky wrote: Good afternoon, all!! Is there a function or series of functions in PHP that will allow a PHP package to read email from a sendmail account, look for a specific information in the subject line, then be able to resend that email to a group of users?? I know mail can be used to send email but reading from sendmail???... Any information is greatly appreciated and profoundly useful. Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 You could use the imap functions to read from an IMAP account quite easily. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] query to display the results without...
Hi there I have a database called Eric and table name called Rocket'. Table consists of three values. PARTNO | DESCRIPTION | COMMENT So far if i want to show copper headgaskets from the 5r field i put this string into the php script (along with the rest of the html/php code) $sql = SELECT * FROM rocket WHERE partno like '5r%' AND description like 'COPPER HEADGASKET%'; The problem is there is 1000s of different querys i want to run and dont want to make a page for each query. So what im trying to ask is how do i run a query to display the results (like http://www.domain.com/query.php?the query i want to run rather then link to a .php/html file with the query inside of it.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: query to display the results without...
Eric Holmstrom wrote: Hi there I have a database called Eric and table name called Rocket'. Table consists of three values. PARTNO | DESCRIPTION | COMMENT So far if i want to show copper headgaskets from the 5r field i put this string into the php script (along with the rest of the html/php code) $sql = SELECT * FROM rocket WHERE partno like '5r%' AND description like 'COPPER HEADGASKET%'; The problem is there is 1000s of different querys i want to run and dont want to make a page for each query. So what im trying to ask is how do i run a query to display the results (like http://www.domain.com/query.php?the query i want to run rather then link to a .php/html file with the query inside of it.) The short answer is to use a GET variable for this. http://example.com/script.php?sql=SELECT... You have to remember to url encode the SQL, though (see urlencode()). You can access it like this: $_GET['sql'] The longer answer is to use a package such as DB_DataObject_FormBuilder (http://pear.php.net/package/DB_DataObject_FormBuilder) to generate this stuff for you. It will take some setup, but once you're used to it, it can make this kind of app happen real quick. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: query to display the results without...
Okay i have this so far --- ?php $conn = mysql_connect(localhost, , ); mysql_select_db(ERIC,$conn); $sql = SELECT * FROM rocket; $result = mysql_query($sql, $conn) or die(mysql_error()); while ($newArray = mysql_fetch_array($result)) { $partno = $newArray['PARTNO']; $description = $newArray['DESCRIPTION']; $comment = $newArray['COMMENT']; } ? --- How do i make it so if i type http://localhost/test.php?partno=5rdescription=copper Cheers if you can help out! Justin Patrin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Eric Holmstrom wrote: Hi there I have a database called Eric and table name called Rocket'. Table consists of three values. PARTNO | DESCRIPTION | COMMENT So far if i want to show copper headgaskets from the 5r field i put this string into the php script (along with the rest of the html/php code) $sql = SELECT * FROM rocket WHERE partno like '5r%' AND description like 'COPPER HEADGASKET%'; The problem is there is 1000s of different querys i want to run and dont want to make a page for each query. So what im trying to ask is how do i run a query to display the results (like http://www.domain.com/query.php?the query i want to run rather then link to a .php/html file with the query inside of it.) The short answer is to use a GET variable for this. http://example.com/script.php?sql=SELECT... You have to remember to url encode the SQL, though (see urlencode()). You can access it like this: $_GET['sql'] The longer answer is to use a package such as DB_DataObject_FormBuilder (http://pear.php.net/package/DB_DataObject_FormBuilder) to generate this stuff for you. It will take some setup, but once you're used to it, it can make this kind of app happen real quick. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP My SQL vs ASP.NET SQL 2000 Server
Hello, On 12/08/2003 07:42 PM, Ryotaro Ishikawa Md wrote: Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative. You may want to take a look at Care 2000 before going to reinvent the wheel: http://www.care2x.net/ -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Reading email from sendmail
Hello, On 12/08/2003 07:58 PM, Robin Kopetzky wrote: Is there a function or series of functions in PHP that will allow a PHP package to read email from a sendmail account, look for a specific information in the subject line, then be able to resend that email to a group of users?? I know mail can be used to send email but reading from sendmail???... You can always try to read the mail box file directly if your Web server user has the right permissions. However, the most portable way is to connect to your POP3 server to fetch the messages as you need. In that case you may want to take a look at this POP3 client class: http://www.phpclasses.org/pop3class -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: query to display the results without...
Eric Holmstrom mailto:[EMAIL PROTECTED] on Monday, December 08, 2003 3:06 PM said: How do i make it so if i type http://localhost/test.php?partno=5rdescription=copper $partno = $_GET['partno']; $description = $_GET['description']; $sql = SELECT partno , description , comment FROM Eric WHERE partno = '$partno' AND description = '$description' ; // execute your sql query HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: query to display the results without...
Eric Holmstrom wrote: Okay i have this so far --- ?php $conn = mysql_connect(localhost, , ); mysql_select_db(ERIC,$conn); $sql = SELECT * FROM rocket; $result = mysql_query($sql, $conn) or die(mysql_error()); while ($newArray = mysql_fetch_array($result)) { $partno = $newArray['PARTNO']; $description = $newArray['DESCRIPTION']; $comment = $newArray['COMMENT']; } ? --- How do i make it so if i type http://localhost/test.php?partno=5rdescription=copper Cheers if you can help out! Justin Patrin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Eric Holmstrom wrote: Hi there I have a database called Eric and table name called Rocket'. Table consists of three values. PARTNO | DESCRIPTION | COMMENT So far if i want to show copper headgaskets from the 5r field i put this string into the php script (along with the rest of the html/php code) $sql = SELECT * FROM rocket WHERE partno like '5r%' AND description like 'COPPER HEADGASKET%'; The problem is there is 1000s of different querys i want to run and dont want to make a page for each query. So what im trying to ask is how do i run a query to display the results (like http://www.domain.com/query.php?the query i want to run rather then link to a .php/html file with the query inside of it.) The short answer is to use a GET variable for this. http://example.com/script.php?sql=SELECT... You have to remember to url encode the SQL, though (see urlencode()). You can access it like this: $_GET['sql'] The longer answer is to use a package such as DB_DataObject_FormBuilder (http://pear.php.net/package/DB_DataObject_FormBuilder) to generate this stuff for you. It will take some setup, but once you're used to it, it can make this kind of app happen real quick. -- paperCrane Justin Patrin At this point, I will recommend you to ANY PHP tutorial and the PHP manual. The point of these lists is to help after you've tried things, not to write your code for you. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] post an array into another site
Hi I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] post an array into another site
fred mailto:[EMAIL PROTECTED] on Monday, December 08, 2003 4:31 AM said: I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? Yes. Here is a hint: delimit. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post an array into another site
Chris W. Parker wrote: fred mailto:[EMAIL PROTECTED] on Monday, December 08, 2003 4:31 AM said: I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? Yes. Here is a hint: delimit. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ ...that's a strange response. I doubt that's what was asked anyway. What you want is probably a php function/class that can post form data to another script. PEAR's HTTP_Request can do that. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post an array into another site
I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? It would help to serialize the array into a string, then pass it as a regular value in a GET or POST request. http://php.net/serialize http://php.net/unserialize - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Hello, On 12/08/2003 10:30 AM, Fred wrote: I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Manuel Lemos wrote: Hello, On 12/08/2003 10:30 AM, Fred wrote: I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Hello, On 12/08/2003 10:39 PM, Justin Patrin wrote: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/ HTTP_Client Why better? Have you tried both packages? -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading email from sendmail
On Tuesday, December 9, 2003, at 08:58 AM, Robin Kopetzky wrote: Good afternoon, all!! Is there a function or series of functions in PHP that will allow a PHP package to read email from a sendmail account, look for a specific information in the subject line, then be able to resend that email to a group of users?? I know mail can be used to send email but reading from sendmail???... Any information is greatly appreciated and profoundly useful. http://au2.php.net/imap Might be a good starting point. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
--- Manuel Lemos [EMAIL PROTECTED] wrote: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client Why better? Have you tried both packages? I can make a guess as to why he would say this, aside from the obvious fact that one is part of the PHP project and one is not. Visitng http://www.phpclasses.org/httpclient results in several pages of banner ads that one must navigate before finally being shown: You need to be a subscriber and log in to access this file. Visiting http://pear.php.net/package/HTTP_Client results in a relevant page of information that contains a link to code, http://pear.php.net/get/HTTP_Client-0.1.tgz. Ads or code. Which would you choose? Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Manuel Lemos wrote: Hello, On 12/08/2003 10:39 PM, Justin Patrin wrote: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/ HTTP_Client Why better? Have you tried both packages? No, however, the httpclient system is a lot of code that is part of one class. HTTP_Client is based on lots of sub-systems, each of which can be used seperately and for other purposes (and each of which is maintained by seperate, multiple people). For instance, there is the Socket API, URL parsing, the HTTP Request, etc. All of which HTTP_Client is built upon instead of re-inventing. Also, and just as important, using PEAR packages gives you a centralized way of dealing with errors. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] restrict access to multiple pages
Hey y'all. Ok so I am working on the admin sectin of the e-commerce app I'm writing and I'm hoping there's a better way to do what I am currently doing. In an effort to prevent circumvention of the login page I've placed a check at the beginning of each page that basically does the following: ?php if(loggedin()) { // entire page of code goes here } else { // redirect back to login page } ? By doing this people will not be able to just enter manually any URL they want and have the page load. As far as better ways go I was thinking that maybe I could employ .htaccess somehow? But then I think that might require having user accounts registered with the server instead of just using a db and I don't want to do that. I was thinking that maybe I could change it to this: ?php // define function stored in class file // (basic auth function, not at all what i'm using. // just an example.) function IsLoggedIn($input) { if(isset($input) !empty($input)) { return 1; } else { // redirect to login page } } IsLoggedIn($input); // entire page of code goes here ? Any want to share their experiences and ideas? Thanks, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
Chris Shiflett wrote: --- Manuel Lemos [EMAIL PROTECTED] wrote: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client Why better? Have you tried both packages? I can make a guess as to why he would say this, aside from the obvious fact that one is part of the PHP project and one is not. Visitng http://www.phpclasses.org/httpclient results in several pages of banner ads that one must navigate before finally being shown: You need to be a subscriber and log in to access this file. Visiting http://pear.php.net/package/HTTP_Client results in a relevant page of information that contains a link to code, http://pear.php.net/get/HTTP_Client-0.1.tgz. Ads or code. Which would you choose? Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ This is also a very good point. Actually PEAR isn't a PHP project per se. It is simply supported by many of the PHP developers and by many very talented PHP coders. Another very important aspect of PEAR that I didn't mention in my other message is that PEAR has standards that must be upheld in all of their packages. The packages are also under peer-review; anyone cna download and use them and anyone can submit bug reports if they find an error or want a new feature. In addition, anyone can add a new package or a feature to an existing package (after it has been reveiwed, of course). -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: restrict access to multiple pages
Chris W. Parker wrote: Hey y'all. Ok so I am working on the admin sectin of the e-commerce app I'm writing and I'm hoping there's a better way to do what I am currently doing. In an effort to prevent circumvention of the login page I've placed a check at the beginning of each page that basically does the following: ?php if(loggedin()) { // entire page of code goes here } else { // redirect back to login page } ? By doing this people will not be able to just enter manually any URL they want and have the page load. As far as better ways go I was thinking that maybe I could employ .htaccess somehow? But then I think that might require having user accounts registered with the server instead of just using a db and I don't want to do that. I was thinking that maybe I could change it to this: ?php // define function stored in class file // (basic auth function, not at all what i'm using. // just an example.) function IsLoggedIn($input) { if(isset($input) !empty($input)) { return 1; } else { // redirect to login page } } IsLoggedIn($input); // entire page of code goes here ? Any want to share their experiences and ideas? Thanks, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ I tend to include the same file which does this for me at the beginning of pages which must have authentication. Using a function as you described (with automatic redirection to the login page) is how I would do it. You may also want to look into a the PEAR Auth package. http://pear.php.net/package/Auth -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restrict access to multiple pages
--- Chris W. Parker [EMAIL PROTECTED] wrote: In an effort to prevent circumvention of the login page I've placed a check at the beginning of each page that basically does the following: ?php if(loggedin()) { // entire page of code goes here } else { // redirect back to login page } ? This is fine, assuming loggedin() does what you intend and can't be subverted. The only risk is forgetting to add this check, since I assume you mean that you have to copy/paste this into every script. You might want to consider whether you can design your application in such a way that you can have a more centralized way to enforce authorization. The one thing I would definitely consider doing differently is the redirect. You could, instead, just include the logic necessary for the login page, so that you avoid the superfluous transaction. As far as better ways go I was thinking that maybe I could employ .htaccess somehow? Yes, and you can use a database like you're wanting. There is existing code to help you do this. However, this implements HTTP authentication, which has the little popup window. This is fine, but some people might perceive this as being unprofessional, so you might want to keep your audience in mind. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Hello, On 12/08/2003 11:06 PM, Justin Patrin wrote: You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/ HTTP_Client Why better? Have you tried both packages? No, however, the httpclient system is a lot of code that is part of one No? If you have not tried it at all WTF are you claiming that something else is better? Better than what? Something you have not tried? class. HTTP_Client is based on lots of sub-systems, each of which can be used seperately and for other purposes (and each of which is maintained by seperate, multiple people). For instance, there is the Socket API, Are you telling me that to make HTTP requests, loading half of dozen classes is better than doing it all with just one? URL parsing, the HTTP Request, etc. All of which HTTP_Client is built upon instead of re-inventing. AFAIK, this HTTP client class was released for the first time in 1999. The way I see it, if anybody reinvented anything, that must have been whoever came after that to do the same. Also, and just as important, using PEAR packages gives you a centralized way of dealing with errors. You meant that 800 line fat base class that many PEAR classes inherit and require in order to run even when developers do not want anything from it? No thanks, I am not interested in bloated software development. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
--- Justin Patrin [EMAIL PROTECTED] wrote: Actually PEAR isn't a PHP project per se. I disagree. You have to become a member of the PHP development team, as far as I know, to participate in PEAR development (CVS account, php.net email address, etc.). The project is also governed by the PHP Group, and it is hosted on php.net servers (pear.php.net). Many PHP extensions (PECL) are a part of it (http://pear.php.net/manual/en/pecl.php) also. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post an array into another site
Chris W. Parker wrote: Justin Patrin mailto:[EMAIL PROTECTED] on Monday, December 08, 2003 4:39 PM said: If all you want to do is give an array to another script, sure you can delimit (although that's much more error prone than serializing). Serialize, delimit. It's pretty much the same idea. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ Not really. If you just delimit, you have to worry about escaping that value in your string somehow. If your delimiter was ',' say and you had one in a field, how would you handle it? In addition, serializing is part of PHP, so you know that what you put in is what you get out. Writing your own simple serialization through delimiting is just asking for problems. What if, say, the array has textual keys instead of just numbered ones? Or the array has three indices? Or one of the values is an object? Using serializa() and unserialize() means that you don't EVER have to worry about this (unless there are errors in these functions, in which case, you submit a bug report and it gets fixed). -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
Chris Shiflett wrote: --- Justin Patrin [EMAIL PROTECTED] wrote: Actually PEAR isn't a PHP project per se. I disagree. You have to become a member of the PHP development team, as far as I know, to participate in PEAR development (CVS account, php.net email address, etc.). The project is also governed by the PHP Group, and it is hosted on php.net servers (pear.php.net). Many PHP extensions (PECL) are a part of it (http://pear.php.net/manual/en/pecl.php) also. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ Ok, I can give you that. But anyone (and I mean anyone) can submit patches to the maintainers for inclusion. The standards are also there and open. All source code and documentation is easily readable (well, not docs for all of the projects, but the code is almost always documented well enough). My point here is that a team of people deal with all of these packages and their interactions. And even so, you can get a PEAR account if you need one. If you want to help maintain a project or create your own, all you have to do is ask (and show that you're serious). -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
Hello, On 12/08/2003 11:04 PM, Chris Shiflett wrote: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client Why better? Have you tried both packages? I can make a guess as to why he would say this, aside from the obvious fact that one is part of the PHP project and one is not. And? Does that meant that all the 130.000+ subscribers of the PHP Classes site are all wrong and you are one that is right? Visitng http://www.phpclasses.org/httpclient results in several pages of banner ads that one must navigate before finally being shown: Do you have a problem with site that use advertising to keep themselves alive? You need to be a subscriber and log in to access this file. If you do not want to subscribe to have access, fine, that is going to be your problem. However, I think that nobody can say that B is better than A if he did not gave himself the opportunity to try both. Just good common sense. Visiting http://pear.php.net/package/HTTP_Client results in a relevant page of information that contains a link to code, http://pear.php.net/get/HTTP_Client-0.1.tgz. Ads or code. Which would you choose? I think any person with good sense would try both before coming to any conclusions. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
- Original Message - From: Manuel Lemos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 08, 2003 8:30 PM Subject: Re: [PHP] Re: post an array into another site Hello, On 12/08/2003 11:04 PM, Chris Shiflett wrote: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client Why better? Have you tried both packages? I can make a guess as to why he would say this, aside from the obvious fact that one is part of the PHP project and one is not. And? Does that meant that all the 130.000+ subscribers of the PHP Classes site are all wrong and you are one that is right? phpclasses.org is a great site! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Manuel Lemos wrote: Hello, On 12/08/2003 11:06 PM, Justin Patrin wrote: You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/ HTTP_Client Why better? Have you tried both packages? No, however, the httpclient system is a lot of code that is part of one No? If you have not tried it at all WTF are you claiming that something else is better? Better than what? Something you have not tried? Even if I have not used the other thing, I am still very likely to work with PEAR packages. Why? Because I know that I can get help with it from the PEAR developers and get fixes and updates easily and quickly. class. HTTP_Client is based on lots of sub-systems, each of which can be used seperately and for other purposes (and each of which is maintained by seperate, multiple people). For instance, there is the Socket API, Are you telling me that to make HTTP requests, loading half of dozen classes is better than doing it all with just one? Yes, it is better to have them all in seperate packages for maintainability. If you have everything in one place, you're VERY prone to errors. Now, I haven't seen the code for the phpclasses project, so I can't say anything about it, but in general having thing seperated is much better practice. URL parsing, the HTTP Request, etc. All of which HTTP_Client is built upon instead of re-inventing. AFAIK, this HTTP client class was released for the first time in 1999. The way I see it, if anybody reinvented anything, that must have been whoever came after that to do the same. Ok, valid point. Also, and just as important, using PEAR packages gives you a centralized way of dealing with errors. You meant that 800 line fat base class that many PEAR classes inherit and require in order to run even when developers do not want anything from it? No thanks, I am not interested in bloated software development. PEAR is used in many production systems and the classes are tuned for speed. Or if they aren't you can alter them and send in a patch. PEAR promotes standards instead of ad-hoc programming. It's better to write your error handling code once instead of re-creating it for every package you ever write. Not all PEAR packages inherit from PEAR. Some just use pieces of it. Some don't use it at all. It all depends on what the package needs. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Justin Patrin wrote: Manuel Lemos wrote: Hello, On 12/08/2003 10:30 AM, Fred wrote: I have an array in php like this: $arr[0][0] = Something; $arr[0][1] = Hello; $arr[0][2] = Hi; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client I hereby retract the Or even better part of my statement. It was wrong since I had not used httpclient. However, I still stand by PEAR and am still more likely to use PEAR packages than any other, simply because I trust them and I like the way that it works. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php validator
Dear List, Is there an application somewhere that can be used to determine incompatibilities with different versions of PHP of ones code? Something like a recursive directory scan checking functions used and determining the versions they will / won't work on. Hope this makes sence. Thanks Terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] spambothoney: script to pollute spammer's databases
Hello PHP-list, I proudly announce the first release of my first PHP script: spambothoney. It provides a class to generate different types of email addresses (random invalid, combination of users/hosts, with spambots IP/host, binary output) and is meant to pollute the crawling spambots that harvest email addresses from webpages. It uses a MySQL database for configuration (through web-interface) and for logging purposes. I would be glad, if this is of some interest for you and you would take a look: http://thequod.de/comp/mysoft/spambothoney (direct download: http://thequod.de/action.php?download=1) I'm especially interested into security issues, but feedback in general is very appreciated.. Thanks.. have a nice week! -- shinE! http://www.thequod.de ICQ#152282665 PGP 8.0 key: http://thequod.de/danielhahler.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] spambothoney: script to pollute spammer's databases
Hi, i'll definately have a look, maybe the PHP list should intergrate a protection system, as i definately got bombarded with spam as soon as i joined, funny enough never happened when i was using the newsgroup ?? Hello PHP-list, I proudly announce the first release of my first PHP script: spambothoney. It provides a class to generate different types of email addresses (random invalid, combination of users/hosts, with spambots IP/host, binary output) and is meant to pollute the crawling spambots that harvest email addresses from webpages. It uses a MySQL database for configuration (through web-interface) and for logging purposes. I would be glad, if this is of some interest for you and you would take a look: http://thequod.de/comp/mysoft/spambothoney (direct download: http://thequod.de/action.php?download=1) I'm especially interested into security issues, but feedback in general is very appreciated.. Thanks.. have a nice week! -- shinE! http://www.thequod.de ICQ#152282665 PGP 8.0 key: http://thequod.de/danielhahler.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP My SQL vs ASP.NET SQL 2000 Server
Before you make any decision please take a look the power of PHP. http://www.dreamlab.ca/technology/phpsites/ Thanks Hardik --- Manuel Lemos [EMAIL PROTECTED] wrote: Hello, On 12/08/2003 07:42 PM, Ryotaro Ishikawa Md wrote: Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative. You may want to take a look at Care 2000 before going to reinvent the wheel: http://www.care2x.net/ -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post an array into another site
Hello, On 12/08/2003 11:36 PM, Justin Patrin wrote: You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/ HTTP_Client Why better? Have you tried both packages? No, however, the httpclient system is a lot of code that is part of one No? If you have not tried it at all WTF are you claiming that something else is better? Better than what? Something you have not tried? Even if I have not used the other thing, I am still very likely to work Therefore, your claim that it is better is void because you have no basis for comparison. with PEAR packages. Why? Because I know that I can get help with it from the PEAR developers and get fixes and updates easily and quickly. Who told you that you do not get help from developers that contribute to the PHP Classes site? The way I see it depends. Some developers provide better support then others . It depends on if and when they are available when you ask. That applies to any developers regardless of the where they contribute their classes. In this case, I developed the HTTP client class and I can tell you that I try to provide prompt support whenever I am not so busy (which is not all the time, but frequently). I even tell you more, recently I even had to develop a patch to fix a bug in PHP itself that affected all code that deals with socket connections. Personally, I am not looking for medals of recognition or whatever, but one thing that you can't say is that only developers that contribute to PEAR always provide prompt support. Not only that is not always true, but you are probably insulting all other PHP authors that contribute to PHP Classes or other repositories that are very commited to providing great support despite they all work for free and benefit of many thousands of PHP users. class. HTTP_Client is based on lots of sub-systems, each of which can be used seperately and for other purposes (and each of which is maintained by seperate, multiple people). For instance, there is the Socket API, Are you telling me that to make HTTP requests, loading half of dozen classes is better than doing it all with just one? Yes, it is better to have them all in seperate packages for maintainability. If you have everything in one place, you're VERY prone to errors. I completely disagree. Spliting all in classes that provide more functionality that you may need to make HTTP requests certainly is more likely to have more bugs because you end up with more code. Also, and just as important, using PEAR packages gives you a centralized way of dealing with errors. You meant that 800 line fat base class that many PEAR classes inherit and require in order to run even when developers do not want anything from it? No thanks, I am not interested in bloated software development. PEAR is used in many production systems and the classes are tuned for speed. Or if they aren't you can alter them and send in a patch. PEAR I am sorry, but you can't convince me that using a bloated 800 line base class, that most of the time you do not need, it is tuned for speed. If you knew the PHP object model minimally, you would know that inherit classes for needless reasons only adds overhead to object creation, meaning it takes more time and memory to create objects of subclasses. promotes standards instead of ad-hoc programming. It's better to write your error handling code once instead of re-creating it for every package you ever write. I am sorry but I disagree that PEAR error handling is any good because it replicates the error handling functions that PHP already provides. Furthermore, I prefer that functions that are susceptible to fail return a boolean condition that is simple to verify and an additional error variable that explains the error to humans. I do not need to inherit bloated 800 line base class to do that. Not all PEAR packages inherit from PEAR. Some just use pieces of it. Some don't use it at all. It all depends on what the package needs. You are just validating my point. Those classes that do not use the PEAR base class are meant for speed and simplification. Anyway, your initial point is that PEAR is good because it provides central error handling, when you have just confirmed that some classes do not use it because at least some of use know that it is a bad idea. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restrict access to multiple pages
On Tuesday, December 9, 2003, at 12:08 PM, Chris W. Parker wrote: Hey y'all. Ok so I am working on the admin sectin of the e-commerce app I'm writing and I'm hoping there's a better way to do what I am currently doing. In an effort to prevent circumvention of the login page I've placed a check at the beginning of each page that basically does the following: ?php if(loggedin()) { // entire page of code goes here } else { // redirect back to login page } ? That's essentially what I do too... except I've got all this stored in a restricted.inc file which I just include() where needed. I think you can minimise your code though, by checking (in my case) for an invalid uid or a uid without admin clearance (redirect and exit), otherwise just show the page: --- ?php if(!$_SESSION['uid'] || !$_SESSION['admin']) { header(Location: login.php); exit; } ? the rest of your page here --- Cheers, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: post an array into another site
= THE END = -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: spambothoney: script to pollute spammer's databases
Hello, On 12/09/2003 12:26 AM, Daniel Hahler wrote: I proudly announce the first release of my first PHP script: spambothoney. It provides a class to generate different types of email addresses (random invalid, combination of users/hosts, with spambots IP/host, binary output) and is meant to pollute the crawling spambots that harvest email addresses from webpages. It uses a MySQL database for configuration (through web-interface) and for logging purposes. I would be glad, if this is of some interest for you and you would take a look: http://thequod.de/comp/mysoft/spambothoney (direct download: http://thequod.de/action.php?download=1) That is curious. This seems to be the second class that I see that seems to be for the same purpose. The other class also seems to be meant to generate honey pot e-mail addresses. Class: Honey Pot http://www.phpclasses.org/honeypot I'm especially interested into security issues, but feedback in general is very appreciated.. I read something about e-mail honey pots and I am afraid that may not be as useful as you think. When you say polluting crawling spambots you will probably be causing harm to innocent mail servers. Let me explain. The latest spamming strategies consist on using valid sender addresses of inocent companies. Therefore, when you make up invalid addresses, all the bounces will go to the innocent companies mail servers. The more invalid addresses you make up the more harm you cause to innocent companies. Anyway, you may want to contribute your class also to the PHP Classes site so you can get the feedback of tens of thousands of potential users that are notified when a new class is published. Despite your class seems to do the same as the other above, it will also be approved for publishing and let the users decide which is more useful. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php validator
Hello, On 12/09/2003 12:14 AM, Terence wrote: Is there an application somewhere that can be used to determine incompatibilities with different versions of PHP of ones code? Something like a recursive directory scan checking functions used and determining the versions they will / won't work on. Hope this makes sence. I do not know if this is what you are looking for. Here you may find a class that comes with a few functions that had their behaviour broken between PHP 4.0 and 4.2 . The class provides functions the reproduce the original behaviour as well a script that tests whether the original functions were broken in the current version that you use. Class: Fixed functions broken before PHP 4.2.0 http://mlemos.users.phpclasses.org/fixedfunctions These are just functions that were broken despite PHP developers do not agree that they should not have been broken, so they will not fix them. There are certainly many functions that were broken between versions but were fixed. For that you may want to try PHP test suite scripts that come with the latest PHP version and try them in the PHP version that you use. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
--- Justin Patrin [EMAIL PROTECTED] wrote: Ok, I can give you that. But anyone (and I mean anyone) can submit patches to the maintainers for inclusion. This is no different than with PHP or most any other open source project. In fact, submitting patches is probably the most common precursor to getting your own CVS account. My point here is that a team of people deal with all of these packages and their interactions. The same with PHP. And even so, you can get a PEAR account if you need one. If you want to help maintain a project or create your own, all you have to do is ask (and show that you're serious). This is also the same with PHP. In fact, as far as I know, the same group of people authorize you to receive the CVS account. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
--- Manuel Lemos [EMAIL PROTECTED] wrote: I can make a guess as to why he would say this, aside from the obvious fact that one is part of the PHP project and one is not. And? Does that meant that all the 130.000+ subscribers of the PHP Classes site are all wrong and you are one that is right? So, your argument is that the people who subscribe, which you mention below is required to even try these classes (and you argue that this should be required before making a decision), are voting in favor of these PHP classes over PEAR? This makes absolutely no sense. So, we have two groups of people: 1. Those who have tried your PHP classes 2. Those who have not Your argument is that group 2's opinion is not valid and that group 1's opinion is decided by you (to prefer the PHP classes over PEAR). Yes, if your erroneous assumptions were somehow true, you would be right. However, most people on this list are too logical to be fooled by such an argument. Visitng http://www.phpclasses.org/httpclient results in several pages of banner ads that one must navigate before finally being shown: Do you have a problem with site that use advertising to keep themselves alive? Nope, that's their choice. It's just funny when the maintainers cry foul when people aren't interested in their site. Your choice is to have ads. My choice is to not visit. Live with it. :-) Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
Ralph Guzman wrote: = THE END = I apologize, everyone. I should have realized a while ago that this would become a holy war. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
Hello, On 12/09/2003 01:55 AM, Chris Shiflett wrote: I can make a guess as to why he would say this, aside from the obvious fact that one is part of the PHP project and one is not. And? Does that meant that all the 130.000+ subscribers of the PHP Classes site are all wrong and you are one that is right? So, your argument is that the people who subscribe, which you mention below is required to even try these classes (and you argue that this should be required before making a decision), are voting in favor of these PHP classes over PEAR? This makes absolutely no sense. I never said that. What I said that is that nobody can tell that one class is better than the other before trying both. Anyway, this thread is not about PHP Classes vs. PEAR but rather about HTTP client solutions. You are the one that is trying to turn this thread into a dispute between two sites where the classes are hosted that says nothing about how good each class can be. So, we have two groups of people: 1. Those who have tried your PHP classes 2. Those who have not Your argument is that group 2's opinion is not valid and that group 1's opinion is decided by you (to prefer the PHP classes over PEAR). Yes, if your erroneous assumptions were somehow true, you would be right. However, most people on this list are too logical to be fooled by such an argument. Anybody with common sense could see in the beginning of the thread that I just suggested one class that I wrote that is available in PHP Classes site and then Justin Patrin came and said that a class available on PEAR is better. Then you can and stated the above guessing that Justin reasons to prefer one class over the other is because one is in one repository sponsored by the PHP group and the other isn't. Who is making erroneous assumptions here, i.e. assumptions about things that they never tried? It seems to me that there is fanatic people like yourself that is trying very hard to impose PEAR classes over PHP Classes as if there is any sort of competion. Only on your mind certainly. Visitng http://www.phpclasses.org/httpclient results in several pages of banner ads that one must navigate before finally being shown: Do you have a problem with site that use advertising to keep themselves alive? Nope, that's their choice. It's just funny when the maintainers cry foul It is really funny that you mention that in this thread when anybody can read it from the begginning and see that I was the one to suggest the use of a class that I wrote and only after I did it, Justin Patrin came and said that the PEAR class that does the same is better. So, who is crying foul here? when people aren't interested in their site. Your choice is to have ads. The site has ads because it is one way that I found to generate enough income to keep it open and still dedicate 100% of my time to continue to develop it, providing more useful features that all users and contributors appreciate. Since the site takes me a lot of time and costs money to keep open, my alternative would be to shut it up and return to working to companies that would pay me a lot more money then I can make with the site even with ads. But no, I decided to keep the site open for the benefit of every user and author that care about PHP, even it takes putting ads all over the site. What is so hard to understand accept about this? I have a friend that suggested that there will always be people that do not stand the success of others. When I see people like yourself bitching against a site that I developed and is beneficial to so many PHP users, I tend to agree with my friend. My choice is to not visit. Live with it. :-) Do you really think the PHP Classes site users miss your visits? Man, grow up! Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ Oh, you write PHP books? Interesting. Once in a while I publish reviews of PHP books because I feel they are interesting to the users of the site. Just yesterday I published a review of a very good PHP book: http://www.phpclasses.org/products.html/latest/latest.html Sometimes I invite authors to send review copies, but most of the times the publishing companies contact me and ask me to review the books. If your publisher contacts me to ask to review your books, I will point them to the archives of this thread so they decide if a book written by PHP Classes site hater like yourself deserves to be reviewed in the site. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: post an array into another site
--- Manuel Lemos [EMAIL PROTECTED] wrote: If your publisher contacts me to ask to review your books, I will point them to the archives of this thread so they decide if a book written by PHP Classes site hater like yourself deserves to be reviewed in the site. I'll leave you to your own arguments, which I won't bother correcting, but describing me (or anyone on this thread) as a PHP Classes hater is a bit extreme. I simply explained why I don't visit. I have in the past, and I can never find any code, so I feel that I have better things to do with my time (such as helping people on this list). Your choices are your own, and my choices are my own. I don't understand why that's difficult to grasp or why stating this should anger you. You can choose to make personal attacks, if it makes you feel better, but it doesn't do anything to strengthen your argument, nor is this list the proper place for such things. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why Imap_open takes a so long time delay???
hi I have worked with imap functions for a long time . When I use imap_open connecting to a imap server ,it always takes a 20 second delay. I use like this : ?php $mbox = imap_open({202.200.0.8:143}INBOX,user,pass); imap_close($mbox); ? why this happen? --http://www.eyou.com --Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä ÓïÒôÓʼþ Òƶ¯ÊéÇ© ÈÕÀú·þÎñ ÍøÂç´æ´¢...ÒÚÓÊδ¾¡ --http://vip.eyou.com --¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä ×¢²áÄúÖÐÒâµÄÓû§Ãû -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Random Numbers..
* Thus wrote Burrito Warrior ([EMAIL PROTECTED]): This would: /* selecting a random record, where n = 1. Works fine on small tables */ mysql SELECT value FROM table ORDER BY RAND() LIMIT n; /* selecting a random record. This is good on large tables if numbering sequence is used */ mysql SET @val = FLOOR(RAND() * n) + 1; mysql SELECT value FROM table WHERE ID = @val; If two queries is acceptable: select a count() on a unique/primary key, it should minimal overhead since the value is obtained very quickly with those columns. then do a limit... SELECT FLOOR(RAND() * COUNT(id)) + 1 as n FROM table; SELECT value FROM table LIMIT n, 1 return 1 record starting to the nth record. There still lies the performance loss the larger n becomes. Or using the ID method: SELECT FLOOR(RAND() * MAX(id)) + 1 as n FROM table; SELECT value FROM table id = n LIMIT 1 This might be the optimal in the two query method. Since it will use the index to seek id = n. Curt -- If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf, BDFL of PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] goto label
* Thus wrote Nitin ([EMAIL PROTECTED]): Hi all, I was wondering, if there's any way to achieve 'goto label:' using PHP The closest you'll get to label's in php is the break statement. while (loop) { while (loop) { break 2; // leave 2 loops } while (loop) { break; // leave this loop } } Curt -- If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf, BDFL of PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: goto label
Nitin wrote: Hi all, I was wondering, if there's any way to achieve 'goto label:' using PHP Thanx for ur time Nitin goto is a very old and broken way of coding. If you ever find yourself in need of a goto, you should re-evaluate how you're doing things. If you're having trouble finding out how to do it better, just ask here. :-) -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: goto label
On Tue, 2003-12-09 at 00:32, Justin Patrin wrote: Nitin wrote: Hi all, I was wondering, if there's any way to achieve 'goto label:' using PHP Thanx for ur time Nitin goto is a very old and broken way of coding. If you ever find yourself in need of a goto, you should re-evaluate how you're doing things. If you're having trouble finding out how to do it better, just ask here. :-) Goto line number is a very broken way of coding. Goto label is a very useful and structured way of coding especially when creating fast FSMs for parsing. I was a little disappointed a few months ago when I found that PHP didn't support the goto label syntax since it would have provided the most elegant solution. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP My SQL vs ASP.NET SQL 2000 Server
* Thus wrote Ryotaro Ishikawa MD ([EMAIL PROTECTED]): Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative. Thanks. It is a bit hard to determine from the details you gave for a justification for either. This topic has been discussed in depth quite a few times so searching the archives might help see what people have said about his topic. Curt -- If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf, BDFL of PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: goto label
Robert Cummings wrote: On Tue, 2003-12-09 at 00:32, Justin Patrin wrote: Nitin wrote: Hi all, I was wondering, if there's any way to achieve 'goto label:' using PHP Thanx for ur time Nitin goto is a very old and broken way of coding. If you ever find yourself in need of a goto, you should re-evaluate how you're doing things. If you're having trouble finding out how to do it better, just ask here. :-) Goto line number is a very broken way of coding. Goto label is a very useful and structured way of coding especially when creating fast FSMs for parsing. I was a little disappointed a few months ago when I found that PHP didn't support the goto label syntax since it would have provided the most elegant solution. Cheers, Rob. goto anywhere is broken. For instance, goto-ing out of loops and functions, or into one function from another causes untold grief to the language developer and makes it very hard to read the code. Then there's using goto into and out of class functions, which is even worse. In truth, goto has no place in a higher level programming language. Anything that can be done with goto can be done without it and (IMHO) more elegantly. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: goto label
On Tue, 2003-12-09 at 00:51, Justin Patrin wrote: Robert Cummings wrote: Goto line number is a very broken way of coding. Goto label is a very useful and structured way of coding especially when creating fast FSMs for parsing. I was a little disappointed a few months ago when I found that PHP didn't support the goto label syntax since it would have provided the most elegant solution. Cheers, Rob. goto anywhere is broken. For instance, goto-ing out of loops and functions, or into one function from another causes untold grief to the language developer and makes it very hard to read the code. Then there's using goto into and out of class functions, which is even worse. As I said that all depends on how it is used. Anyone can write unreadable code regardless of whether the language supports the goto statement. Also since PHP is strongly based on C, you'll notice that the C language does not allow cross function jumping via goto. Goto must jump to a label defined in the same function, so your second argument in this case is invalid. As someone who has implemented my own language, I can tell you I had absolutely no grief implementing a goto label system. In truth, goto has no place in a higher level programming language. This is your opinion, please feel free to qualify it. Anything that can be done with goto can be done without it and (IMHO) more elegantly. Yes anything that can be done with goto can be done without, but the whether it is more elegant strongly depends on what your goal is and how that goal can be achieved. Here's something you should do to properly open your eyes to the utility of the goto label statement. cd /YOUR_PHP_INSTALLATION_SOURCE/ grep -rE 'goto [_[:alnum:]]+;' * In my installation alone there are 1522 instances of goto used. And really I don't consider PHP that much higher level a language than C, although it does provide plenty of high level functions. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with INSERT query
Hi all, I am trying to do a simple INSERT data into the database using the following php script but the problem here is that whenever I click submit, the script only insert a NULL value into the columns into the datadase instead the value I enter in the forms fieldSELECT query was successful but not INSERT.. A snip of the code are as follow: ?php //declare error variable $err = ; //set error variable $err .= check_tutor_name(); $err .= check_tutor_contact(); $err .= check_tutor_email(); $err .= check_tutor_profile(); //define connection string $dsn = mysql://root:[EMAIL PROTECTED]/table1; //connect to DB $db = DB::connect ($dsn); //check for any DB connection errors if (DB::isError ($db)) die ($db-getMessage()); $tutor_name = $db-quote($POST[tutor_name]); $tutor_contact = $db-quote($POST[tutor_contact]); $tutor_email = $db-quote($POST[tutor_email]); $tutor_profile = $db-quote($POST[tutor_profile]); $sql = INSERT INTO tutor (tutor_name, tutor_contact,tutor_email,tutor_profile) VALUES ('$tutor_name', '$tutor_contact', '$tutor_email', '$tutor_profile'); //execute query statement $result = $db-query($sql);//check for DB query error if( DB::isError($result) ) { die ($result-getMessage());?php if( $_POST[submit] != Save ) { ? **HTML** div align=center form name=classinfo action=?php echo $_SERVER[PHP_SELF]; ? method=post input type=hidden name=form_submitted value=1 table name=add_tutor border=0px cellpadding=0 cellspacing=2 width=900 tr th class=darkgreen width=100% colspan=2bTeacher/b/th /tr tr td class=lighter width=200Name:/td td class=lighter width=500Input type=text size=50 name=tutor_name/td /tr tr td class=darker width=150Contact No:/td td class=darker width=150Input type=text size=30 name=tutor_contact/td /tr tr td class=lighter width=150Email:/td td class=lighter width=150Input type=text size=50 name=tutor_email/td /tr tr td class=darker width=150Profile:/td td class=darker width=150TEXTAREA class=textarea name=tutor_profile ROWS=6 COLS=70 /TEXTAREA /td /tr } So, what could be the problem with the code I have wriiten??? Any help are appreciated. Irin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php