Re: [PHP] Upgrade to PHP5 and having issues with mysql
Robert Cummings wrote: On Tue, 2008-01-22 at 12:42 -0500, Tom Ray [Lists] wrote: Robert Cummings wrote: On Mon, 2008-01-21 at 18:01 -0500, Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Any thoughts or pointers on what I am doing wrong here? I've never had an issue before but I never had to compile PHP with mysql support since it was always part of the install. What's your ld.so.conf pointing to for MySQL? It should be pointing to: /usr/local/mysql/lib/mysql And not: /usr/local/mysql/lib Presuming that /usr/local/mysql/ contains the following directories as expected: bin/ include/ info/ lib/ libexec/ man/ mysql-test/ share/ sql-bench/ Cheers, Rob. ARUGH! I fixed my ld.so.conf file and tried again and I'm still dying in the make process at the same spot. Here's what I have: ld.so.conf mx02:~:# cat /etc/ld.so.conf /usr/kerberos/lib /usr/X11R6/lib /usr/local/ssl/lib /usr/local/opensrs-client/lib /usr/local/lib/perl5/site_perl/5.6.1/i686-linux /usr/local/freetds/lib /usr/lib/libmcrypt/lib /usr/local/mhash0-9-3/lib /usr/local/mysql/lib/mysql Here's my mysql structure: (var softlinks to data) mx02:~:# ls /usr/local/mysql binCOPYING docs include INSTALL-BINARY libexec mysql-test scripts sql-bench tests configure data EXCEPTIONS-CLIENT info lib man README sharesupport-files var This looks like the MySQL source tree and not the installation tree. Please provide your ./configure line for building MySQL. Cheers, Rob. This is how I setup mysql: #upgrades: cd mysql tar -zxf mysql-version-x.tar.gz cp -R * /usr/local/mysql cd /usr/local/mysql chown -R mysql:mysql * scripts/mysql_install_db --user=mysql /usr/local/mysql/bin/mysqld_safe & mysql starts/runs just fine. This server has been upgraded from 3.x to 4.x to 5.0.45 currently. Is there something I'm missing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Robert Cummings wrote: On Mon, 2008-01-21 at 18:01 -0500, Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Any thoughts or pointers on what I am doing wrong here? I've never had an issue before but I never had to compile PHP with mysql support since it was always part of the install. What's your ld.so.conf pointing to for MySQL? It should be pointing to: /usr/local/mysql/lib/mysql And not: /usr/local/mysql/lib Presuming that /usr/local/mysql/ contains the following directories as expected: bin/ include/ info/ lib/ libexec/ man/ mysql-test/ share/ sql-bench/ Cheers, Rob. ARUGH! I fixed my ld.so.conf file and tried again and I'm still dying in the make process at the same spot. Here's what I have: ld.so.conf mx02:~:# cat /etc/ld.so.conf /usr/kerberos/lib /usr/X11R6/lib /usr/local/ssl/lib /usr/local/opensrs-client/lib /usr/local/lib/perl5/site_perl/5.6.1/i686-linux /usr/local/freetds/lib /usr/lib/libmcrypt/lib /usr/local/mhash0-9-3/lib /usr/local/mysql/lib/mysql Here's my mysql structure: (var softlinks to data) mx02:~:# ls /usr/local/mysql binCOPYING docs include INSTALL-BINARY libexec mysql-test scripts sql-bench tests configure data EXCEPTIONS-CLIENT info lib man README sharesupport-files var Here's my configuration setup: mx02:~:# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache-dev/bin/apxs --with-mysql=/usr/local/mysql Compiles just fine but when I run make I get the errors previously listed. I've run ldconfig, I rebooted the machine...I just don't know what I'm doing wrong here. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Chris wrote: Tom Ray [Lists] wrote: Chris wrote: Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Did you get any errors when configure ran? I'm not sure if it will stop configure working when it can't find a library you want to compile in or if it just ignores the error and keeps going. No errors during the ./configure part only when I run "make" What happens if you configure --with-mysqli not --with-mysql ? Just wondering if it makes any diff.. it shouldn't really I don't think. Yeah it doesn't still have issues with it. I need to upgrade to PHP5 since some of the new OpenSRS stuff needs it but this is being a damn pain,. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade to PHP5 and having issues with mysql
Chris wrote: Tom Ray [Lists] wrote: Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Did you get any errors when configure ran? I'm not sure if it will stop configure working when it can't find a library you want to compile in or if it just ignores the error and keeps going. No errors during the ./configure part only when I run "make" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrade to PHP5 and having issues with mysql
Hey- I'm trying to install PHP5 with mysql support and I keep running into the same problem over and over again. I run the configuration with this: --with-mysql=/usr/local/mysql and without fail I get this every time: ext/mysql/php_mysql.o: In function `zif_mysql_create_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1227: undefined reference to `mysql_create_db' ext/mysql/php_mysql.o: In function `zif_mysql_drop_db': /home/tech/upgrades/php-5.2.5/ext/mysql/php_mysql.c:1266: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What am I doing wrong here? I'm running mysql 5.0.45 located at /usr/local/mysql which would my my lib directory at /usr/local/mysql/lib I have updated my ld.so.conf file to point to that and I'm still running into issues here. Any thoughts or pointers on what I am doing wrong here? I've never had an issue before but I never had to compile PHP with mysql support since it was always part of the install. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html parsing
Ron Croonenberg wrote: Hello, I have a script that ads data to a html template. However when there is an include in the html like: it is not "processed", but "just" ends up as a string in the page. So I guess it needs to be parsed. Is there an easy way to do that ? thanks, Ron Do you have SSI enable in Apache? You are running Apache right? Do you have the file named .shtml? Or do you have Apache setup to run SSI through the HTML parser allowing you to have the files named .html instead. But I guess the other question is why are you using an SSI command that you could easily use a PHP command for and thus not have to mix the two? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which PHP-Editor to use?
Stut wrote: Zoltán Németh wrote: 2007. 10. 16, kedd keltezéssel 04.59-kor mooor ezt írta: I recommed you Codelobster php edition. Very good free php editor. It reminds me a mix of Zend Studio and MS Visual Studio. If to the basic features they are: syntax highlighting, an intelligent outocomplete, step by step debugger, help on php, html, mysql; jump to funtion's or class's declaration in the project; search within the project; highlighting of paired tags and brackets; Calss View. I like that it has small size - only 5 mb. Free. I've downloaded from: http://www.codelobster.com Good luck! wow I haven't seen that thread for several weeks. this is really thread resurrection lol :) anyway, this thread has been talked to death a million times, so we could just let it drop finally (I thought we already did it...) ;) Nahh. I wanna hear more about the "Drug and Drop function for loading a new file". Cause everyone knows that for best results you've gotta drug files before you drop them into an application. http://www.codelobster.com/details_phped.html (end of page) -Stut I thought it was you had to drug the programmers so they can handle the insanity of the clients that have no idea how anything works and expect you to deliver the world on a silver plater while never paying more then $99 for the project. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Parse Issue
[EMAIL PROTECTED] wrote: I am having a issue parsing an html file. I want to pull all the data between two html tags. Problem I am having is that no matter what I try I can pull either tag or both but not the data in between. Welcome to Rideon function datamatch($document) { preg_match_all('/]*>(.*)/<\/div class="record" [^<>]*>/i',$document,$elements); $match = implode("\r\n",$elements[0]); return $match; } This should return the following Welcome to Rideon You may want to try escaping your quotations. That could cause some issues. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compose MP3 from a php enabled flash page.
John Taylor-Johnston wrote: I have an educational web site. I want to create an interface where my students can record their voices client side and then save messages server side. I thought Odeo would solve my problems. (The have their own problems now.) Then I tried: MyChingo and Mobasoft. COme on $6,000 for a site licence. Are there any php alternatives? Or do you know an flash code I can find in sourceforge, that I might hack, or combine PHP & Flash so they can record me messages in mp3 and submit them? John John- I guess my question is do you really need Flash for this? If they are uploading their recorded messages client side then they should be able to record/convert the audio files to .MP3 before even uploading them. If you just need the files somewhere online where you can download them for playback later (or even stream from the site) then really all you need is an Upload script that will take their audio files and upload them to the server to a specific location. Now if you want to offer a conversion of WAV to MP3 for them, I suggest FFMpeg, it's run on the server side. You can modify your upload script to not only upload the WAV file but then convert it out to MP3 to a specific location using FFMPeg commands then trash the WAV file. Do you have control over the server or are you just hosting your website there? You'll need to find out if the upload function is even turned on and what the max file size for upload is. Otherwise you'll just have to make a few minor adjustments to your php.ini to handle the larger file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Public Announcement
Greg Donald wrote: On Tue, 11 Sep 2007, Stut wrote: You didn't say what you have against mod_rewrite. I'll bet you mod_rewrite can parse a request and send it to the right script faster than your PHP implementation. Has anyone tried Nginx? The rewrite rules are a bit more clear than those of the Apache mod_rewrite variety. http://wiki.codemongers.com/NginxHttpRewriteModule But is it the greatest weapon system of our time? If its not then it's nothing to me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using a variable for include statement
Jeff Benetti wrote: Sorry if this is a noob question, I have used PERL, TCL and VB but I am just getting into PHP. If there is a better place to ask noobie questions then let me know. I want to use the include statement but I want to pass the name of the file rather than hard code it. It seems that PHP needs the file to be in its defined PATH in order to do this (or am I wrong?). My code works OK if I use hard coding Example (works) include ('somefile.php') Example (doesn't work) $TheFile = "somefile.php" include ($TheFile) Am I trying to do something that is impossible? If it is a path problem then how do I get around this, I can control my local server config but I only have a local server for development. Thanks, Jeff Jeff, there are a couple ways you can do this. 1) include("/path/to/".$TheFile."/"); 2) include $TheFile; Notice the lack of brackets in the last one. Either way has worked for me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Open Source Job Wanted system
Joey wrote: Has anybody had any experience with any open source Job posting systems out there? Thanks! I've written one myself. It allows for job seekers to put up a profile, resumes, etc and for employers to post their jobs and search resumes. Full search ability on both sides. They can even opt for "Hot Resumes" or "Hot Jobs" for higher/preferred listings in the search. I'm not sure what else is really out there. I guess it will all depend on what you're looking to do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating watermarks
GP INTERACTIVE wrote: you can use also the following function : function getPictureMarked($sourcefile, $watermarkfile) { # # $sourcefile = Filename of the picture to be watermarked. # $watermarkfile = Filename of the 24-bit PNG watermark file. # //Get the resource ids of the pictures $watermarkfile_id = imagecreatefrompng($watermarkfi le); imageAlphaBlending($watermarkfile_id, false); imageSaveAlpha($watermarkfile_id, true); $fileType = strtolower(substr($sourcefile, strlen($sourcefile)-3)); switch($fileType) { case('gif'): $sourcefile_id = imagecreatefromgif($sourcefile); break; case('png'): $sourcefile_id = imagecreatefrompng($sourcefile); break; default: $sourcefile_id = imagecreatefromjpeg($sourcefile); } //Get the sizes of both pix $sourcefile_width=imageSX($sourcefile_id); $sourcefile_height=imageSY($sourcefile_id); $watermarkfile_width=imageSX($watermarkfile_id); $watermarkfile_height=imageSY($watermarkfile_id); $dest_x = ( $sourcefile_width / 2 ) - ( $watermarkfile_width / 2 ); $dest_y = ( $sourcefile_height / 2 ) - ( $watermarkfile_height / 2 ); // if a gif, we have to upsample it to a truecolor image if($fileType == 'gif') { // create an empty truecolor container $tempimage = imagecreatetruecolor($sourcefile_width, $sourcefile_height); // copy the 8-bit gif into the truecolor image imagecopy($tempimage, $sourcefile_id, 0, 0, 0, 0, $sourcefile_width, $sourcefile_height); // copy the source_id int $sourcefile_id = $tempimage; } imagecopy($sourcefile_id, $watermarkfile_id, $dest_x, $dest_y, 0, 0, $watermarkfile_width, $watermarkfile_height); //Create a jpeg out of the modified picture switch($fileType) { // remember we don't need gif any more, so we use only png or jpeg. // See the upsaple code immediately above to see how we handle gifs case('png'): header("Content-type: image/png"); imagepng ($sourcefile_id); break; default: header("Content-type: image/jpg"); imagejpeg ($sourcefile_id); } imagedestroy($sourcefile_id); imagedestroy($watermarkfile_id); } ?> Regards, Greg http://www.psmdev.com <http://www.psmdev.com/> On 8/4/07, *Tom Ray [Lists]* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create "security code" images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added. How would one go about doing that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php <http://www.php.net/unsub.php> I'll test this tonight...thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating watermarks
I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create "security code" images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added. How would one go about doing that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
Stut wrote: blackwater dev wrote: I have to register a bunch of names and am trying to figure out why I would pay $35 when I can just pay $9 at godaddy. Does godaddy own it and I lease it from them??? Network Solutions are expensive, GoDaddy are cheap. That's all there is to it. In my experience customer service from both can be pretty shoddy or excellent depending on the day of the week and the phase of the moon. My advice is that if it's between the two, go with GoDaddy - you won't get any less for your money than you would with NetSol. -Stut But you might get more then with NetSol. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which PHP-Editor to use?
Merlin wrote: Hi there, I have worked now for several years happily with homesite 4.5, but now it looks like I have to switch to another system as homesite will not run without admin rights on a XP machine. What editors do you use? Do you have any recomendations on a special one? I have looked into eclipse, but I would hear from your experience which one would you recommend me to switch to? Thank you for any comment. Best regards, Merlin I either code in Dreamweaver or straight on the server via SecureCRT and use Pico. I really never could get into the other editor programs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bizarre array create error
Paul Novitski wrote: At 7/29/2007 09:59 PM, Ken Tozier wrote: /*--*/ /* Next two lines are where the problem starts */ /* If I comment either of them out the script runs */ /* but with both uncommented, it dies /*--*/ // create the rect and usable rect records $result->rect = array(0, 0, $result->page_width, $result- >page_height); Does this typo exist in your script? "$result- >page_height" with a space between - and >? Regards, Paul I thought the same thing but when I did the copy and paste no spaces where there. I think it's how the email clients display it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bizarre array create error
Ken Tozier wrote: Hi I'm trying to assign two fields of an object returned from a MySQL query and have stumbled upon the most bizarre PHP bug where I can't create two arrays in succession. Here's the MySQL query with two dummy fields to be filled in later select *, 0 as dummy_1, 0 as dummy_2 from table Here's how I'm grabbing the query results $result= array(); while ($row = mysql_fetch_object($query_result)) { $result[]= $row; } Once that's done, I try to set two of the rows to arrays like this $result-> dummy_1= array(1, 2, 3, 4); $result-> dummy_2= array('a', 'b', 'c', 'd'); If I comment out either of the above lines, the script works but with both uncommented, it seems to drop dead. It doesn't even return an error. Is this all of your code? Do you have some sort of output display for your results? Does PHP generally return errors to the browser? When I tried your code above with a test table with four data fields I got this error: * Warning*: Attempt to assign property of non-object in */usr/local/apache/htdocs/test-script.php* on line *14 **Warning*: Attempt to assign property of non-object in */usr/local/apache/htdocs/test-script.php* on line *15 *Then I re-read your code and realized that you made $row an object not $result, it's just an array. Changing this: $result->dummy_1= array(1, 2, 3, 4); $result->dummy_2= array('a', 'b', 'c', 'd'); to this: $row->dummy_1= array(1, 2, 3, 4); $row->dummy_2= array('a', 'b', 'c', 'd'); Yielded no errors for me what so ever. However, since it's unclear on what you are doing with this data I can't vouch that it's actually what you need. Double check your display_errors setting in your php.ini and make sure it's set to On. Because you're either not giving us all the code to work with and something else is happening and that's why you don't get the error but not your desired result or you're not displaying the errors. I've been doing assignments like the above for 3 years and never had a problem and in fact the exact same function works perfectly in another script.This one has me utterly stumped. Does that script run on the same machine? If it's on another machine is that machine running the same version? I ran this on a server with Apache 2.2.4, PHP 5.2.3 and mySQL 5.0.18. Have you referenced that other script to make sure that it *is* exactly the same? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Rules of Engagement
Colin Guthrie wrote: Daniel Brown wrote: As a relatively-new contributor to this list (read: under 2 years), I realize that I have no business requesting a change, but I'll breech etiquette and hope for the best. Can we update the filters on the list to have the reply-to address header marked to the php-general address? The reason I ask this is because, when people are on vacation (such as Juan is now), we receive responses to our personal addresses. Secondly, we have to continually "Reply All" the messages, which - though it's not a problem - can cause issues when attempting to respond to those "[URGENT]" replies. Third, our addresses are included in gmane, et al, which is an inherent risk --- I understand. Maybe it's just the ramblings of someone attempting to read and type on a limited-bandwidth mobile device while bored due to delays in mass-transit facilities (here, read: I'm fucking exhausted, and yes, I dropped the "F" bomb). In either case, it's not conducive to a new contributor to have to weed through "vacation response" messages each time he/she replies to the list. I agree here. I am on many lists and if I'm interested in something then I expect people to expect me to read the list for replies. But for noobs, the personal reply is quite good. I guess the rule should be "public list -> reply to poster", "subscription list -> reply to list". AFAIK Gmane etc. can be configured to obfuscate email addresses - certainly other lists I read through Gmane are... Col Well I think my only issue with it is that this is a group discussion list. We all ask for help, advice, suggestions or just bounce ideas off each other. When you hit that "Reply" button and it just goes to the person who made the post you're replying to it no long becomes a group discussion but a private one. The other issue is that during these private discussions the public version continues and if the solution is found in private the others don't know it and could actually spend time answering/helping with a problem that was fixed last Tuesday but no one knew because it was just a thread between two people. As for your rule, I think it's flawed. All lists, private or public, require you to subscribe in some way. They don't magically pick up that they should send email to a certain address, they have to be told. If the list is meant to be a discussion list then all the replies should go to the list by default. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Really, I had expected more mature commentary from the adults on this list. So did I. I expect adults to display morality and values. Really? Have you hung out with many computer geeks? Oh..wait..morality..I thought you said maturity. Pardon me. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hide the real URL
Eric Butera wrote: On 7/28/07, brian <[EMAIL PROTECTED]> wrote: Eric Butera wrote: On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, July 27, 2007 8:20 am, Eric Butera wrote: Not everyone has the option to do that. Plus I think it is unintuitive to have things outside of your actual "web site." You can disallow traffic with Apache fairly easily if you're paranoid of such things. If your host doesn't give you a directory outside the webtree, find a new host that does :-) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? We have our own dedicated server that we host client sites on. If I were to back out into the root then I would be at the level of all the other sites. It just doesn't make sense in my case. Then you haven't set up your directories properly, IMHO. Let's say you want all of your client web directories under /var/www/vhosts. Create a dir for each client and set up each of your DocumentRoots as a dir inside of that one. This way all of your clients now have a directory above their web root that they can place into anything they want to keep private. /var/www/vhosts/client_[1 .. n]/htdocs brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I didn't set it up. It is how things have been and will continue to be regardless of my opinion. :) I use this type of structure for my virtual hosting: domainname.com --> cgi-bin (CGI and Perl scripts here) --> error_docs (Custom error pages here. 400, 401, 403, 404 & 500 templates already in place) --> ftp (Holds virtual FTP user information along with a data directory for ftp only upload/downloads) --> htdocs (the website) --> logs (the site log file) --> other (where all non-web accessible files/directories/etc go) Even if they where to go above the domainname.com folder it would just lead them to /home/user anyways and the FTP server locks them into their home directories. This allows one user to control multiple domains under his account. The beauty about the "other" directory is that you can store anything you need there. I put hidden .password directories for htaccess authentication files, attachments for email, data files for things I don't want web accessible. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Email Composing Problem.
Chris wrote: Richard Lynch wrote: On Thu, July 26, 2007 2:46 pm, Tom Ray [Lists] wrote: I'm trying to use PHP to compose an HTML formatted email Don't do that... 3) Spam Assassin doesn't like it either way and tags the email as SPAM for the following reasons: 0.6 HTML_SHORT_LENGTH BODY: HTML is extremely short 0.0 HTML_MESSAGE BODY: HTML included in message 1.5 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding The only people who send out these stupid HTML enhanced (cough, cough) messages are spammers. Pfft. There are tons of legitimate reasons to send html emails. To get rid of the last one, don't base_64 encode your html content. You only need to base64_encode embedded images or attachments (pdf's, docs, stuff like that). As someone else suggested, check out phpmailer - it handles all this for you and works pretty nicely. I would have to agree with you Chris, there a many legitimate reasons for having HTML mail. I was trying to be a nice guy and send both the plain text version and the html version out but like I said, I couldn't get it to stop displaying both. I dumped the base_64 encoding already and also gave up on trying to do a multipart/mixed with both plain text and html and am just composing them as plain text or html as needed. PHPMailer is great for a resource but this is a customized project and PHPMailer won't fit in it. Plus I really would like to have this knowledge rattlin' around in my head anyways. It all works with Yahoo, Gmail and Hotmail. It displays properly and isn't shoved into the Junk/Spam folders. Everything displays right in Thunderbird and Outlook Express and the only time it's flagged as spam is if it goes through my main account which, in reality, has a insanely low score base (.5) and it's now scoring a .6 so I think I've got a solution. However, I would still like to get answers on questions 1 and 2 for future reference so any thoughts would be great. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML Email Composing Problem.
I'm trying to use PHP to compose an HTML formatted email and I'm running into some small problems. 1) When using "Content-Type: multipart/mixed" during my testing both Thunderbird and Gmail display the plain text and html version of the email and Firefox attaches the html portion as an attachement. 2) When using "Content-Type: multipart/alternative" during my testing Thunderbird only showed the HTML portion of the email but Gmail displayed only a blank email. 3) Spam Assassin doesn't like it either way and tags the email as SPAM for the following reasons: 0.6 HTML_SHORT_LENGTH BODY: HTML is extremely short 0.0 HTML_MESSAGE BODY: HTML included in message 1.5 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding Here is the script, which I mostly borrowed from tutorials/how to examples on the web. $to="Tom Ray <[EMAIL PROTECTED]>"; $from="Support <[EMAIL PROTECTED]>"; $subject="Test HTML Email"; // --> plain text part of the email $msgtext="This is HTML Testing"; //--> html part of the email $htmlmsg=chunk_split(base64_encode("This is HTML testing.")); //--> create boundary $sep = strtoupper(md5(uniqid(time(; //--> create email $header = "From: $from\n"; $header .= "MIME-Version: 1.0\n"; $header .= "Content-Type: multipart/mixed; boundary=$sep\n\n"; $header .= "--$sep\n"; $header .= "Content-Type: text/plain; charset=ISO-8859-1\n"; $header .= "Content-Transfer-Encoding: 8bit\n\n"; $header .= "$msgtext\n\n"; $header .= "--$sep\n"; $header .= "Content-Type: text/html; charset=ISO-8859-1\n"; $header .= "Content-Transfer-Encoding: base64\n\n"; $header.= "$htmlmsg\n\n"; $header .= "--$sep--"; //--> mail it mail($to, $subject, "", $header); Any help/suggestions would be appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload Tracker.
I'm a little unsure on how to do this but basically when someone uses a form to upload a file I want to have a popup window come up and so the process in percentage of the transfer. Anyone do this before? Is it possible in PHP or do I need to do it in javascript or a mixture of both? Any suggestions, ideas, commands or functions to try to use? I would greatly appreciate it. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Daniel Brown wrote: P.S. - If a rooster lays an egg in a nest under a tree that falls in the woods and no one is there to hear it, how soon will train B meet train A if the wind blows the egg off the top of a barn facing west before sundown? Oh, I know this! Roosters can't lay eggs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
Richard Heyes wrote: >> Every single one of us has been guilty of it at some time or another You can't make that assumption. Sure he can. Assumptions are like opinions which are like ...well you know what I'm getting at...we all have them. And if someone can honestly say they've never stolen ANYTHING in their life, I'd be hard press to buy it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Currency Exchange Database?
I thought about that but I'm looking to make it seem-less. I just want to get the numbers and do the conversion myself not have the third party do it. I just need an updated list on a daily/hourly basis. Paul Scott wrote: On Thu, 2007-06-28 at 20:44 -0400, Tom Ray [Lists] wrote: I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? I am pretty sure, although I may be wrong, that http://xe.com provides a webservice for this. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Currency Exchange Database?
I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? Any help would be appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php cli and mysql
Chris wrote: Tom Ray [Lists] wrote: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200: On 11/14/06, James Tu <[EMAIL PROTECTED]> wrote: I'm running a php script from the command line (I'm on OS X) and I'm getting ... Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) touch /var/mysql/mysql.sock chmod 777 /var/mysql/mysql.sock How could that possibly help? Because if the mysql.sock file is missing the mysql server won't start. If the mysql server isn't running the PHP script won't work. So I think it helps a lot. Actually the opposite - it becomes a lot harder to debug/diagnose. PHP uses the socket file to talk to mysql if you connect to 'localhost' rather than using a tcp/ip connection. If the socket file is invalid (as this would be), then mysql_connect fails, mysql_query fails and so on. The problem as it turns out was that php was looking in the wrong place, if this file was there and empty, then you'd get completely different errors which would make it harder to find the original problem. Well that's odd because on all my servers the mysql.sock is empty and if it's missing mysql tells me it can't find the sock file when it starts up. This wasn't an actual PHP problem, even trying to connect to the mysql server via /usr/local/mysql/bin/mysql -u user -p database would have produced that error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php cli and mysql
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200: On 11/14/06, James Tu <[EMAIL PROTECTED]> wrote: I'm running a php script from the command line (I'm on OS X) and I'm getting ... Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) touch /var/mysql/mysql.sock chmod 777 /var/mysql/mysql.sock How could that possibly help? Because if the mysql.sock file is missing the mysql server won't start. If the mysql server isn't running the PHP script won't work. So I think it helps a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Probably a dumb question but...
I've just installed PHP 4.4.4 with CLI disabled and CGI enabled. With CLI I can find the PHP executable in $prefix/bin/php but with CGI I can't find it. I need the path to the PHP executable so I can install suPHP but $prefix/bin/php no longer exists and all I have in $prefix/bin is php-config and phpize if I want to replace a call to $prefix/bin/php with the CGI version what would the system path be? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem compiling PHP 4.4.2 with mcrypt
I have to get a temporary server in place under a tight time frame and am using a pre-existing server that wasn't configured really for hosting websites. I've upgraded all the services on it like going from Apache 1.3.x to Apache 2.0.59 and PHP from it's old version to 4.4.2 however I need to have mcrypt compiled with PHP and I'm running into a problem. If I compile PHP without mcrypt I can install PHP without issue. However, when I try to compile PHP with --with-mcrypt=/usr/local/mcrypt I get the following error: main/internal_functions.lo -lcrypt -lcrypt -lmcrypt -lltdl -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o libphp4.la /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: *** [libphp4.la] Error 1 Now I went back and compiled without mcrypt and looked for that line and this is what was there: main/internal_functions.lo -lcrypt -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o libphp4.la I see that along with -lmcrypt not being there neither is -lltdl is there something I'm missing? Do I need to have something else installed on the box? Normally I haven't had this problem with this. But this is an old suse 8.x box that is being used due to time frame issues. Like I said I can compile PHP without mcrypt, but the project requires mcrypt so any help on this would be appreciated. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] User question for PHP
Is it possible to have a PHP script execute as the user of the domain instead of the webserver? So when I upload files through a PHP script they are owned by me and not "wwwrun" or "nobody"? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script timing out.
I just installed PHP Open Chat and I'm getting an error when I log in about the script being unresponsive. Anyone ever run into this? Or could shed a light as to what causes this error? I've never seen it come up before.I'm running PHP 4.4.2/Apache 2.0.5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Max File Upload
Is there anyway to overwrite the max file upload in php.ini per instant? I'd like to have users controlled on a certain website to have more then average uploads but the site runs on a shared hosting environment. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie Question
I've run into something rather odd with cookies today. I'm working with this admin section on a site and I'm setting a cookie that is supposed to be good for one hour. So in the cookie I have time()+3600 and all was well or that was until someone fired up IE. It seems that IE refused to set the cookie. After much swearing at IE, I found that if I set it to time()+7200 the cookie would be set. Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie said it would expire at 8PM which is correct. However, when I logged in via IE at 6PM it said the cookie would expire at 23:00 hours (11PM for those who don't know)...so my question is...why is this happening and why does IE do this? I checked in Opera, Mozilla and Netscape and they all work the same as Firefox. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD
Beauford wrote: I'm using Slackware 10 and installed GD as an install package. I also changed some lines in the php.ini file for GD. Tom: I have no idea how this program works, all I know is that I need it for the captcha program to display the image. I wouldn't even bother otherwise. Thanks. B Well, do you know where it is installed? I have mine installed in /usr/local/gd so to test it I just ran gd2topng via /usr/local/gd/bin/gd2topng it will ask for image information etc. If it does that then you're golden. The downside is you will need to recompile PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD
Beauford wrote: Hi, I am trying to get GD working so I can use a captcha script and not having much luck. I can get it to work in Windows, but not Linux. I have seen a few comments suggesting that PHP needs to be compiled with the GD switch. Is there another way to do this? I have PHP, MySQL and Apache installed and working great, I don't want to have to recompile PHP and have it screw up everything just for one program. Any help is appreciated. B I would say this is more a GD issue than a PHP issue. Can you get GD to run from the command line? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Message check then post
George- Without seeing your code it's hard to say what the problem is. There could be a typo, a missing quote or semi colon. The code snippet of the review page would be helpful. Now when you say it's entering "blanks" into the database, I'm assuming you have a messageID field in the db that auto increments in some way, and that you're seeing a new messageID generated and the remaining fields are blank? If that's the case perhaps you're delcaring those variables without data some where in your script. I would need to see your code in order to tell you better. Assuming everything is good, you need to pass your data from the check message page to your submit page by POST so hidden fields would be good. I'm also noticing that you're not escaping your data before you insert it into the database. This could be bad as quotations, apostrophes, and the such will cause your insert command to fail. Try this: $username=mysql_escape_string($username); $name=mysql_escape_string($name); $message=mysql_escape_string($message); mysql_query("INSERT INTO forum (user,name,message) VALUES ('$username', '$name', '$message')") or die("Insert Failed"); You should have some debuging built into your script so you can see where it errors out. Have you watched your mysql log file to see what happens during your query? Do you actaully the query happen in the log file? Or do you not have access to it? Posting your code and any errors would help us figure out what the real problem is. George B wrote: I am coding a message board. I am about done. I have all the forms needed for the message. So it all works out. The user types in his name, message title, and the message itself. Then clicks submit. The Submit button takes him to the message check. The message check shows all the stuff the user entered. Then it has "echo" which says 'Is this correct'? And then there is a button. "Yes" When the user clicks yes it goes to another PHP file which runs the SQL query to put in the entereddata into the database $query = "INSERT INTO forum (user,name,message) VALUES ('$username','$name','$message')"; $result = mysql_query($query); But see, the problem is that it is entering blanks into the DB. I think that is because the $username $name and $message are in the other file? I have no idea how to by-pass this problem. What should I do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Issue
Again, this won't affect anything since I installed from the CD's and I've always noticed that things installed via CD/rpm have different install paths then source. I'm worried it will look in the wrong spot for Apache...but that could be a un-needed worry. Rory Browne wrote: On 7/29/05, Tom Ray [Lists] <[EMAIL PROTECTED]> wrote: We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? Don't know - Don't have SuSE 2) If I can't, how do I recompile this since I used the SuSE cds? Head to www.php.net and hit the downloads section. unArchive the source, and type ./configure --help to get a list of the compilabel extensions. Once you're done, you can ./configure --with-this --without-that --enable this-thing --disable-that-thing The compile instructions(a file called INSTALL AFAIR) and the PHP manual are among the best docs I've ever seen. It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 any help would be great! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Issue
Yeah, I thought about that. But to be honest, I don't know how to recompile with builds from the CD/rpms. This is the first time I've ever done it this way. So if I get the latest RPM and install it it should activate session right? And then I just need to restart apache2 and I should be good? Burhan Khalid wrote: On Jul 29, 2005, at 8:07 PM, Tom Ray [Lists] wrote: We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? 2) If I can't, how do I recompile this since I used the SuSE cds? It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 I don't *think* there is a separate module/rpm for sessions, so you are off to a recompile job. While you are it, upgrade your PHP to the latest stable version. 4.3.4 is quite old. Maybe there is a new package for SuSE that does it? (not really familiar with SuSE). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Issue
phpinfo() says that sessions are disabled. So, between that and the fact I get the undefined function errors when I try to use session_start() or other session commands, I'm under the strong impression that sessions are disabled. So this leads me back to my original questions, can I activate sessions without recompiling? And if I can't, how do I recompile since I used the SuSE cd's and YasT? John Nichel wrote: Tom Ray [Lists] wrote: We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? 2) If I can't, how do I recompile this since I used the SuSE cds? It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 any help would be great! What does phpinfo() say? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions Issue
We built a box about 7 months or so ago using the SuSE 9.1 cd's, straight install from the CDs. While I've read that sessions are turned on by default, when we try to call on the sessions functions (like with phpOpenChat or start_session()) we get calls to undefined function errors. This is leading me to belive that sessions are disabled for some reason. I need to enable the sessions so I have a few questions 1) Can I do this without recompiling? 2) If I can't, how do I recompile this since I used the SuSE cds? It's SuSE 9.1 running Php 4.3.4 with APache 2.0.49 any help would be great! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_save_path() issue
Hey there- I went to install phpopenchat today and when I run the test.php script that comes with, I get this error: *Fatal error*: Call to undefined function: session_save_path() in */path/to/website/htdocs/phpopenchat/config.inc.php* on line *98 *I'm not sure why this is coming up since the session support is installed by default.. Can anyone enlighten me? I did an out of the box install of SuSE 9.1 with apache2.0 and php4.3, is there something I might have missed in the php.ini file I need to adjust? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COUNT(*) Output Question
Thanks JohnI didn't think of thatI've been working on this catalog admin interface for to long..my brain is mush. John W. Holmes wrote: From: "Tom Ray [Lists]" <[EMAIL PROTECTED]> $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku"); But my question is how do I use PHP to output the COUNT(*) results? When I run the command when I'm logged into mySQL I get the following: I assume you're fetching associative arrays from the result and $r['sku'] works, but you're not sure how to get the COUNT(*) value? Well, $r['COUNT(*)'] would work, but you could also use an alias: SELECT sku, COUNT(*) AS mycount FROM orders GROUP BY sku and then use $r['mycount'] to retrieve the value (after using mysql_fetch_assoc/array, of course). ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COUNT(*) Output Question
Hey- I'm query my mySQL database to see how many of each Sku has been ordered. I am doing my query as: $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku"); But my question is how do I use PHP to output the COUNT(*) results? When I run the command when I'm logged into mySQL I get the following: mysql> select sku, count(*) from orders group by sku\g +--+--+ | sku | count(*) | +--+--+ | 10001|1 | | 10001a |1 | | 10003|2 | | 10005|1 | | 10011|1 | +--+--+ I just can't figure out a way to output that Count(*) column into something HTML friendly...any help or thoughts on this would be appreciated! TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a brian I can pick?
Hey all- I've run into a small bump in some code I'm writing for a membership database. The first thing that needs to be done is an index of all states in the US with members. The fun part is that the state information is stored as the abbreviation in the database (ie MI, WI) and the HTML page needs to display the full name of the State. I want to display the information in a four column table that kicks out as many rows as needed. Now in order to get the full name of the state, I'm running the state result through a switch statement. Actaully, it's working rather well expect for this little issue: Row 8: South Dakota Tennessee Texas Virgina Row 9: West Virgina Wisconsin Texas Virgina I need to kill that extra Texas and Virgina.here's how I'm doing this: $query=mysql_query("SELECT DISTINCT state FROM members WHERE country='US' ORDER BY state ASC"); while($q=mysql_fetch_array($query)) { $q1=mysql_fetch_array($query); $q2=mysql_fetch_array($query); $q3=mysql_fetch_array($query); $q4=mysql_fetch_array($query); (4 Switch statements here one for q1, q2, q3, q4) ?> Any thoughts, let me know if more information is needed. TIA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Maybe a silly question
thanks, now that I know what it's for I know where to find it on php.net Ryan Thompson wrote: It's for classes. A site called http://www.php.net has some great documentation on it. $object->property (or function whatever the case may be) On Friday 10 October 2003 01:57, Tom Ray [Lists] wrote: I'm wondering if someone can explain something for me. I've never used this before but have seen it used in numerous sets of coding. What does the -> do? I see stuff like $test=$test->test_url = "Something"; $test1=$test->test_this = "Something Else"; Is it some sort of array function? I'm just a little confused and have been wondering for sometime. TIA
[PHP] Maybe a silly question
I'm wondering if someone can explain something for me. I've never used this before but have seen it used in numerous sets of coding. What does the -> do? I see stuff like $test=$test->test_url = "Something"; $test1=$test->test_this = "Something Else"; Is it some sort of array function? I'm just a little confused and have been wondering for sometime. TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP / mcrypt compile
Ok, I've never done this before so I want to double check before I do it. I'm running RH 7.3 and PHP was installed as a RPM. Now I've just installed libmcrypt. My question is when I go to recompile PHP can I just run the PHP configure file as "configure --with-mcrypt[=DIR] --disable-posix-threads or do I need to run the enter configre command listed in phpinfo? OR can I just activate it in php.ini since it was an RPM install?(and if I can how do I do that command?) TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php editor?
Why not just use PICO? Kevin Ison wrote: now theres a sadistic way to code! I used to use vi... to be honest I like it. but on a windows platform crimson editor works well. "Gerard Samuel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Because some of us, work directly on the server, instead of modifying files, then uploading to the server to test :) electroteque wrote: boy how painfully dweebish is vi why make it harder for yourself :O
Re: [PHP] reverse DNS lookup with PHP
$_SERVER[REMOTE_HOST]; This will do a reverse lookup on their IP. Manual Link: http://ca3.php.net/manual/en/reserved.variables.php#reserved.variables.server Hope it helps Tim Thorburn wrote: Hi, I'm setting up a simple tracking program for a website I'm working on. Currently it records a visitors IP address, but I would like to be able to do a DNS lookup of these IP addresses. Is this possible with PHP and if so, how is it done? I've been looking through Google, and the very few real results I've come across are large perl programs which make little to no sense to me. Any help would be greatly appreciated. Thanks -Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Formatting issue.
with the proper line breaks: $dat="$_GET[gallery].dat"; $file=fopen($dat, 'r'); $contents = fread ($file, filesize ($dat)); fclose($file); $img=explode("|",$contents); print ""; foreach($img as $image) { if($image) print ""; } print ""; Tom Ray [Lists] wrote: I'm having a bit of a formatting issue, and I was wondering if someone might have an idea on how to solve it. Basically what I have right now is a script that opens and reads the content of an image directory, each time the script is accessed it writes the contents out to a text file for me. I then open that text file and read it's contents, I want to be able to display thumbnail versions of the pictures, 3 per row and as many rows as needed. Unfortunetly, all I can do right now is 1 per row, this is where I need the help. Here's the code that displays images: $dat="$_GET[gallery].dat"; $file=fopen($dat, 'r'); $contents = fread ($file, filesize ($dat)); fclose($file); $img=explode("|",$contents); print ""; foreach($img as $image) { if($image) print ""; } print ""; So how do I make this work so I can have three cells per table row and it actaully show the proper picture? TIA Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Formatting issue.
I'm having a bit of a formatting issue, and I was wondering if someone might have an idea on how to solve it. Basically what I have right now is a script that opens and reads the content of an image directory, each time the script is accessed it writes the contents out to a text file for me. I then open that text file and read it's contents, I want to be able to display thumbnail versions of the pictures, 3 per row and as many rows as needed. Unfortunetly, all I can do right now is 1 per row, this is where I need the help. Here's the code that displays images: $dat="$_GET[gallery].dat"; $file=fopen($dat, 'r'); $contents = fread ($file, filesize ($dat)); fclose($file); $img=explode("|",$contents); print ""; foreach($img as $image) { if($image) print ""; } print ""; So how do I make this work so I can have three cells per table row and it actaully show the proper picture? TIA Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Automatic Headers and Footers
I would have to say yes it can be done. The way *I* would do it is like this: First, I would drop a .htaccess file that allows the HTML files to run through the PHP parser. Like this AddType application/x-httpd-php .php .html The in all of the HTML docs it would look like this: -HTML- -Head- -Title-This is a test-Title- -body- -h1--/h1- Well, did it work? -h3--/h3- -/body- -/html- The next question that comes to mind is, are all the headers and footers static? Or will they rotate? You will have to have that php code in your HTML docs, otherwise they won't know how to add the header and footer. Wendell Brown wrote: Ok guys, I think I have a challenge for you (actually, I don't think this can be done, but I've been proven wrong every time I've made that assumption with php in the past, so I'll ask anyway). Here's the question: Is there a way to have php insert headers and/or footers into all of the html files in a given directory on the fly (not actually modifying the files)? And by this I mean take an existing valid HTML file and add headers and footers and end up with a valid HTML file. Now, before some of you get trigger happy and tell me to read the manual and point me to things like .htaccess, auto_prepend_file, google and the like, think about what I'm really asking It needs to insert the header after the -body- tag and put the footer in before the -/body- tag. It needs to do this without modifications to the HTML file. And yes, I understand that by default HTML files aren't going to be effected by the auto_prepend_file (since they aren't php files) - so it will require adding HTML to the list of php parsed file types. For instance, the goal would be to take the following code: -HTML- -Head- -Title-This is a test-Title- -body- Well, did it work? -/body- -/html- and convert it to this: -HTML- -Head- -Title-This is a test-Title- -body- -h1-This is a page header-/h1- Well, did it work? -h3-This is the footer-/h3- -/body- -/html- Can it be done? I don't think so, but I leave it up to your wiles to suggest a solution Thanks!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mcrypt installation
I'm just a little curious, I've never really don't this before, but is installing mcrypt usually a very hard thing to do, or will it be pretty simple for a dolt like me? :) Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookies and Expirations
Simple question: How do I check the expiration of a cookie that has been set? I can't seem to find it on php.net, if it is there..please provide the proper link for me and I will read up on it. Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php