Re: [PHP] file upload
On Mon, 2005-04-04 at 17:07 +0300, William Stokes wrote: Hello, I might have asked this already but I am still ignorent ;-) How to check if a same name file already exists in a upload directory when uploading new file? Thanks -Will http://www.php.net/file_exists -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP, Ruby, and PostgreSQL Development * http://www.robbyonrails.com/ / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's the going rate for making websites ?
On Sun, 2005-04-03 at 16:51 -0600, -{ Rene Brehmer }- wrote: Hi gang Sorry for asking this question here, but I don't know where else to ask. And Goole'ing didn't help me much. My father-in-law has a friend in Alaska (and I'm in Canada) that needs a website done. Not sure what kinda site he wants done yet, or how much he needs me to do for him (like webspace, domain hosting, domain registration, and such) but for now I've been asked what it'd cost to get it done. I'm assuming it's something pretty simple, since it's just for a motorcycle club, but he wants a price first ... What do y'all charge when you do sites for people ??? ... In the past I've only done pro-bono work (because they usually don't require much work, so it's not a problem getting it done while working on other projects), but I've never actually done paid work before... It's more that I just recently moved to Canada (from Denmark) so I have no feeling with what the prices and rates are overhere ... $x = What is your time worth? $y = How long will it take you? $cost = $x * $z -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP, Ruby, and PostgreSQL Development * http://www.robbyonrails.com/ / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP file as homepage?
On Tue, 2005-03-15 at 11:10 -0500, Phil Neeb wrote: I've noticed that PHP.net uses index.php as its homepage and well, I'm curious as to how that's possible. Is it the server setup that allows them to load a php file as their homepage or something else? Apache handles this... or your web server. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP, Ruby, and PostgreSQL Development * http://www.robbyonrails.com/ / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class/object storing itself in a database
On Mon, 2005-03-14 at 14:07 -0600, Chris Boget wrote: I have the following Class: class MyClass { function store_myself() { $query = 'INSERT INTO mytable ( myfield ) VALUES ( ' . $this . ')'; $result = mssql_query( $query ); } } which works. Kind of. What I expected was a serialized copy of the object to be stored in the column myfield. However, what I am actually seeing is simply the word 'Object'. How can I get it so that the serialize copy is stored so that I can retrieve that copy later and use it as a PHP object? thnx, Chris Try serializing it first. What happens when you run: echo $this; ..your query is going to save the same thing. try serialize($this) instead. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP, Ruby, and PostgreSQL Development * http://www.robbyonrails.com/ / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload and resize image script
On Fri, 2005-03-04 at 03:04 +0100, p80 wrote: hey all I'm looking for a simple script that would upload an image and resize it to thumbnail using a form to upload the picture. anyone has a good script for that? There is a function in this post for resizing: http://blog.planetargon.com/archives/44-Image-Watermarks-in-PHP.html -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Catalog or cart
On Wed, 2005-03-02 at 02:45 -0800, Ryan A wrote: Hey all, I have a client who has a computer store, now he wants to put all his stuff in one site. He does not want to do any selling from his site, but just list all his items. After looking via google and the the usual script sites, agora cart looks pretty good and easy to maintain, other choices X-Cart,oscommerce,phpcatalog I dont really want to build this from scratch as I am sure a lot of very very good solutions are already out there and i would rather use the time instead to either tweak the software to his particular needs/requests request for example: he wants a few lines and a picture(optional) of his product (eg: a HP printer) and when clicked on it should pop up a window with that products details. /request or cleaning up his design, digital snaps etc I've never really worked on a site like this before so I would appreciate any recommendations you have towards a cart or catalog system thats has worked really well for you, or you heard is good or you helped develop etc I would like a cart/catalog that is open source (does not have to be free..but not expensive) so i can play with the code if need be. The reason i was leaning towards a cart is, if he ever decides to sell online, i dont want to build a whole extra piece of software to go with the catalog. Thanks in advance, Ryan Very flexible and runs on PostgreSQL. http://www.pgcart.com/ -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Catalog or cart
On Wed, 2005-03-02 at 13:15 -0800, Robby Russell wrote: On Wed, 2005-03-02 at 02:45 -0800, Ryan A wrote: Very flexible and runs on PostgreSQL. http://www.pgcart.com/ Oops, forgot to provide link for an example of it in production: - http://www.johnbenzart.com/ -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting PHP to work with MySQL 4.1.10 under Fedora Core 3
On Mon, 2005-02-28 at 07:30 -0500, John Swartzentruber wrote: On 2/28/2005 2:47 AM M. Sokolewicz wrote: well, for some reason it didn't compile in the mysql extension at all... even though it was configured to. That's strange, and I have no idea why it would do that. However, since you're using mysql 4.1.x, you should be using the mysqli interface anyway. Even phpmyadmin has the option to use mysqli instead of mysql; you just need to configure it that way (via config.inc.php) - tul I'll try that, but I'd really like to know why it didn't compile in the mysql extension. That was my impression as well, but I couldn't see why that would be the case and am too new to know for sure that this was the case. Where would I look for the mysqli interface documentation? Is it in the MySQL documentation or the PHP documentation (or both or neither)? Do you have mysql-devel installed? (since you installed via RPM). -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function to resize images
On Mon, 2005-02-28 at 10:34 -0500, Bosky, Dave wrote: Does anyone have a nice function that will resize an uploaded image to specific width/height dimensions? I wanted to find something that would work for only GIF and JPG image types. I've converted my shopping cart application from Cold Fusion to PHP and need to create thumbnails and reduce the size of large uploaded images. I've already done a google search and found an example but can't get it to work for some reason and it includes a bunch of other stuff that's not needed and too much trouble to remove. Some info in this post might help you: http://blog.planetargon.com/archives/44-Image-Watermarks-in-PHP.html -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Wiki
On Thu, 2005-02-24 at 17:49 -0500, Randy Johnson wrote: Is there a Wiki site for PHP? Is there a need for one? -Randy The php.net site doesn't really need a wiki. or did you mean is there a php-based wiki? http://www.google.com/search?q=php+wiki -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wierd PHP Problem
On Wed, 2005-02-23 at 16:39 -0500, Will Beers wrote: Matthew Fonda wrote: $HTTP_*_VARS is deprecated in PHP5, so if the server is running PHP5, this code won't work. Instead, you should use $_POST On this subject, is there anything 'wrong' with using $_REQUEST instead of specifying between $_POST and $_GET? Will Beers It really depends on the circumstance. Typically, do not use it unless you are totally okay with the data coming from $_GET or $_POST. For security-minded people, it's best to not use this unless you really need to. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me
On Thu, 2005-02-17 at 19:11 +0530, K Karthik wrote: can u help me to use $_SERVER['remote_addr'] to find the IP address ? i am new to php. i also want to find what page of my site he is viewing ? print_r($_SERVER); what do you see? -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP security
On Thu, 2005-02-17 at 20:47 -0600, .hG wrote: While back I read in an article that placing UN and PASSwords in a PHP was not secure. couple of open source programs that I have seen they have for example $database = ; $username = ; $password = ; It makes me wonder how secure in reallity it is to place your UN and Passwords on a PHP file. Thanks for your input Well, what do you suggest we do? We could ask the code you write to guess the username and password? From the web, if you do it right, there is no way to really find out what the user/pass is. Don't keep it in your webroot if you can help it is a good way to avoid any issues. The only people who should have access to the file are you and your webserver process. if you put a file in your directory called, db.inc.php and it looks like so: ?php // robbys secret password $super_secret_password = noonewillguessthisone; ? .. if php is properly configured, this will never be displayed at /db.inc.php ... will just show a blank page -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delete all files in DIR every 20 days
On Tue, 2005-02-15 at 02:12 +1030, Tim Burgan wrote: Hello, How can I delete ALL files within a specified directory every 20 days? Does anyone know of any code-snippets that are around at the moment that are able to do this? (And where I can find them?) Thanks Tim What operating system? In linux you'd use rm -rf /path/to/dir and add this to crontab. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help parsing named.conf file
On Sun, 2005-02-13 at 16:46 +0100, Torsten Rosenberger wrote: Hello is there a way to parse the named.conf file with preg_match_all to get back an array which looks like [options][directory] = '/var/lib/named' [options][forwoarder] = '192.168.0.2' [zone][mydomain.com][type] = 'master' [zone][mydomain.com][notify] = 'yes' [zone][domain2.com][type] = 'slave' . . You might try googling for some existing classes that do this. http://sourceforge.net/projects/phpbind/ -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Limit iterations on a foreach loop?
On Thu, 2005-02-10 at 15:58 -0800, Brian Dunning wrote: I'm using an RSS feed that has WAY too much content, I only want the first 10. I'm outputting the array with a foreach loop: is there a way to limit it to only go through the first 10? Thanks, - Brian Is this data coming from a database? If so, just set a limit at the end of your query... example: SELECT * FROM blog ORDER BY id DESC LIMIT 10; ..will return the latest 10 entries. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpBB alternatives?
On Tue, 2005-02-08 at 17:16 -0800, Tony Di Croce wrote: Due to the recent vulnerabilities discovered in phpBB and the content of this page: http://www.phpbb.com/ I have decided to consider other options for my forum needs... Does anyone have any reccomendations for a PHP based forum software? -- Send REAL USPS letters from the Web! http://www.quickymail.com e attacked phpbb.com did indeed use a vulnerability in awstats to gain entry to our server -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting Ruby on Rails Apps --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Headers already sent error
On Thu, 2005-02-03 at 12:59 +1030, Tim Burgan wrote: Hello, I'm receiving an error Cannot modify header information - headers already sent by XXX. In my php, I have a heap of code, then use header(Location: blah.php); to redirect the user. I get this error on the webhost, but not on my local host. I've searched and found that this can be caused by spaces after the closing php tag, but I don't have any. What could this be? Tim try adding: ob_start(); to the top of your file -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting PostgreSQL 8.0! --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple question
On Tue, 2005-02-01 at 01:41 +, Pagongski wrote: I have this function: function supscript($texto) { print(sup.$texto./sup); } But when i do: print 2.supscript(3); I get the 3 before the 2, how is that posible? And: print(supscript(3).2); makes the 2 appear before the 3. I am confused! Thanks probably because it calls the function before it calls the main print. try return instead of print. example: function supScript($txt) { return sup{$txt}/sup; } print 2 . supScript(3); You shouldn't print a function that prints.. ;-) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now hosting PostgreSQL 8.0! --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Search Engine Friendly URLs
On Fri, 2005-01-14 at 13:46 -0500, Josh wrote: I am converting a site to use includes instead of a Dreamweaver template. I want the URLs to look like this: www.my-site1234.com/contact instead of www.my-site1234.com/default.php?p=contact. I found some tutorials on editing the .htaccess file but where do I find it on the server? You need to create the file in the root directory of your website. Example: if your website is located in /home/web/foo/public_html/ then you need to create the file: /home/web/foo/public_html/.htaccess You also need to make some adjustments to Apache to allow you to do this. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP code to analize email HELP
On Sun, 2005-01-09 at 19:20 -0500, Alejandro Marn Uribe wrote: Hi all I really need help. I have an idea about to create a piece of code that it analyze an email, extract certain data (this email contains Name, email and telephone of a person in a standar html) and insert this data in MySQL database. It this posible? I'm a newbie in PHP/MySQL, any ideas? Thanks, excuse my english You can probably search online and find some tutorials for this. Some terms that might help are 'php parse html email' -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable hell
On Tue, 2005-01-04 at 16:54 +0200, mario wrote: Hi all I have few variables in this format: $isproductssorttext = 150; $isofferssorttext = 250; $isnewproductssorttext = 350; $isproductscount = 50; $isofferscount = 30; $isnewproductscount = 20; etc What I want to do is have a variable e.g. $x = products; and create from that, the variable $is'products'sorttext (--$isproductssorttext) and use its value so if $x was offers on echo I would have (250) -- $isofferssorttext if $x was newproducts on echo I would have (350) -- $isnewproductssorttext Thanks in advance Mario This seems like an odd approach to doing this.. but here goes: $isproducttext = 120; $x = product; $y = is . $x . text; print $$y; -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie.. $_GET $_POST
On Mon, 2005-01-03 at 10:54 -0300, Pablo D Marotta wrote: Hi there.. I need to pass variables to a page through an html link. I do it like this: A href=Extra/excelListing3.php?buildQuery=?php echo $buildQuery ?Export/A where 'buildQuery' is the variable Im passing. In the destination page, I capture it with $_GET and thats it. I want to know if there is any way of doing it without showing the variables in the direction bar. Thanks! Pablo You can store it in POST, GET, in the SESSION, track the user in the database... lots of ways to do it. POST might be the easiest route without showing in the URL. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to argue with ASP people...
On Fri, 2004-12-31 at 02:49 +, mail.pmpa wrote: Don't mean to start a discussion whatsoever, I love php, but one thing i can't do in php is Response.Redirect . Apart from that no complains so far :) * Happy New Year * Pedro Almeida. Sure you can.. class Response { function redirect($location) { header(Location: . $location); } function write($text) { print $text; } } Response::Redirect(http://www.planetargon.com/;); Response::Write(bar); There, now we can compete with ASP. ;-) -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to argue with ASP people...
sure, add this to the top of your file: ob_start(); On Fri, 2004-12-31 at 04:50 +, mail.pmpa wrote: Can I do any session handling before calling header(Location: $url); ? Pedro Almeida. -Mensagem original- De: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] mail.pmpa wrote: Don't mean to start a discussion whatsoever, I love php, but one thing i can't do in php is Response.Redirect . Apart from that no complains so far :) header(Location: $url); which, by the way, makes a hell of a lot more sense. It's just an HTTP response header like any other response header and it is called Location, not Redirect. -Rasmus -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test, please ignore
On Tue, 2004-12-28 at 18:09 +0100, Steven Spierenburg wrote: to see if i can post... no, you can't. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gallery (4 in a row) // carefull newbie
On Tue, 2004-12-28 at 19:47 +0100, [EMAIL PROTECTED] wrote: Hi all I am making a gallery for my Homepage. Now, I want to make little tumbnails of my work and make a table out of them. So, to not put them all in a row, what whould make the site unreadable, i have to put them in a little table, an i think 4 in each row would be ok. I like to read out the pic's name etc. out of a mysql table. But how do make the script to write a /tr after it read out 4 entries of a mysql table? Thanks in advance :) I'd reply, but I don't think it would go anywhere: [EMAIL PROTECTED] wrote: -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with code
karl james said: Team, Can you tell me why this code is not working? I get a query is empty at the moment. http://www.theufl.com/php/wrox_php/movie_details.phps We need some information on the errors that you are getting. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MP3s
.m3u does this For example: $ cat the_vacant_-_live_10192004_full_show.m3u http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_01_-_ladders_to_the_moon.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_02_-_rooftop_rocketship.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_03_-_perception.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_04_-_song_1.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_05_-_the_cure_got_in_her_head.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_06_-_red_light.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_07_-_bliss.mp3 Cheers, Robby On Thu, 2004-12-23 at 11:18 -0500, David Dickson wrote: I think if you generate a .m3a file with just the full url of your mp3 and send that to download in the browser this will launch the users mp3 player which will then stream the mp3 that was contained in the file. GH wrote: I appologize in advanced if this is an off topic discussion... I am working on a PHP based website and would like to offer media to my visitors... I have the Audio in WMA and MP3 formats... I would like to know how I could get them to Stream? inline... using PHP any advice would be greatfully appreciated Thanks in advance Happy Holidays Gary -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing new code vs. re-writing someone else's code
On Tue, 2004-12-21 at 11:41 +0100, Eakin, W wrote: Hello, This question could be seen as a general programming question, but because PHP is what I know best, I'll ask it here. A good friend of mine is the person who got me more interested in programming as a career. She's a professional COBOL programmer, and works for a large bank. She once told me that 75% of her time was spent going over and rewriting/repairing old code that she didn't write, and only 25% writing new code. From what I know about COBOL, it seems that it might need more rewriting than other languages, because of all the built up old code. But as I look forward to the day when I can work as a full-time PHP coder, I wonder. The question is, how much of your time (you, the professional PHP coder reading this), is spent rewriting/repairing old code vs. writing new code. Although this is a PHP list, and my question is in regards to PHP, if you want to give me your opinion on this same question in regards to other languages you've programmed in, I wouldn't mind. thanks, William All languages have this problem. It's going to happen regardless of which language that you work on. As you become a better programmer you can plan ahead better, but you should always expect to have to go back and rethink things and clean up existing code. (refactoring) If you do it effectively, the time it takes to go back and work on legacy code can be dropped: see: http://www.refactoring.com/ ..and a good book that someone recommended to me recently: http://www.amazon.com/exec/obidos/redirect? tag=gp04-20path=tg/detail/-/0201485672%3Fv%3Dglance Cheers, -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fax Gateway
On Sat, 2004-12-18 at 13:00 +0100, Neo Theone wrote: I have to setup a HTML-Form to Fax Gateway and I am looking for some way to do this in PHP. Generally have the Fax-Modem and nothing more right now. Does anybody have any experiancs with this? Thanks for any help I did something similar to this in perl a long time ago. Basically, you can build an interface to a hylafax server and build a postscript file with php (or other scripting language) and then call the hylafax command with the postscript file. Actually, the interface was part of a web interface to display the current status of hylafax, so all you really need is the hylafax commandlines and call them with php. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Possible to make $$ distributing PHP as Shareware?
On Thu, 2004-12-16 at 10:50 +0800, Jonathan wrote: Hi, I have developed a full email marketing application (using php, mysql) which supports tracking technology (i.e. whether the recipient has read the email, view online, unsubscribe, click on any of the link etc), bounce mail management, backend engine. Is it possible to make some $$ if I distribute the application as a shareware or should I just sell it as an commercial package. If you have any experience with this, kindly enlighten me. Thanks, Jonathan You have three options. 1. Sell it as a commercial product ($)..and hope people don't build a free version 2. Give it out..and hope that people come to you for customizations and enhancements ($) 3. Don't sell it like regular software. Sell it as a service that you completely control and support..and have your users pay you to utilize your service. ($$) ..depending on what your goal is with it, those are generally the three ways you can make money with your app. Cheers, -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counting chars..
On Thu, 2004-12-16 at 14:28 +0800, Louie Miranda wrote: ?php $string = function yes good; $display = count_chars($string); echo $display; ? i know this is wrong, but how can i count chars used here? php.net/strlen ? -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Classes and Functions
On Sat, 2004-12-11 at 13:03 -0500, R. Van Tassel wrote: Can someone give me a distinction between the two and when to use / not use them? I want to thank everyone who replied about myFor loop question. All the answers were VERY helpful! Thanks very much. You might want to pick up a book on programming to read up on this. In a nutshell, a function should do something specific. It's good to use functions when you do the same thing in different places in your code so that you don't need to copy/paste your code over and over. function foo() { $x = 1; $y = 2; return $x + $y; } $bar = foo(); print $bar; - OUTPUT: 3 A class/object is a collection of functions and variables that are contained within their own scope. (vague description) class foobar { var $x = 10; var $y = NULL; function foobar($y) { $this-y = $y; } function add() { return $this-x + $this-y; } function subtract() { return $this-x - $this-y; } } $object = new foobar(4); print $object-add() . \n; print $object-subtract() . \n; # set y to a new number $object-y = 2; print $object-add() . \n; print $object-subtract() . \n; OUTPUT: 14 6 12 8 As it sounds like you're still new to this, I would pick up a book or read some material online that will better show you when to use either and play around with them both. Have fun -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me split chars w/o spaces by 2... like: 2004
On Thu, 2004-12-09 at 09:55 +0800, Louie Miranda wrote: Help me split chars w/o spaces by 2... like: 2004 How can i make it? first: 20 second: 04 Im working on this.. # begin code $year_split = date(Y); $chars = preg_split('//', $year_split, -1, PREG_SPLIT_NO_EMPTY); # end code But it splits the whole 2004 string.. Array ( [0] = 2 [1] = 0 [2] = 0 [3] = 4 ) First of all, what sort of code are you building that needs to split the year by 2 sets of 2 digits? Second, you can do this like so: $foo = date(Y); $bar = array(); $bar[] = substr($foo,0,2); $bar[] = substr($foo,2,2); print_r($bar); Array ( [0] = 20 [1] = 04 ) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Free for commercial use?
On Thu, 2004-12-02 at 07:29 -0800, Brian Dunning wrote: I thought I wouldn't have any trouble finding this. I'm trying to provide documentation that PHP is free for commercial use, and I can't find anything on php.net. Can anyone help me? - Brian http://www.php.net/license/ http://www.php.net/license/3_0.txt -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] mysql_connect vs mysql_pconnect
On Fri, 2004-11-26 at 19:55 +0100, fabien champel wrote: hello, I do not know when I must use mysql_pconnect instead of the mysql_connect :( what are the real advantages of persistent connections, please ? http://www.google.com/search?q=advantages+of+persistent+connection -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Is there a shorthand way to...?
On Mon, 2004-11-22 at 09:01 -0500, Al wrote: When handling $_POST[] values that may or may not be assigned, I am forever using: if((isset($_POST['courses_list']) AND $_POST['courses_list']== 'Used')) Is there a shorthand way of doing this without causing notice errors? Thanks. You could write a function that would perform this for you. function getPostVar($var) { if (array_key_exists($var, $_POST) isset($_POST[$var])) { return $_POST[$var]; } else { return False; } } if (getPostVar('contact_list') == Used)... -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] redirecting to a success page
On Mon, 2004-11-22 at 09:13 -0500, Judson Vaughn wrote: Group, I have a create_login.php page, which works (it inserts data into the database), but I need for the script once executed to redirect to a success.php page. It doesn't do this and I can't figure out how to do it. I've included a portion of the script below. This was created by Dreamweaver MX and modified by me. The original script, created by Dreamweaver, gives an error that says header has already been sent. I tried different options to no avail. I realize this script is now seriously hosed but thought I would include it anyway since others may be using Dreamweaver. Sounds like you are displaying information then trying to redirect a user? The way the internet works is that you load a page...and the browser shouldn't be sent more headers until the next browser action. Javascript can do this with a meta refresh, or you can use ob_start() at the start of your php code, which will allow you to send headers at any point during your php code, as it waits until it goes through all your php code before sending any headers. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] How do I get referer in php?
On Wed, 2004-11-17 at 13:54 -0600, Brent Clements wrote: Let's say I have a page at another site that links to a php script on my server. Is there anyway to get the referrer to the php script using php? Look in the $_SERVER array. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] PHP Supremacy...
On Wed, 2004-11-17 at 16:17 -0600, Pedro Irn Mndez Prez wrote: Hello my friends, I need your help in convince to my boss in adopt php for development of a tool for intranet in my office, he told me that php is open source and we dont know if will disappear in a year, or if php have a support like .net. what arguments can I show for convince him to try PHP? Thank you very much :) The internet might disappear in a year..and then PHP could disappear as well. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] mp3 cropping
On Wed, 2004-11-17 at 21:53 -0600, Ryan King wrote: Anyone out there know of a tool or technique for cropping an MP3 file (e.g., cutting the first 30 sec out into another file)? PHP would be nice, but not necessary. TIA, ryan a php question would be nice, but not necessary. :-p -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] copy function?
On Tue, 2004-11-16 at 16:42 +0200, Garth Hapgood - Strickland wrote: I have a button which I want to add a function to, so that when it is clicked, the data from one textarea will be copied to another textarea Which event handler of the button should I use and hoe should I construct the function? Garth Php doesn't do anything like this...unless you post a form. Try javascript. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Is Perl faster than PHP?
On Tue, 2004-11-16 at 16:54 +0100, Merlin wrote: Hi there, it came to my attention that most of the high traffic portals are using perl in the backend. Those sites do also apear to me to be very fast in comparison to most php sites. Are there any known performance comperissons between the two available? Or can one say that PHP or Perl is faster about x percent in general compared to the other one? thanx for any hint, Merlin It really depends on how you're running them.. is PHP or Perl running in mod_* or is it running as a CGI? Which is quicker to program in? Yahoo uses php for some of their stuff, I would say that is a pretty high traffic site. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
[PHP] weekly email idea
On some of the general lists (like I am on the python list), they have a weekly email that someone puts together and sends out to the list with tips and urls to things found throughout the week on the mailing list. People post valuable links and information and it would be a quick overview of the past week in URLs/quotes/etc. I'd be happy to take this on initially (the python passes it around to the more active people every once in a while), just wondering if you think it would be worthwhile or not. We could even have, best javascript question of the week section in the email. ;-) Thoughts? I looked over the past several months and saw nothing like this happening so I thought I'd put the idea out there and would be happy to try it out for a few weeks. I don't think one email a week would flood our inbox so any other concerns, comments or suggestions? Cheers, -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] http header script to stimluate upload with drag and drop??
On Tue, 2004-11-16 at 13:10 -0500, Scott Fletcher wrote: Hi! I wonder is is it possible to have an http header that would stimluate files/folders upload via dragging over to the browser window? If so then what are the sample functions or scripts that make this possible... Thanks, Scott I have a script that will stimulate you. ;-) -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] isset opposite
On Tue, 2004-11-16 at 15:11 -0800, Dustin Krysak wrote: Hi there.. I am pretty new to PHP, and I am familiar with php isset option now i was wondering (I have looked at the PHP site - but can not find it) how can you check if something is not set? I need to test if a $_GET is not set (not just empty). thanks in advance! d isset() returns a boolean. so...try, if (!isset($x)) -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Object oriented programming
On Tue, 2004-11-16 at 15:39 -0800, Matthew Sims wrote: It's a new way of writing out programs that many new languages are taking in. OO programming is definitely not a new way of writing programs. SIMULA I (1962-65) and Simula 67 (1967) are the two first object-oriented languages. Simula 67 introduced most of the key concepts of object-oriented programming: both objects and classes, subclasses (usually referred to as inheritance) and virtual procedures, combined with safe referencing and mechanisms for bringing into a program collections of program structures described under a common class heading (prefixed blocks). Pretty sure that probably out dates many of the people subscribed to the list. ;-) (i included..) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] free php live support script ?
On Tue, 2004-11-16 at 21:40 -0400, Mario Bittencourt wrote: Hi, I was wondering if there is any free php live support script ? I'd like to add a chat room in my web site so users could chat with a human operator in a 1-1 mode. thanks. We use this program for live support with our customers. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
RE: [PHP] Question on query string
On Wed, 2004-11-17 at 11:28 +1100, Jason Oakley wrote: I think maybe $jtitle=$HTTP_GET_VARS['JTitle']; Might I remind you that $_HTTP_*_VARS is deprecated.. $_GET $_POST (it's also much quicker to type) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] isset opposite
On Tue, 2004-11-16 at 17:19 -0800, Dustin Krysak wrote: Thanks! perfect! d For future reference, just about any function that uses is at the beginning should return a boolean result. So if (is_array()) can also be checked with if (!is_array()) This should apply to all the php included functions that start with is. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] free php live support script ?
On Tue, 2004-11-16 at 18:35 -0800, Robby Russell wrote: On Tue, 2004-11-16 at 21:40 -0400, Mario Bittencourt wrote: Hi, I was wondering if there is any free php live support script ? I'd like to add a chat room in my web site so users could chat with a human operator in a 1-1 mode. thanks. We use this program for live support with our customers. Oops, it helps when I post the link. ;-) http://www.cslh.com/ -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Dinamically adding methods to an object instance?
On Mon, 2004-11-15 at 18:56 +0100, Francisco M. Marzoa Alonso wrote: I've seen that's possible to add public members to objects dinamically, such as: ?php class TestClass { public $One=1; } $Obj = new TestClass (); $Obj-Two = 2; echo $Obj-Two; ? There'll be a public Two member that's not defined in the class. Hmm, don't think that you can do this. You could do something like this though: class foo { var $bar = array(); function foo() { $this-bar['One'] = 1; } } $obj = new foo(); $obj-bar['Two'] = 2; print_r($obj); foo Object ( [bar] = Array ( [One] = 1 [Two] = 2 ) ) Is it possible to add methods dinamically to an object instance in same way? how? will these methods have access to private and protected members of the class of the object? Thanks a lot in advance... -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Column Totals
On Mon, 2004-11-15 at 11:01 -0700, Ben Miller wrote: SELECT SUM(Revenue) FROM Sales WHERE Date='$Date' What happens when you do: SELECT Revenue FROM Sales WHERE Date='$Date'; Make sure you're getting values back first..and then you can try to sum them. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Join PHPExperts
On Thu, 2004-11-11 at 11:03 +0600, Hasin Hayder wrote: Hi all, We starts a great user forum for PHP users. We gurantee the urgent solution of your problem regarding PHP, MySQL and It's extensions. Visit our group and be a proud member of our group visit: http://groups.yahoo.com/group/phpexperts Thank you all --Evelin brilliant. you should start an irc channel next. :-p -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] image uploads - part 2
On Sat, 2004-11-06 at 03:58 -0800, Jaskirat Singh wrote: 4) database + dedicated = err.. stupid? ;) I should have clarified this more as to why I prefer the DB storage method. I don't expect that my web application will be the only interface to the data that I am storing the database. For some clients, we build pyton interfaces that clients run on their desktop. We also replicate our databases across a few servers and it's much easier to keep track of the database than it is to make sure a bunch of filesystem-stored files are too. Some of our client database machines don't have a webservers so we don't program with just the web in mind. With storing in the database, we get transaction support and we know that an image will not be deleted if it is being referenced by another piece of data. Speed versus data integrity is something we have to juggle per client as to what is more important. If you know how to optimize your database (a stock pgsql db can be rather slow..) then the speed differences are not enough of a factor for us to know that our data just a bit more safer. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] postgres-embedded images via php. two issues...
On Tue, 2004-11-02 at 16:45 -0600, P. George wrote: i am storing images in a postgres database and i have set up a little php file to retrieve them in such a way that i can do: echo img src='gif.php?name=$picname'; ...from another php file. it's working great, BUT i've noticed two things that bother me: [1] if someone wants to download an image, they can, but it will be downloaded as gif.php instead of whatever.gif. even though renaming the file solves the problem, users will be confused by this. [2] (and i think this may be related to the first problem) is that in at least one of my browsers (camino/osx) the images are ALWAYS pulled directly from the server. they are never cached by the browser. i suppose all browsers may be behaving this way, but in camino, it is blatantly and visually obvious as you watch the gif being slowly downloaded/displayed over a slow connection. anyone know what to do for either of these? concerning [2], i'm thinking maybe i can implant the local browser cache _manually_ instead of depending on the browser to do it for me? if so, how would i go about doing that? thanks. - philip My guess is that your browser isn't set to cache .php file output. If it's caching images, you might need to trick it into thinking that it's an image. for example, look at the mod_rewrite rules at the bottom of this blog post. http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html I don't know if this *is* the issue, but it's my first guess. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] postgres-embedded images via php. two issues...
On Wed, 2004-11-03 at 10:20 +1000, Tom Rogers wrote: Hi, Wednesday, November 3, 2004, 8:45:17 AM, you wrote: PG i am storing images in a postgres database and i have set up a little PG php file to retrieve them in such a way that i can do: PG echo img src='gif.php?name=$picname'; PG ...from another php file. PG it's working great, BUT i've noticed two things that bother me: PG [1] if someone wants to download an image, they can, but it will be PG downloaded as gif.php instead of whatever.gif. even though PG renaming the file solves the problem, users will be confused by this. It does not matter what the extension is, it is the header that has more sway PG [2] (and i think this may be related to the first problem) is that in PG at least one of my browsers (camino/osx) the images are ALWAYS pulled PG directly from the server. they are never cached by the browser. i PG suppose all browsers may be behaving this way, but in camino, it is PG blatantly and visually obvious as you watch the gif being slowly PG downloaded/displayed over a slow connection. The browser wont cache url's that have the ? in them so change your info passing scheme to echo img src='gif.php/name=$picname'; then process the query string to extract the info You could even add a dummy value at the end like src='gif.php/name=$picname/type.gif to make it look like a gif' In my .htaccess file, I have placed the following : RewriteEngine On RewriteRule ^images/([0-9]+)$ image.php?id=$1 [L] RewriteRule ^images/(.*)$ image.php?filename=$1 [L] This allows either: http://localhost/images/5 or http://localhost/images/myimage.png to work. I prefer the filename as it looks cleaner and appears to be more standard. So, in a webpage, I can now add the following html code to show the image. img src=http://localhost/images/myimage.png; / -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] image files - upload and managment
On Sat, 2004-10-30 at 02:43 -0700, Jaskirat Singh wrote: Hi People, I am writing a web app on LAMP. The app is sort of yellow pages where people can login and post advertisments with pictures. App needs to allow users to upload pictures. (jpg and gif), needs to create thumbnails of those pictures and to store thumbnails and full pictures. App needs to manage all those files - can be as much as 20K plus images. I think image file size, file type and image dimensions restrictions should be easy to handle by using $_FILES array and getimagesize function. The issues that I am thinking of and need suggestions about are 1) Storage and retrieval - File system sounds like a better choice over database. We are talking about 20 thousand plus pictures. I would do it in the database (PostgreSQL in my case). The speed isn't going to be much slower if you keep things optimized. You can even cache your images if necessary on the filesystem (for high traffic images). 2) Thumbnails - Should I create those once and save it in a file when the image is uploaded for the first time. Looks like a faster option than creating them every time on the fly. I just recently finished working on a project where I knew that would automatically create a thumbnail version of each image on upload... but then I realized that I might one day want to change the default thumbnail sizes.. so what I did was have it create a thumbnail on the fly from the database. (this way I can control the thumbnail size in the future). The speed difference was hardly noticed. I have done what I mentioned above and am now caching images that get loaded frequently. 3) Security issues - I believe I must have a world writable 666 permissions directory to keep images as users of the web app are uploading them. Does that create any security holes in my application? The database will help you add a nice layer of security. 4) Any thing else related to image uploads that one might need to take care of. Are there any tutorials on image upload issues. an example: http://blog.planetargon.com/index.php?/archives/26_Uploading_images_into_PostgreSQL.html and here is how you can display the images from the db. I am also using mod_rewrite so that it looks like it's coming from the filesystem, for example: mydomain.com/images/mypic.jpg actually calls ./image.php?filename=mypic.jpg http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html hth, -Robbyu -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] image files - upload and managment
On Sat, 2004-10-30 at 22:30 +, Matthew Weier O'Phinney wrote: * Robby Russell [EMAIL PROTECTED]: On Sat, 2004-10-30 at 02:43 -0700, Jaskirat Singh wrote: App needs to allow users to upload pictures. (jpg and gif), needs to create thumbnails of those pictures and to store thumbnails and full pictures. App needs to manage all those files - can be as much as 20K plus images. I think image file size, file type and image dimensions restrictions should be easy to handle by using $_FILES array and getimagesize function. The issues that I am thinking of and need suggestions about are 1) Storage and retrieval - File system sounds like a better choice over database. We are talking about 20 thousand plus pictures. I would do it in the database (PostgreSQL in my case). The speed isn't going to be much slower if you keep things optimized. You can even cache your images if necessary on the filesystem (for high traffic images). I have difficulty believing retrieving an image from a database will have similar speed performance as simply grabbing it from the filesystem... and if you're seeing a need to cache images on the filesystem anyways, that's certainly already an argument against it. I tend to stick as much in the database with strict restraints. I know that in my database, an image cannot be deleted unless several rules are met. In the filesystem, a number of things could accidently delete the wrong file. I treat my images as another piece of data and that data is kept there by constraints. 2) Thumbnails - Should I create those once and save it in a file when the image is uploaded for the first time. Looks like a faster option than creating them every time on the fly. I just recently finished working on a project where I knew that would automatically create a thumbnail version of each image on upload... but then I realized that I might one day want to change the default thumbnail sizes.. so what I did was have it create a thumbnail on the fly from the database. (this way I can control the thumbnail size in the future). The speed difference was hardly noticed. I have done what I mentioned above and am now caching images that get loaded frequently. Thumbnailing on the fly may have decent performance, but it *is* slower than simply serving up an image. If you doubt that, try surfing from a T1 connection some time (dial-up users may not notice the extra time required to generate the image, but those on broadband will). In addition, if you generate a thumbnail every time the image is requested, you're making your server do extra work -- even if you're caching oft-requested images. I understand the argument regarding a future change in thumbnail sizes. However, generating thumbnails on a filesystem of images is something that is easily scripted and can be performed on an as-needed basis. (ImageMagick is great for this sort of thing, and scripts in PHP using GD could also be used.) As I can do when I want it to be a thumbnail. Infact, in PostgreSQL, I can use plPHP, plPerl, psycopg, etc and perform these tasks within database functions. This isn't an issue at all. Here are a few reasons why storing in the DB can be more useful. http://www.oracle.com/technology/products/intermedia/htdocs/why_images_in_database.html Also, Gallery 2, is moving to a database backend, one would wonder why that would be a good move, considering the sole purpose of gallery is to display images. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Gawd I hate those useless error messages...
On Fri, 2004-10-29 at 16:28 +0200, -{ Rene Brehmer }- wrote: Hi gang I do realise that this error means I've forgotten a curly brace or semi-colon somewhere, but seriously ... Parse error: parse error, unexpected $end in E:\web\Metalbunny\addguest.php on line 274 where line 274 would be the last line, obviously (since it's always the last line when it does this)... now I'm lucky that this script in question has alot of HTML in it, so there's only about 180 lines of actual code, but is there really not something that can be done to PHP to make errors like these just a LITTLE easier to debug ??? It's not that bad in this particular case ... but when we have scripts of 500-800 lines code, or even more, it tends to be a rather not very helpful message... and it gets worse when you jump in and out of PHP ... the '$end' and the '$' error are by far the most annoying errors, so hard to debug ... atleast with 'unexpected {' you have a slight chance as it limits the part you have to search through ... since this is the test-server, I run with all errors, alerts, and messages on, but isn't there someway to make PHP just a little more helpful when this happens ??? Yeah, don't make errors in your code. ;-) Also, try to seperate your html and php code as much as possible. Use a template system of some form. (ie. smarty) Use a PHP editor with syntax highlighting..click on one curly brace and then find where the other highlighted brace is and make sure that it where it should end. Learn how to debug your code. See how far it's getting for each thing..add test messages and die() in different scopes of code. Good luck, Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: Bug-Tracking-System in PHP ?
On Fri, 2004-10-29 at 16:51 +0200, Michelle Konzack wrote: Am 2004-10-29 09:48:32, schrieb Reinhart Viane: Dunno if this is ok: http://www.mantisbt.org/ Nice features and 1.0 support postgresql (can not use MySQL because some tools conflicts with postgresql) How do mysql and postgresql tools conflict? You should have no problem running them side by side... or even several of each on the same machine. They don't obsolete each other or cause dependancy issues. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: Re: Bug-Tracking-System in PHP ?
On Fri, 2004-10-29 at 12:04 -0500, Greg Donald wrote: On Fri, 29 Oct 2004 18:25:54 +0200, Michelle Konzack [EMAIL PROTECTED] wrote: I have tools for postgresql installed which drives mysql crazy... I must admit my curiosity here.. What tools? Seems pretty impossible since both Postgres and MySQL are stand-alone databases and have nothing to do with each other. I am curious too. I have never seen any conflicts of the sort. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Emulation of Application object
On Sat, 2004-10-30 at 00:55 +0300, Anakreon wrote: Hello all. How could I emulate the functionality provided by the Application object in ASP with PHP? Anakreon Rebuild it in PHP? You can try asp2php...but don't expect much out of it. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] https://...
On Thu, 2004-10-28 at 11:01 -0500, Afan Pasalic wrote: Hi Robby, Yes, I looked at SERVER_PORT/SERVER_PROTOCOL. What I got is 80 and HTTP/1.1 when I manually change http:// to https:// I'm getting 443 and HTTP/1.1 I am not so good in this: you want to say that SSL use 443 port -afan There you go, the standard SSL port is 443. If you want to verify that you are on 443, then you can use SERVER_PORT -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now supporting PHP5 and PHP4 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Review: Function that measures the width of a text string in pixels.
On Fri, 2004-10-29 at 00:11 +0200, Jacob Friis wrote: I have created a function that will measure the width of a text string in pixels. It works ok. If you have optimizations, please let me know. Thanks, Jacob function txt_width ($txt) { $width = 0; $txt_len = strlen($txt); for ($n = 1; $n = $txt_len; $n++) { switch (substr($txt, $n, 1)) { case 'l'; case '.'; case ' '; case '-'; case 't'; $width += 3; break; default : $width += 8; break; } } return $width; } ..and how do you plan to account for things such as, font sizes on all platforms, font types, etc? -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] File uploads and handling
On Thu, 2004-10-28 at 19:04 -0500, Philip Thompson wrote: On Oct 26, 2004, at 7:06 AM, Jason Wong wrote: On Tuesday 26 October 2004 03:45, Philip Thompson wrote: I have a form to upload a file from a user's computer to the server. I want to then modify the file, and then let the user save it back. However, I am having troubles opening the file. It says it doesn't exist. Any suggestions? --- if (is_uploaded_file($_FILES['userfile']['name'])) $handle = fopen($_FILES['userfile']['name'], r); else echo $filename . was not uploaded properly; --- I know the actual filename shows up... In the above you are only referencing the *filename* and not the actual uploaded file itself. but somehow it's not uploading. Ideas? Read manual Handling file uploads to see how it all works. Yeah, that was not useful at all. That's what I originally looked at. If anyone has some code that shows how to reference the actual file, then that would be helpful. I have pulled my hair out long enough over this one. I did try this, but nothing changed (b/c it's just an array): if (is_uploaded_file(_FILES['userfile'])) $handle = fopen($_FILES['userfile'], r); Tips would be wonderful. Thanks! Here is an example: http://blog.planetargon.com/index.php?/archives/26_Uploading_images_into_PostgreSQL.html hth, Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] https://...
On Wed, 2004-10-27 at 16:35 -0500, Afan Pasalic wrote: hi, how can I check using php that I use SSL? tried with REQUEST_URI HTTP_HOST PATH_INFO but any of these does show http:// Thanks! -afan Have you looked at $_SERVER['SERVER_PORT'] and $_SERVER['SERVER_PROTOCOL'] ? -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] User Screen Resolution
On Wed, 2004-10-27 at 15:25 -0700, Web Guy wrote: I am new to PHP and couldn't find any Globals for the User's Screen Resolution. (don't laugh at me please) I used to use a Javascript function to pass the resolution using screen.width and screen.height. What I am actually trying to do is make a page resize depending on screen resolution, in case that helps anyone. go back and find your javascript function. PHP is server side not client side. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now supporting PHP5 and PHP4 --- / signature.asc Description: This is a digitally signed message part
RE: [PHP] Default value if parameter is not passed in
On Wed, 2004-10-27 at 16:56 -0700, Quanah Gibson-Mount wrote: --On Wednesday, October 27, 2004 4:53 PM -0700 Vail, Warren [EMAIL PROTECTED] wrote: I notice that none of your variables use the PHP convention of $ preceding the variable name, I also do not see you defining a value for DEFAULT_VALUE, which by the upper case convention seems to be referring to a global constant. Is it not true (no pun intended) that if a variable (or constant) has not been defined, that assigning the contents of that variable (or value of the constant) will return a false (i.e. a 1)? This is inside the C source code for PHP. C does not prefix variables with a $. The DEFAULT_VALUE was simply shorthand for what I'm setting it to, and is not representative of an actual value, and that bit doesn't particularly matter, since it was never getting executed (although it was for a global constant from a header file). --Quanah So, you're asking for help on modifications to the source code for PHP, not how to help with modifications of PHP code, correct? If so, you might want to try the PHP developers list. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now supporting PHP5 and PHP4 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] PHP Compiler?
On Wed, 2004-10-27 at 19:26 -0500, Bill McCuistion wrote: Sorry if this is an old question: Where can I find information on any plans to create a compiler for PHP, especially v5.x? Barring that, is there a PHP syntax checker that would enforce some of the types of things that a compiler would find? I remember from back in my MS-DOS days the very good Clipper compiler for the dBase III language. dBase III, not unlike PHP, was an interpretive language, and along the way some bright folks figured out how to write a true dBase language compiler, which then allowed for all sorts of nice things to happen. One of the nicest things for me was that the compiler caught all sorts of little things before the same code in the interpreter would find them at run-time. I believe that there are some commercial products that can do this for you. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now supporting PHP5 and PHP4 --- / signature.asc Description: This is a digitally signed message part
RE: [PHP] Newbie again: get no $QUERY_STRING
On Thu, 2004-10-28 at 09:28 +0530, Zareef Ahmed wrote: Hi, What are you trying to do? If you want to get the values of query string they will be available in $_GET array. Try Print pre; print_r ($_GET); Print /pre; Yeah, as a habit I usually have a function called something like debug() function debug($arg) { print pre; print_r($arg); print /pre; } debug($_GET); try not to use capitalized P in print... -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development * --- Now supporting PHP5 and PHP4 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Form containing 2 menus not returning anything
On Sat, 2004-10-23 at 10:01 -0400, Ken Tozier wrote: I created an html form comprised of two menus but when the action method for the form calls my handler.php script, neither of the menu variables contain anything. Could someone point out what I'm doing wrong? Thanks, Ken Here's the relevant html: form action=handler.php method=post name=select_view_form table width=90% border=0 cellspacing=0 cellpadding=0 align=center tr td class=labelTextBold width=100pxPublication:/td td class=labelText select name=publication onChange=MenuSubmit(); option value=nonenone/option option value=1Ashland TAB/option option value=2Canton Journal/option /td /tr tr td class=labelTextBold width=100pxView:/td td class=labelText select name=view onChange=MenuSubmit(); option value=nonenone/option option value=1Pub Status/option option value=2Pub Notes/option /select /td /tr /table /form And here's the PHP handler script: ?php if ($view) { echo $publication.\n.$view; } else { echo no values supplied; } ? Not sure where you learned how to handle form posts, but you might want to spend some time reading the PHP site, specifically looking at how global variables work. Try changing $view to $_POST['view']; -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
RE: [PHP] Re-compiling PHP
On Fri, 2004-10-22 at 09:26 -0400, Mike R wrote: find the mysql-devel package that matches the version you are running. tip: download apt from freshrpms.net http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/ install the rpm for apt... then run: apt-get update apt-get install mysql mysql-devel This is what I got when I did that: mysql is already the newest version. mysql-devel is already the newest version. 0 packages upgraded, 0 newly installed, 0 removed and 75 not upgraded. Hmm. What version of PHP are you trying to install? -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Passing the Array as Parameter to either the function or object/class???
On Thu, 2004-10-21 at 09:57 -0400, Scott Fletcher wrote: Hi! I wanted to know is can it be done by passing the array as a parameter to the function? I also wanted to know is is it possible to pass around the array in the object-orientated feature like object/class stuffs? yes and yes. ie: function foo($bar) { print_r($bar); } $myarray = array(1,2,3,4); foo($myarray); ouputs: Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 ) cheers, Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
RE: [PHP] Strange Array Error
On Thu, 2004-10-21 at 15:04 +0100, Graham Cossey wrote: Oh @#*! Thanks Greg, I always get that one wrong ! $test_array = array(); :) a few less lines version: $test_array = array(); for ($i=0; $i7; $i++) $test_array[$i] = $i; print_r($test_array); hth, -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Simple Time Question
On Thu, 2004-10-21 at 08:48 -0600, Ben Miller wrote: Probably a stupid question, but hopefully has a simple answer. Is there a way to get Grenwich Mean time? time() and date() functions that I can see only seem to get date/time from the server, which knowing where that is, could easily figure out GM time, but would rather go the other way. Thanks. Ben You can set an environment variable for your project like so: putenv(TZ=US/Pacific); just find the proper GMT time zone format.. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Best practices for php application
On Thu, 2004-10-21 at 13:47 -0300, abrea wrote: Dear list, Does anybody know of a url where I can find reading materials about best practices to organize the filesystem and variable structure of a php application? Although application purposes probably vary widely, I imagine that in one way or other most include adding, updating, deleting and displaying records, so there might be some standard or preferred procedure. Thanks for any help Alberto Brea [EMAIL PROTECTED] eh, it depends on how you were trained/taught/learned how to do it. for good examples, head over to sourceforge and look at some of the major php projects..and browse their CVS directories..see how they do it for some examples. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
RE: [PHP] Re-compiling PHP
On Thu, 2004-10-21 at 14:52 -0400, Mike R wrote: Mike R wrote: I am trying to re-compile php, but keep getting erros that the mysql extensions are not installed. I got the binary from php.net and included mysql in configure (following). What am I not doing correctly? You're trying to compile the binaries? Sorry, the tar'd file I should say. ;p You probably need to do --with-mysql=/path/to/mysql/libs It's not finding them by itself..so you my need to be a bit more specific. ..you have mysql libs installed, right? -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
RE: [PHP] Re-compiling PHP
On Thu, 2004-10-21 at 16:05 -0400, Mike R wrote: On Thu, 21 Oct 2004 15:35:09 -0400, Mike R [EMAIL PROTECTED] wrote: Even after re-compiling with the location of the mysql headers, it still won't work. :\ Pretty discouraging. What version of PHP did they start dropping the libraries? Maybe I need to just upgrade to that version.. What does the --with-mysql portion of your ./configure command look like? Do you actually have any files on your system named libmysql* ? A quick check on two systems I have access to, Suse 9.1 and Debain Sarge, they are in the same place: /usr/lib/libmysqlclient*. that means I would have installed PHP like --with-mysql=/usr . How is your MySQL installed? From RPMs? If so do you have the MySQL development RPMs installed? What OS are you running? Redhat 7.3, I believe MySQL was installed with an RPM. No, I don't have any development RPMs installed. Should I maybe recompile MySQL first? Thanks, -Mike find the mysql-devel package that matches the version you are running. tip: download apt from freshrpms.net http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/ install the rpm for apt... then run: apt-get update apt-get install mysql mysql-devel -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] remote file existance when protected by a .htaccess
On Wed, 2004-10-20 at 09:53 -0700, Mag wrote: which works great except I have been getting some 403 access denied errors for some sites, checking I see that they are protected by a htaccess file (that checks the referrer) so i tried putting header('referer: domain') where domain is the parse_url['host'] of $remote_file but that too has failed... Any ideas? might want to try http://pear.php.net/package/HTTP_Client Nope, no PEAR allowedany other options? No PEAR allowed? Why not? You can include the libraries in your own paths... -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] File Upload Problem
On Wed, 2004-10-20 at 19:27 -0400, Nathan Mealey wrote: This file upload problem has me very confused. The code is: $upload_dir = '/articles_store/'; $uploadfile = $upload_dir . basename($_FILES['userfile']['name']); if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) { } else { die (Cannot upload file); } (this code is practically verbatim the example from php.net) The directory '/articles_store' has permissions 777. And the user is and group are 'www' (the Apache user). Are you sure that this is the correct path? Did you create a new path in your root level as /articles_store ? so, if I go on your machine and type in: $ cd / $ ls it'll show /articles_store /dev /etc /var ...etc? -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] File Upload Problem
On Wed, 2004-10-20 at 17:00 -0700, Robby Russell wrote: On Wed, 2004-10-20 at 19:27 -0400, Nathan Mealey wrote: This file upload problem has me very confused. The code is: $upload_dir = '/articles_store/'; $uploadfile = $upload_dir . basename($_FILES['userfile']['name']); if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) { } else { die (Cannot upload file); } (this code is practically verbatim the example from php.net) The directory '/articles_store' has permissions 777. And the user is and group are 'www' (the Apache user). Are you sure that this is the correct path? Did you create a new path in your root level as /articles_store ? so, if I go on your machine and type in: $ cd / $ ls it'll show /articles_store /dev /etc /var Basically, my first guess is that you are not understanding the directory structures properly. You need to give it the full path if you're going to have a / at the beginning of your directory path. /foo != yousite.com/foo in the system level. hth, Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Nested foreach ?
On Sun, 2004-10-17 at 09:53 -0700, Stuart Felenstein wrote: I have 3 arrays. 3 for 3 fields in a table (all part of 1 record) array1 - field1 array2 - field2 array3 - field3 What I've been doing which works good with one array: if ( is_array( $_SESSION['foo'] ) ) { foreach ( $_SESSION['foo'] as $x ) { sql .= INSERT INTO TABLE (... VALUES ($x) Just can't seem to figure out how with three arrays. help appreciated. Stuart Can you provide a print_r() output of your $_SESSION['foo'] ? I can help you more after that. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Nested foreach ?
On Sun, 2004-10-17 at 12:40 -0700, Stuart Felenstein wrote: Robby Here is the printout : Using- print_r ($skills); print_r ($skys); print_r ($slus); Array ( [0] = skillone [1] = skilltwo [2] = skillthree [3] = [4] = ) Array ( [0] = 2 [1] = 3 [2] = 4 [3] = [4] = ) Array ( [0] = [1] = [2] = [3] = [4] = ) 1 FYI - The skills is a string, skys and slus ints. Also I had only filled in 3 of the 5 for each. Thank you Stuart Are these 3 arrays related somehow? are all the [0]'s related and all the [1]'s related in each array? If so, you might consider having an array of arrays -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Nested foreach ?
On Sun, 2004-10-17 at 13:08 -0700, Stuart Felenstein wrote: They are related in the sense that they are part of one record in the database. Fields Skill YearsUsed LastUsed When you say array of arrays you are referring to a multi-dimensional ? I'm not sure what you mean by are the [0] related. Thank you, Stuart I guess that I am just trying to figure out what your issue is. Can you explain what the issue is a bit more, in plain english and perhaps I can help you from there. All I can see right now is that you are having an issue with a nested foreach, but didn't really explain what the issue was. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] looking for a few php partners/developers....
On Thu, 2004-10-14 at 05:55 -0700, bruce wrote: hi... i'm curious.. if i'm putting together a project, and am looking for a few php developers as sweat equity partners, is this an appropriate place to post my request..??? thanks -bruce [EMAIL PROTECTED] craigslist.org too. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] replacing characters in a string
On Thu, 2004-10-14 at 21:04 -0500, Mark Hubert wrote: This should be simple but having never have done it before and at deadline...help please. Need to change: [EMAIL PROTECTED] to; user=domain Did you try searching on the php site or google first? http://www.google.com/search?q=php+replace+character+in+string first result should find you your answer...and would take less time than sending the email. ;-) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] time
On Wed, 2004-10-13 at 10:31 -0400, Jerry Swanson wrote: I want to send email every 24. What time format you recomend to use? In what format the data should be store in mysql? TH every 24? hours? minutes? Are you going to be running a script all the time to do this? You might want to consider using CRONTAB (if in the *nix environment)...which would call a script to send your email. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] deleting multiple items from a database
On Wed, 2004-10-13 at 16:11 -0400, Adil wrote: function deleteFiles() { foreach($_POST['stack'] as $i) {//This should work but I can't tell if it is or isn't mysql_query(DELETE FROM uploads WHERE upload_id = . $i); } header(Location: http://; . $_SERVER['PHP_SELF']);//forces a page refresh to show the file list without the items that were deleted. } For sanity of your mysql database, you might consider making this one query. Something like DELETE FROM table WHERE id IN (32,34,46,432,35); generating your list of numbers/ids from your array... -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: Sessions and Mozilla (Firefox)
On Wed, 2004-10-13 at 01:26 +, Matthew Weier O'Phinney wrote: * Pablo Gosse [EMAIL PROTECTED]: I just noticed that if I open up a Mozilla window, log into my CMS, then open another Mozilla window (not by ctrl-n, but by selecting it from my programs menu) and bring up the login page in that new window, then it detects the session from the other window and redirects right to the CMS control panel. In IE, this will happen if I ctrl-n a new window, but not if I start a new instance of the browser from the program list. Is the correct behavior for sessions in Mozilla? I've searched the lists but I couldn't find anything which seemed to answer this. My understanding is that if you have a session of Mozilla open, if you run the executable again, it searches for a running session and, if one is found, uses it to spawn a new window without actually running another copy. The way around this is to use profiles in mozilla. -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
[PHP] php4 objects
A friend of mine asked me if I knew if this was possible in PHP4. class foo { var $bar = NULL; function foo() { $this-bar = new bar(); } function getBar() { return $this-bar; } } class bar { var $thing = NULL; function bar() { $this-thing = Hello World!; } function getThing() { return $this-thing; } } he wants to do something like this: $obj = new foo; print $foo-getBar()-getThing(); is this possible in PHP4? I know that he can do a: print $obj-bar-getThing(); ..but he wants it to run some stuff in the functions that he is calling and wants to do it in one command if possible. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] tool to check syntax
On Fri, 2004-10-08 at 14:37 +0200, Stphane THIBAUDEAU wrote: Hello, I'm looking for a tool which checks php syntax the way CheckStyle does for Java for example. (http://checkstyle.sourceforge.net/) I'd like such a tool to warn me when a PHPDoc comment doesn't document every parameters for a method, when there is no PHPDoc comment for a class or method, when a method contains too many lines and so on... I couldn't find any tool like that on the internet. I hope it exists. Thanks in advance, Stphane What about phpxref? http://phpxref.sourceforge.net/ I use it for documentation and forcing myself to stick to a standard. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Quotes in form textarea fields
On Fri, 2004-10-08 at 06:22 -0700, Sam Smith wrote: I swear I googled for an hour first. A user enters in a textarea field of FORM1.php: Bob is high Submitted to FROM2.php we get: Bob is \high\ In a hidden field in FROM2.php we store the value: type=hidden, value=? echo stripslashes($_POST['textarea']); ? Value now Bob is high Then from FROM2.php we Submit BACK to FROM1.php and enter it back into the textarea field with: type=textarea, value=? echo $_POST['hidden']); ? we have; Bob is Everything after the first double quote is clobbered. I can fix this by putting this in FORM2.php: $APParea1 = $_POST['textarea']; $APParea1 = str_replace(\,[QT],$APParea1); and then back by putting this in FORM1.php: $APParea1 = $_POST['hidden']; $APParea1 = str_replace([QT],\,$APParea1); type=textarea, value=? echo $APParea1; ? BUT THIS must have happened many times a long long time ago to many good people and some smart function was developed, right? Thanks stripslashes() addslashes() another option is to turn off magic quotes. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] read aspx files
On Fri, 2004-10-08 at 15:00 -0300, celso andrade wrote: hi all, how do i setup a apache+php server to read aspx files as php files? i need it to parse aspx files. thank you Do you mean run aspx files? Or just read them? If so, you should just be able to read the contents of yourfile.aspx on the local disk. PHP doesn't run aspx files.. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Best way to save preferences?
On Sun, 2004-09-26 at 10:00, Victor Spng Arthursson wrote: Which is the best way to save preferences (for a site) to make them easily accessable for changes? What I want is a way to save arrays and read them in again without having to use a database Thankful for suggests, sincerely Victor http://www.sqlite.org/ perhaps? -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] PHP and extern link
On Sun, 2004-09-19 at 02:29, Martin Justra wrote: Hi, Did you want to a) redirect the user to https://www.domain.com/... or b) display the contents of https://www.domain.com/...? I want to redirect the user. But as soon as I try with fopen (https://) I get the following error: Warning: fopen(https://tto.deutschepost.de/nexttonline/jsp/direct_access.do?v_benutzer=xxxv_passwort=xxxv_ic=xxxv_spr=deu): failed to open stream: No such file or directory in /var/www/catalog/blubb.php on line 2 It seems that fopen is not able to open it, because it is not redirected to a file... Any solutions ? Martin try ?php header(Location: http://domain.com/;); ? -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Capturing an Image of a web page
On Tue, 2004-09-14 at 17:45, Vail, Warren wrote: Has anyone run across a tool available to PHP that can render an image of a entire webpage from a URL, so that it can be reduced to a thumbnail and stored in a database? Warren Vail This would require that PHP act as a web browser..which it doesn't do. I've seen things like this before..but I believe they are using real browsers to do this.. perhaps looking into building a way to connect to the mozilla api or something... don't think PHP is going to be much help with you for this one. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] trying to do too much with functions?
On Thu, 2004-09-02 at 07:11, Justin French wrote: I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... My main objectives: 1. have all parameters optional 2. have a mixed order for the paramaters Other languages seem to do this well (Ruby, or perhaps RubyOnRails seems good at it), but in PHP I can only see a few options... I'm hoping someone might offer a few more ideas. ? $params = array('a'='123','b'='456'); echo doStuff($params); ? ?=doStuff(array('a'='123','b'='456'))? ?=doStuff('a=123','b=456')? ?=doStuff('a','123','b','456'); ? ?=doStuff(a='123' b='456')? So, is that it? Have I thought of all possible options? /** * pass an array..so as long as you pass one thing... */ function doStuff($args) { // do something print_r($args); } /** * this arg is optional as it has a default value */ function doSomething($x=0) { return $x; } -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Get Value
On Wed, 2004-08-25 at 21:11, Syed Ghouse wrote: Hi All Will anybody tell me how to extract the value (say Google) from the code below: a href=www.google.comGoogle(value to extract)/a Thanks and Regards Syed You can use regular expressions for this. $in = 'a href=meep/a'; preg_match(|(.*)/a|, $in, $out); $foo = $out[1]; print $foo; ...prints: meep This is just a quick and dirty example of how this can be done. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part