[PHP] FTP problem with PHP 4.2.2 / AIX 4.3.2
Hi, I've just configured and installed sucessfully PHP 4.2.2 on my AIX server. Everything works good, except when I want to connect to a FTP server within a PHP script. I compiled PHP using the --enable-ftp option and phpinfo() tells me that FTP support is enabled. Here is a simple script I tried: ? $res = ftp_connect(127.0.0.1); echo res=$res; ? When executing this script I get the following output: Warning: php_hostconnect: connect failed in /www/nico/www/test.php on line 3 res= 127.0.0.1 is correctly configured as a FTP server !! I tried to connect to some others FTP server with the same result. Is there a problem with FTP support on AIX ? because I tried the same on Linux without any problem ? Does anyone know about this problem ? Nicolas. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cookie domain name
Hi all, If I want a cookie to work on both www.domain.com and domain.com what should I set as the domain for the cookie? I'm having trouble deleting cookies when they were set without the www., but attempted to delete without... Thanks, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl request works on command line but not in script
Hi, make sure you urlencode everything that is sent on the url, or as postvars. $d2 =urlencode($d2); and so on then curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch,CURLOPT_POSTFIELDS,$post); don't use the $testrequest, cause it has un-urlenoded values I think that should do the trick. Merijn van den Kroonenberg e-factory bv Tel.: +31 (0)475 - 340 975 Fax: +31 (0)475 - 320 351 Web: www.e-factory.nl - Original Message - From: Joshua Alexander [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 6:13 AM Subject: [PHP] Curl request works on command line but not in script Hi folks, I'm trying to send an XML request to a server to get its response back... I can get it to work on the command line (with passthru) but not with libcurl. I'm using libcurl 7.9.2 which may actually be different from the curl on the command line... the latter came with OS X, the former came from entropy.ch with the PHP package I installed. Of course my host is using 7.9.4 and the script doesn't work there either. I've tried it with both GET and POST... here are some setup variables. $testrequest = $server?API=RateXML=RateRequest USERID=\$userid\ PASSWORD=\$password\Package ID=\0\ServiceEXPRESS/ServiceZipOrigination20770/ZipOriginationZi pDestination20852/ZipDestinationPounds10/PoundsOunces0/OuncesCon tainerNone/ContainerSizeREGULAR/SizeMachinable/Machinable/Packag e/RateRequest; $post['API']=Rate\n; $post['XML']= 'RateRequest USERID=\$userid\ PASSWORD=\$password\Package ID=\0\ServiceEXPRESS/ServiceZipOrigination20770/ZipOriginationZi pDestination20852/ZipDestinationPounds10/PoundsOunces0/OuncesCon tainerNone/ContainerSizeREGULAR/SizeMachinable/Machinable/Packag e/RateRequest'\n; # (I've tried it with the 's and without, with the \n's and without) $d1 = API=Rate; $d2 = XML='RateRequest USERID=\$userid\ PASSWORD=\$password\Package ID=\0\ServiceEXPRESS/ServiceZipOrigination20770/ZipOriginationZi pDestination20852/ZipDestinationPounds10/PoundsOunces0/OuncesCon tainerNone/ContainerSizeREGULAR/SizeMachinable/Machinable/Packag e/RateRequest'; $ch = curl_init(); # doesn't work, returns Error 400 curl_setopt($ch, CURLOPT_URL, $testrequest); # also doesn't work, returns BAD REQUEST curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch,CURLOPT_POSTFIELDS,$post); # what DOES work passthru(curl -d . $d1 . -d . $d2 . $server); Any ideas? -Josh -- 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] Arrays within arrays question
I have the following loop to insert data into an array: while ($data = pg_fetch_object($res)) { $aProds[] = array('id' = $data-prod_id, 'quantity' = $data-quantity); } But when I print this out using print_r I get the following: Array ( [0] = Array ( [0] = Array ( [id] = 289000100024 [quantity] = 1 ) [1] = Array ( [id] = 289000100050 [quantity] = 1 ) ) ) This array has only one element in it; not what I wanted. I wanted something like this: Array ( [0] = Array ( [id] = 289000100024 [quantity] = 1 ) [1] = Array ( [id] = 289000100050 [quantity] = 1 ) ) How can I achieve this? Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_match
hi all, i'm trying to create an script that cut's the text when a . ( dot ) is found in one of the last words.. i'm trying it with preg_match but it seems not to work. this is what i'm trying : if($i==15) { if(preg_match(/./,$text2[15])) { $text3 .= ($i $text2[15] ); break; } } could some one tell me what i'm doing wrong? thnx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays within arrays question
Okay, it may be the end of a long day here, but I can't tell the difference between the two arrays you posted! Justin on 28/08/02 5:31 PM, Jean-Christian Imbeault ([EMAIL PROTECTED]) wrote: I have the following loop to insert data into an array: while ($data = pg_fetch_object($res)) { $aProds[] = array('id' = $data-prod_id, 'quantity' = $data-quantity); } But when I print this out using print_r I get the following: Array ( [0] = Array ( [0] = Array ( [id] = 289000100024 [quantity] = 1 ) [1] = Array ( [id] = 289000100050 [quantity] = 1 ) ) ) This array has only one element in it; not what I wanted. I wanted something like this: Array ( [0] = Array ( [id] = 289000100024 [quantity] = 1 ) [1] = Array ( [id] = 289000100050 [quantity] = 1 ) ) How can I achieve this? Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays within arrays question
Justin French wrote: Okay, it may be the end of a long day here, but I can't tell the difference between the two arrays you posted! One array contains only one element. That one element contains two elements, each and array with two elements. The other array contains two elements, each element being an array itself with two elements. Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match
On Wednesday 28 August 2002 15:39, [EMAIL PROTECTED] wrote: hi all, i'm trying to create an script that cut's the text when a . ( dot ) is found in one of the last words.. i'm trying it with preg_match but it seems not to work. this is what i'm trying : if($i==15) { if(preg_match(/./,$text2[15])) { $text3 .= ($i $text2[15] ); break; } } could some one tell me what i'm doing wrong? The period (.) has a special meaning within regexes, it matches any character. Read manual for full details. You need to escape special characters using a backslash ie: /\./ -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* We Americans, we're a simple people... but piss us off, and we'll bomb your cities. -- Robin Williams, _Good Morning Vietnam_ */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match
hi, yes, you have to escape the '.' because it has a special meaning, it matches on Any character (except newline maybe). But you probably do not need a preg_match anyway. Merijn van den Kroonenberg e-factory bv Tel.: +31 (0)475 - 340 975 Fax: +31 (0)475 - 320 351 Web: www.e-factory.nl - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 9:39 AM Subject: [PHP] preg_match hi all, i'm trying to create an script that cut's the text when a . ( dot ) is found in one of the last words.. i'm trying it with preg_match but it seems not to work. this is what i'm trying : if($i==15) { if(preg_match(/./,$text2[15])) { $text3 .= ($i $text2[15] ); break; } } could some one tell me what i'm doing wrong? thnx -- 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] Arrays within arrays question
On Wednesday 28 August 2002 15:31, Jean-Christian Imbeault wrote: I have the following loop to insert data into an array: while ($data = pg_fetch_object($res)) { $aProds[] = array('id' = $data-prod_id, 'quantity' = $data-quantity); } But when I print this out using print_r I get the following: Array ( [0] = Array ( [0] = Array ( [id] = 289000100024 [quantity] = 1 ) [1] = Array ( [id] = 289000100050 [quantity] = 1 ) ) ) This array has only one element in it; not what I wanted. I wanted something like this: Array ( [0] = Array ( [id] = 289000100024 [quantity] = 1 ) [1] = Array ( [id] = 289000100050 [quantity] = 1 ) ) How can I achieve this? If $aProds can contain more than 1 item then what you're doing now is correct. If $aProds will only ever contain 1 item then use: $aProds = array('id' = $data-prod_id, 'quantity' = $data-quantity); But then you can drop the while-loop and probably can just do: $aProds = pg_fetch_object($res); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Q: What is the difference between a duck? A: One leg is both the same. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays within arrays question
Jason Wong wrote: If $aProds can contain more than 1 item then what you're doing now is correct. Thanks. The problem was that I was doing this: $return[] = get_array_of_prods(); the [] was creating the extra array level ... The problem I now face is that foreach keeps crapping out if I pass it an unitialized (i.e. has no value) array. Foreach is happy with empty arrays but not arrays that have not been assigned anything yet ... Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] use curl.so with php4.1.0 and apache1.3.22 and curl7.9.8
When I restart apache this is the message: Stopping httpd:[ OK ] Starting httpd: PHP Warning: Unable to load dynamic library '/usr/lib/php4/curl.so' - /usr/lib/php4/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0 [ OK ] Help me please ? Saluti Stefano -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Host
Bruce -- ...and then Bruce Karstedt said... % % Anyone care to recommend a host as follows: % % Unix % PHP % MySQL % Domain Reg. % No unusual size or traffic requirements (now) We host with datapipe.net and I've been quite happy; excellent bandwidth, good uptime, tech support that meets my needs, and so on. If you didn't wnat to pay their price (a little steep but it works for the stuff we do on our server), I can handle your hosting needs as another customer on our server, particularly based on the very very lean requirements you've just set. Hey, I'll even give you email ;-) % % Pay by Check (my company will not allow the used of company credit cards % over the Internet.) Not a problem. % % Bruce Karstedt % President % Technology Consulting Associates, Ltd. % Tel: 847-735-9488 % Fax: 847-735-9474 HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg76902/pgp0.pgp Description: PGP signature
[PHP] that UNIX permissions thing again -- sort of
Hi, all -- I promise I'm not asking the same old question :-) Our image gallery application takes a directory tree of images uploaded by the user and then does all sorts of magic to make thumbnails, track comments, and so on. The only thing owned by the user is the directory tree and its contents; everything else is owned by the web server ID. All of this works well until a user wants to change the name of a subtree in the source directory; all of the 'nails are lost (since they're now unrelated to the source tree, and they just hang around taking up space), and even worse all of the comments are lost. The problem, of course, is that the user can't rename the cache directory and the web server can't rename the source directory. Has anyone already solved this problem -- preferably without reeking too terribly of a kludge? We've already thought of a script that the user calls which renames the cache side and then says OK, so *now* go and rename the source side with ftp like you would anyway but that's not pretty by any stretch. I just can't get past the concept that we're mixing user ID and web server ID and that you just can't. Of course, if the same old question (How do I have the web server do things in a user way?) has finally been answered, please let me know ;-) TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg76903/pgp0.pgp Description: PGP signature
Re: [PHP] Apostrophe in preg_match?
I'm trying to get an apostrophe (and a dash, as well) to be included in a preg_match expression, but I don't know how to escape the characters. The manual discusses which characters need escaping and how to escape characters: http://www.php.net/manual/en/pcre.pattern.syntax.php ?php if (preg_match(^[!a-zA-Z-/\\\'/]^, $_POST['ssname'])) die (h5Numbers and special characters not allowed in 'Surname'brbr Click 'Back' on your browser to re-enter information./h5); ? Any help will be greatly appreciated. Keep it simple: [^a-zA-Z-'] Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CHM 8th sample is out
Hi! The 8th sample of the New CHM Edition of the PHP Manual is out now. It fixes the *.js selection problem in the preferences application, and many bugs experienced by IE6 users: - example ugliness is away - horizontal scroll problems are away - context menu placement is fixed All these errors occured because the modified standard compliant object model of IE6. In addition to these bug fixes two small new features were added. Now you can access both of the context menus (one with right click, the other with CTRL+right click), so you only need to select your prefered menu. The custom context menu is also placed inside the window if you right click at the edge (much like the system context menu), and is not forced to the right-bottom direction of the place where you click. The Friendly HTTP error message problem does not seem to be solveable, so I included a reg file in the distribution to ease the fix for IE6 users (please also read details on the CHM's page). http://weblabor.hu/php-doc-chm/ The question is what new bugs I have added with these fixes? ;) Goba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No Localhost with apache?
Hi Guys, I have a real funny problem that I have never encountered before.. I went to hotscripts and downloaded PHPTriad and SpaceServer (In case you are not familiar with the programsthe programs are supposed to install Apache/MySql/PHP/Perl on my system and configure it automatically...) Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using localhost as some programs are configured that way... Plz help and thanks in advance. Cheers, -Ryan.
[PHP] Window/Page/Browser/Screen width
Hi, I've seen similar questions in archives so sorry if I'm asking the same thing again! Is it possible, using php, to get the screen, page, or window width? My aim would be to have a set of picture thumbnails, and give the html the best number of columns depending on the size of the display. I'd rather not use java, because many people have it turned off (even though I wouldn't be exploiting it!) Cheers, --Rick __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No Localhost with apache?
Hi Ryan, Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using localhost as some programs are configured that way... =What does a ping localhost and/or 127.0.0.1 give you? =Please advise, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with PHP 4.2.2 and *IMAP*
Yes. Another poor soul who is having problems with PHP and installing the IMAP library. I've installed Apache 1.3.26, PHP 4.2.2 and MySQL and they all work just fine together. But I want IMAP as well, because I want my webmail app to work. I compiled PHP like so: $./configure --with-apache=[valid path to apache source] --with-imap --with-kerberos and there were no errors to speak of. It created many of these files in my php-source-directory/ext/imap: config.m4 imap.dsp libimap.la Makefile php_imap.c php_imap.lo setup.stub CREDITSIMAP_Win32_HOWTO.txt libs.mk Makefile.in php_imap.h php_imap.o The only file that is missing from my entire system - I have looked - is php_imap.so. Oh sure, php_imap.LO is here, but no php_imap.so. And so Apache barfs but keeps going when I go and start it: [root@ns apache_1.3.26]# /etc/rc.d/init.d/apache start PHP Warning: Unable to load dynamic library '/usr/local/lib/php_imap.so' - /usr/local/lib/php_imap.so: No such file or directory Of course, I know it isn't in /usr/local/lib but it isn't anywhere on my system. How do I get this gosh darn php_imap.so file?? I would graciously appreciate a reply by email because these are such active groups. Thank you. Ryan Faricy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SV: [PHP-DEV] How to specify exstension_dir in PHP.ini for Windows
On Wed, Aug 28, 2002 at 01:16:44PM +0200, Steinar Kolnes wrote : Thanks for the respond, I am actually using 'extension_dir' There was only a typos in the e-mail. The question however; how do I specify the directory ?? Chances are pretty high that you've modified the wrong php.ini . Please ask further question on php-general -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Window/Page/Browser/Screen width
Hi Rick Check out list archives for last week (and the week before...) keyword: resolution. Also check out HTML, which will cheerfully slap text and graphics together an adapt to local peculiarities. Regards, =dn I've seen similar questions in archives so sorry if I'm asking the same thing again! Is it possible, using php, to get the screen, page, or window width? My aim would be to have a set of picture thumbnails, and give the html the best number of columns depending on the size of the display. I'd rather not use java, because many people have it turned off (even though I wouldn't be exploiting it!) Cheers, --Rick __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- 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] Window/Page/Browser/Screen width
Hi Rick, The important thing to remember is that PHP (as any other similar language) is a server-side scripting language. It won't help you getting your client details apart of those sent in HTTP headers. You should rather consider looking into JavaScript capabilities to accomplish your task. HTH, Stas - Original Message - From: Rick Selby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 12:02 PM Subject: [PHP] Window/Page/Browser/Screen width Hi, I've seen similar questions in archives so sorry if I'm asking the same thing again! Is it possible, using php, to get the screen, page, or window width? My aim would be to have a set of picture thumbnails, and give the html the best number of columns depending on the size of the display. I'd rather not use java, because many people have it turned off (even though I wouldn't be exploiting it!) Cheers, --Rick __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- 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] Window/Page/Browser/Screen width
Woah, sorry, somehow I missed that thread. Cheers. --- DL Neil [EMAIL PROTECTED] wrote: Hi Rick Check out list archives for last week (and the week before...) keyword: resolution. Also check out HTML, which will cheerfully slap text and graphics together an adapt to local peculiarities. Regards, =dn I've seen similar questions in archives so sorry if I'm asking the same thing again! Is it possible, using php, to get the screen, page, or window width? My aim would be to have a set of picture thumbnails, and give the html the best number of columns depending on the size of the display. I'd rather not use java, because many people have it turned off (even though I wouldn't be exploiting it!) Cheers, --Rick __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- 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 __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Window/Page/Browser/Screen width
On Wednesday 28 August 2002 19:02, Rick Selby wrote: I've seen similar questions in archives so sorry if I'm asking the same thing again! What were the answers in the archive? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* We are drowning in information but starved for knowledge. -- John Naisbitt, Megatrends */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stepping through an array more than once
Hi I would like to do something like the following: I have a table that contains a bunch of info at various stages. To optimize the load on the db, I was thinking it would be better to do a select * from table , and then use PHP to sort through the results, rather than have 3 SQL's with where status=xxx . There are essentially 3 stages or states at which the data in the table can be sorted, so I would need to loop through the array 3 times in order to display the entire contents of the table ordered by the 3 statges. This is my first attempt: $sql_it = 'select * from tickets '; $result_it = mysql_query($sql_it); echo 'New Tickets br'; $count = 0; while ($myrow_it = mysql_fetch_assoc($result_it)) { $status = $myrow_it[status]; if ($status == OPEN) { $company = $myrow_it[company]; $title = $myrow_it[title]; $content = $myrow_it[content]; echo $company.' :: '.$title.' :: '.$content.'br'; $count++; } } echo 'Total New:'.$count.'br'; echo 'Current Tickets br'; while ($myrow_it = mysql_fetch_assoc($result_it)) { $status = $myrow_it[status]; if ($status == CURRENT) { $company = $myrow_it[company]; $title = $myrow_it[title]; $content = $myrow_it[content]; echo $company.' :: '.$title.' :: '.$content.'br'; } } echo 'Old Tickets br'; while ($myrow_it = mysql_fetch_assoc($result_it)) { $status = $myrow_it[status]; if ($status == OLD) { $company = $myrow_it[company]; $title = $myrow_it[title]; $content = $myrow_it[content]; echo $company.' :: '.$title.' :: '.$content.'br'; } } Now, obviously this only echoes the first part, as it seems the array is at the end when it tries to loop through again. I tried a reset($myrow_it) , but it drops an error about $myrow_it not being an array. I'm not sure if my logic here is correct. Is this the way to re-loop the array? Hope I explained what I am trying to do well enough. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with PHP and Apache..
Hi! I have been struggling with getting PHP 4.2.2 to load with Apache 1.3.26 for a few days now, and after searching through the archives to find that others have had this problem (yet I couldn't find any replies in the archives), I thought I might ask myself. :) I'm hoping for better luck. I have Apache 1.3.26, running on Solaris 9. I compiled and installed PHP with no problems. When I start Apache, it gives the following error: Syntax error on line 249 of /etc/apache/httpd.conf: Cannot load /usr/apache/libexec/libphp4.so into server: ld.so.1: /usr/apache/bin/httpd: fatal: relocation error: file /usr/apache/libexec/libphp4.so: symbol __cmpdi2: referenced symbol not found Help? I've attached some additional information at the end of the email. If anyone needs anymore information, please let me know. Thanks! Ever lovable and always scrappy, kawaii Raise the Dour Roger! - Rob [/home/kawaii] (8:31)ldd -r /usr/apache/libexec/libphp4.so libdl.so.1 =/usr/lib/libdl.so.1 libpam.so.1 = /usr/lib/libpam.so.1 libz.so.1 = /usr/lib/libz.so.1 libcrypt_i.so.1 = /usr/lib/libcrypt_i.so.1 libresolv.so.2 =/usr/lib/libresolv.so.2 libm.so.1 = /usr/lib/libm.so.1 libnsl.so.1 = /usr/lib/libnsl.so.1 libsocket.so.1 =/usr/lib/libsocket.so.1 libc.so.1 = /usr/lib/libc.so.1 libcmd.so.1 = /usr/lib/libcmd.so.1 libgen.so.1 = /usr/lib/libgen.so.1 libmp.so.2 =/usr/lib/libmp.so.2 /usr/platform/SUNW,UltraSPARC-IIi-cEngine/lib/libc_psr.so.1 symbol not found: top_module (/usr/apache/libexec/libphp4.so) symbol not found: ap_user_name (/usr/apache/libexec/libphp4.so) symbol not found: ap_max_requests_per_child (/usr/apache/libexec/libphp4.so) symbol not found: ap_server_root (/usr/apache/libexec/libphp4.so) symbol not found: ap_user_id (/usr/apache/libexec/libphp4.so) symbol not found: ap_group_id (/usr/apache/libexec/libphp4.so) symbol not found: ap_block_alarms (/usr/apache/libexec/libphp4.so) symbol not found: ap_unblock_alarms (/usr/apache/libexec/libphp4.so) symbol not found: ap_rwrite (/usr/apache/libexec/libphp4.so) symbol not found: ap_rflush (/usr/apache/libexec/libphp4.so) symbol not found: ap_signal (/usr/apache/libexec/libphp4.so) symbol not found: ap_hard_timeout (/usr/apache/libexec/libphp4.so) symbol not found: ap_get_client_block (/usr/apache/libexec/libphp4.so) symbol not found: ap_reset_timeout (/usr/apache/libexec/libphp4.so) symbol not found: ap_table_get (/usr/apache/libexec/libphp4.so) symbol not found: ap_pstrdup (/usr/apache/libexec/libphp4.so) symbol not found: ap_table_add (/usr/apache/libexec/libphp4.so) symbol not found: ap_table_set (/usr/apache/libexec/libphp4.so) symbol not found: ap_send_http_header (/usr/apache/libexec/libphp4.so) symbol not found: ap_log_error (/usr/apache/libexec/libphp4.so) symbol not found: ap_block_alarms (/usr/apache/libexec/libphp4.so) symbol not found: ap_register_cleanup (/usr/apache/libexec/libphp4.so) symbol not found: ap_unblock_alarms (/usr/apache/libexec/libphp4.so) symbol not found: ap_getword (/usr/apache/libexec/libphp4.so) symbol not found: ap_uudecode (/usr/apache/libexec/libphp4.so) symbol not found: ap_getword_nulls_nc (/usr/apache/libexec/libphp4.so) symbol not found: ap_setup_client_block (/usr/apache/libexec/libphp4.so) symbol not found: ap_add_common_vars (/usr/apache/libexec/libphp4.so) symbol not found: ap_add_cgi_vars (/usr/apache/libexec/libphp4.so) symbol not found: ap_kill_timeout (/usr/apache/libexec/libphp4.so) symbol not found: ap_update_mtime (/usr/apache/libexec/libphp4.so) symbol not found: ap_set_last_modified (/usr/apache/libexec/libphp4.so) symbol not found: ap_set_etag (/usr/apache/libexec/libphp4.so) symbol not found: ap_add_version_component (/usr/apache/libexec/libphp4.so) symbol not found: ap_child_terminate (/usr/apache/libexec/libphp4.so) symbol not found: ap_sub_req_lookup_uri (/usr/apache/libexec/libphp4.so) symbol not found: ap_destroy_sub_req (/usr/apache/libexec/libphp4.so) symbol not found: ap_run_sub_req (/usr/apache/libexec/libphp4.so) symbol not found: ap_pstrndup (/usr/apache/libexec/libphp4.so) symbol not found: ap_table_setn (/usr/apache/libexec/libphp4.so) symbol not found: __cmpdi2 (/usr/apache/libexec/libphp4.so) symbol not found: __floatdidf (/usr/apache/libexec/libphp4.so) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stepping through an array more than once
Actually, it's not accurate for me to say stepping through an array more than once, as I want to step through the database ( $result) more than once, without having to make connections to the db again. Can this be done? On Wed, 2002-08-28 at 13:58, Petre Agenbag wrote: Hi I would like to do something like the following: I have a table that contains a bunch of info at various stages. To optimize the load on the db, I was thinking it would be better to do a select * from table , and then use PHP to sort through the results, rather than have 3 SQL's with where status=xxx . There are essentially 3 stages or states at which the data in the table can be sorted, so I would need to loop through the array 3 times in order to display the entire contents of the table ordered by the 3 statges. This is my first attempt: $sql_it = 'select * from tickets '; $result_it = mysql_query($sql_it); echo 'New Tickets br'; $count = 0; while ($myrow_it = mysql_fetch_assoc($result_it)) { $status = $myrow_it[status]; if ($status == OPEN) { $company = $myrow_it[company]; $title = $myrow_it[title]; $content = $myrow_it[content]; echo $company.' :: '.$title.' :: '.$content.'br'; $count++; } } echo 'Total New:'.$count.'br'; echo 'Current Tickets br'; while ($myrow_it = mysql_fetch_assoc($result_it)) { $status = $myrow_it[status]; if ($status == CURRENT) { $company = $myrow_it[company]; $title = $myrow_it[title]; $content = $myrow_it[content]; echo $company.' :: '.$title.' :: '.$content.'br'; } } echo 'Old Tickets br'; while ($myrow_it = mysql_fetch_assoc($result_it)) { $status = $myrow_it[status]; if ($status == OLD) { $company = $myrow_it[company]; $title = $myrow_it[title]; $content = $myrow_it[content]; echo $company.' :: '.$title.' :: '.$content.'br'; } } Now, obviously this only echoes the first part, as it seems the array is at the end when it tries to loop through again. I tried a reset($myrow_it) , but it drops an error about $myrow_it not being an array. I'm not sure if my logic here is correct. Is this the way to re-loop the array? Hope I explained what I am trying to do well enough. -- 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] Stepping through an array more than once
From: Petre Agenbag [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 8:17 AM To: Petre Agenbag Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Stepping through an array more than once Actually, it's not accurate for me to say stepping through an array more than once, as I want to step through the database ( $result) more than once, without having to make connections to the db again. Can this be done? Yes, see mysql_data_seek() http://www.php.net/manual/en/function.mysql-data-seek.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stepping through an array more than once
Try unset($myrow_it). You don't want to reset the array, you want to clear it, then use a new array (with the same name, and the same $result) for another while loop. FWIW, I'm pretty sure I'd just use three distinct queries. Infact, it'd be worth you timing your scripts with both these versions to see what works out quicker -- three queries, or lots of if() statements [remember, you're in a while loop, so 5000 rows * 3 if statements = 15000!!] Put this at the top: ? $show_timer = 1; function getmicrotime() { list($usec, $sec) = explode( ,microtime()); return ((float)$usec + (float)$sec); } $time_start = getmicrotime(); ? And this at the end: ? if($show_timer) { $time_end = getmicrotime(); $timer = $time_end - $time_start; echo Timer: {$timer}BR; } ? Run the script with both versions about 10 times each, and take the average :) There are many many ways I can see that you could clean up and optimise the script you've shown (not intended as an insult AT ALL!) -- quite possibly some of these would make more of a difference to your performance than limiting yourself to just one query... at the very least, it would make updating the script easier, and reduce the lines of code. Good luck, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SV: SV: [PHP-DEV] How to specify extension_dir in PHP.ini for Windows
On Wed, Aug 28, 2002 at 02:09:57PM +0200, Steinar Kolnes wrote : When changing the directory to the latter it seems that it finds something because it comes up with an new error message: The procedure entry point _Zend_list_delete could not be located in the dynamic link library php4ts.dll That sympton occurs if you the PHP version you're using differes from the one the library was linked against. Make sure you don't mix up those and always only use php and libs from the very same distribution. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stepping through an array more than once
On Wednesday 28 August 2002 20:16, Petre Agenbag wrote: Actually, it's not accurate for me to say stepping through an array more than once, as I want to step through the database ( $result) more than once, without having to make connections to the db again. Can this be done? mysql_data_seek() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I don't know who my grandfather was; I am much more concerned to know what his grandson will be. -- Abraham Lincoln */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using variable ..help
I wanna do with my TR bgcolor trough my array ?$mycolor = array(#E8D0E8, #F8EFF8);? table ?php while ($row=mysql_fetch_array($result)){? tr bgcolor=?for($i=0;$i=count($mycolor[$i]);++$i){ echo ($mycolor[$i]); } ? tdblablabbaba/td /tr ? } ? /table I have look my view source output my TR bgcolor , and i found this below tr bgcolor=#E8D0E8#F8EFF8 I want my tr bgcolor display with one by one like this below tr bgcolor=#E8D0E8 td/td /tr tr bgcolor=#F8EFF8 td/td /tr etc help please. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays within arrays question
I always put an if(is_array($var)) to check if an array was actually return. On Wednesday, August 28, 2002, at 04:49 AM, Jean-Christian Imbeault wrote: Jason Wong wrote: If $aProds can contain more than 1 item then what you're doing now is correct. Thanks. The problem was that I was doing this: $return[] = get_array_of_prods(); the [] was creating the extra array level ... The problem I now face is that foreach keeps crapping out if I pass it an unitialized (i.e. has no value) array. Foreach is happy with empty arrays but not arrays that have not been assigned anything yet ... Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Does this call for an array?
Here is what I would like to do. I have a simple form that asks for information from a customer. One of the questions is Which categories of products are you interested in? I want to store all the data in a table called pf_survey. All the categories(42) are already listed in a separate table called categories. I don't think I want to repeat a list of columns in the pf_survey table if they are already in the categories table. The categories table is simply category_id and category_name. If my form has a checkbox by each category name with the corresponding category_id in the value field - how do I concatenate all the boxes checked in order to put more than one category_id in the pf_survey category_ids field? Does this call for an array? Does it even make sense to do it like this? Thank you for any help. Duffy Betterton Director of Publications 615-277-3265 [EMAIL PROTECTED] www.mtadistributors.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apostrophe in preg_match?
Thanks DL, I've read that part of the manual. My original syntax was as you suggested [^a-zA-Z-'], but the PostgreSQl query barfed on the apostrophe. The preg_match works, but the db refuses to accept the apostrophe. Reading the postgresql docs, they suggest escaping the character, but since the variable is contained in $_POST['ssname'] I don't know how to get the escaped character inserted into this POST'd variable. After the validation check : if (!preg_match(^[a-zA-Z-/\'/]^, $_POST['ssname'])) die . . . . . the POST'd variable is transformed: $_POST['ssname'] = ucwords({$_POST['ssname']}); $_SESSION['ssname'] = $_POST['ssname']; $_SESSION['ssname'] = ucwords({$_SESSION['ssname']}); and then inserted into the db: INSERT INTO sponsor (sid, sfname, ssname, . . . '{$_SESSION['ssname']}', . . . . So, how would I get this escaped character into the db? Any further help would be greatly appreciated. I'm stumped on this one. Perhaps, I'll have to exclude apostrophes, but there must be a way?? Tia, Andre On Wednesday 28 August 2002 06:16 am, DL Neil wrote: I'm trying to get an apostrophe (and a dash, as well) to be included in a preg_match expression, but I don't know how to escape the characters. The manual discusses which characters need escaping and how to escape characters: http://www.php.net/manual/en/pcre.pattern.syntax.php ?php if (preg_match(^[!a-zA-Z-/\\\'/]^, $_POST['ssname'])) die (h5Numbers and special characters not allowed in 'Surname'brbr Click 'Back' on your browser to re-enter information./h5); ? Any help will be greatly appreciated. Keep it simple: [^a-zA-Z-'] Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does this call for an array?
It calls for a intermediate table. You need 3 tables: pf_survey, categories and survey_cat They look like: pf_survey survey_id, Questions, Whatever, but no categories fields categories category_id, category_name survey_cat survey_id and category_id for each record in pf_survey you will have one or more records in survey_cat. Each record in servey_cat will be one of the tick boxes ticked for that survey_id... so 2 tick boxs, 2 records in survery_cat with the same survery_id... When accessing the data you will need to use some different SQL querys like the JOIN, and/or select more than one table at a time... This is the correct database relationship way of doing it, but if this is beyond you a cheap and nasty was would be to either: A)store a comma delimited list of cat_id in your pf_survey record. B)create a boolean field for each catorgy in your pf_survey table.. Hope this helps Andrew - Original Message - From: Duffy Betterton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 2:48 PM Subject: [PHP] Does this call for an array? Here is what I would like to do. I have a simple form that asks for information from a customer. One of the questions is Which categories of products are you interested in? I want to store all the data in a table called pf_survey. All the categories(42) are already listed in a separate table called categories. I don't think I want to repeat a list of columns in the pf_survey table if they are already in the categories table. The categories table is simply category_id and category_name. If my form has a checkbox by each category name with the corresponding category_id in the value field - how do I concatenate all the boxes checked in order to put more than one category_id in the pf_survey category_ids field? Does this call for an array? Does it even make sense to do it like this? Thank you for any help. Duffy Betterton Director of Publications 615-277-3265 [EMAIL PROTECTED] www.mtadistributors.com -- 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 can I strip the code from HTML pages to extract the contents of a HTML page.
This may be an interesting challenge for someone or has it been done before Can some one help me. I am looking for a laboursaving method of extracting the contents of a web page (Text only) and dumping the rest of the html code. I need the contents to rework the pages and put the contents into flat file database. Large but only two columns of data. Simple to work with (no need for DB) - They are just alot of links on a links page. Scripts would be welcome. Ciao, Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] curl and UTF-8, follow up
Hi, This problem is solved now (thanks Wez Furlong). The problem was, that i had the mbstring php module enabled (check with phpinfo). By default this module encodes input data. After i added the following lines to the php.ini the problem was solved: mbstring.http_input = pass; mbstring.http_output = pass; bottomline, be carefull when activating this module, it might do more than you expect ;-) Merijn - Original Message - From: Merijn van den Kroonenberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 26, 2002 4:10 PM Subject: [PHP] curl and UTF-8, follow up I did some further testing, and i found that this behaviour is not consistent. Actually i am pretty puzzled about this. When i wrote the message below is was testing with a xml document that contained only the following multi byte utf chacracter: \303\253(octal utf8) (LATIN SMALL LETTER E WITH DIAERESIS) The output from CURL got automatically decoded to latin1. Then after i wrote the message i tested with another xml document that contained the following multi byte utf character: \342\202\254 (octal utf8) (EURO SIGN) I was suprised to see that the output was now correct UTF-8. Now i modified the first document and inserted the EURO SIGN in this document. When i process this document again, the CURL output is UTF-8. So it seems the output of CURL depends on what it detects on its imput, and it will try to convert the data to latin1 if possible?? Does anyone know how i can disable this behaviour? For me, CURL should not do any encoding of my data. Greetings, Merijn van den Kroonenberg - Original Message - From: Merijn van den Kroonenberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 26, 2002 2:36 PM Subject: [PHP] curl and UTF-8 Hello List, I have a problem with the php CURL module and UTF-8 data. My php script uses curl to do a post to a perl/cgi script. This perl script returns UTF-8 encoded XML. The perl script returns utf-8, i have verified that using the webserver logfiles, but the data that i receive in $result (see below) is decoded to ISO-8859-1. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $post_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $result = curl_exec ($ch);// UTF compatible? curl_close ($ch); Anyone an idea how i can get curl to return me UTF-8 data? Thank you, Merijn van den Kroonenberg -- 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
[PHP] Reconfigure PHP
I have installed GD, libpng, zlib, jpeg-6b, and FreeType 2. I now need to reconfigure PHP 'with' these additions. I don't understand how to determine what directories to point to for each of these 'with' statements. In Windows, I would just look for an exe, but under UNIX (Solaris 7) I not sure what the comparable file extensions are. I used 'pkgadd' command for these install programs: /usr/local/jpeg-6b-sol7-sparc-local /usr/local/libpng-1.2.0-sol7-sparc-local /usr/local/zlib-1.1.4-/sol7-sparc-local used 'make' in: /usr/local/src/freetype-2.1.2 and used 'make install' in: /usr/local/src/gd-2.0.1 I didn't specify any special installation instructions for these programs/libraries. How can I determine what directories to point the 'with' statements to? Thanks much. Zach Curtis POPULUS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apostrophe in preg_match?
Andre, Thanks DL, =a pleasure I've read that part of the manual. My original syntax was as you suggested [^a-zA-Z-'], but the PostgreSQl query barfed on the apostrophe. =these are two quite separate things (1) and (4): 1 accept input ($_POST) 2 validate input 3 prepare input for storage 4 store the input data The preg_match works, but the db refuses to accept the apostrophe. Reading the postgresql docs, they suggest escaping the character, but since the variable is contained in $_POST['ssname'] I don't know how to get the escaped character inserted into this POST'd variable. After the validation check : if (!preg_match(^[a-zA-Z-/\'/]^, $_POST['ssname'])) die . . . . . the POST'd variable is transformed: $_POST['ssname'] = ucwords({$_POST['ssname']}); $_SESSION['ssname'] = $_POST['ssname']; $_SESSION['ssname'] = ucwords({$_SESSION['ssname']}); and then inserted into the db: INSERT INTO sponsor (sid, sfname, ssname, . . . '{$_SESSION['ssname']}', . . . . So, how would I get this escaped character into the db? Any further help would be greatly appreciated. I'm stumped on this one. Perhaps, I'll have to exclude apostrophes, but there must be a way?? =with PHP there's usually a way... =throw 'escape database' (apostrophe will work too) at the PHP manual's search facility (the manual is really v.good!) and it will respond with a reference to ADDSLASHES(), which will do as you ask - there is also a reference to a PG function (I'm not a PostGres user so can't assess if that might hold some advantage in your situation). =hope that helps, =dn On Wednesday 28 August 2002 06:16 am, DL Neil wrote: I'm trying to get an apostrophe (and a dash, as well) to be included in a preg_match expression, but I don't know how to escape the characters. The manual discusses which characters need escaping and how to escape characters: http://www.php.net/manual/en/pcre.pattern.syntax.php ?php if (preg_match(^[!a-zA-Z-/\\\'/]^, $_POST['ssname'])) die (h5Numbers and special characters not allowed in 'Surname'brbr Click 'Back' on your browser to re-enter information./h5); ? Any help will be greatly appreciated. Keep it simple: [^a-zA-Z-'] Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I strip the code from HTML pages to extract the contents of a HTML page.
Carlos, I'm sorry, but am just leaving... If you check the PCRE RegEx pages of the annotated manual, there are contributed examples that will help in this situation (probably under preg_match_all() ) Regards, =dn This may be an interesting challenge for someone or has it been done before Can some one help me. I am looking for a laboursaving method of extracting the contents of a web page (Text only) and dumping the rest of the html code. I need the contents to rework the pages and put the contents into flat file database. Large but only two columns of data. Simple to work with (no need for DB) - They are just alot of links on a links page. Scripts would be welcome. Ciao, Carlos -- 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] using variable ..help
Remon, Your code works correct, cause you coded it this way as it should go through the array and output every element in the array into one line. If I got your idea correctly - you probably want you rows to be of two different colors. You may do it simplier way: table ? $mycolor = array(#E8D0E8, #F8EFF8); $index = 0; while ($row=mysql_fetch_array($result)) { ? tr bgcolor=? echo $mycolor[$index1]; ? tdblablabbaba/td /tr ? $index++; } ? /table The $index1 construct will return either 0 or 1 for even and odd rows, so the proper color will be selected. HTH, Stas - Original Message - From: Remon Redika [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 2:46 PM Subject: [PHP] using variable ..help I wanna do with my TR bgcolor trough my array ?$mycolor = array(#E8D0E8, #F8EFF8);? table ?php while ($row=mysql_fetch_array($result)){? tr bgcolor=?for($i=0;$i=count($mycolor[$i]);++$i){ echo ($mycolor[$i]); } ? tdblablabbaba/td /tr ? } ? /table I have look my view source output my TR bgcolor , and i found this below tr bgcolor=#E8D0E8#F8EFF8 I want my tr bgcolor display with one by one like this below tr bgcolor=#E8D0E8 td/td /tr tr bgcolor=#F8EFF8 td/td /tr etc help please. -- 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] pear installation fails
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Folk, i tried to install pear with lynx -source http://pear.php.net/go-pear | php -q After some time, i get an error-message: Downloading package: XML_Parser...ok Extracting installer..ok Fatal error: Can't use method return value in write context in /tmp/gopecc836o/PEAR/Command.php on line 134 Any Idea ? cu, Torsten. - -- Torsten Hahn / Chemnitzer Str. 4 / 09599 Freiberg / Germany mail: [EMAIL PROTECTED] phone: (+49) 177 2181338 pgp-key: http://www.physik.tu-freiberg.de/~hahn/pgp-key.txt -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9bN07Lv67WZAuOD0RArcSAKDEer40RWq/wuTznC5qRFEiEmBAdQCgptun elP4B83wDFqqZDLTp8Da0s8= =PPlN -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I strip the code from HTML pages to extract the contents of a HTML page.
the striptag function is what I think you want, it just removes all HTML tags and returns whatever is left php.net/striptag Andrew - Original Message - From: Charles Fowler [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 2:58 PM Subject: [PHP] How can I strip the code from HTML pages to extract the contents of a HTML page. This may be an interesting challenge for someone or has it been done before Can some one help me. I am looking for a laboursaving method of extracting the contents of a web page (Text only) and dumping the rest of the html code. I need the contents to rework the pages and put the contents into flat file database. Large but only two columns of data. Simple to work with (no need for DB) - They are just alot of links on a links page. Scripts would be welcome. Ciao, Carlos -- -- -- 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] Fun with Binary Numbers
Here's a question, Say I have a binary number like this 1101 0100 0110 0110 And I want to pull out of the binary number the third quartet (is that the right word) I want to know how to apply the mask to the number above so that the result would be 0100 Likewise, given the number: 1101 0100 0110 0110 and the mask the result 0110 I suppose this is the same algorithm used to separate the host from the node address given an IP address and a subnet mask. I just need to know what the algorithm is. Thanks David
Re: [PHP] Fun with Binary Numbers
Well, to begin with applying the mask to 1101 0100 0110 0110 is going to give you 110 not 110. But you can shift the result to the right 4 if that is the result you want. There is no algorithm to speak of here, just apply the mask. Like this: $num = 1101010001100110; $mask =; $result = bindec($num) bindec($mask); echo decbin($result); If you want only the second quartet of the result, do: $result = $result4; -Rasmus On Wed, 28 Aug 2002, David Buerer wrote: Here's a question, Say I have a binary number like this 1101 0100 0110 0110 And I want to pull out of the binary number the third quartet (is that the right word) I want to know how to apply the mask to the number above so that the result would be 0100 Likewise, given the number: 1101 0100 0110 0110 and the mask the result0110 I suppose this is the same algorithm used to separate the host from the node address given an IP address and a subnet mask. I just need to know what the algorithm is. Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fun with Binary Numbers
Hey Dave, It is much easier to use hex numbers when working with bits. Thus, the mask for the first (left) quartet would be 0xF000, second 0x0F00, third 0x00F0 and fourth 0x000F. To apply the mask use binary AND operator, which is in case of PHP. After applying the mask you need to shift-right (another binary operator) your number to the certain number of bits you want to omit: $result = ($yourNumber 0x0F00) 8; // for the third quartet Hope this helps, Stas - Original Message - From: David Buerer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 3:11 PM Subject: [PHP] Fun with Binary Numbers Here's a question, Say I have a binary number like this 1101 0100 0110 0110 And I want to pull out of the binary number the third quartet (is that the right word) I want to know how to apply the mask to the number above so that the result would be 0100 Likewise, given the number: 1101 0100 0110 0110 and the mask the result 0110 I suppose this is the same algorithm used to separate the host from the node address given an IP address and a subnet mask. I just need to know what the algorithm is. Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: CHM 8th sample is out
Great! The sample code in the manual looks much better. But I feel the function definition is not so visible. I almost didn't find it when I first look at the manual. I think add a blank line before and after function definition or use a special color could be better. Gabor Hojtsy [EMAIL PROTECTED] wrote in message 010401c24e7f$1e1745d0$0f0a@developer2">news:010401c24e7f$1e1745d0$0f0a@developer2... Hi! The 8th sample of the New CHM Edition of the PHP Manual is out now. It fixes the *.js selection problem in the preferences application, and many bugs experienced by IE6 users: - example ugliness is away - horizontal scroll problems are away - context menu placement is fixed All these errors occured because the modified standard compliant object model of IE6. In addition to these bug fixes two small new features were added. Now you can access both of the context menus (one with right click, the other with CTRL+right click), so you only need to select your prefered menu. The custom context menu is also placed inside the window if you right click at the edge (much like the system context menu), and is not forced to the right-bottom direction of the place where you click. The Friendly HTTP error message problem does not seem to be solveable, so I included a reg file in the distribution to ease the fix for IE6 users (please also read details on the CHM's page). http://weblabor.hu/php-doc-chm/ The question is what new bugs I have added with these fixes? ;) Goba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I strip the code from HTML pages to extract thecontents of a HTML page.
Either the ereg_replace, eregi_replace, or preg_replace has a full working script that does this, returning pretty much plain text. There's also the strip_tags()/striptags() function which strips out all PHP and HTML tags -- perhaps not enough, nice you'd want to remove *some* other stuff maybe, but it's a good start, and may be used in conjunction with other stuff. You haven't said if you want: - all the stuff between the body tags OR - all the stuff that isn't tags (would include the title, and perhaps other stuff As per usual, specifically asking for what you want helps, but there is HEAPS of ways of doing this. More than likely you'll find/build the components you need in different places: - recursively run through a directory for each HTML file - stripping each HTML file - possibly presenting the raw text in a TEXTAREA for previewing/modifying - adding the text to the DB, probably assigning the ID based on the original filename, or something Etc etc Good luck, Justin on 28/08/02 11:58 PM, Charles Fowler ([EMAIL PROTECTED]) wrote: This may be an interesting challenge for someone or has it been done before Can some one help me. I am looking for a laboursaving method of extracting the contents of a web page (Text only) and dumping the rest of the html code. I need the contents to rework the pages and put the contents into flat file database. Large but only two columns of data. Simple to work with (no need for DB) - They are just alot of links on a links page. Scripts would be welcome. Ciao, Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using variable ..help
I want my tr bgcolor display with one by one like this below tr bgcolor="#E8D0E8" td/td /tr tr bgcolor="#F8EFF8" td/td /tr Try this: /* -- from here -- */ ?php $mycolor = array("#E8D0E8", "#F8EFF8"); echo "table\n"; foreach ($mycolor as $value) { echo "tr bgcolor=\"$value\"\ntd/td\n/tr\n"; } echo "/table\n"; ? /* -- 'til here -- */ - E PS See: http://www.php.net/manual/en/control-structures.foreach.php I wanna do with my TR bgcolor trough my array ?$mycolor = array("#E8D0E8", "#F8EFF8");? table ?php while ($row=mysql_fetch_array($result)){? tr bgcolor="?for($i=0;$i=count($mycolor[$i]);++$i){ echo ("$mycolor[$i]"); } ?" tdblablabbaba/td /tr ? } ? /table I have look my view source output my TR bgcolor , and i found this below tr bgcolor="#E8D0E8#F8EFF8"" I want my tr bgcolor display with one by one like this below tr bgcolor="#E8D0E8" td/td /tr tr bgcolor="#F8EFF8" td/td /tr etc help please. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ きっと見つかるあなたの新居 不動産情報は MSN 住宅で http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] whats wrong with this?
I just cant seem to work out why this doesn't work. My PHP book doesn't explain if statements very well so i have no idea if i am breaking a rule. $system_day = date(j); for($day = 1; $day 32; $day++){ if($day = $system_day){ echo match!; } else{ echo no match; } } the problem i am experiencing is that it seems the if statement is setting the $day value to equal $system_day instead of comparing their values if i add echo Day: . $day . System_day: . $system_day; before and after the if statement then the first result is something like Day: 1 System_day: 29 after the if statement has executed the result is Day: 29 System_day: 29 so you see, instead of if comparing $day to $system_day it is making $day equal to $system_day. any ideas why and how to fix this? help is most appreciated :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] whats wrong with this?
you need to use == instead of = == is used when comparing values (i.e. is this == to that) = is used to set something's value (i.e. this = that) -chip -Original Message- From: Chris Barnes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 11:12 AM To: Php-General (E-mail) Subject: [PHP] whats wrong with this? I just cant seem to work out why this doesn't work. My PHP book doesn't explain if statements very well so i have no idea if i am breaking a rule. $system_day = date(j); for($day = 1; $day 32; $day++){ if($day = $system_day){ echo match!; } else{ echo no match; } } the problem i am experiencing is that it seems the if statement is setting the $day value to equal $system_day instead of comparing their values if i add echo Day: . $day . System_day: . $system_day; before and after the if statement then the first result is something like Day: 1 System_day: 29 after the if statement has executed the result is Day: 29 System_day: 29 so you see, instead of if comparing $day to $system_day it is making $day equal to $system_day. any ideas why and how to fix this? help is most appreciated :) -- 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] whats wrong with this?
A single = will assing a value, even inside an if statement A double = (ie ==) will perform a comparison between 2 values, returning true if they evaluate to the same value, false otherwise A triple = (===) will do the same as ==, but also check that the types of the 2 variables match. Check out the PHP manual - http://www.php.net/manual/ - for more info HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Chris Barnes [mailto:[EMAIL PROTECTED]] Sent: 28 August 2002 17:12 To: Php-General (E-mail) Subject: [PHP] whats wrong with this? I just cant seem to work out why this doesn't work. My PHP book doesn't explain if statements very well so i have no idea if i am breaking a rule. $system_day = date(j); for($day = 1; $day 32; $day++){ if($day = $system_day){ echo match!; } else{ echo no match; } } the problem i am experiencing is that it seems the if statement is setting the $day value to equal $system_day instead of comparing their values if i add echo Day: . $day . System_day: . $system_day; before and after the if statement then the first result is something like Day: 1 System_day: 29 after the if statement has executed the result is Day: 29 System_day: 29 so you see, instead of if comparing $day to $system_day it is making $day equal to $system_day. any ideas why and how to fix this? help is most appreciated :) -- 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] whats wrong with this?
(1) for($day = 1; $day 32; $day++){ (2) if($day = $system_day){ (3) echo match!; (4) } . . . Easy enough. One of those things the programmer may not spot, but a casual observer might. In line #2, you have a single =. A comparative = is a double equal (==). The line should read if($day == $system_day){. A single equal will assign the value; a double equal will compare the two. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and gnupg problems.
Hi, Appologies if this comes through twice. I tried to post it via goolg groups but it didn't seem to work. If I run the following script from within apache, then the script fails and returns $error=2 ?php $data=this is a test; $GNUPGHOME=/home/nobody/.gnupg; putenv(GNUPGHOME=$GNUPGHOME); $HOME=/home/nobody/; putenv(HOME=$HOME); system (echo '$data' |/usr/bin/gpg -vv --clearsign -u testing -o /home/httpd/html/nic/output --passphrase-fd 2 2/home/httpd/html/nic/test,$error); print $error; ? . I've seen quite a lot on the web about this suggesting that it's a permissions problem. However, If I add #!/usr/bin/php to the top of the script and make it executable, then su to 'nobody' (which appache runs as) then the script runs perfectly from the command line - so I think that the permissions are all OK. Any ideas where I'm going wrong? Regards, Jon Lawrence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: No Localhost with apache?
--- Ryan A [EMAIL PROTECTED] wrote in message 000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh">news:000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh... Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using localhost as some programs are configured that way... --- What is the value of ServerName in your httpd.conf file? I'm guessing that it's 127.0.0.1. If so, just change it to localhost and restart Apache. --- Seairth Jacobs [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with script - if possible
Hi All Thanks for everyones help in trying to get my script to work - I'm learning fast. But have the following problem: I am using the following select command for searching a table with regards to booked villas according to id number: $sql = SELECT COUNT(*) as count FROM bookings WHERE '$book_start_date' BETWEEN booking_start AND booking_end OR '$book_end_date' BETWEEN booking_start AND booking_end AND villa_id = '$place'; This counts as far as I believe an displays a 0 if available and number of times it occurs if unavailable. The problem I have is that still counts the number of entries regardless of the villa_id number it is given. In other words if I have a villa that is booked between 2002-04-10 and 2002-004-20 for villa_id 1 and I search using the same dates (via a FORM) but on villa_id 3 it still comes back and says that the villas is unavailable. Which of course it is wrong for villa_id 3 (it is villa_id 1 that is booked). I have tried to find a command (something like IF villa_id =3 THEN count) but to no avail that would only count if the villa_id matches as well. Can anyone help Thanks for your time. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with script - if possible
Try putting brackets round the date selection part. I think the database treats AND with a higher precedence than OR, and evaluates ANDs first. So what your query is doing is like A OR (B AND C) But what you want is (A OR B) AND C Where A is '$book_start_date' BETWEEN booking_start AND booking_end B is '$book_end_date' BETWEEN booking_start AND booking_end C is villa_id = '$place' HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Ray Healy (Data Net Services) [mailto:[EMAIL PROTECTED]] Sent: 28 August 2002 17:49 To: [EMAIL PROTECTED] Subject: [PHP] Help with script - if possible Hi All Thanks for everyones help in trying to get my script to work - I'm learning fast. But have the following problem: I am using the following select command for searching a table with regards to booked villas according to id number: $sql = SELECT COUNT(*) as count FROM bookings WHERE '$book_start_date' BETWEEN booking_start AND booking_end OR '$book_end_date' BETWEEN booking_start AND booking_end AND villa_id = '$place'; This counts as far as I believe an displays a 0 if available and number of times it occurs if unavailable. The problem I have is that still counts the number of entries regardless of the villa_id number it is given. In other words if I have a villa that is booked between 2002-04-10 and 2002-004-20 for villa_id 1 and I search using the same dates (via a FORM) but on villa_id 3 it still comes back and says that the villas is unavailable. Which of course it is wrong for villa_id 3 (it is villa_id 1 that is booked). I have tried to find a command (something like IF villa_id =3 THEN count) but to no avail that would only count if the villa_id matches as well. Can anyone help Thanks for your time. Ray -- 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] Re: No Localhost with apache?
Actually, the same thing happens if the ServerName directive was not set. But anyway, even if the default page doesn't show up, http://localhost/some.php would still work... - E --- "Ryan A" [EMAIL PROTECTED] wrote in message 000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh">news:000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh... Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using "localhost" as some programs are configured that way... --- What is the value of "ServerName" in your httpd.conf file? I'm guessing that it's "127.0.0.1". If so, just change it to "localhost" and restart Apache. --- Seairth Jacobs [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ 最新のファイナンス情報とライフプランのアドバイス MSN マネー http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: getting directory info
This is giving me a parse error: ?php $path = '/usr/local/...full.path.snipped.../httpdocs/thumbnails/'; $dir = opendir($path) or die(Could not open $dir); while ($file = readdir($dir)){ if (stristr($file, 'jpg') || stristr($file, 'jpeg')){ echo A HREF=/enlargements/$file$file/ABR\n; } } ?BR This is the only PHP on the page, so it arguably has to be in the above... :-( Wm Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... ?php $path = '/full/path/to/your/jpeg/dir/'; # Be sure it's world-readable! $dir = opendir($path) or die(Could not open $dir); while ($file = readdir($dir)){ if (stristr($file, 'jpg') || stristr($file, 'jpeg')){ echo A HREF=$file$file/ABR\n; } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: No Localhost with apache?
Hey, Thank you for replying... I checked the httpd.conf file and this is what I saw ServerName localhost ServerName 212.92.**.*** (The stars are numbers of course but I put them there to protect myself from evil genus's on the list :-) ) I have no idea what the second line is forapache still only responds to 127.0.0.1 Any new ideas? Cheers, -Ryan Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using localhost as some programs are configured that way... --- What is the value of ServerName in your httpd.conf file? I'm guessing that it's 127.0.0.1. If so, just change it to localhost and restart Apache. --- Seairth Jacobs [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
[PHP] Configure 'with' PHP
I am proceeding with adding support for gd-2.0.1, libpng-1.2.0, jpeg-6b, zlib-1.1.4, and freetype-2.1.2. The configure script is ending with an error. Here is my configure command as well. I am using PHP 4.0.6. ./configure \ --with-apxs=/usr/local/apache/bin/apxs \ --with-mysql=/usr/local/mysql \ --with-gd=/usr/local/src/gd-2.0.1 \ --with-png-dir=/usr/local/lib \ --with-zlib-dir=/usr/local/include \ --with-jpeg-dir=/usr/local/lib \ --with-freetype-dir=/usr/local/include/freetype2 configure: error: Unable to find libgd.(a|so) anywhere under /usr/local/include/freetype2. I search for libgd.so which is located in /usr/lib. What am doing wrong? Am I pointing to the correct gd location and/or freetype location? Regards, Zach Curtis POPULUS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] faxing
Does anyone know of a solution to get a script to actually connect with the POTS system (even through a 3rd party provider) and send a fax? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using localhost is taking me to localhost.com!!! why?
Hi again guys, Just tried to use http://localhost/ again but as I do so it takes me http://www.localhost.com tried it in both IE and NN with the same results... PLEASE help, -Ryan.
Re: [PHP] Using localhost is taking me to localhost.com!!! why?
This has nothing to do with PHP. You are missing a local DNS entry pointing localhost to 127.0.0.1 -Rasmus On Wed, 28 Aug 2002, Ryan A wrote: Hi again guys, Just tried to use http://localhost/ again but as I do so it takes me http://www.localhost.com tried it in both IE and NN with the same results... PLEASE help, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Configure 'with' PHP
On Thursday 29 August 2002 01:10, Zach Curtis wrote: I am proceeding with adding support for gd-2.0.1, libpng-1.2.0, jpeg-6b, zlib-1.1.4, and freetype-2.1.2. The configure script is ending with an error. Here is my configure command as well. I am using PHP 4.0.6. I search for libgd.so which is located in /usr/lib. What am doing wrong? Am I pointing to the correct gd location and/or freetype location? --with-gd=/usr -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A committee is a group that keeps the minutes and loses hours. -- Milton Berle */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: No Localhost with apache?
First, my mistake: "localhost" still works even if ServerName directive wasn't set... (More below) Hey, Thank you for replying... You're welcome :) I checked the httpd.conf file and this is what I saw ServerName localhost ServerName 212.92.**.*** Perhaps you can try taking one out and restart Apache then test again? (The stars are numbers of course but I put them there to protect myself from evil genus's on the list :-) ) If there are "evil genus's" on the list, I'm sure they can find out what those stars mean : I have no idea what the second line is forapache still only responds to 127.0.0.1 Any new ideas? Maybe you should ask the Apache ml... Cheers, -Ryan - Original Message - From: "@ Edwin" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 7:00 PM Subject: Re: [PHP] Re: No Localhost with apache? Actually, the same thing happens if the ServerName directive was not set. But anyway, even if the default page doesn't show up, http://localhost/some.php would still work... - E --- "Ryan A" [EMAIL PROTECTED] wrote in message 000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh">news:000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh... Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using "localhost" as some programs are configured that way... --- What is the value of "ServerName" in your httpd.conf file? I'm guessing that it's "127.0.0.1". If so, just change it to "localhost" and restart Apache. --- Seairth Jacobs [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ 最新のファイナンス情報とライフプランのアドバイス MSN マネー http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ かわいくて愉快なイラスト満載 MSN キャラクター http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] faxing
Mike Mannakee wrote: Does anyone know of a solution to get a script to actually connect with the POTS system (even through a 3rd party provider) and send a fax? Mike There are several fax over the internet providers out there. I used to work for one. That service was via email. You sent a email to a phone number by putting it into the destination email address ([EMAIL PROTECTED]). The fax had to be attached as a postscript or html file. You would get a email back with the status of the fax. Most of these services could only send faxes from a specific email address that you registered and paid for. The free ones added a banner ad to the top of the fax. A quick search for fax over the internet http://www.savetz.com/fax/ This is an FAQ. It even mentions my old compay. http://www.tpc.int/faxbyemail.html http://www.easylink.com/home/0_0.cfm http://www.efax.com/index.html http://www.fax4free.com/home.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using localhost is taking me to localhost.com!!! why?
shouldn't that just be /localhost/ rather than http://? Seems like the http://; part would be telling it to look for an actual website, which would default to a .com address... Wm Ryan A [EMAIL PROTECTED] wrote in message 04ae01c24eb6$8228edd0$61d396c1@l2zcaxu7emppqh">news:04ae01c24eb6$8228edd0$61d396c1@l2zcaxu7emppqh... Hi again guys, Just tried to use http://localhost/ again but as I do so it takes me http://www.localhost.com tried it in both IE and NN with the same results... PLEASE help, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] faxing
system(html2ps document.html); system(hylafax -somedirectives document.ps); I haven't got around to actually figuring this out, but this is my plan. James -Original Message- From: Mike Mannakee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 1:14 PM To: [EMAIL PROTECTED] Subject: [PHP] faxing Does anyone know of a solution to get a script to actually connect with the POTS system (even through a 3rd party provider) and send a fax? Mike -- 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] Are sessions affected by Unix user changes?
To clarify, session files ARE being created still, but they all have a length of 0. So it seems that the permissions to create a file are ok, but something else is wrong. Any idea why the file could be created, but would be empty? I'm perplexed. K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: No Localhost with apache?
Hmm... maybe there is a problem with your hosts file (in WinNT systems (NT/W2K/XP), I think you can find it in /winnt/system32/drivers/etc). Normally, you should have a line that looks like: 127.0.0.1 localhost # default localhost (the #default localhost is just a comment). If this entry is missing or different, I suppose it's possible to lose access to localhost altogether, though I don't know for sure (and don't want to test out either g). What happens when you ping localhost at a command prompt? --- Seairth Jacobs [EMAIL PROTECTED] Ryan A [EMAIL PROTECTED] wrote in message 049a01c24eb5$3b29fdd0$61d396c1@l2zcaxu7emppqh">news:049a01c24eb5$3b29fdd0$61d396c1@l2zcaxu7emppqh... Hey, Thank you for replying... I checked the httpd.conf file and this is what I saw ServerName localhost ServerName 212.92.**.*** (The stars are numbers of course but I put them there to protect myself from evil genus's on the list :-) ) I have no idea what the second line is forapache still only responds to 127.0.0.1 Any new ideas? Cheers, -Ryan Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using localhost as some programs are configured that way... --- What is the value of ServerName in your httpd.conf file? I'm guessing that it's 127.0.0.1. If so, just change it to localhost and restart Apache. --- Seairth Jacobs [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] Re: Using localhost is taking me to localhost.com!!! why?
Hey Wm, Nothing prevents you from running a webserver on your local host (unless of course you're on a corporate network where it's generally pooh-poohed by the AoH (Admins on High). Lots of developers run local webservers to check their work. And, since localhost refers to 127.0.0.1 or the local loopback address, http://localhost is a perfectly valid URL if one is running a webserver and trying to connect to that webserver from the same machine it's running on. :) Glenn On 10:52 AM 8/28/2002 -0700, Wm wrote: shouldn't that just be /localhost/ rather than http://? Seems like the http://; part would be telling it to look for an actual website, which would default to a .com address... --- Glenn E. Sieb System Administrator Lumeta Corporation +1 732 357-3514 (V) +1 732 564-0731 (Fax) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple regexp
Hi Folks, Seeking some guidance here. My regexp knowledge is pathetic. I want to do a simple validation of an ipv6 address. I just want to validate the entire string (not specific blocks) if it has the allowed charachters. I though ereg('[A-Fa-f0-9:]') would work, but it isn't. Anyone can help me with this? IPv6 addresses are just Hex with : characters, so I just need to validate that for the entire string. Thanks for your time. -- Adam Alkins http://www.rasadam.com --
Re: [PHP] Re: Using localhost is taking me to localhost.com!!! why?
OK, I learned something today... g I thought I'd usually seen localhost specified without the http:// , so I assumed there was a reason. Wm Glenn Sieb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey Wm, Nothing prevents you from running a webserver on your local host (unless of course you're on a corporate network where it's generally pooh-poohed by the AoH (Admins on High). Lots of developers run local webservers to check their work. And, since localhost refers to 127.0.0.1 or the local loopback address, http://localhost is a perfectly valid URL if one is running a webserver and trying to connect to that webserver from the same machine it's running on. :) Glenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and gnupg problems.
On Thursday 29 August 2002 00:19, Jon Lawrence wrote: If I run the following script from within apache, then the script fails and returns $error=2 ?php $data=this is a test; $GNUPGHOME=/home/nobody/.gnupg; putenv(GNUPGHOME=$GNUPGHOME); $HOME=/home/nobody/; putenv(HOME=$HOME); system (echo '$data' |/usr/bin/gpg -vv --clearsign -u testing -o /home/httpd/html/nic/output --passphrase-fd 2 2/home/httpd/html/nic/test,$error); print $error; ? . I've seen quite a lot on the web about this suggesting that it's a permissions problem. However, If I add #!/usr/bin/php to the top of the script and make it executable, then su to 'nobody' (which appache runs as) then the script runs perfectly from the command line - so I think that the permissions are all OK. Any ideas where I'm going wrong? Try doing everything with a single system() call. IE system(export HOME=$HOME; export ...; echo '$data' ...); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* You will have many recoverable tape errors. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SV: SV: SV: [PHP-DEV] How to specify extension_dir in PHP.ini for Windows
Markus, After reinstalling almost everything I am happy to report that PHP starts without any complaints about missing dll's or other error messages. So it seems that must have been some conflict with older versions. However I am still not able run any cURL functions like $ch = curl_init (http://www.example.com/;); Is there anything more I have to do like copying some other dll's or any form of black magic. It seem so close, but still .. It does not work. I always get this error: Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in d:\apache\htdocs\phonec\sms\send_sms.php on line 45 Best regards Steinar Kolnes -Opprinnelig melding- Fra: Markus Fischer [mailto:[EMAIL PROTECTED]] Sendt: August 28, 2002 1:25 PM Til: Steinar Kolnes Kopi: [EMAIL PROTECTED]; [EMAIL PROTECTED] Emne: Re: SV: SV: [PHP-DEV] How to specify extension_dir in PHP.ini for Windows On Wed, Aug 28, 2002 at 02:09:57PM +0200, Steinar Kolnes wrote : When changing the directory to the latter it seems that it finds something because it comes up with an new error message: The procedure entry point _Zend_list_delete could not be located in the dynamic link library php4ts.dll That sympton occurs if you the PHP version you're using differes from the one the library was linked against. Make sure you don't mix up those and always only use php and libs from the very same distribution. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Scheduling tasks
Hi, I'm trying to work out how to schedule tasks in php. I would like to use at but are having a few difficulties. Does anyone have any suggestions on an alternate way to schedule a command to run on the system via php. Thanks a lot, Todd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF POST, but refresh is GET
I have a page the will print a telephone listing in pdf (using pdflib and inline pdf) by POSTing the requested orientation and papersize to a second page. I've found that I have to post to a second page because IE seems to cache a response, and if I post to the same page, I can never get the html to render again, as IE I suppose, is expecting PDF, and I was sending html. Anyway, this 2 page method works fine, but if I hit refresh on the window showing the PDF doc (like I do when change fonts and want to see the change), the document reformats to the default values I have for orientation and papersize. Now, IE pops up the window that says the data must be resent, so IE knows to post it, but in sniffing, I see that the request is now a GET, and there is no form data being sent. Experimenting around, I added some foreach statements at the top and bottom of the page, submitted it from the first page, and when I do that (and my headers aren't sent), I can see the posted data, and the refresh stays as a POST. But, it I take out the foreach, send the headers, and the pdf; refresh becomes a GET, and I loose the users requested orientation. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF POST, but refresh is GET
Sounds like an IE bug to me. If it knows there is POST data and it sends a GET, it is just plain wrong. How about just using GET-method vars in the URL to bounce this stuff along, or even a cookie-based session. -Rasmus On Wed, 28 Aug 2002, Matt Schroebel wrote: I have a page the will print a telephone listing in pdf (using pdflib and inline pdf) by POSTing the requested orientation and papersize to a second page. I've found that I have to post to a second page because IE seems to cache a response, and if I post to the same page, I can never get the html to render again, as IE I suppose, is expecting PDF, and I was sending html. Anyway, this 2 page method works fine, but if I hit refresh on the window showing the PDF doc (like I do when change fonts and want to see the change), the document reformats to the default values I have for orientation and papersize. Now, IE pops up the window that says the data must be resent, so IE knows to post it, but in sniffing, I see that the request is now a GET, and there is no form data being sent. Experimenting around, I added some foreach statements at the top and bottom of the page, submitted it from the first page, and when I do that (and my headers aren't sent), I can see the posted data, and the refresh stays as a POST. But, it I take out the foreach, send the headers, and the pdf; refresh becomes a GET, and I loose the users requested orientation. Any ideas? -- 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] Building a query on multiple variables, how to test for which variables are valid?
So these 4 variables walk into a bar :^] I have a form with 4 drop downs. Each of these drop downs might have a value and there is no order in which they might have a value. A query needs to built (the WHERE and AND portions) that takes into account which ever variables have been set. A user may choose a variable that would not be in the first location. $var1 = is not set $var2 = is set $var3 = is set $var4 = is not set (or any other combination) The query, of course, needs to be in order taking into account the above example; $query = SELECT foo ; $query .= FROM bar ; $query .= WHERE thus = ' . $var2 . ' ; $query .= AND thus = ' . $var3 . ' ; If three of the variables are set then there would need to be an additional AND statement, etc. It would be foolhardy to construct an if or case statement that would take into account each possible combination. I have been thinking this through for an hour or so, but I am not seeing a clear, elegant, and efficient piece of code. Has anyone done anything like this, or does anyone have an idea of how this might be done? TIA! Jay * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDF POST, but refresh is GET
GET solved it. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 2:44 PM To: Matt Schroebel Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PDF POST, but refresh is GET Sounds like an IE bug to me. If it knows there is POST data and it sends a GET, it is just plain wrong. How about just using GET-method vars in the URL to bounce this stuff along, or even a cookie-based session. -Rasmus On Wed, 28 Aug 2002, Matt Schroebel wrote: I have a page the will print a telephone listing in pdf (using pdflib and inline pdf) by POSTing the requested orientation and papersize to a second page. I've found that I have to post to a second page because IE seems to cache a response, and if I post to the same page, I can never get the html to render again, as IE I suppose, is expecting PDF, and I was sending html. Anyway, this 2 page method works fine, but if I hit refresh on the window showing the PDF doc (like I do when change fonts and want to see the change), the document reformats to the default values I have for orientation and papersize. Now, IE pops up the window that says the data must be resent, so IE knows to post it, but in sniffing, I see that the request is now a GET, and there is no form data being sent. Experimenting around, I added some foreach statements at the top and bottom of the page, submitted it from the first page, and when I do that (and my headers aren't sent), I can see the posted data, and the refresh stays as a POST. But, it I take out the foreach, send the headers, and the pdf; refresh becomes a GET, and I loose the users requested orientation. Any ideas? -- 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] Using localhost is taking me to localhost.com!!! why?
Hey, did a nslookup and got this returned to me server:ns02.chello.se address: (looks like an ip no) *** ns02.chello.se cant find localhost: non existent domain Whats the problem? -Ryan. - Original Message - From: SHEETS,JASON (Non-HP-Boise,ex1) [EMAIL PROTECTED] To: 'Ryan A' [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 7:19 PM Subject: RE: [PHP] Using localhost is taking me to localhost.com!!! why? Sounds like your browsers can't resolve localhost so they are resolving localhost.com. Open a dos window and do nslookup localhost, make sure the ip it returns is 127.0.0.1 and not some other ip. By default Windows is supposed to resolve localhost to 127.0.0.1. Jason -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 11:15 AM To: [EMAIL PROTECTED] Subject: [PHP] Using localhost is taking me to localhost.com!!! why? Hi again guys, Just tried to use http://localhost/ again but as I do so it takes me http://www.localhost.com tried it in both IE and NN with the same results... PLEASE help, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Permission Denied
I use PHP to send mail. Recently, emails originating from the server stopped sending. After some investigation, I looked at the /var/log/maillog file, and saw the following errors when a mailing tried to originate: Aug 29 13:16:10 x sendmail[1162]: g7TIGA001162: SYSERR(apache): Can't create transcript file ./xfg7TIGA001162: Permission denied Aug 29 13:16:10 x sendmail[1162]: g7TIGA001162: SYSERR(apache): Cannot create ./dfg7TIGA001162: Permission denied I looked in my mail queue directory, and there were like 15,000 files...looked at a sample few of them, and they were jibberish. Question 1: I'm assuming the error has something to do with the chown/chgrp/chmod of the /var/spool/mqueue directory? I don't know how this could have changed, nothing was modified on the server. Currently: owner = root, group = mail, permissions = rwx rx rx Question 2: Did I get hacked?? __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Proxy taking me to localhost.com
Hey, I am on a cable connection...and to connect to the net my provider gave me an address where my browser would get automatically configured...maybe because of that I am goint to localhost.com? I may be way off track here coz I dont know the first thing about what the heck a proxy itself is but. Please reply, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Proxy taking me to localhost.com
This is the greatest php related question I have ever seen. tyler On Wed, 28 Aug 2002 15:23:48 -0400 [EMAIL PROTECTED] wrote: Hey, I am on a cable connection...and to connect to the net my provider gave me an address where my browser would get automatically configured...maybe because of that I am goint to localhost.com? I may be way off track here coz I dont know the first thing about what the heck a proxy itself is but. Please reply, -Ryan. -- 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] Building a query on multiple variables, how to test for which variable
There must be a better way how to do it but this is what I would do: (Not tested--just the "idea"...) Instead of $var1, $var2... I'd use an array for the drop downs thus, $var[] $var[] $var[] $var[] Then, check if any is set, then... anyway, this is how it goes: // from here $query = "SELECT foo "; $query .= "FROM bar"; if (isset($_POST['var']){ // if POSTed $its_set = 1; // my super "switch" foreach ($var as $key = $value){ if ($its_set == 1){ $query .= " WHERE thus = '" . $value . "'"; $its_set = 2; // just to make sure "WHERE" is only added once } else { $query .= " AND thus = '" . $value . "'"; } } } HTH, -E So these 4 variables walk into a bar :^] I have a form with 4 drop downs. Each of these drop downs might have a value and there is no order in which they might have a value. A query needs to built (the WHERE and AND portions) that takes into account which ever variables have been set. A user may choose a variable that would not be in the first location. $var1 = is not set $var2 = is set $var3 = is set $var4 = is not set (or any other combination) The query, of course, needs to be in order taking into account the above example; $query = "SELECT foo "; $query .= "FROM bar "; $query .= "WHERE thus = '" . $var2 . "' "; $query .= "AND thus = '" . $var3 . "' "; If three of the variables are set then there would need to be an additional AND statement, etc. It would be foolhardy to construct an if or case statement that would take into account each possible combination. I have been thinking this through for an hour or so, but I am not seeing a clear, elegant, and efficient piece of code. Has anyone done anything like this, or does anyone have an idea of how this might be done? TIA! Jay * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ ウィルスメール、迷惑メール対策なら MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tyler-Re: [PHP] Proxy taking me to localhost.com
Hey, comon,give a dude a chance, I'm a newbie trying to leave java servlets and migrate to PHP and cant even get localhost to work and you are getting sarcastic... -Ryan A. This is the greatest php related question I have ever seen. tyler On Wed, 28 Aug 2002 15:23:48 -0400 [EMAIL PROTECTED] wrote: Hey, I am on a cable connection...and to connect to the net my provider gave me an address where my browser would get automatically configured...maybe because of that I am goint to localhost.com? I may be way off track here coz I dont know the first thing about what the heck a proxy itself is but. Please reply, -Ryan. -- 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
[PHP] ITS WORKING!!!!! LOCALHOST...the bastard is working!
HEY everyone, esp all of you who tried to help me, For all of you that are curious how. Sheets Jason got to the problem it was my proxy setting that was wrong. I took his advise and went to the settings under tools-connections and checked the bypass proxy for local addresses and it did the trick. THANKS DUDE. Cheers everyone, thanks once again for all your help and have a great day. -Ryan.
[PHP] How to use cURL in PHP under Win NT ?
I have tried to use cURL with PHP but without sucess so far. In the php.ini I have made the following changes: extension_dir = d:/php/extensions/ and extension=php_curl.dll Also, I have copied; SSLEY32.dll and libey32.dll to WINNT\SYSTEM32 Someone who have expirence with this ? Thanks in advance. Rgs Steinar Kolnes However I am still not able run any cURL functions like $ch = curl_init (http://www.example.com/;); Is there anything more I have to do like copying some other dll's or any form of black magic. It seem so close, but still .. It does not work. I always get this error: Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in d:\apache\htdocs\phonec\sms\send_sms.php on line 45 Best regards Steinar Kolnes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Building a query on multiple variables, how to test for which variable A SOLUTION
Todd came in with a good suggestion which I had started towards, so this is what I have arrived at for the moment. I will be looking to make this more elegant soon, but since they are screaming for the report now this is what I did; ?php if($usoc1 "--- Select ---"){ $usoc[] = $usoc1; } if($usoc2 "--- Select ---"){ $usoc[] = $usoc2; } if($usoc3 "--- Select ---"){ $usoc[] = $usoc3; } if($usoc4 "--- Select ---"){ $usoc[] = $usoc4; } $usoc_count = count($usoc); // query details $qpon = "SELECT BillDate, StateInd, BAN, Type, PON, Phrase, PhraseLine1, USOC, Description, RateZone, Rate "; $qpon .= "FROM tblUSOCChargesDetail WHERE "; $first = 0; for($i = 0; $i $usoc_count; $i++){ if($first == 0){ $qpon .= "USOC = '" . $usoc[$i] . "' "; $first = 1; } else { $qpon .= "AND USOC = '" . $usoc[$i] . "' "; } } $qpon .= "ORDER BY BillDate "; if(!($dbpon = mysql_query($qpon, $dbconnect))){ print("MySQL reports: " . mysql_error() . "\n"); exit(); } ? I am sure that there is a more elegant solution, if I find it I will let you know. Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Zero-length files for PHP sessions??
My PHP session files are being created in the specified directory (/tmp) by the specified user (apache), but always have a file-length of zero, so no data is being stored. Anyone know what may cause this or how to correct? K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to use cURL in PHP under Win NT ?
I have tried to use cURL with PHP but without sucess so far. In the php.ini I have made the following changes: extension_dir = d:/php/extensions/ and extension=php_curl.dll Also, I have copied; SSLEY32.dll and libey32.dll to WINNT\SYSTEM32 Someone who have expirence with this ? Thanks in advance. Rgs Steinar Kolnes However I am still not able run any cURL functions like $ch = curl_init (http://www.example.com/;); Is there anything more I have to do like copying some other dll's or any form of black magic. It seem so close, but still .. It does not work. I always get this error: Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in d:\apache\htdocs\phonec\sms\send_sms.php on line 45 Best regards Steinar Kolnes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Building a query on multiple variables, how to test for which variables are valid?
Jay - How 'bout this? $init = 1; $query = SELECT foo ; $query .= FROM bar WHERE; if ($init AND isset($var1)) { $query .= WHERE thus = ' . $var1 . ' ; $init = 0;} if ($init AND isset($var2)) { $query .= WHERE thus = ' . $var2 . ' ; $init = 0;} elseif (isset($var2)) { $query .= AND WHERE thus = ' . $var2 . ' ; $init = 0;} if ($init AND isset($var3)) { $query .= WHERE thus = ' . $var3 . ' ; $init = 0;} elseif (isset($var3)) { $query .= AND WHERE thus = ' . $var3 . ' ; $init = 0;} if ($init AND isset($var4)) { $query .= WHERE thus = ' . $var4 . ' ; $init = 0;} elseif (isset($var4)) { $query .= AND WHERE thus = ' . $var4 . ' ; $init = 0;} ... you could even make all of those if...elseif's into a function. Chip -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 1:51 PM To: [EMAIL PROTECTED] Subject: [PHP] Building a query on multiple variables, how to test for which variables are valid? So these 4 variables walk into a bar :^] I have a form with 4 drop downs. Each of these drop downs might have a value and there is no order in which they might have a value. A query needs to built (the WHERE and AND portions) that takes into account which ever variables have been set. A user may choose a variable that would not be in the first location. $var1 = is not set $var2 = is set $var3 = is set $var4 = is not set (or any other combination) The query, of course, needs to be in order taking into account the above example; $query = SELECT foo ; $query .= FROM bar ; $query .= WHERE thus = ' . $var2 . ' ; $query .= AND thus = ' . $var3 . ' ; If three of the variables are set then there would need to be an additional AND statement, etc. It would be foolhardy to construct an if or case statement that would take into account each possible combination. I have been thinking this through for an hour or so, but I am not seeing a clear, elegant, and efficient piece of code. Has anyone done anything like this, or does anyone have an idea of how this might be done? TIA! Jay * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- 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] Building a query on multiple variables, how to test for which variable A SOLUTION
I have done this two different ways. The first involves a function that creates a dropdown from the database. What is special about this function is that I assign it's own condition as part of the value for that option. Take this sql statement: select distinct column_name from the_table and it would generate this for a select statement: select name="column_name" option value=" "All/option option value=" and column_name='some_value'"some_value/option option value=" and column_name='another_value'"another_value/option option value=" and column_name='a_different_value'"a_different_value/option /select Then, when the form is processed, the sql statement would be as follows: $sql="select whatever_columns from the_table where 1=1$column_name"; The second method is somewhat similar in that the sql statement would remain the same, but you would have to check each select value to see if you needed to add a "and column_name ='$column_value'" to it. i.e. select statement would be like: select name="column_name" option value=" "All/option option value="some_value"some_value/option option value="another_value"another_value/option option value="a_different_value"a_different_value/option /select processing would be like: if (trim($column_name)) $column_name=" and column_name='$column_name'"; $sql="select whatever_columns from the_table where 1=1$column_name"; The important part on this is that you don't have to be concerned with whether or not to use and or where on the statement, always use and, and in your sql statement put a where clause that is always true. i.e. where 1=1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] AOL problem with remote IP address
In a portion of a website, I have implemented user authentication and management using sessions. When a user first logs in, the $REMOTE_ADDR is stored is a session variable SESSION['ip']. On each of the protected pages, a header.php is included with the following code: if ($SESSION['ip'] != $REMOTE_ADDR){ header(Location: error.php?err=2); die; } As you can see, this is an attempt to see if someone is trying to hijack a session. The problem is, AOL doesn't like this. Whenever an AOL user logs into the website, the session starts successfully, but when the user goes to a protected page, he's redirected to error.php?err=2. For some reason, the IP address appears to be changing. Is this a known issue with AOL? Is the IP really changing from page to page? That seems weird. Any way around this, or must I stop using this security approach? Thanks, -- : Joseph Szobody : Computers are like airconditioners: They stop working properly if you open windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: time stamp
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I am using PHP with MySQL and have a timestamp field in my db table. What would be the easiest way to get the newest timestamp out of the db? Thanks in Advance Steve Use an ORDER BY on the timestamp field in your select statement, and use LIMIT to restrict the number of rows you retrieve (if you want a subset of rows). -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What's the trick ?
testing sorry... Richard Lynch wrote: Hi guys, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] command line argument vs. urlencode ?
Hi, Any one know why the + (plus sign) is not passed as argument to $argv when calling a php script from linux shell ? if this is not a bug, how do I pass a + as argument ? should I use urlencode/urldecode ? is that any php.ini variable to turn off this behavior ? try this and you will see : teste.php-- ?php foreach( $argv as $x ) printf(p: %s\n,$x); ? --- call with : php test.php 123 xxx+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php