php-general Digest 2 Jul 2006 23:48:56 -0000 Issue 4218
php-general Digest 2 Jul 2006 23:48:56 - Issue 4218 Topics (messages 239067 through 239074): Re: Job Opportunities in Web Design company 239067 by: Ryan A 239068 by: tedd 239069 by: Kevin Waterson 239070 by: chris smith Re: global class instance 239071 by: John Wells Re: IMAGECOPYRESIZED(); DOESN'T WORK... 239072 by: BBC 239074 by: chris smith Re: design? 239073 by: John Wells Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- Requirements: blah blah blah How much? Right to the point :) Also, what benefits? as the applicant will have to move to Egypt if not already located there (I have not read the whole email but I don't think Mr Ahmed mentioned applicants have to already be residents there). Will the person who gets the job also have to redesign the homepage? because it looks/feels quite crappy for a web design company...IMHO. Cheers! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ---End Message--- ---BeginMessage--- At 6:45 AM +0300 7/2/06, Ahmed Abdel-Aliem wrote: Safari Studio Inc. is looking for qualified designers/developers for a full time/part time position. This is position is available for designers/developers that want to work in a company that is growing. click here to fill in the application form http://www.safaristudio.net/hr/ I certainly could have designed/coded a better page, and site, than that -- does that count? My advice, if you're looking for qualified and experienced help, then reflect same in your site. tedd -- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- This one time, at band camp, tedd [EMAIL PROTECTED] wrote: I certainly could have designed/coded a better page, and site, than that -- does that count? My advice, if you're looking for qualified and experienced help, then reflect same in your site. Had not actually looked at the site, ick.. and, umm, some security on those forms would possibly help. Kevin -- Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote. ---End Message--- ---BeginMessage--- On 7/2/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, tedd [EMAIL PROTECTED] wrote: I certainly could have designed/coded a better page, and site, than that -- does that count? My advice, if you're looking for qualified and experienced help, then reflect same in your site. Had not actually looked at the site, ick.. and, umm, some security on those forms would possibly help. That would probably explain the job position ;) -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- On 7/1/06, sempsteen [EMAIL PROTECTED] wrote: hi all, i wonder if there is a way of creating an instance of a class and reach it direcly from any scope in PHP4. basically what i want is: ... i don't want to: - declare global $foo, - use pre-defined $GLOBALS variable, - or use a::print Well I don't know what the list will feel about this one, but you *could* create a function (or series of functions) to do what you want with $a, since functions always live in the global scope. If you're just looking for a generic get-me-around-scoping solution, this obviously wouldn't be appropriate. However if your $a is special, for example an application-wide configuration object, then the approach might suit your needsor wants, as it were. -John W ---End Message--- ---BeginMessage--- Did you check if you had the required gd extension? I believe someone already told you and how to check. Sorry I resent my question unintentionally I believe no one did. btw, what is GD extension, and how to install or load it? I have read my 'php.ini', and then I found this: ;extension=php_gd.dll But I don't know what's that suppose to mean.. My system is winXP -- -- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- BBC wrote: Did you check if you had the required gd extension? I believe someone already told you and how to check. Sorry I resent my question unintentionally I believe no one did. Then you didn't look hard enough. btw, what is GD extension, and how to install
Re: [PHP] Job Opportunities in Web Design company
This one time, at band camp, Ahmed Abdel-Aliem [EMAIL PROTECTED] wrote: Requirements: blah blah blah How much? Kevin -- Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Job Opportunities in Web Design company
Requirements: blah blah blah How much? Right to the point :) Also, what benefits? as the applicant will have to move to Egypt if not already located there (I have not read the whole email but I don't think Mr Ahmed mentioned applicants have to already be residents there). Will the person who gets the job also have to redesign the homepage? because it looks/feels quite crappy for a web design company...IMHO. Cheers! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Job Opportunities in Web Design company
At 6:45 AM +0300 7/2/06, Ahmed Abdel-Aliem wrote: Safari Studio Inc. is looking for qualified designers/developers for a full time/part time position. This is position is available for designers/developers that want to work in a company that is growing. click here to fill in the application form http://www.safaristudio.net/hr/ I certainly could have designed/coded a better page, and site, than that -- does that count? My advice, if you're looking for qualified and experienced help, then reflect same in your site. tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Job Opportunities in Web Design company
This one time, at band camp, tedd [EMAIL PROTECTED] wrote: I certainly could have designed/coded a better page, and site, than that -- does that count? My advice, if you're looking for qualified and experienced help, then reflect same in your site. Had not actually looked at the site, ick.. and, umm, some security on those forms would possibly help. Kevin -- Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Job Opportunities in Web Design company
On 7/2/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, tedd [EMAIL PROTECTED] wrote: I certainly could have designed/coded a better page, and site, than that -- does that count? My advice, if you're looking for qualified and experienced help, then reflect same in your site. Had not actually looked at the site, ick.. and, umm, some security on those forms would possibly help. That would probably explain the job position ;) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] global class instance
On 7/1/06, sempsteen [EMAIL PROTECTED] wrote: hi all, i wonder if there is a way of creating an instance of a class and reach it direcly from any scope in PHP4. basically what i want is: ... i don't want to: - declare global $foo, - use pre-defined $GLOBALS variable, - or use a::print Well I don't know what the list will feel about this one, but you *could* create a function (or series of functions) to do what you want with $a, since functions always live in the global scope. If you're just looking for a generic get-me-around-scoping solution, this obviously wouldn't be appropriate. However if your $a is special, for example an application-wide configuration object, then the approach might suit your needsor wants, as it were. -John W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IMAGECOPYRESIZED(); DOESN'T WORK...
Did you check if you had the required gd extension? I believe someone already told you and how to check. Sorry I resent my question unintentionally I believe no one did. btw, what is GD extension, and how to install or load it? I have read my 'php.ini', and then I found this: ;extension=php_gd.dll But I don't know what's that suppose to mean.. My system is winXP -- -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] design?
On 6/30/06, Sjef [EMAIL PROTECTED] wrote: Thanks, John, I'm not sure I completely get the idea of a pair class. As an question and answer are in the same database tabel I now created a questionDepot class that gets the array from the db, does save and update operations, and for example, sets a flag in the db tabel when a question is accepted for the list. Hi Sjef, It sounds as if you've got the idea, even if I didn't explain myself well. My point was to *not* create a Question class that maintained an array of questions, which was only _implicitly_ related to a similarly-structured but disparate Answers class. An array of questions sitting beside an array of answers is, in my opinion, not a proper abstraction of the objects you're dealing with. Perhaps it is out of experience that I'm harping on this point, because I've been burned by a similar design before. One of my first OO projects was a weblog, and I had built a Post class, and then for posts with galleries, a separate Gallery class that contained *only* image information for it's parent Post. On it's own, this wasn't all bad, but the big mistake I made was how I handled multiple posts and multiple galleries (like for building out the homepage where I showed 5 recent posts and a thumbnail from each, if they were galleries). Within each Post and Gallery class, I turned the properties into _arrays_. So what originally was a string for the post's title, now became an array of strings for many posts. Likewise for the Gallery class. Arrays of thumbnails became arrays of arrays of thumbnails. I'm sure The List will shudder at this design, but hey, I've learned my lesson. Be-lieve-me. Anyway, the point is, your initial approach was the same (if I read it correctly). You suggested an array of questions, and an array of answers, which would only be implicitly related. Your design started with the concept of many questions, and many answers, but my argument is that, abstractly, you should begin with one question, and one answer. Then think in terms of a question-answer pair that *belong to each other*. And then think of many question-answer pairs. Anyway, I'm sure that by the time you've finished reading this hair-splitting rambling, you've already finished your app and moved on to something else entirely. :) -John W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IMAGECOPYRESIZED(); DOESN'T WORK...
BBC wrote: Did you check if you had the required gd extension? I believe someone already told you and how to check. Sorry I resent my question unintentionally I believe no one did. Then you didn't look hard enough. btw, what is GD extension, and how to install or load it? I have read my 'php.ini', and then I found this: ;extension=php_gd.dll But I don't know what's that suppose to mean.. http://www.php.net/manual/en/install.windows.extensions.php -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] global class instance
sempsteen wrote: yes i'm calling a lot. actually i have a class that handles mysql queries named database. what i want was call a database method from a method of another function. class function ...$database-execute_query(... Always CC the list. What's wrong with this being a global variable? In your common or global or whatever you call it file: $db = new Db(); $db-Connect(''); $GLOBALS['Database'] = $db; then you use $GLOBALS['Database']-... This file is *always* called before your other classes so it's always set. It can't be overridden or anything, so I don't understand the objection to it being a global variable. Another option, inside your main class (you're using inheritance right?) var $Db = null; function GetDb() { if (!is_null($this-Db) is_resource($this-Db-Connection)) { return $this-Db; } $db = new Db(); $db-Connect(...); $this-Db = $db; } then use $db = $this-GetDb(); inside your class. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Update or add?
Brian Dunning wrote: I have a table where I want to update each record with today's date as it's hit, or add the record if it's not in there: +--+-++ | id | creation_date | last_hit | +--+-++ I'm trying to do this with a minimum of hits to the db, so rather than first searching to see if a matching record is in there, I thought I'd just go ahead and update the matching record, check to see if it failed, and if it failed then add a new one, like this: $id = $_GET['id']; // Update $query = update table set last_hit=NOW() where id='$id'; $result = mysql_query($query); // Add if(the update failed) { $query = insert into table (id,creation_date,last_hit) values ('$id',NOW(),NOW()); $result = mysql_query($query); } What's the fastest way to check if the update failed? You have a few options as others have pointed out, but I'll post this as an option anyway. Other db's don't have replace into or the on duplicate key option either, so you'd need to do something like this: $query = update ..; $result = mysql_query($query); if (mysql_affected_rows($result) == 0) { // do the insert. } -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ONE PAGE CONNECTS MANY DATABASE
BBC wrote: Yes I'm using MySQL and the DataBases I mean are in different servers but the problem is I don't know how to set the host. All input will be very helpful... Maybe this was an accidental duplicate post, but you've done this with a few of your questions. Sending the same question over and over again isn't going to get you a different response. If you don't understand one of the (many) replies you receive, then tell us what part you don't understand and ask us to explain it further. http://php.net/mysql_connect explains how to set the different hosts (servers) when connecting to the database. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems installing 5.1.4
I'm trying to get v5.1.4 installed on my server and running into something of a mystery. I can configure and run make with no problem. When I run 'make install' however, it starts the process, installing the dynamic modules, PHP SAPI module, make the necessary changes in httpd.conf and moves on to installing the other pieces: Installing PHP CLI binary:/usr/local/bin/ Installing PHP CLI man page: /usr/share/man/man1/ Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20050922/ Installing build environment: /usr/local/lib/php/build/ Installing header files: /usr/local/include/php/ Installing helper programs: /usr/local/bin/ program: phpize program: php-config Installing man pages: /usr/share/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/lib/php/ That's where it just dies. Dies in the sense that, it just sits there. Doesn't seem to be doing anything at all. My only recourse at that point is to hit CTRL-C. Now, looking in /usr/local/lib/php I see the following: [200] 19:41:56 [EMAIL PROTECTED]:/usr/local/lib/php ls -al total 20 drwxr-xr-x 4 root root 4096 Jul 2 18:59 ./ drwxr-xr-x 5 root root 4096 Jul 2 18:59 ../ drwxr-xr-x 2 root root 4096 Jul 2 18:59 build/ drwxr-xr-x 3 root root 4096 Jul 2 18:59 extensions/ [201] 19:41:58 [EMAIL PROTECTED]:/usr/local/lib/php Looking at running processes (related to this install) I get this: 17828 pts/2S+ 0:00 make install 25312 pts/2S+ 0:00 /bin/sh -c if test -f pear/install-pear-nozlib.phar /usr/local/src/apache/php-5.1.4/build/shtool mkdir -p /usr/local/lib/php; then make -s install-pear-installer; else cat /usr/local/src/apache/php-5.1.4/pear/install-pear.txt; fi 25329 pts/2S+ 0:00 make -s install-pear-installer 25330 pts/2S+ 0:00 /usr/local/src/apache/php-5.1.4/sapi/cli/php -n -dshort_open_tag=0 -dsafe_mode=0 -derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0 pear/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin It's just sitting there, doing nothing. What's going on here? How do I even start figuring out why it won't finish the install? -- A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Programming question - New to PHP
On Wednesday 28 June 2006 19:55, Chris wrote: Russbucket wrote: I took an example of a script from the PHP documentation and try to connect to my database. If I leave in the or die part of line 3, I get nothing, if I comment out that part I get the echo message on line 4. ?php // Connecting and selecting the database $conn = mysql_connect ('localhost', 'finemanruss', 'XXXl') or die ('Could not connect : ' . mysql_error()); echo 'Connected successfully'; mysql_select_db (Lions, $conn); // Preform SQL query $query = 'SELECT * FROM Moses_Lake_Lions'; $result = mysql_query ($query) or die ( 'Query failed; ' . mysql_error()); ? I know line three works without the or die part since I have a 2nd script that is almost the same (no or die) and it retrieves info from my DB. Try it the same as the php manual page: $conn = mysql_connect(''); if (!$conn) { die(Could not connect: . mysql_error()); } -- Postgresql php tutorials http://www.designmagick.com/ Chris thanks for the response. I got this working and solved a couple other issues. Now just have one I'm working on where thedata is not being sorted correctly. I will be looking at that tommorrow. Thanks again for the response. -- Russ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?
Hello, on 06/30/2006 11:38 AM Jay Paulson said the following: I'd like to get some feedback on what the list thinks is a good template engine other than smarty. I'd also like to do some quick prototyping using a PHP framework does anyone have any recommendations for one that is easy to pick up and run with? Finally, does anyone have any suggestions for a good PHP database abstraction library? You may want to take a look at this post for a few recommendations: http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php