Re: [PHP] php5 threadsafe / apache2 mpm=worker
Yep, that's pretty much what I got, except I haven't been able to find a list of what modules are thread safe, except mysql. Jochem Maas wrote: Jason Morehouse wrote: Hello, Just wondering if anyone is using the apache worker module with php? I've complied php5 with zend threadsafe support, and apache2 with the MPM worker module on a Linux box. Everything seems sweet. mysqli_thread_safe() reports true... anyone know if this configuration may include modules that aren't threadsafe? if you use phpmodules that aren't threadsafe then use the prefork apache module. or face segfault hell or at least unwanted behaviour. anyone care to correct me? (i.e. this is what I have gathered from reading the internals mailinglist and from various people/friends/colleagues who are versed in these matters - I may have got the wrong of the stick!) I can't say which modules are threadsafe or not - I would have to look it up - which you can probably do just as quickly yourself :-) with-apxs2=/usr/local/apache2/bin/apxs with-gd enable-gd-native-ttf with-pspell with-zlib with-freetype-dir with-curlwrappers with-mime-magic with-curl enable-shmop with-jpeg-dir with-mcrypt=/usr/lib with-mysqli enable-magic-quotes with-enable-sockets enable-roxen-zts Thanks, -J -- Vendorama http://www.vendorama.com The evolution of e-commerce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sending attachment by email - can't find a bug?
You need to post some code #are you using phpMailer - makes emails a doddle http://phpmailer.sourceforge.net/ Afan Pasalic wrote: I have a form and once the form is submitted, php code build csv file with entered information and store it on server in temp file. Then send this file as an attachment to me. Code to send an attachment is included in main code. The code to store csv file works fine. I'm getting the attachment in email but can't open the file: Alert: Unable to read the file. Then I tried to create txt file and got the same result. Actually, I was able to open attached file but the file was empty?!? Then accidentally, I changed the code back to create csv file but didn't change in code to send an attachment. after submitting the csv file was created but got by email earlier created txt file - and it works fine. I was able to open it?!? My conclusion: I can't send just created file, but later, as a second process - it works just fine. And that means, code to send an attachment works as well. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql improved extensions affected_rows
Tom wrote: ... It correctly updates 4 rows, but returns 1 as the count. I think that this may actually be a mysql issue - I've put the same php/apache configs onto another similar box, the only difference being that the second box is mysql 5.0.1, whereas the problem is reported against 5.0.0 (both alpha's!). The correct value is returned from the what do you expect with alpha software (rhetorical question, not a dig!), I'd be surprised if there are any devs out there who have spent any serious time testing the mysqli extension again 5.0.x - regardless of whether this is a bug in php or mysql. brave man to go out there on the bleeding edge! you experience may prove useful to the mysqli devs, something to bare in mind as you come accross more problems (which you probably will!) good luck! second box. Thanks Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple question: $_POST
Stuart Felenstein wrote: When using $_POST vars is it required that a form is used ? In other words I can create an href link and echo variable and pick them up using $_GET in the following page. No so with $_POST ? in order to create POST vars the proper request headers need to sent to the browser. that could be done with some newfangled javascript techniques e.g. XHTTPRequest object - see sitepoint.com (Harry Fuecks article) if you don't care if a var comes via post or get you could use a func like this to avoid having to check both superglobals everytime /** * getGP() * * this function will return the value of a GET or POST var that corresponds to the * variable name pasted, if nothing is found NULL is returned. contents of POST array * takes precendence over the contents of the GET array. You can specify a value as second argument * which will be returned if the GP var *does not* exist; a third parameter can be given to * which will act as the return value if the GP *does* exist - the limitation is that the parameter cannot be * used to return a literal NULL; but I suggest that this would probably be a silly thing to do in practice * * @var string $v // the name of GP variable whose value to return * @var mixed $r // value to return if the GP variable was not set * @var mixed $t // value to return if the GP variable was set (i.e. override the value from GP) * * @return mixed */ function getGP($v = '', $r = null, $t = null) { if (!empty($v)) { if (isset($_GET[$v])) { $r = (!is_null($t)) ? $t: $_GET[$v]; } if (isset($_POST[$v])) { $r = (!is_null($t)) ? $t: $_POST[$v];} } return $r; } Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php editor
I had been using Zend Studio, but I've just about made the switch to Eclipse with the TruStudio PHP plugin. Eclipse: http://www.eclipse.org TruStudio: http://www.xored.com/trustudio/ Mostly running it in Linux (Fedora Core 3), but I've used that combination in Windows and OSX, too. --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] including an HTML file
Hello Gaetano, Thursday, January 13, 2005, 5:53:04 PM, you wrote: So i must do all manually i write this [snip] where $corpo is a variable for the name of the file. if the file not existe the page have a blank body I don't know of another way to do what you asked, which was to include only the information contained between the BODY and /BODY tags. You could put and else clause to your if(file_exist) which would include the contents of some other file if that condition happens. That file could just be some default content. Cheers, Leif Gregory -- TB Lists Moderator (and fellow registered end-user) PCWize Editor / ICQ 216395 / PGP Key ID 0x7CD4926F Web Site http://www.PCWize.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Feature request for print_r() and var_dump()
I suggest a slight but useful change to these two functions, or possibly an alternate parameter. I find myself always having to do this annoyance: echo BmyDevice/BBR; print_r($myDevice); To get: myDevice Array ( [] = Array ( [range] = range_3 [scanner] = scanner_3 [record] = record_3 ) [] = Array ( [range] = range_4 [scanner] = scanner_4 [record] = record_4 ) ) It seems to me the functions should just print out the name of the array you're looking at, at the very top, just as it prints out the keys. I already know it's an Array or I wouldn't be print_r()'ing it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex help
Mike Ford wrote: Just off the top of my head (and untested!), I'd try something like /b(\s+[^]*)?/ Cheers! Mike That pretty much seems to work the best. Thanks all! -- Jason Morehouse Vendorama - Create your own online store http://www.vendorama.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using a multi-dimensional array in a POST form?
I have a lot of data I want to associate with a single line item in table of data. The current method (which feels messy to me) is to do this INPUT TYPE=HIDDEN VALUE=range_1 NAME=userange[] INPUT TYPE=HIDDEN VALUE=scanner_1 NAME=usescanner[] INPUT TYPE=HIDDEN VALUE=record_1 NAME=userecord[] INPUT TYPE=HIDDEN VALUE=range_2 NAME=userange[] INPUT TYPE=HIDDEN VALUE=scanner_2 NAME=usescanner[] INPUT TYPE=HIDDEN VALUE=record_2 NAME=userecord[] Which gives me this: _POST[userange] = Array ( [] = range_1 [] = range_2 ) _POST[usescanner] = Array ( [] = scanner_1 [] = scanner_2 ) _POST[userecord] = Array ( [] = record_1 [] = record_2 ) What I'd like to do is this: INPUT TYPE=HIDDEN VALUE=range_1 NAME=device[][range] INPUT TYPE=HIDDEN VALUE=scanner_1 NAME=device[][scanner] INPUT TYPE=HIDDEN VALUE=record_1 NAME=device[][record] INPUT TYPE=HIDDEN VALUE=range_2 NAME=device[][range] INPUT TYPE=HIDDEN VALUE=scanner_2 NAME=device[][scanner] INPUT TYPE=HIDDEN VALUE=record_2 NAME=device[][record] When I submit the form, it appears to work as illustrated by this print_r(): _POST[device] = Array ( [] = Array ( [range] = range_1 [scanner] = scanner_1 [record] = record_1 ) [] = Array ( [range] = range_2 [scanner] = scanner_2 [record] = record_2 ) ) However, I don't seem to be able to access the elements?! I've tried various combinations of tick marks on both the hidden input and also on the retrieval to no avail... Ie. INPUT TYPE=HIDDEN VALUE=range_2 NAME=device[]['range'] And echo device[][range] = .$device[]['range']; or echo device[][range] = .$device[][range]; Is this possible? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange troule with PHP and MySQL
Greetings all, I am runnign into a strange problem. I am working on a Linux box. Running PHP 4.2.2 Apache 2.0 And it has MySQl installed on it (not sure of the version. I ran a quick script to check to make sure the connection to the DB is working fine as this is a very secure connection (have to do 2 SSH tunnesl to get in.) ?php $link = mysql_connect('localhost', 'some_un', 'some_pw'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ? However when I ran that I got an error saying that mysql_connect is an undefinied function??? This has got me stumped. I checked the php.ini to make sure that mysql is turned on (which it is by default now). Nothing I can see is telling me other wise. Fatal error: Call to undefined function: mysql_connect() in /home/aiastudios/htdocs/mysql.test.php on line 13 I have noticed that on the phpinfo(); That there is no section for Mysql, which I thought was odd. So it seems to me that mysql is disabled or something but I cannot see how to turn it on. Any help here would be appreciated. -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need help with array/foreach
Collin Davis wrote: Hi, Long time reader, first time poster. I've been using Dreamweaver to generate my PHP (I know - but I'm a designer... most of this makes absolutely zero sense to me), but I've run into something that I know could be done better. If you look here: http://pastebin.com/228804 you can see that I have several MySQL queries. Now I know that surely these can be concatenated into an array or something, but I have no idea how to do that - concatenation means sticking strings together, which is kind of what you would do to an array if you used the join() function on it. but anyway I grabbed this bit of code from you source file: $db2-query(select pid,poster, . date_format(posted, '%a %D %b %H:%i') as posted . from pastebin where pid=.$db-f(parent_pid)); you could do this with the sql: $queries = array(); $queries['get_poster'] = ' select pid,poster, date_format(posted, '%%a %%D %%b %%H:%%i') as posted from pastebin where pid=%s'; $queries['get_poster_parents'] = ' select pid,poster, date_format(posted, '%%a %%D %%b %%H:%%i') as posted from pastebin where parent_pid=%s order by posted desc; (the double percentage signs are there for the benefit of sprintf()) the later on in the script: $db2-query(sprintf( $queries['get_poster'],$db-f(parent_pid) )); and $db2-query( sprintf( $queries['get_poster_parents'],$db-f(parent_pid))); (sorry about the odd line wrapping) to be honest it wasn't totally clear what you wanted to achieve (or why - the why is often telling and will others to help with possibly different solutions), but I hope this gives you something to go on. I've googled until I'm blue in the face, read tutorials about arrays and foreach loops but I just can't make sense of it. Any help anybody could I feel like that everytime I try reading up on character encoding/transcoding - my brain hurts and I feel the need to scream! give me would be greatly appreciated. Thanks, Collin Davis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Experiences with PHP Training in US?
Hi All, I'm looking for a PHP training course within the US, and I'm wondering if have any recommendations. Specifically, I want to know if there's any courses that will cover using Kerberos through PHP, though I don't have too much hope in that. D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP - mail problems - HELP!!! PLEASE
I am having trouble with PHP 5.0.3. I am running Apache 1.3.29. I am running Solaris 9 x86 on an Intel box. I get no errors when I start Apache. I get no errors when I run configtest. My problem is mail() does not work. It does invoke sendmail as there is activity in sendmail log. When I get an error page it does not display PHP is exposed. It is exposed in php.ini. register_globals is turned on right now. Variables to parse into values. $MESG = $_POST['comments']; parses to values. This is the log from sendmail. The first is sending mail from WEBMIN. The second is sending from PHP mail(). 'WEBMIN' Jan 14 20:03:13 www sendmail[17613]: [ID 801593 mail.info] j0F23DBA017613: [EMAIL PROTECTED], size=889, class=0, nrcpts=1, msgid=[EMAIL PROTECTED], [EMAIL PROTECTED] Jan 14 20:03:14 www sendmail[17616]: [ID 801593 mail.info] j0F23D4b017616: from=[EMAIL PROTECTED], size=1083, class=0, nrcpts=1, msgid=[EMAIL PROTECTED], proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1] Jan 14 20:03:14 www sendmail[17613]: [ID 801593 mail.info] j0F23DBA017613: [EMAIL PROTECTED], [EMAIL PROTECTED] (0/1), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30889, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j0F23D4b017616 Message accepted for delivery) Jan 14 20:03:15 www sendmail[17618]: [ID 801593 mail.info] j0F23D4b017616: to=[EMAIL PROTECTED], ctladdr=[EMAIL PROTECTED] (0/1), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=121083, relay=boredomsoftware.com. [67.18.56.2], dsn=2.0.0, stat=Sent (OK id=1CpdH0-00067K-Lb) 'PHP mail()' Jan 14 20:04:41 www sendmail[17630]: [ID 801593 mail.info] j0F24f8b017630: from=nobody, size=200, class=0, nrcpts=0, msgid=[EMAIL PROTECTED], [EMAIL PROTECTED] Can someone please help me figure this out? I am desperate!! I am also at my wits end. I have been fighting with this for a week. Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with encryption
Greg Donald wrote: On Thu, 13 Jan 2005 13:53:30 -0800, Brian Dunning [EMAIL PROTECTED] wrote: Could anyone point me to a web page or other documentation that shows a SIMPLE example of encryption? I know absolutely nothing about encryption. There are like 6 people in the entire world who know something about it, but sadly.. I'm not one of them. Good luck in your quest. Now, who was it that said you didn't have a sense of humor? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 threadsafe / apache2 mpm=worker
Jason Morehouse wrote: Hello, Just wondering if anyone is using the apache worker module with php? I've complied php5 with zend threadsafe support, and apache2 with the MPM worker module on a Linux box. Everything seems sweet. mysqli_thread_safe() reports true... anyone know if this configuration may include modules that aren't threadsafe? if you use phpmodules that aren't threadsafe then use the prefork apache module. or face segfault hell or at least unwanted behaviour. anyone care to correct me? (i.e. this is what I have gathered from reading the internals mailinglist and from various people/friends/colleagues who are versed in these matters - I may have got the wrong of the stick!) I can't say which modules are threadsafe or not - I would have to look it up - which you can probably do just as quickly yourself :-) with-apxs2=/usr/local/apache2/bin/apxs with-gd enable-gd-native-ttf with-pspell with-zlib with-freetype-dir with-curlwrappers with-mime-magic with-curl enable-shmop with-jpeg-dir with-mcrypt=/usr/lib with-mysqli enable-magic-quotes with-enable-sockets enable-roxen-zts Thanks, -J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions and Objects using PHP4
I have RTFM and TTFE and still am having a heck of a time getting my objects to play well between pages The only real examples are in the notes for classes objects http://us2.php.net/manual/en/language.oop.php Basic usage ? include_once(config.inc); include_once(class.php); $songbook = new songbook(); // defined in the class.php session_register('songbook'); $songbook-get_stats(); $songbook-populate_manu(); $songbook-populate_series(); if (!isset($songbook-userid) || $songbook-userid == ) { header(Location: login.php); } Now the login.php is basically the same but if the login correctly it should set $songbook-userid to the username require('common.php'); session_start(); include_once(class.php); $songbook = new songbook(); session_register('songbook'); include(newheader.php); if ( isset($_POST['submitit'])) { $link = dbconnector(); $sql = select * from userinfo where lower(username)=lower('.$_POST['user'].') and lower(password)=lower('.$_POST['pass'].'); $result = mysql_query($sql); if( mysql_num_rows($result) 0 ) { $songbook-userid = strtolower($_POST['user']); header(Location: green.php); } else { $errormsg = font size=3Invalid Username or Password.br\nPlease Try Again./font; } } So I guess what I am asking is how DO you make objects work across pages? -Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple question: $_POST
14 2005 16:48 Stuart Felenstein (a): When using $_POST vars is it required that a form is used ? exactly
Re: [PHP] RE: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] strange in MySQL Query.
MySQL don't know what is UNION -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 404 custom handler on a cgi-wrap PHP - No input specified error
Luke Barker wrote: Hi, This maybe a PHP problem, but is associated with Apache too - so my apologies if it is slightly off topic. My web hosts use a CGI wrap version of PHP 4.3.10 I have made a 404 custom error handler, using .htaccess in a directory - it is usppoed to route all unfound pages to error.php, and works as expected for .htm and .html pages as well as gifs etc. But ofr .php scripts, e.g /path/to/wrongurl.php it doesnt show my page - instead it shows No Input file specified.. After some Googling I have only found people witht eh similar problem without solutions. Can any one help me on this? I should say that in IE it just gets the default 404 ( I think this is windows own one responding to the particular http response header) - in firefox you get the 'No input ' error thanks for any advice Luke Much like this thread: http://marc.theaimsgroup.com/?t=11053858474r=1w=2 I suppose the reason is the same, apache handles the request to php w/out checking if the file exists. Maybe you can solve it with auto_prepend script -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Experiences with PHP Training in US?
Hi All, I'm looking for a PHP training course within the US, and I'm wondering if have any recommendations. Specifically, I want to know if there's any courses that will cover using Kerberos through PHP, though I don't have too much hope in that. D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple question: $_POST
On Friday 14 January 2005 21:48, Stuart Felenstein wrote: When using $_POST vars is it required that a form is used ? Better worded as if you want to pass values from one page to another and you want said values to be available in $_POST then yes, you *have* to use a form. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sending attachment by email - can't find a bug?
Hello, on 01/14/2005 03:00 PM Afan Pasalic said the following: I have a form and once the form is submitted, php code build csv file with entered information and store it on server in temp file. Then send this file as an attachment to me. Code to send an attachment is included in main code. The code to store csv file works fine. I'm getting the attachment in email but can't open the file: Alert: Unable to read the file. Then I tried to create txt file and got the same result. Actually, I was able to open attached file but the file was empty?!? Then accidentally, I changed the code back to create csv file but didn't change in code to send an attachment. after submitting the csv file was created but got by email earlier created txt file - and it works fine. I was able to open it?!? My conclusion: I can't send just created file, but later, as a second process - it works just fine. And that means, code to send an attachment works as well. Any ideas? Maybe you are using PHP safe mode which disallow file creation and you are noty really verifying wether the file is created successfully. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Global Postal
I'd posted this link yesterday on the geographic search engine thread, but it has not appeared. Richard Lynch wrote: Is anybody aware of any existing world-wide data-collection effort of postal codes in relation to geogrpahical coordinates (long/lat)? Just: country_code + postal_code (long, lat) in a one-to-one relationship, as crude as that might be. http://ibWebAdmin.lsces.co.uk/FirebirdFederationDataArchive.html I've added the GB_POSTAREA table with some 3000 primary postal area entries, all with XY coordinates which can be used on www.multimap.com (See the notes in the DATA_INDEX for details on how to use - getting to them will give you exercise on ibWebAdmin ;) ) Also added last night is an old US_ZIPCODE table - it's a start. The object of the archive is to build a database of useful information such as post codes, states, towns/cities, and the like - all running on PHP of cause, into a Firebird database. Feel free to forward any additional information you have for inclusion ;) -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Best method for threading?
I'm working on a web spider application where the server has considerable latency in serving the information I require, but simultaneous requests do not have a significant performance hit. I have a nice little class that handles all the sessions, cookies, etc perfectly. What's the best way to basically hand off a bunch of threads to access this information without hanging up the execution of my script? I plan to handle inter-thread coordination via MySQL and code in the main script. I've done threads before like this and have had great luck, but all my solutions have been hack-ish at best. What are the cleanest solution for this? What do you all do to handle situations like this? I will be running PHP 4.3.1.0 under Linux and Mac OS X, depending on location. Thoughts anybody? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search Engine Friendly URLs
I am converting a site to use includes instead of a Dreamweaver template. I want the URLs to look like this: www.my-site1234.com/contact instead of www.my-site1234.com/default.php?p=contact. I found some tutorials on editing the .htaccess file but where do I find it on the server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: geographic search engine
For those who were asking about UK post code mapping http://ibWebAdmin.lsces.co.uk/FirebirdFederationDataArchive.html I've added the GB_POSTAREA table with some 3000 primary postal area entries, all with XY coordinates which can be used on www.multimap.com As yet these are a local metric grid rather than Latitude and Longitude but they work well for distance comparison in the UK, and multimap use the same thing on all their world maps. You can download a CSV dump using the instructions provided, all PHP into Firebird ;) There is also a Firebird backup if people want it - eMail requests at the moment so I can keep load down :) I am waiting for some of the tables including the US zip table. I have a UK full postcode table in multimap format, but it's 200Mb! So 'not just yet'. -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Global Postal
Richard Lynch wrote: Is anybody aware of any existing world-wide data-collection effort of postal codes in relation to geogrpahical coordinates (long/lat)? Just: country_code + postal_code (long, lat) in a one-to-one relationship, as crude as that might be. I've tried to post this twice now, third time lucky ;) http://ibWebAdmin.lsces.co.uk/FirebirdFederationDataArchive.html I've added the GB_POSTAREA table with some 3000 primary postal area entries, all with XY coordinates which can be used on www.multimap.com This is a PHP based management interface to Firebird, so we can add information directly into the database, but I plan to allow a more controlled entry at some point in the future. -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Global Postal
Richard Lynch wrote: Is anybody aware of any existing world-wide data-collection effort of postal codes in relation to geogrpahical coordinates (long/lat)? Just: country_code + postal_code (long, lat) in a one-to-one relationship, as crude as that might be. http://ibWebAdmin.lsces.co.uk/FirebirdFederationDataArchive.html I've added the GB_POSTAREA table with some 3000 primary postal area entries, all with XY coordinates which can be used on www.multimap.com Along with an older US_ZIPCODE table. The plan is to generate a single search table starting from the iso country codes. The current interface is just the PHP management tool into Firebird, but it does allow a CVS export and import for transfers to other databases. -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP - mail problems - HELP!!! PLEASE
Hello, on 01/15/2005 12:59 AM Kelly said the following: I am having trouble with PHP 5.0.3. I am running Apache 1.3.29. I am running Solaris 9 x86 on an Intel box. I get no errors when I start Apache. I get no errors when I run configtest. My problem is mail() does not work. It does invoke sendmail as there is activity in sendmail log. When I get an error page it does not display PHP is exposed. It is exposed in php.ini. Does the address [EMAIL PROTECTED] exist? If it doesn't, it seems the messages that are not delivered are discarded because they are set to bounce to that address and if it does not exist the bounces are dropped. Message bounces contain explanations of the message delivery problems, so you need to fix the bounce address so you can see what is the problem of the bounces. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: calling php functions as library or cmd line
Cere Davis wrote: Geeze, That was obnoxious. you have to admit (well no you don't actually!) tho, it was damn tempting to just answer yes :-) anyway... Luckily google helped me out eventually: if (basename($argv[0]) == basename(__FILE__)) { ...so that bit of code allows you to differentiate between CLI and CGI/webmodule, I'm interested where you took it from there. care to extrapolate? (e.g. did you setup some kind of generic magic that converts cmdline args to, for instance GET/POST vars that you app/components normally relies on? interested, Jochem o f f t o p i c: you're familiar with Ruby (cool name that)? what do you use it for? just curious. Robert Cummings wrote: On Thu, 2005-01-13 at 09:46, Cere Davis wrote: Does anyone know how to write php libraries in a modular way so that you can both test the libraries/functions on the command line with arguments and/or use the php library as a part of your web code with 'require_once()' syntax? Sort of like how Python or Ruby works? Yes. Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Executing command in Linux
Hi, I have this problem: Linux Red Hat 7.3 server and PHP 4.3.8 MySQL 4. When I Try to execute linux command - nothing happens and in Apache logs I see Access denied. This is about permissions in executing this command. My question is can I execute a linux command via PHP ( this is command allowed only for root user ) ? P.S. I own this server - i.e. I have user pass for root. Thanks in advance! Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP - mail problems - HELP!!! PLEASE
Kelly wrote: I am having trouble with PHP 5.0.3. I am running Apache 1.3.29. I am running Solaris 9 x86 on an Intel box. I get no errors when I start Apache. I get no errors when I run configtest. My problem is mail() does not work. It does invoke sendmail as there is activity in sendmail log. When I get an error page it does not display PHP is exposed. It is exposed in php.ini. register_globals is turned on right now. Variables to parse into values. $MESG = $_POST['comments']; parses to values. This is the log from sendmail. The first is sending mail from WEBMIN. The second is sending from PHP mail(). 'WEBMIN' Jan 14 20:03:13 www sendmail[17613]: [ID 801593 mail.info] j0F23DBA017613: [EMAIL PROTECTED], size=889, class=0, nrcpts=1, msgid=[EMAIL PROTECTED], [EMAIL PROTECTED] Jan 14 20:03:14 www sendmail[17616]: [ID 801593 mail.info] j0F23D4b017616: from=[EMAIL PROTECTED], size=1083, class=0, nrcpts=1, msgid=[EMAIL PROTECTED], proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1] Jan 14 20:03:14 www sendmail[17613]: [ID 801593 mail.info] j0F23DBA017613: [EMAIL PROTECTED], [EMAIL PROTECTED] (0/1), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30889, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j0F23D4b017616 Message accepted for delivery) Jan 14 20:03:15 www sendmail[17618]: [ID 801593 mail.info] j0F23D4b017616: to=[EMAIL PROTECTED], ctladdr=[EMAIL PROTECTED] (0/1), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=121083, relay=boredomsoftware.com. [67.18.56.2], dsn=2.0.0, stat=Sent (OK id=1CpdH0-00067K-Lb) 'PHP mail()' Jan 14 20:04:41 www sendmail[17630]: [ID 801593 mail.info] j0F24f8b017630: from=nobody, size=200, class=0, nrcpts=0, msgid=[EMAIL PROTECTED], [EMAIL PROTECTED] Can someone please help me figure this out? I am desperate!! I am also at my wits end. I have been fighting with this for a week. Kelly What do you mean by: When I get an error page it does not display PHP is exposed. It is exposed in php.ini. Is mail() returning an error? If so, what is it? Have you had the same PHP code working in a different environment? If you haven't figured out the problem yet, post your PHP code here. -John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php editor
Greg Donald wrote: On Fri, 14 Jan 2005 18:47:14 +0100, Jochem Maas [EMAIL PROTECTED] wrote: in addition there is the xdebug extension by Derick Rethans its at version 2 but I might suggest starting with 1.3 as its alot simpler to use than 2 (then again if you have experience of things like valgrind/dbg on linux you should have little problems). I just don't see the need. PHP explodes right on the screen for me. I can usually find and fix an error in a few seconds of seeing it in my browser or in my terminal. Lines numbers always accompany the error messages, and you can even go the extra mile and link the error messages back into the PHP manual for faster lookups when required. actually I agree with you when it come to bug hunting/fixing. especially with PHP5 and the nice stacktraces you get as part of an Exception. but (there always a 'but' hey!)... where I found xdebug to be very handy is in code profiling. - it helped me shave 30% (time) per request in a (way too!) generic data editing framework I wrote with a friend of mine. (we run it on a slow test server and some of the _really_ heavy pages were taking 10-15 seconds to display - 40,000 calls to strtolower()!!! for instance - and that wasn't even the 'bad' part). thats also the reason I mentioned going for xdebug1.3x - it lets you basically dump different kinds of profiling info onto the screen in HTML format (or into a file for later viewing) where as xdebug 2.x requires using something like cachegrind to analyse the data - which is little over my head to just setup and go (i.e. too much effort to figure it out right now :-). I haven't even look at the actually debugger functionality of xdebug! so I reckon its overkill for most people - but nice to know its there if you ever need it. Granted if you have a long running PHP app that's acting funky then you might want to analyze it in more depth.. but at that point you gotta ask yourself should you even be using PHP for the task at hand? Could this task or even part of the task be better handled better with another language? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple question: $_POST
Jochem Maas wrote: Stuart Felenstein wrote: When using $_POST vars is it required that a form is used ? In other words I can create an href link and echo variable and pick them up using $_GET in the following page. No so with $_POST ? in order to create POST vars the proper request headers need to sent to the browser. that could be done with some newfangled javascript I had a bit of a thinko there - that should have read '...sent to the server' not '...sent to the browser', sorry! techniques e.g. XHTTPRequest object - see sitepoint.com (Harry Fuecks article) if you don't care if a var comes via post or get you could use a func like this to avoid having to check both superglobals everytime /** * getGP() * * this function will return the value of a GET or POST var that corresponds to the * variable name pasted, if nothing is found NULL is returned. contents of POST array * takes precendence over the contents of the GET array. You can specify a value as second argument * which will be returned if the GP var *does not* exist; a third parameter can be given to * which will act as the return value if the GP *does* exist - the limitation is that the parameter cannot be * used to return a literal NULL; but I suggest that this would probably be a silly thing to do in practice * * @var string $v // the name of GP variable whose value to return * @var mixed $r // value to return if the GP variable was not set * @var mixed $t // value to return if the GP variable was set (i.e. override the value from GP) * * @return mixed */ function getGP($v = '', $r = null, $t = null) { if (!empty($v)) { if (isset($_GET[$v])) { $r = (!is_null($t)) ? $t: $_GET[$v]; } if (isset($_POST[$v])) { $r = (!is_null($t)) ? $t: $_POST[$v];} } return $r; } Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Objects using PHP4
David OBrien wrote: I have RTFM and TTFE and still am having a heck of a time getting my objects to play well between pages The only real examples are in the notes for classes objects http://us2.php.net/manual/en/language.oop.php (are you on php4 or php5 btw?) Basic usage ? include_once(config.inc); include_once(class.php); indeed, you must include classes for objects stored in a session before starting the session. :-) $songbook = new songbook(); // defined in the class.php if you are creating this object on every page/call and then assigning it to the session it will always have a blank/null userid. because each call overwrites the old object thats stores with a brand new one. so you need to check the session to see if a songbook object is already available. so you only ever see the login screen in your example. session_register('songbook'); alternative is using $_SESSION. but if you do you must call session_start() first: session_start(); if (!isset($_SESSION['songbook']) || !is_object($_SESSION['songbook']) || !(get_class($_SESSION['songbook']) == 'songbook')) { $_SESSION['songbook'] = new songbook; } $songbook-get_stats(); $songbook-populate_manu(); $songbook-populate_series(); if (!isset($songbook-userid) || $songbook-userid == ) { header(Location: login.php); } Now the login.php is basically the same but if the login correctly it should set $songbook-userid to the username require('common.php'); session_start(); include_once(class.php); $songbook = new songbook(); session_register('songbook'); include(newheader.php); if ( isset($_POST['submitit'])) { $link = dbconnector(); $sql = select * from userinfo where lower(username)=lower('.$_POST['user'].') and lower(password)=lower('.$_POST['pass'].'); $result = mysql_query($sql); if( mysql_num_rows($result) 0 ) { $songbook-userid = strtolower($_POST['user']); header(Location: green.php); } else { $errormsg = font size=3Invalid Username or Password.br\nPlease Try Again./font; } } So I guess what I am asking is how DO you make objects work across pages? -Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with encryption
Michael Sims wrote: Greg Donald wrote: On Thu, 13 Jan 2005 13:53:30 -0800, Brian Dunning [EMAIL PROTECTED] wrote: Could anyone point me to a web page or other documentation that shows a SIMPLE example of encryption? I know absolutely nothing about encryption. There are like 6 people in the entire world who know something about it, but sadly.. I'm not one of them. Good luck in your quest. Now, who was it that said you didn't have a sense of humor? :) i THINK thats aimed at me, and I must admit he made me chuckle with that one! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Search Engine Friendly URLs
* Josh [EMAIL PROTECTED]: I am converting a site to use includes instead of a Dreamweaver template. I want the URLs to look like this: www.my-site1234.com/contact instead of www.my-site1234.com/default.php?p=contact. I found some tutorials on editing the .htaccess file but where do I find it on the server? You can place .htacces files in any directory -- assuming you're using Apache as your webserver AND assuming Apache is configured to allow .htaccess files. -- Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED] Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple question: $_POST
--- Ford, Mike [EMAIL PROTECTED] wrote: To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -Original Message- From: Stuart Felenstein Sent: 14/01/05 13:48 When using $_POST vars is it required that a form is used ? In other words I can create an href link and echo variable and pick them up using $_GET in the following page. No so with $_POST ? Short answer: correct. Long answer: well, this being PHP, there's pretty much always ways and means, e.g. cURL. (I suspect, from the way you've asked the question, though, the short answer probably suffices! ;) Cheers! Mike Yes, the short answer sufficed, though the different responses were great and appreciated. I did not know about java alternatives or cURL or other php extensions. More alternatives for the future. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [HAB] Remove empty cells from an array
Dears, How can I remove empty cells/places in an array. For example: a[1]='John'; a[2]='Mike'; a[3]='Lisa'; a[4]=''; a[5]=''; How can I remove a[4] a[5], so the array is only a[1]='John'; a[2]='Mike'; a[3]='Lisa'; = Regards, OOzy What is the purpose of life? __ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [HAB] Force Browsers to encode in utf8
Thanks guys/gals, The header (.utf-8) thing worked ok. --- Jochem Maas [EMAIL PROTECTED] wrote: OOzy Pal wrote: Dears, My html templates are encoded using utf-8. When the browser reads the files as .html it encodes it fine and my characters looks fine. However, when php reads the files and sends them to the browser the files looks ugly and unreadable. How can I force the broswer to encode the pages in utf-8. does it help if you add the following statement to your php file(s): header(Content-Type: text/plain; charset=UTF-8); the call to header must occur before any output is done. also you may wish to investigate the usage of (and your current settings of) the follow ini settings: mbstring.internal_encoding mbstring.encoding_translation mbstring.internal_encoding default_charset I don't profess to have a good grip on charsets/encoding/transcoding etc and I've yet to find an article that I can get my head round... can anyway out there confess to actually understanding this stuff - Im very interested! = Regards, OOzy What is the purpose of life? does there need to be a purpose? = Regards, OOzy What is the purpose of life? __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date()
I might be doing this backwards, but how do I extract the date from $week5 and display $week5 + 4 days. I would like to create a function so when I pass echo displaydate($week5); it echos February 14-18 $week0 = 2005-01-10; $week1 = 2005-01-17; $week2 = 2005-01-24; $week3 = 2005-01-31; $week4 = 2005-02-07; $week5 = 2005-02-14; $week6 = 2005-02-21; $week7 = 2005-02-28; `Doable´? Easy enough to learn how to do? John -- John Taylor-Johnston - °v° Université de Sherbrooke /(_)\ http://compcanlit.ca/ ^ ^ 819-821-8000, #3216 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Executing command in Linux
On Sat, 2005-01-15 at 11:57, Rosen wrote: Hi, I have this problem: Linux Red Hat 7.3 server and PHP 4.3.8 MySQL 4. When I Try to execute linux command - nothing happens and in Apache logs I see Access denied. This is about permissions in executing this command. My question is can I execute a linux command via PHP ( this is command allowed only for root user ) ? P.S. I own this server - i.e. I have user pass for root. I use sudo for these situations. use visudo to establish that the user that owns the apache process ( I can't remember if RHL 7.3 was nobody or if the had switched to apache by then ). THen you can use exec(sudo yourCommandThatMustBeRunAsRoot arg1 arg2); man pages for sudo, sudoers and visudo are good resources. I am pretty sure 7.3 had the rpm available. visudo MUST be used to edit the sudoers file. you can add the following line to get you started apache ALL=(root) NOPASSWD:yourCommandThatMustBeRunAsRoot, someotherCmd What this says is let the user apache run yourCommandThatMustBeRunAsRoot and someotherCmd without having to enter a passwd. There are some things you can do to limit the arguments that can be passed to the commands see the man pages. Very cool stuff with finegrained permission on what can be run by who. Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date()
John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I might be doing this backwards, but how do I extract the date from $week5 and display $week5 + 4 days. I would like to create a function so when I pass echo displaydate($week5); it echos February 14-18 $week0 = 2005-01-10; $week1 = 2005-01-17; $week2 = 2005-01-24; $week3 = 2005-01-31; $week4 = 2005-02-07; $week5 = 2005-02-14; $week6 = 2005-02-21; $week7 = 2005-02-28; `Doable´? Easy enough to learn how to do? John Hi John, // convert your data to a timestamp: $firstDayTs = strtotime($week5); // add 4 days $lastDayTs = $firstDayTs + (4 * 86400); echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' . date('m', $lastDayTs); Not tested. Maybe there's an easier way to do this. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [HAB] Remove empty cells from an array
OOzy Pal [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dears, How can I remove empty cells/places in an array. For example: a[1]='John'; a[2]='Mike'; a[3]='Lisa'; a[4]=''; a[5]=''; How can I remove a[4] a[5], so the array is only a[1]='John'; a[2]='Mike'; a[3]='Lisa'; unset($a[4]); Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Experiences with PHP Training in US?
On Fri, 14 Jan 2005, Donald Wong wrote: Specifically, I want to know if there's any courses that will cover using Kerberos through PHP, though I don't have too much hope in that. No chance. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best method for threading?
Galen wrote: I'm working on a web spider application where the server has considerable latency in serving the information I require, but simultaneous requests do not have a significant performance hit. I have a nice little class that handles all the sessions, cookies, etc perfectly. What's the best way to basically hand off a bunch of threads to access this information without hanging up the execution of my script? I plan to handle inter-thread coordination via MySQL and code in the main script. I've done threads before like this and have had great luck, but all my solutions have been hack-ish at best. What are the cleanest solution for this? What do you all do to handle situations like this? I will be running PHP 4.3.1.0 under Linux and Mac OS X, depending on location. Thoughts anybody? nonblocking sockets and socket_select in a while loop. Or execute more processes. php does not have thread support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Feature request for print_r() and var_dump()
Daevid Vincent [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I suggest a slight but useful change to these two functions, or possibly an alternate parameter. I find myself always having to do this annoyance: echo BmyDevice/BBR; print_r($myDevice); To get: myDevice Array ( [] = Array ( [range] = range_3 [scanner] = scanner_3 [record] = record_3 ) [] = Array ( [range] = range_4 [scanner] = scanner_4 [record] = record_4 ) ) It seems to me the functions should just print out the name of the array you're looking at, at the very top, just as it prints out the keys. I already know it's an Array or I wouldn't be print_r()'ing it. print_r() can also be used to output the contents of an object. So it's not always an array! To output the type of the variable *does* make sense. Best regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Persistent PHP web application?
what about using $_SESSION arrays ? On Fri, 14 Jan 2005 19:28:24 -0500, Al [EMAIL PROTECTED] wrote: George Schlossnagle addresses exactly your requirement in his book Advanced PHP Programming. Josh Whiting wrote: Dear list, My web application (an online classifieds server) requires a set of fairly large global arrays which contain vital information that most all the page scripts rely upon for information such as the category list, which fields belong to each category, and so on. Additionally, there are a large number of function definitions (more than 13,000 lines of code in all just for these global definitions). These global arrays and functions never change between requests. However, the PHP engine destroys and recreates them every time. After having spent some serious time doing benchmarking (using Apache Bench), I have found that this code takes at least 7ms to parse per request on my dual Xeon 2.4ghz server (Zend Accelerator in use*). This seriously cuts into my server's peak capacity, reducing it by more than half. My question is: is there a way to define a global set of variables and functions ONCE per Apache process, allowing each incoming hit to run a handler function that runs within a persistent namespace? OR, is it possible to create some form of shared variable and function namespace that each script can tap? AFAIK, mod_python, mod_perl, Java, etc. all allow you to create a persistent, long-running application with hooks/handlers for individual Apache requests. I'm surprised I haven't found a similar solution for PHP. In fact, according to my work in the past few days, if an application has a large set of global functions and variable definitions, mod_python FAR exceeds the performance of mod_php, even though Python code runs significantly slower than PHP code (because in mod_python you can put all these definitions in a module that is loaded only once per Apache process). The most promising prospect I've come across is FastCGI, which for Perl and other languages, allows you to run a while loop that sits and receives incoming requests (e.g. while(FCGI::accept() = 0) {..}). However, the PHP/FastCGI modality seems to basically compare to mod_php: every request still creates and destroys the entire application (although the PHP interpreter itself does persist). Essentially I want to go beyond a persistent PHP *interpreter* (mod_php, PHP/FastCGI) and create a persistent PHP *application*... any suggestions? Thanks in advance for any help! Regards, J. Whiting * - Please note that I am using the Zend Accelerator (on Redhat Enterprise with Apache 1.3) to cache the intermediate compiled PHP code. My benchmarks (7ms+) are after the dramatic speedup provided by the accelerator. I wouldn't even bother benchmarking this without the compiler cache, but it is clear that a compiler cache does not prevent PHP from still having to run the (ableit precompiled) array and function definition code itself. -- 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] Best method for threading?
On Wed, 12 Jan 2005 04:13:17 -0800, Galen [EMAIL PROTECTED] wrote: What do you all do to handle situations like this? If you need threads then use a language that has threads. I'd go with Java or Perl. -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] strange in MySQL Query.
Santa wrote: MySQL don't know what is UNION http://dev.mysql.com/doc/mysql/en/UNION.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date()
Don't know where my other post went, but I corrected it: echo date('F', $firstDayTs) . ' ' . date('d', $firstDayTs) . '-' . date('Y',$firstDayTs) echo date('F', $firstDayTs) . ' ' . date('d', $lastDayTs) . '-' . date('Y',$firstDayTs) Thanks, John Torsten Roehr wrote: John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I might be doing this backwards, but how do I extract the date from $week5 and display $week5 + 4 days. I would like to create a function so when I pass echo displaydate($week5); it echos February 14-18 $week0 = 2005-01-10; $week1 = 2005-01-17; $week2 = 2005-01-24; $week3 = 2005-01-31; $week4 = 2005-02-07; $week5 = 2005-02-14; $week6 = 2005-02-21; $week7 = 2005-02-28; `Doable´? Easy enough to learn how to do? John Hi John, // convert your data to a timestamp: $firstDayTs = strtotime($week5); // add 4 days $lastDayTs = $firstDayTs + (4 * 86400); echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' . date('m', $lastDayTs); Not tested. Maybe there's an easier way to do this. Regards, Torsten Roehr -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. '''Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] control REMOTE_ADDR header
how can I can send http request with my chosen REMOTE_ADDR is there a class to do that or method in php ? -- Alawi Albaity Jeddah - KSA Mobile : +966506660442 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 silently throwing exceptions???
Im currently using php 5.0.3 on a dev box, trying to figure out how to correctly use exceptions in my code. Per chance, I was monitoring the __autoload() function, and Im noticing that calls are being made to exception classes that I've setup. But nothing is being actually thrown. As I understand it, __autoload(), only gets called, if a class file hasn't been loaded for a class. I know for a fact that all my exception classes are derived from php's Exception class. I've debugged it down to this - //try //{ $db-connect(); //} //catch(databaseException $e) //{ //throw $e; //} The ::connect() method is supposed to throw a databaseException if a connection cannot be made. In my tests, connections are made, and the exception is not thrown. But the try/catch block above, for some reason, tries to throw the databaseException (according to __autoload()). If I comment it out the try/catch block, __autoload() doesn't try to load the databaseException object. I dont know if this is a bug in my code, as Im still new to exceptions. Im just checking to see if anyone else experienced anything like this before... Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Developement
The sample is attached! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems upgrading
Guys. Maybe somebody lese has been having or had this problem while upgrading apache, mod_perl and php. I just upgraded from apache 1.3.29, mod_perl 1.29 and php 4.3.6 (due to the security issues) to apache 1.3.33, mod_perl 1.29 and php 4.3.10.. But I can get mod_perl to work... Everything compiled perfectly (Im using perl 5.8.0) but everytime I try to open a webpage, apache faults (core dumps). I tried removing mod_perl and everything works fine so I guess the problem is with mod_perl. I tried upgrading to perl 5.8.5 but now I have a problem compiling mod_perl, says it cant recognize the -mtune=pentium4 parameter in cc. Anybody knows how to get apache, mod_perl and php to compile and not fault? Im using RH9 BTW. Thx! Anton Krall -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Search Engine Friendly URLs
On Fri, 2005-01-14 at 13:46 -0500, Josh wrote: I am converting a site to use includes instead of a Dreamweaver template. I want the URLs to look like this: www.my-site1234.com/contact instead of www.my-site1234.com/default.php?p=contact. I found some tutorials on editing the .htaccess file but where do I find it on the server? You need to create the file in the root directory of your website. Example: if your website is located in /home/web/foo/public_html/ then you need to create the file: /home/web/foo/public_html/.htaccess You also need to make some adjustments to Apache to allow you to do this. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] use php to determine user OS
is there a php function out there that can get the operating system of the user...Mac/PC/Linux suppose I could do it with java, but wanted to see if I could do it all in php :) g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Persistent PHP web application?
$_SESSION is same as it use serialize/unserialize, alghough there're some difference On Sat, 15 Jan 2005 10:06:58 +0100, Zouari Fourat [EMAIL PROTECTED] wrote: what about using $_SESSION arrays ? On Fri, 14 Jan 2005 19:28:24 -0500, Al [EMAIL PROTECTED] wrote: George Schlossnagle addresses exactly your requirement in his book Advanced PHP Programming. Josh Whiting wrote: Dear list, My web application (an online classifieds server) requires a set of fairly large global arrays which contain vital information that most all the page scripts rely upon for information such as the category list, which fields belong to each category, and so on. Additionally, there are a large number of function definitions (more than 13,000 lines of code in all just for these global definitions). These global arrays and functions never change between requests. However, the PHP engine destroys and recreates them every time. After having spent some serious time doing benchmarking (using Apache Bench), I have found that this code takes at least 7ms to parse per request on my dual Xeon 2.4ghz server (Zend Accelerator in use*). This seriously cuts into my server's peak capacity, reducing it by more than half. My question is: is there a way to define a global set of variables and functions ONCE per Apache process, allowing each incoming hit to run a handler function that runs within a persistent namespace? OR, is it possible to create some form of shared variable and function namespace that each script can tap? AFAIK, mod_python, mod_perl, Java, etc. all allow you to create a persistent, long-running application with hooks/handlers for individual Apache requests. I'm surprised I haven't found a similar solution for PHP. In fact, according to my work in the past few days, if an application has a large set of global functions and variable definitions, mod_python FAR exceeds the performance of mod_php, even though Python code runs significantly slower than PHP code (because in mod_python you can put all these definitions in a module that is loaded only once per Apache process). The most promising prospect I've come across is FastCGI, which for Perl and other languages, allows you to run a while loop that sits and receives incoming requests (e.g. while(FCGI::accept() = 0) {..}). However, the PHP/FastCGI modality seems to basically compare to mod_php: every request still creates and destroys the entire application (although the PHP interpreter itself does persist). Essentially I want to go beyond a persistent PHP *interpreter* (mod_php, PHP/FastCGI) and create a persistent PHP *application*... any suggestions? Thanks in advance for any help! Regards, J. Whiting * - Please note that I am using the Zend Accelerator (on Redhat Enterprise with Apache 1.3) to cache the intermediate compiled PHP code. My benchmarks (7ms+) are after the dramatic speedup provided by the accelerator. I wouldn't even bother benchmarking this without the compiler cache, but it is clear that a compiler cache does not prevent PHP from still having to run the (ableit precompiled) array and function definition code itself. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple question: $_POST
On Fri, 2005-01-14 at 07:48, Stuart Felenstein wrote: When using $_POST vars is it required that a form is used ? In other words I can create an href link and echo variable and pick them up using $_GET in the following page. No so with $_POST ? You could probably create hidden vars and on the href set the var values and submit the form ( with form method defined as post of course). You could create the javascript needed in a function built dynamically setting the vars and simply call the function in the onclick method of the href. I think you will have to return false from the function so that the link won't try to go to nowhere. Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best method for threading?
nonblocking sockets wont work with select, blocking is ok On Sat, 15 Jan 2005 19:30:14 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote: Galen wrote: I'm working on a web spider application where the server has considerable latency in serving the information I require, but simultaneous requests do not have a significant performance hit. I have a nice little class that handles all the sessions, cookies, etc perfectly. What's the best way to basically hand off a bunch of threads to access this information without hanging up the execution of my script? I plan to handle inter-thread coordination via MySQL and code in the main script. I've done threads before like this and have had great luck, but all my solutions have been hack-ish at best. What are the cleanest solution for this? What do you all do to handle situations like this? I will be running PHP 4.3.1.0 under Linux and Mac OS X, depending on location. Thoughts anybody? nonblocking sockets and socket_select in a while loop. Or execute more processes. php does not have thread support -- 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] Adding up query results
I hope someone can help with this frustratingly simple (I assume!) question I have. I run this mysql query: select sum(quantity)*price,price from sale where dvd_id=1 group by price; I get this result: sum(quantity)*price price 450.00 15.00 29.99 29.99 I want to display the sum of the values in the first column (450.00+29.99), but I cannot figure out how to do this! Can someone clue me in? Thanks a million, Nathan -- Nathan Mealey Website Manager Administrative Director Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 210-7984 (512) 681-7043 Fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagejpeg() output
I'm trying to write an object oriented system for saving my uploaded files to a blog. I am using php to resize the original photos and save a thumbnail . When I get all done, I want to do something like this: $tempImageData = imagejpeg( $imageResource, '', 75 ); $outputHandler - save ( $tempImageData ); Where the $outputHandler is an object that knows how/where to save the file. However, I've noticed that imagejpeg() only returns a number 1. This worked on my previous server, but I'm guessing my new server has a newer version of php. What am I doing wrong? How can i pass the raw jpeg data to a function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Unit Tests - which framework to use?
--- dAniel hAhler [EMAIL PROTECTED] wrote: I'm looking for a PHP Unit Test framework and found so far: SimpleTest: https://sourceforge.net/projects/simpletest/ PEAR PHPUnit: - http://pear.php.net/package/PHPUnit - http://pear.php.net/package/PHPUnit2 Sourceforge PHPUnit: http://phpunit.sourceforge.net/ While SF PHPUnit seems to have stalled (2002-10) there are still PEAR PHPUnit and Simpletest. There is now a third option, Apache-Test, described here: http://shiflett.org/archive/80 I'm biased, being heavily involved with the effort to bring Apache-Test to PHP, but I find this to be far superior to any other testing framework for web applications. It is also the official testing framework for the Apache httpd project: http://httpd.apache.org/test/ Now PHP developers can also use Apache-Test. :-) Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly HTTP Developer's Handbook - Sams Coming Soon http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date()
Torsten, Whatever the combination, it echos February 02-2005brFebruary 02-2005brFebruary 02-2005. What is wrong with it? ?php $week5 = 2005-02-14; $firstDayTs = strtotime($week5); $lastDayTs = $firstDayTs + (4 * 86400); echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' . date('Y',$firstDayTs) .br; echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' . date('Y',$lastDayTs) .br; ? John Roehr wrote: John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I might be doing this backwards, but how do I extract the date from $week5 and display $week5 + 4 days. I would like to create a function so when I pass echo displaydate($week5); it echos February 14-18 $week0 = 2005-01-10; $week1 = 2005-01-17; $week2 = 2005-01-24; $week3 = 2005-01-31; $week4 = 2005-02-07; $week5 = 2005-02-14; $week6 = 2005-02-21; $week7 = 2005-02-28; `Doable´? Easy enough to learn how to do? John Hi John, // convert your data to a timestamp: $firstDayTs = strtotime($week5); // add 4 days $lastDayTs = $firstDayTs + (4 * 86400); echo date('F', $firstDayTs) . ' ' . date('m', $firstDayTs) . '-' . date('m', $lastDayTs); Not tested. Maybe there's an easier way to do this. Regards, Torsten Roehr -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. '''Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Appologies
Hello, I just wanted to send my apologies to anyone who got bounce-backs from me repeatedly. I upgraded my hosting package at my webhost and they switched servers on me without letting me know. Everything of mine was down and just now came back up, and I could not unsubscribe from the list. Once again, sorry for anyone affected. Thanks, Stephen Craton http://www.melchior.us
Re: [PHP] strange in MySQL Query.
... I dont know why .. is this mysql bug ? It's a known bug in MySQL. Since this is a PHP list, I leave it up to you to check what version fixed it. IIRC, it's possible to work around by making sure the first statement has the longest data type. -- More views at http://www.thorslund.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems upgrading
Guys. Maybe somebody lese has been having or had this problem while upgrading apache, mod_perl and php. I just upgraded from apache 1.3.29, mod_perl 1.29 and php 4.3.6 (due to the security issues) to apache 1.3.33, mod_perl 1.29 and php 4.3.10.. But I can get mod_perl to work... Everything compiled perfectly (Im using perl 5.8.0) but everytime I try to open a webpage, apache faults (core dumps). I tried removing mod_perl and everything works fine so I guess the problem is with mod_perl. I tried upgrading to perl 5.8.5 but now I have a problem compiling mod_perl, says it cant recognize the -mtune=pentium4 parameter in cc. Anybody knows how to get apache, mod_perl and php to compile and not fault? Im using RH9 BTW. Thx! Anton Krall -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php