[PHP] Problem when scaling Jpeg images with libgd
Hello, I have a problem when im trying to scale an jpeg image with libgd my function lookes like this: function image_resize_jpeg( $img, $w) { $image = imagecreatefromjpeg($img); $img_info = getimagesize ($img); $orig_height = $img_info[1]; //source hieght from $img_info $orig_width = $img_info[0]; //source width from $img_info if ($orig_width $w) { $h = ($w * $orig_height) / $orig_width; $thumb = imagecreate($w, $h); imagecopyresized($thumb, $image, 0, 0, 0, 0, $w, $h, $orig_width, $orig_height); imagejpeg($thumb, $img, 95); } } To illustrate: Original image: http://www.thcca.com/~offson/test.jpg scaled image: http://www.thcca.com/~offson/test_thumb.jpg Does anyone have any suggestion what i can do? _ Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear question
Hi List, How do I tell if pear is installed ? If it is not, then how do I add it to my Php. My Php is 4.3.0 on Unix system Thanks for any help or advice Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] Constructor Inheritance
class B extends A { function B() { // call parents constructor A::A(); } } - Markus Why would you not use ... class B extends A { function B() { { parent::A(); } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem when scaling Jpeg images with libgd
Oôv asäönsson wrote: ... Does anyone have any suggestion what i can do? Just a wild guess.. What happens if You use imagecreatetruecolor() instead of imagecreate() and imagecopyresampled() instead of imagecopyresized()? -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pear question
PEAR doesn't need to be installed, so to speak. PEAR is simply a set of classes, at heart, they can be downloaded and used without problem from the pear.php.net website. However, PEAR does have an installer program that allows you to install these packages from command line. To check if you have the pear installer intalled, type pear list-packages as superuser on your machine. If the installer is not installed, see the http://pear.php.net/ website for installation information. Dave Carrera [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi List, How do I tell if pear is installed ? If it is not, then how do I add it to my Php. My Php is 4.3.0 on Unix system Thanks for any help or advice Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please Don't Shoot...
Me for asking this question, I'm just not sure where to start but with the experts here. I'm moving my PHP and MySQL application to a hosting server. Currently, I'm looking at 1and1.com's dedicated servers on a Linux machine for $49/month (let me know if there are better choices). One problem though, the dedicated server, unlike a shared server, does not have a SSL certificate. So, I need one. Can anyone recommend a low cost (preferably free), and easy to install (since I have to do it myself) SSL Cert? Thanks, Ryan
[PHP] RE: Pear question
Thanks Aidan, I get a list of installed packages. What do I or one of my users need to do to access / use the DB package? Any help, advice, example is very much appreciated. Dave C -Original Message- From: Aidan Lister [mailto:[EMAIL PROTECTED] Sent: 20 May 2004 13:04 To: [EMAIL PROTECTED] Subject: Re: Pear question PEAR doesn't need to be installed, so to speak. PEAR is simply a set of classes, at heart, they can be downloaded and used without problem from the pear.php.net website. However, PEAR does have an installer program that allows you to install these packages from command line. To check if you have the pear installer intalled, type pear list-packages as superuser on your machine. If the installer is not installed, see the http://pear.php.net/ website for installation information. Dave Carrera [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi List, How do I tell if pear is installed ? If it is not, then how do I add it to my Php. My Php is 4.3.0 on Unix system Thanks for any help or advice Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php installation help
Hi I have recently installed gd-2.0.15 on my linux 9.0 machine and this machine has a database that i need to access through phpMyadmin so the requirements are that php should be installed but when I error this instruction I get this error; [EMAIL PROTECTED] root]# apt-get install php Reading Package Lists... Done Building Dependency Tree... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help to resolve the situation: The following packages have unmet dependencies: php: Depends: libgd.so.1.8 E: Broken packages I understand that gd 2 comes with libgd.so.2.0. Any help.
[PHP] send mail error
hello, i face a problem with send mail via php. i have a server with ms IIS and i have not access to php.ini how i send a email with php script with auto add the sendmail_from into php.ini ? PS. i write a php script to send email but i receive the follow error message mail(): sendmail_from not set in php.ini or custom From: header missing in *... *please advise Thanks Tassos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Request database_queryf() functions.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi All, After having been talking to lots of people in irc lately who are haveing problems with SQL injection etc i think that haveing a *_queryf() function would be really useful to help people esp when it comes to integers and the id=$id where $id = 1 OR and name='$name' where $name = name' OR issues for example. Most of the sprintf formatting would take care of itself but any %s would automatically have addslashes() applied. I have a php implementation below for the mysql database. Let me know what you think or if i have missed anything. ?php /* ~ * MySQL queryf() function example. ~ */ define('DEBUG', true); // usage: // mysql_queryf($query, $link_identifier = NULL, $arg1, $arg2$argN); function mysql_queryf() { ~$args = func_get_args(); ~if(!isset($args[0]) || !(is_null($args[1]) || is_resource($args[1]) ) ){ ~return false; ~} ~$formatString = array_shift($args); ~$linkIdentifier = array_shift($args); ~$parts = preg_split('/%([ 0]|\'.)?-?[0-9]*(\\.[0-9]*)*[%abcdufosxX]/', $formatString, -1, PREG_SPLIT_OFFSET_CAPTURE); ~$newString = ; ~for($i = 0; $i count($parts); $i++){ ~$start = $parts[$i][1] + strlen($parts[$i][0]); ~if(isset($parts[$i + 1][1])){ ~$length = $parts[$i + 1][1] - $start; ~}else{ ~$length = strlen($formatString) - $start; ~} ~$formatCode = substr($formatString, $start, $length); ~$newString .= $parts[$i][0].sprintf($formatCode, (isset($args[$i]) ? ((substr($formatCode, -1, 1) == 's') ? addslashes($args[$i]) : $args[$i]) : NULL)); ~} ~if(DEBUG === true){ ~print(Query is:\n.$newString.\n); ~}else{ ~if(is_resource($linkIdentifier)){ ~return mysql_query($newString, $linkIdentifier); ~}else{ ~return mysql_query($newString); ~} ~} } mysql_queryf('SELECT * FROM blah WHERE id=%d AND name=\'%\'.-34s\' AND account=\'%0.2f\' AND blah=%06d AND value \'30%%\'', NULL, '1 OR', 'name\'s'); ? Output: Query is: SELECT * FROM blah WHERE id=1 AND name='name\'s...' AND account='0.00' AND blah=00 AND value '30%' - -- Regards, William Bailey. Pro-Net Internet Services Ltd. http://www.pro-net.co.uk/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFArKwGzSfrYDJMXmERAlTAAJ9NMfOG3nLlsU4kPGPDB0UekYh70QCfYBqS 8FDg6oC1MtUWgaK6A/GYmsg= =MtCS -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pear question
All of this information is on the http://pear.php.net/ website. A simple usage example of PEAR::DB is here: http://pear.php.net/manual/en/package.database.db.intro-connect.php Basically, once you've established that PEAR is installed the user simply loads the script. Eg. ?php include_once 'DB.php'; $db = DB::connect(); ? If this fails, you'll need to configure your users include_path via php.ini to contain the location to the PEAR scripts. Also, I'd run a pear upgrade-all to make sure you're using the latest version of all the packages too. Hope this helps :) Dave Carrera [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks Aidan, I get a list of installed packages. What do I or one of my users need to do to access / use the DB package? Any help, advice, example is very much appreciated. Dave C -Original Message- From: Aidan Lister [mailto:[EMAIL PROTECTED] Sent: 20 May 2004 13:04 To: [EMAIL PROTECTED] Subject: Re: Pear question PEAR doesn't need to be installed, so to speak. PEAR is simply a set of classes, at heart, they can be downloaded and used without problem from the pear.php.net website. However, PEAR does have an installer program that allows you to install these packages from command line. To check if you have the pear installer intalled, type pear list-packages as superuser on your machine. If the installer is not installed, see the http://pear.php.net/ website for installation information. Dave Carrera [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi List, How do I tell if pear is installed ? If it is not, then how do I add it to my Php. My Php is 4.3.0 on Unix system Thanks for any help or advice Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php installation help
Hi Phillip, For future reference, PHP install questions are best asked on the [EMAIL PROTECTED] mailing list, however I'm sure someone can answer your question here also. Khutjo Phillip Leremi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I have recently installed gd-2.0.15 on my linux 9.0 machine and this machine has a database that i need to access through phpMyadmin so the requirements are that php should be installed but when I error this instruction I get this error; [EMAIL PROTECTED] root]# apt-get install php Reading Package Lists... Done Building Dependency Tree... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help to resolve the situation: The following packages have unmet dependencies: php: Depends: libgd.so.1.8 E: Broken packages I understand that gd 2 comes with libgd.so.2.0. Any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Request database_queryf() functions.
If you need a better source example/layout goto: http://nopaste.php-q.net/59720 William Bailey wrote: Hi All, After having been talking to lots of people in irc lately who are haveing problems with SQL injection etc i think that haveing a *_queryf() function would be really useful to help people esp when it comes to integers and the id=$id where $id = 1 OR and name='$name' where $name = name' OR issues for example. Most of the sprintf formatting would take care of itself but any %s would automatically have addslashes() applied. I have a php implementation below for the mysql database. Let me know what you think or if i have missed anything. ?php /* ~ * MySQL queryf() function example. ~ */ define('DEBUG', true); // usage: // mysql_queryf($query, $link_identifier = NULL, $arg1, $arg2$argN); function mysql_queryf() { ~$args = func_get_args(); ~if(!isset($args[0]) || !(is_null($args[1]) || is_resource($args[1]) ) ){ ~return false; ~} ~$formatString = array_shift($args); ~$linkIdentifier = array_shift($args); ~$parts = preg_split('/%([ 0]|\'.)?-?[0-9]*(\\.[0-9]*)*[%abcdufosxX]/', $formatString, -1, PREG_SPLIT_OFFSET_CAPTURE); ~$newString = ; ~for($i = 0; $i count($parts); $i++){ ~$start = $parts[$i][1] + strlen($parts[$i][0]); ~if(isset($parts[$i + 1][1])){ ~$length = $parts[$i + 1][1] - $start; ~}else{ ~$length = strlen($formatString) - $start; ~} ~$formatCode = substr($formatString, $start, $length); ~$newString .= $parts[$i][0].sprintf($formatCode, (isset($args[$i]) ? ((substr($formatCode, -1, 1) == 's') ? addslashes($args[$i]) : $args[$i]) : NULL)); ~} ~if(DEBUG === true){ ~print(Query is:\n.$newString.\n); ~}else{ ~if(is_resource($linkIdentifier)){ ~return mysql_query($newString, $linkIdentifier); ~}else{ ~return mysql_query($newString); ~} ~} } mysql_queryf('SELECT * FROM blah WHERE id=%d AND name=\'%\'.-34s\' AND account=\'%0.2f\' AND blah=%06d AND value \'30%%\'', NULL, '1 OR', 'name\'s'); ? Output: Query is: SELECT * FROM blah WHERE id=1 AND name='name\'s...' AND account='0.00' AND blah=00 AND value '30%' -- Regards, William Bailey. Pro-Net Internet Services Ltd. http://www.pro-net.co.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: send mail error
On windows I believe this will work: ini_set(sendmail_from,[EMAIL PROTECTED]); Try that. http://www.php.net/ini_set HTH Craig Tassos T [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hello, i face a problem with send mail via php. i have a server with ms IIS and i have not access to php.ini how i send a email with php script with auto add the sendmail_from into php.ini ? PS. i write a php script to send email but i receive the follow error message mail(): sendmail_from not set in php.ini or custom From: header missing in *... *please advise Thanks Tassos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Don't Shoot...
Ryan Schefke wrote: snip I'm moving my PHP and MySQL application to a hosting server. Currently, I'm looking at 1and1.com's dedicated servers on a Linux machine for $49/month (let me know if there are better choices). One problem though, the dedicated server, unlike a shared server, does not have a SSL certificate. So, I need one. Can anyone recommend a low cost (preferably free), and easy to install (since I have to do it myself) SSL Cert? /snip Google for buy ssl certificate. Installing a cert is not difficult, but it's way off topic for this list...you can google for install ssl certificate linux or ask on an Apache list and get better results. -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cron job for php not working
Hi there, I am trying to install following cron job: 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php The script works, if I run this php /home... line manually it works out, but it does not automaticaly at 6 am as supposed. I do also see in /var/log/messages that the cron job has happened at that time, but the file did not generate the emails like it supposed to. I am running the crontab as webserver user. Thanx for any helpful ideas on that, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cron job for php not working
[snip] I am trying to install following cron job: 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php The script works, if I run this php /home... line manually it works out, but it does not automaticaly at 6 am as supposed. I do also see in /var/log/messages that the cron job has happened at that time, but the file did not generate the emails like it supposed to. [/snip] At the command line type which php and it will return the full path to php. Modify your line in the crontab with the full path... 0 6 * * * /usr/local/bin/php /home/www/project/app_cron/follow_up_new_members.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron job for php not working
On Thursday 20 May 2004 11:35 am, Jay Blanchard wrote: At the command line type which php and it will return the full path to php. Modify your line in the crontab with the full path... 0 6 * * * /usr/local/bin/php /home/www/project/app_cron/follow_up_new_members.php I always put the #!/usr/local/bin/php at the top of all my command line php scripts. Mine is actually #!/usr/bin/php. Then chmod 755 the file so that it can execute. James Hicks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple MySQL/PHP Query
Hi all, First off, yeah, it's a dumb Q ;-) but I cant remember enuf about mysql to know if I need a php script or it might be done from the command line... I have a DB that has a field called 'body' - it holds the body of html pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. How do I do that? - Do I need to select the body, then add the text to it, then UPDATE it, or can i just appened somthing to what's already there? Many thx! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron job for php not working
It looks like that cron line is making it so that the command runs as the user php... so, you should check if that user has permission to run the script. Tim. At 08:33 AM 5/20/2004, Merlin wrote: Hi there, I am trying to install following cron job: 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php The script works, if I run this php /home... line manually it works out, but it does not automaticaly at 6 am as supposed. I do also see in /var/log/messages that the cron job has happened at that time, but the file did not generate the emails like it supposed to. I am running the crontab as webserver user. Thanx for any helpful ideas on that, Merlin -- 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] Simple MySQL/PHP Query
Nick Wilson wrote: I have a DB that has a field called 'body' - it holds the body of html pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. UPDATE table SET body = body + text to append will update all rows in the table. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
[snip] Do I need to select the body, then add the text to it, then UPDATE it [/snip] that is what you want to do -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
* and then Stuart declared Nick Wilson wrote: I have a DB that has a field called 'body' - it holds the body of html pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. UPDATE table SET body = body + text to append Hehe, it's been such a lng time since i did even the simplest SQL work ;-) Thanks, i knew I should have known that, but it's amazing how fast you can lose skills/knowledge if you dont practice them regularly... Thanks again! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Simple MySQL/PHP Query
Is the text the same on every page? Where you print your body, concatenate the string you want to your content variable. HTH Nick Wilson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, First off, yeah, it's a dumb Q ;-) but I cant remember enuf about mysql to know if I need a php script or it might be done from the command line... I have a DB that has a field called 'body' - it holds the body of html pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. How do I do that? - Do I need to select the body, then add the text to it, then UPDATE it, or can i just appened somthing to what's already there? Many thx! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
* and then Matt Matijevich declared [snip] Do I need to select the body, then add the text to it, then UPDATE it [/snip] that is what you want to do That's what I figured 2, but check the post above ;-) thanks mate.. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
If you know exactly what you need to append, then you can just do the update query directly. UPDATE tablename SET body=concat(body,'string to add') that should do it... Tim At 09:04 AM 5/20/2004, Nick Wilson wrote: Hi all, First off, yeah, it's a dumb Q ;-) but I cant remember enuf about mysql to know if I need a php script or it might be done from the command line... I have a DB that has a field called 'body' - it holds the body of html pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. How do I do that? - Do I need to select the body, then add the text to it, then UPDATE it, or can i just appened somthing to what's already there? Many thx! -- Nick W -- 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] Simple MySQL/PHP Query
* and then Nick Wilson declared pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. UPDATE table SET body = body + text to append Hehe, it's been such a lng time since i did even the simplest SQL work ;-) DAMN! - Good job i tested on the local DB not the live one! That wiped the entire DB and put a '0' in place of every body column? Here's what I did: update node set body = body + \n\npThis is extra/p; Anyone see what went wrong? -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
* and then Nick Wilson declared * and then Matt Matijevich declared [snip] Do I need to select the body, then add the text to it, then UPDATE it [/snip] that is what you want to do That's what I figured 2, but check the post above ;-) Damn, looks like you were right... -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
* and then Tim Traver declared If you know exactly what you need to append, then you can just do the update query directly. UPDATE tablename SET body=concat(body,'string to add') Awesome, that did it. Thanks for taking the time to show me dude ;-) -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple MySQL/PHP Query
yeah, the + modifier thinks you mean you want to add them as integers... use my previous post with the concat command and that works... Tim. At 09:20 AM 5/20/2004, Nick Wilson wrote: * and then Nick Wilson declared pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. UPDATE table SET body = body + text to append Hehe, it's been such a lng time since i did even the simplest SQL work ;-) DAMN! - Good job i tested on the local DB not the live one! That wiped the entire DB and put a '0' in place of every body column? Here's what I did: update node set body = body + \n\npThis is extra/p; Anyone see what went wrong? -- Nick W -- 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
[PHP] newbie question about preg_match
I'm trying to compose a general purpose text snip expression to extract a text segment from a string. Should this work for all reasonable cases? It seems to work for several test strings. $start= str1; $end= str2; preg_match (|$start (.*) ? $end |i, $contents, $text); $segment= $text[1]; Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date Function - Empty Value
Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( ) or NULL and I always get a datatype mismatch sql error. So then I just tried submitting a date that will never be used ( e.g. 1/1/ ). That works, but then when I try to read the date out of the field in the DB and format it using the date() function in PHP it doesn't display anything (which is fine with me). I read up on the date function on the PHP website and valid dates are limited from 01-01-1970 to 19-01-2038 on windows machines. So that explains why the function returns nothing. So, I guess my question is this: Is what I'm doing technically ok (using a date that's not in the valid range)? Or does anyone know of an empty date value that I can submit to the DB? Thanks! NULL should work if you have allowed it for the column when creating the table. Can you post your table structure? Regards, Torsten Well, I would, but I can't seem to figure out how to export just the structure out of access. Wouldn't NULL be allowed by default? This command should show you the table structure: SHOW CREATE TABLE tablename Please post the output. regards, Torsten Sorry Torsten, but you'll have to forgive my lack of understanding. Where should I put that command in? Thanks for you patience. In the mysql command line, if possible or if you're using phpMyAdmin. Should also work with mysql_query() in a php script and echoing out the result. Do you know how to do this? Regards, Torsten I'm using Microsoft Access for my database not MySQL. Does that change what I need to do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.6
I recently updated my Apache to 1.3.31 and when it was finished, none of my PHP scripts are working correctly. They seem to stop in the middle of displaying a page. On some pages, my footer doesn't come up, it just quits before it gets there. I got on the PHP website to get the instructions for building PHP and followed them, but that didn't help. Here is the configure line I used for PHP: ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs Now nothing works right. Stanley G. Martin System Administrator Sprint - EAS Business Intelligence 913.762.8667 913.221.8241 PCS [EMAIL PROTECTED]
Re: [PHP] Simple MySQL/PHP Query
From: Nick Wilson [EMAIL PROTECTED] * and then Nick Wilson declared pages of course... What I need to do, is add to the very end of each html page, one short peice of text.. not a footer, just an adition to every page. UPDATE table SET body = body + text to append Hehe, it's been such a lng time since i did even the simplest SQL work ;-) DAMN! - Good job i tested on the local DB not the live one! That wiped the entire DB and put a '0' in place of every body column? Here's what I did: update node set body = body + \n\npThis is extra/p; Anyone see what went wrong? string + string == Zero... concat() ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3.6
Martin, Stanley G [Contractor for Sprint] wrote: I recently updated my Apache to 1.3.31 and when it was finished, none of my PHP scripts are working correctly. They seem to stop in the middle of displaying a page. On some pages, my footer doesn't come up, it just quits before it gets there. I got on the PHP website to get the instructions for building PHP and followed them, but that didn't help. Here is the configure line I used for PHP: ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs Now nothing works right. Anything in you Apache error logs? Do you have error reporting turned on in the php.ini? -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.6
I'm getting a segmentation fault in the Apache error log whenever I access a page the doesn't finish. Stanley G. Martin System Administrator Sprint - EAS Business Intelligence [EMAIL PROTECTED] -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 11:45 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: I recently updated my Apache to 1.3.31 and when it was finished, none of my PHP scripts are working correctly. They seem to stop in the middle of displaying a page. On some pages, my footer doesn't come up, it just quits before it gets there. I got on the PHP website to get the instructions for building PHP and followed them, but that didn't help. Here is the configure line I used for PHP: ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs Now nothing works right. Anything in you Apache error logs? Do you have error reporting turned on in the php.ini? -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- 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] newbie question about preg_match
From: Al [EMAIL PROTECTED] I'm trying to compose a general purpose text snip expression to extract a text segment from a string. Should this work for all reasonable cases? It seems to work for several test strings. $start= str1; $end= str2; preg_match (|$start (.*) ? $end |i, $contents, $text); $segment= $text[1]; Looks like you have some extra spaces in there that'll mess it up. The '?' for example, is only applying to the space before it. You want preg_match(|$start(.*?)$end |i, $contents, $text); Note that this will only return one match when there could be more, depending upon your string. If you want all of them, use preg_match_all(). ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3.6
Martin, Stanley G [Contractor for Sprint] wrote: I'm getting a segmentation fault in the Apache error log whenever I access a page the doesn't finish. Dear Contractor for Sprint, What john meant was for you to share it (error message) with us. Martin, Stanley G [Contractor for Sprint] wrote: I recently updated my Apache to 1.3.31 and when it was finished, none of my PHP scripts are working correctly. They seem to stop in the middle of displaying a page. On some pages, my footer doesn't come up, it just quits before it gets there. I got on the PHP website to get the instructions for building PHP and followed them, but that didn't help. Here is the configure line I used for PHP: ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs Now nothing works right. Anything in you Apache error logs? Do you have error reporting turned on in the php.ini? -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date Function - Empty Value
Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( ) or NULL and I always get a datatype mismatch sql error. So then I just tried submitting a date that will never be used ( e.g. 1/1/ ). That works, but then when I try to read the date out of the field in the DB and format it using the date() function in PHP it doesn't display anything (which is fine with me). I read up on the date function on the PHP website and valid dates are limited from 01-01-1970 to 19-01-2038 on windows machines. So that explains why the function returns nothing. So, I guess my question is this: Is what I'm doing technically ok (using a date that's not in the valid range)? Or does anyone know of an empty date value that I can submit to the DB? Thanks! NULL should work if you have allowed it for the column when creating the table. Can you post your table structure? Regards, Torsten Well, I would, but I can't seem to figure out how to export just the structure out of access. Wouldn't NULL be allowed by default? This command should show you the table structure: SHOW CREATE TABLE tablename Please post the output. regards, Torsten Sorry Torsten, but you'll have to forgive my lack of understanding. Where should I put that command in? Thanks for you patience. In the mysql command line, if possible or if you're using phpMyAdmin. Should also work with mysql_query() in a php script and echoing out the result. Do you know how to do this? Regards, Torsten I'm using Microsoft Access for my database not MySQL. Does that change what I need to do? I'm not familiar with Access but should have an option or specific view to show you the table structure. Look at the Access program help for something like that. Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failing to load php_mysql.dll
Hi this error is causing me grief. I installed mySQL Apache and PHP 5. in php.ini at the c:\WINDOWS I assigned the extension dir as follows: ; Directory in which the loadable extensions (modules) reside. extension_dir = c:\php\ext the extension php_mysql.dll resides in this ext folder Nevertheless on loading starting apache I get a php error PHP Startup: Unable to load dynamic library 'c:\php\ext\php_mysql.dll' - The specific procedure could not be found. I have tried everything. Any idea how I can resolve this? Thanks a bunch, Ted BTW my Apache loads php as a module fine when I comment the mysql extension. in apache httpd.conf LoadModule php5_module c:/php/php5apache.dll AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps All these works fine
Re: [PHP] Re: Date Function - Empty Value
On Thu, May 20, 2004 at 12:28:00PM -0400, Gabe wrote: I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( ) I'm using Microsoft Access for my database not MySQL. Does that change what I need to do? Access delimits dates with '#' hash marks. Try something like: UPDATE tablename SET date_field=#9/30/2003# WHERE foo='bar'; or UPDATE tablename SET date_field=NULL WHERE foo='bar'; if you want to make that field null. If it complains when you try to set it NULL and you want it to be null, put 'No' for 'Required' for that field in Design View. -Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] an array question
What is wrong with whis syntax: $array = array($_POST['input_1'],$_POST['input_2']); -- +-+-++ | Blake Schroeder | Owner/Developer |lhwd.net| +--(http://www.lhwd.net)+--/ \--+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: an array question
Blake Schroeder [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What is wrong with whis syntax: $array = array($_POST['input_1'],$_POST['input_2']); You don't need the double quotes: $array = array($_POST['input_1'], $_POST['input_2']); Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.6
OK. Here it is [Thu May 20 11:52:41 2004] [notice] child pid 19615 exit signal Segmentation fault (11) Stanley G. Martin System Administrator Sprint - EAS Business Intelligence [EMAIL PROTECTED] -Original Message- From: raditha dissanayake [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 12:01 PM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: I'm getting a segmentation fault in the Apache error log whenever I access a page the doesn't finish. Dear Contractor for Sprint, What john meant was for you to share it (error message) with us. Martin, Stanley G [Contractor for Sprint] wrote: I recently updated my Apache to 1.3.31 and when it was finished, none of my PHP scripts are working correctly. They seem to stop in the middle of displaying a page. On some pages, my footer doesn't come up, it just quits before it gets there. I got on the PHP website to get the instructions for building PHP and followed them, but that didn't help. Here is the configure line I used for PHP: ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs Now nothing works right. Anything in you Apache error logs? Do you have error reporting turned on in the php.ini? -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- 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] an array question
Blake Schroeder wrote: What is wrong with whis syntax: $array = array($_POST['input_1'],$_POST['input_2']); The error message you should get with it should tell youhowever, I'll be if you remove the double quotes from around the $_POST variables, it won't throw the same errors. -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3.6
Martin, Stanley G [Contractor for Sprint] wrote: OK. Here it is [Thu May 20 11:52:41 2004] [notice] child pid 19615 exit signal Segmentation fault (11) Was php4.3.6 compiled with the same options as your previous version? Just a guess here, but your scripts may be calling a function that existed in your old version, but isn't in your new version. This would usually just throw an error, but stranger things have happened. If this is on *nix, you could strace Apache. -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.6
When I ran configure for PHP I tried to use the --with-apache and pointed it to /usr/local/apache but it told me it couldn't find httpd.h anywhere under there and it is there (/usr/local/apache/include/httpd.h). So, I ran it with --with-apxs=/usr/local/apache/bin/apxs. It creates the file libphp4.so and I'm loading it in Apache (which I didn't have to change because it was there before). I did notice before the changes that when I executed httpd -l to list loaded modules, PHP was listed and it's not now. I didn't have mod_so loaded before, but I loaded it this time. Stanley G. Martin System Administrator Sprint - EAS Business Intelligence 913.762.8667 913.221.8241 PCS [EMAIL PROTECTED] -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 1:05 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: OK. Here it is [Thu May 20 11:52:41 2004] [notice] child pid 19615 exit signal Segmentation fault (11) Was php4.3.6 compiled with the same options as your previous version? Just a guess here, but your scripts may be calling a function that existed in your old version, but isn't in your new version. This would usually just throw an error, but stranger things have happened. If this is on *nix, you could strace Apache. -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- 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] PHP 4.3.6
Martin, Stanley G [Contractor for Sprint] wrote: When I ran configure for PHP I tried to use the --with-apache and pointed it to /usr/local/apache but it told me it couldn't find httpd.h anywhere under there and it is there (/usr/local/apache/include/httpd.h). So, I ran it with --with-apxs=/usr/local/apache/bin/apxs. It creates the file libphp4.so and I'm loading it in Apache (which I didn't have to change because it was there before). I did notice before the changes that when I executed httpd -l to list loaded modules, PHP was listed and it's not now. I didn't have mod_so loaded before, but I loaded it this time. Was Apache configured with apxs? I don't think you can load mod_so if it wasn't configured with it. -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.6
Yes. I used --enable-module=so. Stanley G. Martin System Administrator Sprint - EAS Business Intelligence 913.762.8667 913.221.8241 PCS [EMAIL PROTECTED] -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 1:21 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: When I ran configure for PHP I tried to use the --with-apache and pointed it to /usr/local/apache but it told me it couldn't find httpd.h anywhere under there and it is there (/usr/local/apache/include/httpd.h). So, I ran it with --with-apxs=/usr/local/apache/bin/apxs. It creates the file libphp4.so and I'm loading it in Apache (which I didn't have to change because it was there before). I did notice before the changes that when I executed httpd -l to list loaded modules, PHP was listed and it's not now. I didn't have mod_so loaded before, but I loaded it this time. Was Apache configured with apxs? I don't think you can load mod_so if it wasn't configured with it. -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- 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] PHP 4.3.6
Martin, Stanley G [Contractor for Sprint] wrote: -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 1:21 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: When I ran configure for PHP I tried to use the --with-apache and pointed it to /usr/local/apache but it told me it couldn't find httpd.h anywhere under there and it is there (/usr/local/apache/include/httpd.h). So, I ran it with --with-apxs=/usr/local/apache/bin/apxs. It creates the file This is a guess... did you run a make clean between your first and second configure attempts? -- Aaron Gould Parts Canada - Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Date Function - Empty Value
Mark Pecaut wrote: On Thu, May 20, 2004 at 12:28:00PM -0400, Gabe wrote: I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( ) I'm using Microsoft Access for my database not MySQL. Does that change what I need to do? Access delimits dates with '#' hash marks. Try something like: UPDATE tablename SET date_field=#9/30/2003# WHERE foo='bar'; or UPDATE tablename SET date_field=NULL WHERE foo='bar'; if you want to make that field null. If it complains when you try to set it NULL and you want it to be null, put 'No' for 'Required' for that field in Design View. -Mark I'll give those a try. Thanks for the tips. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date Function - Empty Value
Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( ) or NULL and I always get a datatype mismatch sql error. So then I just tried submitting a date that will never be used ( e.g. 1/1/ ). That works, but then when I try to read the date out of the field in the DB and format it using the date() function in PHP it doesn't display anything (which is fine with me). I read up on the date function on the PHP website and valid dates are limited from 01-01-1970 to 19-01-2038 on windows machines. So that explains why the function returns nothing. So, I guess my question is this: Is what I'm doing technically ok (using a date that's not in the valid range)? Or does anyone know of an empty date value that I can submit to the DB? Thanks! NULL should work if you have allowed it for the column when creating the table. Can you post your table structure? Regards, Torsten Well, I would, but I can't seem to figure out how to export just the structure out of access. Wouldn't NULL be allowed by default? This command should show you the table structure: SHOW CREATE TABLE tablename Please post the output. regards, Torsten Sorry Torsten, but you'll have to forgive my lack of understanding. Where should I put that command in? Thanks for you patience. In the mysql command line, if possible or if you're using phpMyAdmin. Should also work with mysql_query() in a php script and echoing out the result. Do you know how to do this? Regards, Torsten I'm using Microsoft Access for my database not MySQL. Does that change what I need to do? I'm not familiar with Access but should have an option or specific view to show you the table structure. Look at the Access program help for something like that. Regards, Torsten After looking carefully through the table structure, it does allow NULL values. So maybe I'm not passing it correctly to the variables in the SQL. I thought I was -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question about preg_match
If I have multiple instances that match the pattern, but only want the first one, which is the best way to handle it? Putting the U flag seems to work, but I don't understand the full implications of using it here. preg_match(|$start(.*?)$end |Ui, $contents, $text); Alternatively, I could use preg_match_all and use $text [1]. Thanks John W. Holmes wrote: From: Al [EMAIL PROTECTED] I'm trying to compose a general purpose text snip expression to extract a text segment from a string. Should this work for all reasonable cases? It seems to work for several test strings. $start= str1; $end= str2; preg_match (|$start (.*) ? $end |i, $contents, $text); $segment= $text[1]; Looks like you have some extra spaces in there that'll mess it up. The '?' for example, is only applying to the space before it. You want preg_match(|$start(.*?)$end |i, $contents, $text); Note that this will only return one match when there could be more, depending upon your string. If you want all of them, use preg_match_all(). ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.6
I went back to PHP 4.3.1. I still had the src directory from when I installed it. When I configured PHP 4.3.6 like this: ./configure --with-apache=/app_source/Apache/apache_1.3.31 --with-mysql it's supposed to create libmodphp4.a library in /app_source/Apache/apache_1.3.31/src/modules/php4, but it didn't. I went to my old installation of Apache 1.3.27 and found the files there that were generated when I installed PHP 4.3.1, so I copied those to my Apache 1.3.31 source tree and recompiled Apache using : ./configure --activate-module=src/modules/php4/libphp4.a --enable-module=so I have everything back to normal now, but was wondering if this is a bug in the 4.3.6 installation where it doesn't create the needed library files. Stanley G. Martin System Administrator Sprint - EAS Business Intelligence [EMAIL PROTECTED] -Original Message- From: Aaron Gould [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 1:46 PM To: Martin, Stanley G [Contractor for Sprint] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 1:21 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.3.6 Martin, Stanley G [Contractor for Sprint] wrote: When I ran configure for PHP I tried to use the --with-apache and pointed it to /usr/local/apache but it told me it couldn't find httpd.h anywhere under there and it is there (/usr/local/apache/include/httpd.h). So, I ran it with --with-apxs=/usr/local/apache/bin/apxs. It creates the file This is a guess... did you run a make clean between your first and second configure attempts? -- Aaron Gould Parts Canada - Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear/Net_FTP help
Hi all. Hopefully someone here can show me what I am doing wrong. I am trying to write a small script to ftp into a server and retrieve a listing. I am using the Pear module Net_FTP for this. I am able to connect to the server, but I cannot get a directory listing to work. Here is my code. // PEAR::Net_FTP require_once 'Net/FTP.php'; // Configuration section $ftp[hostname] = localhost; $ftp[user] = username; $ftp[password] = password; // Create a new ftp class $ftp = new Net_FTP(); // Time to connect to the ftp server $ftp-setHostname($ftp[hostname]); $ftp-setPort(21); $ftp-connect(); $ftp-setUsername($ftp[user]); $ftp-setPassword($ftp[password]); if(!$ftp-login()){ echo Unable to connect to the $ftp[hostname] server. Please verify your settings and try again.br; } $ftp-pwd(); // Lets see what we can see. $ftpLS = $ftp-ls(null, NET_FTP_DIRS_ONLY); echo pre; print_r($ftpLS); echo pre; $ftp-disconnect(); I get a error message back saying it could not retrieve current directory. Can anyone offer any help? Example code would be appreciated. Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] socket_select()
All the examples I see of socket_select() are on socket servers. But is it reasonable/feasible to use socket_select() on a socket client, that is receiving data periodically from a server (and when not receiving, doing something else)? ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie question about preg_match
Al mailto:[EMAIL PROTECTED] on Thursday, May 20, 2004 12:51 PM said: If I have multiple instances that match the pattern, but only want the first one, which is the best way to handle it? reread the last sentence in John's post. John W. Holmes wrote: From: Al [EMAIL PROTECTED] [snip] Note that this will only return one match when there could be more, depending upon your string. If you want all of them, use preg_match_all(). hth, chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to make program execution go to another file?
Hi, I want program execution to go to one of several other files based on a decision. For Example. if (1==a) go to this .php file if (1==b) go to that .php file if (1==c) go to the other .php file Thank you for your time. Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Blocking vs. Selecting
MY PROGRAM FLOW: Enter loop Wait incoming data If (incoming data) { do something } elseif (no data delay 5 seconds) { send ping to server return to top of loop } Of course, it's very simple. :-) But to make it work, I think I need to choose: 1. Timeout the socket_read() (nonblocking socket, etc.) or 2. Use socket_select. Here's my question: I have only one socket active in this application at any time. Is it appropriate to use socket_select with just one socket connection? And if I stop deselect that socket, and the server sends data while the scirpt is doing something else, will the data be lost, or will it wait o be read again once the script can give its attention to that connection? rEne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] World's simplest tutorial on socket_select???
I've seen a sweet script for a multi-client, multi-socket server in PHP (http://dave.dapond.com/socketselect.php.txt), but its purpose is quite different from mine, and it's about one billion times more complex than I need. I am building a SIMPLE socket client that makes ONE connection to ONE server, and waits for data (socket_read)... and when no data comes for a few seconds, does something else, then waits for data again. HOW SHOULD I APPROACH THIS?! PLEASE TOSS ME A BONE! (If you help me, I will buy you a pint of great beer.) ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to make program execution go to another file?
You could include those other php files, eg. switch( $i ) { case 'a': include('a.php'); break; case 'b': include('b.php'); break; } On Thu, 20 May 2004, michael young wrote: Hi, I want program execution to go to one of several other files based on a decision. For Example. if (1==a) go to this .php file if (1==b) go to that .php file if (1==c) go to the other .php file Thank you for your time. Michael -- Jeroen C is quirky, flawed and an enormous success. -- Dennis Ritchie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to make program execution go to another file?
This works providing there has NOT been any header (HTML) info outputed. if (1==a) header(Location: thisotherfile.php); Hi, I want program execution to go to one of several other files based on a decision. For Example. if (1==a) go to this .php file if (1==b) go to that .php file if (1==c) go to the other .php file Thank you for your time. Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to make program execution go to another file?
This is a common problem for people coming from other languages where the file structures are the same as the execution structure. A few of at least 50 answers is as follows; Force the browser to invoke your next program; If(1==a) { header(Location: this.php); exit; //stop this script } If(1==b) { header(Location: that.php); exit; } If(1==c) { header(Location: other.php); } Another option would be to take advantage of conditional includes to bring the code into the current script; If(1==a) { include(this.php); exit; } If(1==b) { include(that.php); exit; } If(1==c) { include(other.php); } Include will issue a warning if executed and the file does not exist. Require is fatal if executed and the file does not exist. You can, of course use; if(file_exists(this.php)) include(this.php); to suppress any warning at all. Warren Vail -Original Message- From: michael young [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 2:12 PM To: [EMAIL PROTECTED] Subject: [PHP] How to make program execution go to another file? Hi, I want program execution to go to one of several other files based on a decision. For Example. if (1==a) go to this .php file if (1==b) go to that .php file if (1==c) go to the other .php file Thank you for your time. Michael -- 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
[PHP] I am in Socket Paradise
Please ignore my previous I-AM-SO-FRUSTRATED-I-AM-READY-FOR-A-JACKET-WITH-REALLY-LONG-SLEEVES posts. I have managed to solve my socket woes. My simple client works loops, timesout, loops again... elegantly. (I've learned not take those PHP warnings so seriously... and to clear socket errors.) Yippee! ..Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pear/Net_FTP help
Hi Chris, Please send your message to [EMAIL PROTECTED], you are more likely to get a response there. Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all. Hopefully someone here can show me what I am doing wrong. I am trying to write a small script to ftp into a server and retrieve a listing. I am using the Pear module Net_FTP for this. I am able to connect to the server, but I cannot get a directory listing to work. Here is my code. // PEAR::Net_FTP require_once 'Net/FTP.php'; // Configuration section $ftp[hostname] = localhost; $ftp[user] = username; $ftp[password] = password; // Create a new ftp class $ftp = new Net_FTP(); // Time to connect to the ftp server $ftp-setHostname($ftp[hostname]); $ftp-setPort(21); $ftp-connect(); $ftp-setUsername($ftp[user]); $ftp-setPassword($ftp[password]); if(!$ftp-login()){ echo Unable to connect to the $ftp[hostname] server. Please verify your settings and try again.br; } $ftp-pwd(); // Lets see what we can see. $ftpLS = $ftp-ls(null, NET_FTP_DIRS_ONLY); echo pre; print_r($ftpLS); echo pre; $ftp-disconnect(); I get a error message back saying it could not retrieve current directory. Can anyone offer any help? Example code would be appreciated. Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I am in Socket Paradise
René Fournier mailto:[EMAIL PROTECTED] on Thursday, May 20, 2004 2:58 PM said: Please ignore my previous I-AM-SO-FRUSTRATED-I-AM-READY-FOR-A-JACKET-WITH-REALLY-LONG-SLEEVES posts. I have managed to solve my socket woes. My simple client works loops, timesout, loops again... elegantly. (I've learned not take those PHP warnings so seriously... and to clear socket errors.) so i admittedly stopped following your numerous threads after a while... mainly for the simple fact that i've never worked with sockets thus had nothing to contribute... but how praytell did you solve your problem? chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: World's simplest tutorial on socket_select???
René fournier wrote: I've seen a sweet script for a multi-client, multi-socket server in PHP (http://dave.dapond.com/socketselect.php.txt), but its purpose is quite different from mine, and it's about one billion times more complex than I need. I am building a SIMPLE socket client that makes ONE connection to ONE server, and waits for data (socket_read)... and when no data comes for a few seconds, does something else, then waits for data again. HOW SHOULD I APPROACH THIS?! PLEASE TOSS ME A BONE! (If you help me, I will buy you a pint of great beer.) ...Rene Just set a receive timeout and check socket_last_error() for a timeout error if socket_read() fails. socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, 5); Of course, I could be wrong about this. ;-) -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] eval() with CONSTANTS
How can I eval() an HTML template to make a CONSTANT be evaluated properly? Previously I have been using regular $variables in my HTML templates. Today I decided to make one of the $variables a CONSTANT only to find it would not parse out as it's defined value. It is instead treated as regular text. I tried wrapping the CONSTANT with curly braces, and also tried using the constant() function with it in the HTML template. Neither return the value I previously defined with define(). The manual says Constants may be defined and accessed anywhere without regard to variable scoping rules but I'm missing something. I do: define('TABLE_PARAMETERS', ' border=0 cellspacing=0 cellpadding=0'); Then I get and eval() my template: $index = getTemplate('index'); eval(\$index = \$index\;); And I end up with HTML that looks like: table {TABLE_PARAMETERS} instead of the desired table border=0 cellspacing=0 cellpadding=0 Any ideas? I've google'd, and read lots of docs today trying to figure it out but I don't know what else to try. TIA. -- Greg Donald [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] World's simplest tutorial on socket_select???
* Thus wrote Ren Fournier ([EMAIL PROTECTED]): I am building a SIMPLE socket client that makes ONE connection to ONE server, and waits for data (socket_read)... and when no data comes for a few seconds, does something else, then waits for data again. HOW SHOULD I APPROACH THIS?! PLEASE TOSS ME A BONE! (If you help me, I will buy you a pint of great beer.) Does that help earlier count for that great beer ;) Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
Greetings, I compiled and installed mysql from source, and now I am trying to recompile php agaisnt the new version of MySQL (was previous running 3.23.53). Here is the configure string I used: ./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-gettext Note: I have used this exact string compilng against myql 3.23.53 with no issues. When I run the make command, I get the following error: ext/mysql/php_mysql.lo: In function `zif_mysql_create_db': /home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1158: undefined reference to `mysql_create_db' ext/mysql/php_mysql.lo: In function `zif_mysql_drop_db': /home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1200: undefined reference to `mysql_drop_db' collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 Any suggestions? Thanks. -- Aaron Axelsen AIM: aaak2 Email: [EMAIL PROTECTED]
Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
* Thus wrote Aaron Axelsen ([EMAIL PROTECTED]): Greetings, I compiled and installed mysql from source, and now I am trying to recompile php agaisnt the new version of MySQL (was previous running 3.23.53). Here is the configure string I used: ./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-gettext ... ext/mysql/php_mysql.lo: In function `zif_mysql_create_db': /home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1158: undefined reference to `mysql_create_db' That sound like php used a 3.x mysql_version.h file to include but is trying to link against the real 4.x mysqlclient.so (since 4.x does not have mysql_create_db). At what prefix was mysql 3.x installed? /usr or /usr/local? Couple quick commands to find your mysql files locate mysql.h locate mysql_version.h find / find / -type f -name mysql*.h #last resort Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
The mysql 3.x was installed with prefix /usr/local/mysql -- Aaron Axelsen Email: [EMAIL PROTECTED] -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 7:08 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8 * Thus wrote Aaron Axelsen ([EMAIL PROTECTED]): Greetings, I compiled and installed mysql from source, and now I am trying to recompile php agaisnt the new version of MySQL (was previous running 3.23.53). Here is the configure string I used: ./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-gettext ... ext/mysql/php_mysql.lo: In function `zif_mysql_create_db': /home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1158: undefined reference to `mysql_create_db' That sound like php used a 3.x mysql_version.h file to include but is trying to link against the real 4.x mysqlclient.so (since 4.x does not have mysql_create_db). At what prefix was mysql 3.x installed? /usr or /usr/local? Couple quick commands to find your mysql files locate mysql.h locate mysql_version.h find / find / -type f -name mysql*.h #last resort Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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
[PHP] How do I grab the contents of a web page?
I'm sure there's a really simple way to do this: how can I grab the source code of a specified web page and store it in a variable? Is there something like this: $siteCode = functionI'mLookingFor('www.123.com/index.htm'); Thanks, - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I grab the contents of a web page?
Brian Dunning wrote: I'm sure there's a really simple way to do this: how can I grab the source code of a specified web page and store it in a variable? Is there something like this: $siteCode = functionI'mLookingFor('www.123.com/index.htm'); a cracker's dream and programmer's worst nightmare Thanks, - Brian -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I grab the contents of a web page?
Hello Brian, Friday, May 21, 2004, 1:19:19 AM, you wrote: BD I'm sure there's a really simple way to do this: how can I grab the BD source code of a specified web page and store it in a variable? Is BD there something like this: BD $siteCode = functionI'mLookingFor('www.123.com/index.htm'); If you're talking about the resulting HTML code then there are a variety of ways - look in the manual at the fopen() examples. -- Best regards, Richard Davey http://www.launchcode.co.uk / PHP Development Services http://www.phpcommunity.org/wiki/296.html / PHP Community -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
Aaron Axelsen wrote: The mysql 3.x was installed with prefix /usr/local/mysql So why are you pointing to the 3.x path when compiling with 4.x? And since you are going through all this trouble might as well use a very recent version of mysql -- Aaron Axelsen Email: [EMAIL PROTECTED] Greetings, I compiled and installed mysql from source, and now I am trying to recompile php agaisnt the new version of MySQL (was previous running 3.23.53). Here is the configure string I used: ./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-gettext ... ext/mysql/php_mysql.lo: In function `zif_mysql_create_db': /home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1158: undefined reference to `mysql_create_db' That sound like php used a 3.x mysql_version.h file to include but is trying to link against the real 4.x mysqlclient.so (since 4.x does not have mysql_create_db). At what prefix was mysql 3.x installed? /usr or /usr/local? Couple quick commands to find your mysql files locate mysql.h locate mysql_version.h find / find / -type f -name mysql*.h #last resort Curt -- I used to think I was indecisive, but now I'm not so sure. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I grab the contents of a web page?
On May 20, 2004, at 5:43 PM, raditha dissanayake wrote: I'm sure there's a really simple way to do this: how can I grab the source code of a specified web page and store it in a variable? Never mind, I found it: $string = get_file_contents('www.123.com'); - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
I was trying to upgrade over the older one, which is why the paths are the same. I want to stick with the stable realease -- Aaron Axelsen Email: [EMAIL PROTECTED] -Original Message- From: raditha dissanayake [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 7:47 PM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8 Aaron Axelsen wrote: The mysql 3.x was installed with prefix /usr/local/mysql So why are you pointing to the 3.x path when compiling with 4.x? And since you are going through all this trouble might as well use a very recent version of mysql -- Aaron Axelsen Email: [EMAIL PROTECTED] Greetings, I compiled and installed mysql from source, and now I am trying to recompile php agaisnt the new version of MySQL (was previous running 3.23.53). Here is the configure string I used: ./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-gettext ... ext/mysql/php_mysql.lo: In function `zif_mysql_create_db': /home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1158: undefined reference to `mysql_create_db' That sound like php used a 3.x mysql_version.h file to include but is trying to link against the real 4.x mysqlclient.so (since 4.x does not have mysql_create_db). At what prefix was mysql 3.x installed? /usr or /usr/local? Couple quick commands to find your mysql files locate mysql.h locate mysql_version.h find / find / -type f -name mysql*.h #last resort Curt -- I used to think I was indecisive, but now I'm not so sure. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- 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] How do I grab the contents of a web page?
raditha dissanayake wrote: a cracker's dream and programmer's worst nightmare Must everything be negative? You can not assume what other people are trying to do. Either answer the question, or don't answer at all. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
Aaron Axelsen wrote: I was trying to upgrade over the older one, which is why the paths are the same. I want to stick with the stable realease 4.0.18 is stable. Generally you should not install a new version of a software over the older tree, it leads to many a conflict as you have just found ;-) -- Aaron Axelsen Email: [EMAIL PROTECTED] -Original Message- From: raditha dissanayake [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 7:47 PM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8 Aaron Axelsen wrote: The mysql 3.x was installed with prefix /usr/local/mysql So why are you pointing to the 3.x path when compiling with 4.x? And since you are going through all this trouble might as well use a very recent version of mysql -- Aaron Axelsen -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] eval() with CONSTANTS
Hi, Friday, May 21, 2004, 8:26:30 AM, you wrote: GD How can I eval() an HTML template to make a CONSTANT be evaluated GD properly? GD Previously I have been using regular $variables in my HTML templates. GD Today I decided to make one of the $variables a CONSTANT only to find it GD would not parse out as it's defined value. It is instead treated as GD regular text. I tried wrapping the CONSTANT with curly braces, and also GD tried using the constant() function with it in the HTML template. GD Neither return the value I previously defined with define(). The manual GD says Constants may be defined and accessed anywhere without regard to GD variable scoping rules but I'm missing something. GD I do: GD define('TABLE_PARAMETERS', ' border=0 cellspacing=0 cellpadding=0'); GD Then I get and eval() my template: GD $index = getTemplate('index'); GD eval(\$index = \$index\;); GD And I end up with HTML that looks like: GD table {TABLE_PARAMETERS} GD instead of the desired GD table border=0 cellspacing=0 cellpadding=0 GD Any ideas? I've google'd, and read lots of docs today trying to figure GD it out but I don't know what else to try. GD TIA. GD -- GD Greg Donald GD [EMAIL PROTECTED] There is no way for php to what is a constant and what is text so you have to put it in a variable to use it in a string. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [PHP 4.3.6] Compiling agaisnt MySQL 4.0.18 on Redhat 8
* Thus wrote Aaron Axelsen ([EMAIL PROTECTED]): I was trying to upgrade over the older one, which is why the paths are the same. I want to stick with the stable realease Overwritting versions like that might not work very well, file names have changed accross the versions. I usually update my server with something like: cd /usr/local mv mysql mysql.3.x cd /source/mysql.4.x make install cd /usr/local mv mysql.3.x/var/* mysql/data/var/ Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I am in Socket Paradise
On Thursday, May 20, 2004, at 04:17 PM, Chris W. Parker wrote: René Fournier mailto:[EMAIL PROTECTED] on Thursday, May 20, 2004 2:58 PM said: Please ignore my previous I-AM-SO-FRUSTRATED-I-AM-READY-FOR-A-JACKET-WITH-REALLY-LONG-SLEEVES posts. I have managed to solve my socket woes. My simple client works loops, timesout, loops again... elegantly. (I've learned not take those PHP warnings so seriously... and to clear socket errors.) so i admittedly stopped following your numerous threads after a while... mainly for the simple fact that i've never worked with sockets thus had nothing to contribute... but how praytell did you solve your problem? A combination of randomly following some (but not all) advice from this list and injecting enough debugging code to figure out myself what is going on. What threw me was the serious (but not Fatal) PHP Warnings that appeared when my socket was timing out. That, and I didn't clear the socket_last_error($socket). After ignoring the warnings, and clearing the error, and setting the socket options appropriately, the client loops, waits, executes and loops some more. ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] World's simplest tutorial on socket_select???
On Thursday, May 20, 2004, at 05:15 PM, Curt Zirzow wrote: * Thus wrote Ren Fournier ([EMAIL PROTECTED]): I am building a SIMPLE socket client that makes ONE connection to ONE server, and waits for data (socket_read)... and when no data comes for a few seconds, does something else, then waits for data again. HOW SHOULD I APPROACH THIS?! PLEASE TOSS ME A BONE! (If you help me, I will buy you a pint of great beer.) Does that help earlier count for that great beer ;) Curt Sure... the next time you're in Calgary. :-) ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I grab the contents of a web page?
On Thursday, May 20, 2004, at 06:42 PM, Brian Dunning wrote: On May 20, 2004, at 5:43 PM, raditha dissanayake wrote: I'm sure there's a really simple way to do this: how can I grab the source code of a specified web page and store it in a variable? Never mind, I found it: $string = get_file_contents('www.123.com'); - Brian You probably mean... $string = file_get_contents(http://www.123.com;); (The protocol bit is important too.) ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I grab the contents of a web page?
You probably mean... $string = file_get_contents(http://www.123.com;); Whoops Well, it worked, so I must have typed it correctly in my code... :) :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php