RE: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?
Doug, Have you tried setting the variables with putenv() ? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 2:28 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2? I just checked my config, and I *actually* have that line in apachectl. Try that, and if it fixes it, I'll correct the doc. although my apache is built via rpm, i put the line (. /home/db2inst1/sqllib/db2profile) in apachectl and started httpd w/ apachectl, bt... unfortunately i'm still getting the Warning: SQL error: , SQL state ËtøO@Ùÿ¿6#A@ in SQLConnect in /var/www/html/db2php/db2lib.php on line 8 error... i also tried to add export DB2INSTANCE=db2inst1 in the same script and that didn't help either. could the problem be that i'm starting httpd (or apachectl) as root? i know the . /home/db2inst1/sqllib/db2profile is supposed to make apachectl inherit the db2 environment variables, but.. somehow it's not working :/ matt, thank you again :) -doug p.s. for the record__ ./configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbind ir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/includ e --libdir=/usr/lib --sysconfdir=/etc --with-apxs=/usr/sbin/apxs --with-ibm- db2 -- 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] can i use --with-unixODBC instead of --with-ibm-db2?
Andrew, I tried adding these lines to my php script... putenv(LD_LIBRARY_PATH=/home/db2inst1/sqqlib/lib); putenv(DB2INSTANCE=db2inst1); // i assume that's the right way to create those statements But... I didn't have any luck with that either :/ ..same error. Thanks again, -Doug Andrew Hill [EMAIL PROTECTED] wrote in message 044701c23f14$d1f1b650$[EMAIL PROTECTED]">news:044701c23f14$d1f1b650$[EMAIL PROTECTED]... Doug, Have you tried setting the variables with putenv() ? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 2:28 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2? I just checked my config, and I *actually* have that line in apachectl. Try that, and if it fixes it, I'll correct the doc. although my apache is built via rpm, i put the line (. /home/db2inst1/sqllib/db2profile) in apachectl and started httpd w/ apachectl, bt... unfortunately i'm still getting the Warning: SQL error: , SQL state ËtøO@Ùÿ¿6#A@ in SQLConnect in /var/www/html/db2php/db2lib.php on line 8 error... i also tried to add export DB2INSTANCE=db2inst1 in the same script and that didn't help either. could the problem be that i'm starting httpd (or apachectl) as root? i know the . /home/db2inst1/sqllib/db2profile is supposed to make apachectl inherit the db2 environment variables, but.. somehow it's not working :/ matt, thank you again :) -doug p.s. for the record__ ./configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbind ir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/includ e --libdir=/usr/lib --sysconfdir=/etc --with-apxs=/usr/sbin/apxs --with-ibm- db2 -- 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] sucking news out of the usenet
Hi guys, I am trying to build a usenet gateway which is collecting usenet posts and puts them into a phpbb forum. Same other way around. So I did read an excelent article on that published by Armel Fauveau at: http://www.phpbuilder.com/columns/armel20010427.php3?page=1 (this is where the code underneath is from. So getting the articles works. My problem is how to glue all the articles together which are relies. I am sure there is a way to find out which reply belongs to a post. I would like to feed the phpbb database with it. This is an example of an article including the header: Newsgroups: php.general Path: news.php.net Xref: news.php.net php.general:111709 Return-Path: Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 81897 invoked by uid 1007); 8 Aug 2002 18:28:33 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Reply-To: sebastian Date: Thu, 8 Aug 2002 20:27:21 +0200 Lines: 11 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Posted-By: 141.44.162.176 Subject: streaming mp3-audio??? From: [EMAIL PROTECTED] (Sebastian) hi @ all! i´m looking for an algorithm or class to stream mp3-audiofiles, such as easy as it can be. i found nothing on php.net and downloaded some phpscripts from hotscripts and sourceforge but they were all very cryptical and bad documentated. please help me, many thanks sebastian . Lots of text.. puhh! I hope this is somehow possible. Maybe one of you guys has a good idea on that. You can just cut and past the code underneath and try it out by yourself. Thanx for any help on that. Andy - http://www.OZforum.info Australia Information Forum ?php # http://www.phpbuilder.com/columns/armel20010427.php3?page=3 $cfgServer= news.php.net; $cfgPort= 119; $cfgTimeOut= 10; // open a socket if(!$cfgTimeOut) // without timeout $usenet_handle = fsockopen($cfgServer, $cfgPort); else // with timeout $usenet_handle = fsockopen($cfgServer, $cfgPort, $errno, $errstr, $cfgTimeOut); if(!$usenet_handle) { echo Connexion failed\n; exit(); } else { echo Connected\n; $tmp = fgets($usenet_handle, 1024); } ### # page 2 //$cfgUser= xx; //$cfgPasswd= yy; $cfgNewsGroup= php.general; // identification required on private server if($cfgUser) { fputs($usenet_handle, AUTHINFO USER .$cfgUser.\n); $tmp = fgets($usenet_handle, 1024); fputs($usenet_handle, AUTHINFO PASS .$cfgPasswd.\n); $tmp = fgets($usenet_handle, 1024); // check error if($tmp != 281 Ok\r\n) { echo 502 Authentication error\n; exit(); } } // select newsgroup fputs($usenet_handle, GROUP .$cfgNewsGroup.\n); $tmp = fgets($usenet_handle, 1024); if($tmp == 480 Authentication required for command\r\n) { echo $tmp\n; exit(); } $info = split( , $tmp); $first = $info[2]; $last = $info[3]; print First : $first\nbr; print Last : $last\nbr; ### # page 3 $cfgLimit= 10; // upload last articles $boucle=$last-$cfgLimit; while ($boucle = $last) { set_time_limit(0); fputs($usenet_handle, ARTICLE $boucle\n); #fputs($usenet_handle, BODY $boucle\n); $article=; $tmp = fgets($usenet_handle, 4096); if(substr($tmp,0,3) != 220 AND substr($tmp,0,3) != 222) { echo +--+\nbr; echo Error on article $boucle\nbr; echo +--+\nbr; } else { while($tmp!=.\r\n) { $tmp = fgets($usenet_handle, 4096); $article = $article.$tmp; } echo +--+\nbr; echo Article $boucle\nbr; echo +--+\nbr; echo $article\nbr; } $boucle++; } // close connexion fclose($usenet_handle); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?
I used this: Some of his info is wrong, or I had problems with, but hey, this worked: * Now we know DB2 works now to test it with PHP and Apache, first login as user db2inst1 then su to the user root, dont use su - , cause this will make the shell use the settings of root instead of db2inst1 and we need those settings so Apache can find the DB2 Instances. Now first stop apache (if started ofcourse) /usr/local/apache/bin/apachectl stop and start apache /usr/local/apache/bin/apachectl start . Now create a file in de apache docroot ( on my machine thats /usr/local/apache/htdocs/ ) called test.php for example and fill it with the following example: * http://people.a2000.nl/nlvanrey/docs/install-db2-php-apache-linux.html -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 1:28 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2? I just checked my config, and I *actually* have that line in apachectl. Try that, and if it fixes it, I'll correct the doc. although my apache is built via rpm, i put the line (. /home/db2inst1/sqllib/db2profile) in apachectl and started httpd w/ apachectl, bt... unfortunately i'm still getting the Warning: SQL error: , SQL state ËtøO@Ùÿ¿6#A@ in SQLConnect in /var/www/html/db2php/db2lib.php on line 8 error... i also tried to add export DB2INSTANCE=db2inst1 in the same script and that didn't help either. could the problem be that i'm starting httpd (or apachectl) as root? i know the . /home/db2inst1/sqllib/db2profile is supposed to make apachectl inherit the db2 environment variables, but.. somehow it's not working :/ matt, thank you again :) -doug p.s. for the record__ ./configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbind ir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/includ e --libdir=/usr/lib --sysconfdir=/etc --with-apxs=/usr/sbin/apxs --with-ibm- db2 -- 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] Re: sucking news out of the usenet
I'm not on expert on usenet, but I'd recommend reading the RFC that defines the message headers. In particular you're going to need to look at the Message-ID, References, Xref, In-Reply-To, Subject, and Date headers and do what you can to try and sort them out... good luck! -philip On Thu, 8 Aug 2002, andy wrote: Hi guys, I am trying to build a usenet gateway which is collecting usenet posts and puts them into a phpbb forum. Same other way around. So I did read an excelent article on that published by Armel Fauveau at: http://www.phpbuilder.com/columns/armel20010427.php3?page=1 (this is where the code underneath is from. So getting the articles works. My problem is how to glue all the articles together which are relies. I am sure there is a way to find out which reply belongs to a post. I would like to feed the phpbb database with it. This is an example of an article including the header: Newsgroups: php.general Path: news.php.net Xref: news.php.net php.general:111709 Return-Path: Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 81897 invoked by uid 1007); 8 Aug 2002 18:28:33 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Reply-To: sebastian Date: Thu, 8 Aug 2002 20:27:21 +0200 Lines: 11 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Posted-By: 141.44.162.176 Subject: streaming mp3-audio??? From: [EMAIL PROTECTED] (Sebastian) hi @ all! i´m looking for an algorithm or class to stream mp3-audiofiles, such as easy as it can be. i found nothing on php.net and downloaded some phpscripts from hotscripts and sourceforge but they were all very cryptical and bad documentated. please help me, many thanks sebastian . Lots of text.. puhh! I hope this is somehow possible. Maybe one of you guys has a good idea on that. You can just cut and past the code underneath and try it out by yourself. Thanx for any help on that. Andy - http://www.OZforum.info Australia Information Forum ?php # http://www.phpbuilder.com/columns/armel20010427.php3?page=3 $cfgServer= news.php.net; $cfgPort= 119; $cfgTimeOut= 10; // open a socket if(!$cfgTimeOut) // without timeout $usenet_handle = fsockopen($cfgServer, $cfgPort); else // with timeout $usenet_handle = fsockopen($cfgServer, $cfgPort, $errno, $errstr, $cfgTimeOut); if(!$usenet_handle) { echo Connexion failed\n; exit(); } else { echo Connected\n; $tmp = fgets($usenet_handle, 1024); } ### # page 2 //$cfgUser= xx; //$cfgPasswd= yy; $cfgNewsGroup= php.general; // identification required on private server if($cfgUser) { fputs($usenet_handle, AUTHINFO USER .$cfgUser.\n); $tmp = fgets($usenet_handle, 1024); fputs($usenet_handle, AUTHINFO PASS .$cfgPasswd.\n); $tmp = fgets($usenet_handle, 1024); // check error if($tmp != 281 Ok\r\n) { echo 502 Authentication error\n; exit(); } } // select newsgroup fputs($usenet_handle, GROUP .$cfgNewsGroup.\n); $tmp = fgets($usenet_handle, 1024); if($tmp == 480 Authentication required for command\r\n) { echo $tmp\n; exit(); } $info = split( , $tmp); $first = $info[2]; $last = $info[3]; print First : $first\nbr; print Last : $last\nbr; ### # page 3 $cfgLimit= 10; // upload last articles $boucle=$last-$cfgLimit; while ($boucle = $last) { set_time_limit(0); fputs($usenet_handle, ARTICLE $boucle\n); #fputs($usenet_handle, BODY $boucle\n); $article=; $tmp = fgets($usenet_handle, 4096); if(substr($tmp,0,3) != 220 AND substr($tmp,0,3) != 222) { echo +--+\nbr; echo Error on article $boucle\nbr; echo +--+\nbr; } else { while($tmp!=.\r\n) { $tmp = fgets($usenet_handle, 4096); $article = $article.$tmp; } echo +--+\nbr; echo Article $boucle\nbr; echo +--+\nbr; echo $article\nbr; } $boucle++; } // close connexion fclose($usenet_handle); ? -- 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] Re: can i use --with-unixODBC instead of --with-ibm-db2?
does this look like the ODBC SDK of unixODBC (not that i expect you to know unixODBC) /usr/lib/libboundparam.so.1 /usr/lib/libboundparam.so.1.0.0 /usr/lib/libesoobS.so.1 /usr/lib/libesoobS.so.1.0.0 /usr/lib/libgtrtst.so.1 /usr/lib/libgtrtst.so.1.0.0 /usr/lib/libnn.so.1 /usr/lib/libnn.so.1.0.0 /usr/lib/libodbc.so.1 /usr/lib/libodbc.so.1.0.0 /usr/lib/libodbccr.so.1 /usr/lib/libodbccr.so.1.0.0 /usr/lib/libodbcdrvcfg1S.so.1 /usr/lib/libodbcdrvcfg1S.so.1.0.0 /usr/lib/libodbcdrvcfg2S.so.1 /usr/lib/libodbcdrvcfg2S.so.1.0.0 /usr/lib/libodbcextras.so.1 /usr/lib/libodbcextras.so.1.0.0 /usr/lib/libodbcinst.so.1 (...it continues) I found this from $rpm -q --list unixODBC ... somehow I was under the assumption that IBM DB2 UDB came with a ODBC SDK -- i.e. this stuff... /usr/IBMdb2/V7.1/lib/libdb2ccai.so.1 /usr/IBMdb2/V7.1/lib/libdb2ar.so /usr/IBMdb2/V7.1/lib/libdb2.so /usr/IBMdb2/V7.1/lib/libdb2qp.so /usr/IBMdb2/V7.1/lib/libdb2apie.so /usr/IBMdb2/V7.1/lib/libdb2jdbc.so (which continues as well...) or am i still missing something? thanks again, and thanks for your patience too, i really appreciate it. -doug Andrew Hill [EMAIL PROTECTED] wrote in message news:043601c23f0c$0d74efc0$[EMAIL PROTECTED]... Doug, You need an ODBC SDK - you should be able to find the libs in UnixODBC or simply use iODBC from www.iodbc.org Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 10:11 AM To: Andrew Hill Subject: Re: [PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2? Thanks for the suggestion. I tried issuing the command # export LD_LIBRARY_PATH=/usr/IBMdb2/V7.1/include/ (which is where i found sql.h and sqlext.h to be living) Before I ran make install but, unfortunately it came up with the same errors. Well... Maybe it is time I head back to the drawing board and checkout iodbc -- thank you very much, I appreciate it. -Doug Smith Andrew Hill [EMAIL PROTECTED] wrote in message news:03f101c23eea$986d8960$[EMAIL PROTECTED]... Doug, You can try --with-iodbc if you like, there is a howto at www.iodbc.org. That being said, I think that you simply need to set LD_LIBRARY_PATH to the location of your ODBC SDK, so the .h files can be found. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 9:38 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2? well i figured i'd try it... i run $ ./configure i386-redhat-linux --sysconfdir=/etc --with-unixODBC=shared --with-apxs=/usr/ sbin/apxs $ make clean $ make install which returns this aweful mess :/ Making install in odbc make[2]: Entering directory `/home/doug/php-4.2.2/ext/odbc' make[3]: Entering directory `/home/doug/php-4.2.2/ext/odbc' /bin/sh /home/doug/php-4.2.2/libtool --silent --mode=compile gcc -I. -I/home/dou g/php-4.2.2/ext/odbc -I/home/doug/php-4.2.2/main -I/home/doug/php-4.2.2 -I/u sr/i nclude/apache -I/home/doug/php-4.2.2/Zend -I/home/doug/php-4.2.2/ext/mysql/l ibmy sql -I/usr/local/include -I/home/doug/php-4.2.2/ext/xml/expat -DLINUX=22 -D EAPI -DEAPI_MM -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -I/home/doug/php-4.2.2/TSRM -g -O2 -prefer-pic -c php_odbc.c touch php_odbc.slo In file included from php_odbc.c:37: php_odbc.h:120:17: sql.h: No such file or directory php_odbc.h:121:20: sqlext.h: No such file or directory make[3]: *** [php_odbc.slo] Error 1 make[3]: Leaving directory `/home/doug/php-4.2.2/ext/odbc' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/home/doug/php-4.2.2/ext/odbc' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/home/doug/php-4.2.2/ext' make: *** [install-recursive] Error 1 how do i let php know where the sql.h / sqlext.h files are? TIA -- any ideas are appreciated. ___ Doug Smith [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... can i use --with-unixODBC instead of --with-ibm-db2? I've had a lot of trouble getting php to talk to IBM DB2 (see comp.databases.ibm-db2 for more info [if you want], ref DB2 / PHP / Redhat -- Tried Many Suggestions) But, I can get unixODBC to work with DB2, no problem (via the isql command, so i've got the .odbc.ini and odbcinst.ini all set) So, if I compile php --with-unixODBC and _not_ --with-ibm-db2 --- will i be able to make requests to the database using the unified ODBC commands in php -- i.e.
Re: [PHP] sucking news out of the usenet
Andy, I've recently written an newsgroup (NNTP) gateway between FUDforum and newsgroup, which allows read/write data sharing between the two. The solution for tracking down the reply to is done via 2 headers X-Reply-To or In-Reply-To or most commonly References headers. There are a number of mail clients that break the convention and send no such data, in which case you need to do match replies based on subject. The latter occurs only very rarely and in most cases you have a header with a unique ID against which you can match messages. -- Ilia Alshanetsky [EMAIL PROTECTED] http://fud.prohost.org/forum/ On August 8, 2002 04:10 pm, andy wrote: Hi guys, I am trying to build a usenet gateway which is collecting usenet posts and puts them into a phpbb forum. Same other way around. So I did read an excelent article on that published by Armel Fauveau at: http://www.phpbuilder.com/columns/armel20010427.php3?page=1 (this is where the code underneath is from. So getting the articles works. My problem is how to glue all the articles together which are relies. I am sure there is a way to find out which reply belongs to a post. I would like to feed the phpbb database with it. This is an example of an article including the header: Newsgroups: php.general Path: news.php.net Xref: news.php.net php.general:111709 Return-Path: Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 81897 invoked by uid 1007); 8 Aug 2002 18:28:33 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Reply-To: sebastian Date: Thu, 8 Aug 2002 20:27:21 +0200 Lines: 11 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Posted-By: 141.44.162.176 Subject: streaming mp3-audio??? From: [EMAIL PROTECTED] (Sebastian) hi @ all! i´m looking for an algorithm or class to stream mp3-audiofiles, such as easy as it can be. i found nothing on php.net and downloaded some phpscripts from hotscripts and sourceforge but they were all very cryptical and bad documentated. please help me, many thanks sebastian . Lots of text.. puhh! I hope this is somehow possible. Maybe one of you guys has a good idea on that. You can just cut and past the code underneath and try it out by yourself. Thanx for any help on that. Andy - http://www.OZforum.info Australia Information Forum ?php # http://www.phpbuilder.com/columns/armel20010427.php3?page=3 $cfgServer= news.php.net; $cfgPort= 119; $cfgTimeOut= 10; // open a socket if(!$cfgTimeOut) // without timeout $usenet_handle = fsockopen($cfgServer, $cfgPort); else // with timeout $usenet_handle = fsockopen($cfgServer, $cfgPort, $errno, $errstr, $cfgTimeOut); if(!$usenet_handle) { echo Connexion failed\n; exit(); } else { echo Connected\n; $tmp = fgets($usenet_handle, 1024); } ### # page 2 //$cfgUser= xx; //$cfgPasswd= yy; $cfgNewsGroup= php.general; // identification required on private server if($cfgUser) { fputs($usenet_handle, AUTHINFO USER .$cfgUser.\n); $tmp = fgets($usenet_handle, 1024); fputs($usenet_handle, AUTHINFO PASS .$cfgPasswd.\n); $tmp = fgets($usenet_handle, 1024); // check error if($tmp != 281 Ok\r\n) { echo 502 Authentication error\n; exit(); } } // select newsgroup fputs($usenet_handle, GROUP .$cfgNewsGroup.\n); $tmp = fgets($usenet_handle, 1024); if($tmp == 480 Authentication required for command\r\n) { echo $tmp\n; exit(); } $info = split( , $tmp); $first = $info[2]; $last = $info[3]; print First : $first\nbr; print Last : $last\nbr; ### # page 3 $cfgLimit= 10; // upload last articles $boucle=$last-$cfgLimit; while ($boucle = $last) { set_time_limit(0); fputs($usenet_handle, ARTICLE $boucle\n); #fputs($usenet_handle, BODY $boucle\n); $article=; $tmp = fgets($usenet_handle, 4096); if(substr($tmp,0,3) != 220 AND substr($tmp,0,3) != 222) { echo +--+\nbr; echo Error on article $boucle\nbr; echo +--+\nbr; } else { while($tmp!=.\r\n) { $tmp = fgets($usenet_handle, 4096); $article = $article.$tmp; } echo +--+\nbr; echo Article $boucle\nbr; echo +--+\nbr; echo $article\nbr; } $boucle++; } // close connexion fclose($usenet_handle); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DynaPic Class funktion
Hello, can somebody explain me, how this class is working and how I can use it? ? //Images Wrapper for thumbs and other stuffs, require GDLib //Riccardo Pasquini, 04/04/2001, v0.1 [EMAIL PROTECTED] class DynaPic { var $m_sPicName; var $m_sFormat; var $m_hPic; var $m_bHandled; var $m_sLastError; var $m_nThumbX; var $m_nThumbY; var $m_aHeaders; function DynaPic($pic,$format) { //check if valid format if(strtoupper($format)!=PNG strtoupper($format)!=GIF strtoupper($format)!=JPEG) { $this-m_sLastError=Invalid format: .stripslashes(htmlentities($format)); return false; } //initialize $this-m_sFormat=strtoupper($format); $this-m_sPicName=$pic; $this-m_sLastError=; //thumb default resize 50% $this-setThumbDimension(0.5); $this-m_aHeaders=array(GIF=Content-type: image/gif,PNG=Content-type: image/png,JPEG=Content-type: image/jpeg); return $this-create(); } function destroy() { if($this-m_bHandled) { imagedestroy($this-m_hPic); $this-m_bHandled=false; } } function create() { $this-destroy(); eval(\$this-m_hPic=@imagecreatefrom.$this-m_sFormat.('.$this-m_sPicName.');); //check if init succeded if(!$this-m_hPic) { $m_sLastError=Unable to open .stripslashes(htmlentities($this-m_sPicName)). as .stripslashes(htmlentities($this-m_sFormat)); $this-m_bHandled=false; return false; } else { $this-m_bHandled=true; return true; } } //property access function getLastError() { return $this-m_sLastError; } function setPicName($pic) { $this-m_sPicName=$pic; $this-m_bHandled=false; } function getPicName() { return $this-m_sPicName; } function setThumbDimension($pctg) { $size = GetImageSize($this-m_sPicName); $this-m_nThumbX=$size[0]*$pctg; $this-m_nThumbY=$size[1]*$pctg; } function getThumbDimension($w,$h) { $w=$this-m_nThumbX; $h=$this-m_nThumbY; } function setPicFormat($format) { if(strtoupper($format)!=PNG strtoupper($format)!=GIF strtoupper($format)!=JPEG) { $this-m_sLastError=Invalid format: .stripslashes(htmlentities($format)); return false; } else { $this-m_sFormat=strtoupper($format); $this-m_bHandled=false; } return true; } function getPicFormat() { return $this-m_sFormat; } //display functions function thumb() { if($this-m_bHandled) { $size = GetImageSize($this-m_sPicName); $picTmp=imagecreate($this-m_nThumbX,$this-m_nThumbY); imagecopyresized($picTmp, $this-m_hPic, 0, 0, 0, 0, $this-m_nThumbX, $this-m_nThumbY, $size[0], $size[1]); header($this-m_aHeaders[$this-m_sFormat]); switch($this-m_sFormat) { case 'JPEG': imagejpeg($picTmp); break; case 'GIF': imagegif($picTmp); break; case 'PNG': imagepng($picTmp); break; } imagedestroy($picTmp); } } function full() { if($this-m_bHandled) { header($this-m_aHeaders[$this-m_sFormat]); switch($this-m_sFormat) { case 'JPEG': imagejpeg($this-m_hPic); break; case 'GIF': imagegif($this-m_hPic); break; case 'PNG': imagepng($this-m_hPic); break; } } } function view($width, $height) { if($this-m_bHandled) { $size = GetImageSize($this-m_sPicName); $picTmp=imagecreate($width,$height); imagecopyresized($picTmp, $this-m_hPic, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
RE: [PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2?
Doug, It may be - I'm a bit more familiar with iODBC. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 3:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2? does this look like the ODBC SDK of unixODBC (not that i expect you to know unixODBC) /usr/lib/libboundparam.so.1 /usr/lib/libboundparam.so.1.0.0 /usr/lib/libesoobS.so.1 /usr/lib/libesoobS.so.1.0.0 /usr/lib/libgtrtst.so.1 /usr/lib/libgtrtst.so.1.0.0 /usr/lib/libnn.so.1 /usr/lib/libnn.so.1.0.0 /usr/lib/libodbc.so.1 /usr/lib/libodbc.so.1.0.0 /usr/lib/libodbccr.so.1 /usr/lib/libodbccr.so.1.0.0 /usr/lib/libodbcdrvcfg1S.so.1 /usr/lib/libodbcdrvcfg1S.so.1.0.0 /usr/lib/libodbcdrvcfg2S.so.1 /usr/lib/libodbcdrvcfg2S.so.1.0.0 /usr/lib/libodbcextras.so.1 /usr/lib/libodbcextras.so.1.0.0 /usr/lib/libodbcinst.so.1 (...it continues) I found this from $rpm -q --list unixODBC ... somehow I was under the assumption that IBM DB2 UDB came with a ODBC SDK -- i.e. this stuff... /usr/IBMdb2/V7.1/lib/libdb2ccai.so.1 /usr/IBMdb2/V7.1/lib/libdb2ar.so /usr/IBMdb2/V7.1/lib/libdb2.so /usr/IBMdb2/V7.1/lib/libdb2qp.so /usr/IBMdb2/V7.1/lib/libdb2apie.so /usr/IBMdb2/V7.1/lib/libdb2jdbc.so (which continues as well...) or am i still missing something? thanks again, and thanks for your patience too, i really appreciate it. -doug Andrew Hill [EMAIL PROTECTED] wrote in message news:043601c23f0c$0d74efc0$[EMAIL PROTECTED]... Doug, You need an ODBC SDK - you should be able to find the libs in UnixODBC or simply use iODBC from www.iodbc.org Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 10:11 AM To: Andrew Hill Subject: Re: [PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2? Thanks for the suggestion. I tried issuing the command # export LD_LIBRARY_PATH=/usr/IBMdb2/V7.1/include/ (which is where i found sql.h and sqlext.h to be living) Before I ran make install but, unfortunately it came up with the same errors. Well... Maybe it is time I head back to the drawing board and checkout iodbc -- thank you very much, I appreciate it. -Doug Smith Andrew Hill [EMAIL PROTECTED] wrote in message news:03f101c23eea$986d8960$[EMAIL PROTECTED]... Doug, You can try --with-iodbc if you like, there is a howto at www.iodbc.org. That being said, I think that you simply need to set LD_LIBRARY_PATH to the location of your ODBC SDK, so the .h files can be found. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 9:38 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2? well i figured i'd try it... i run $ ./configure i386-redhat-linux --sysconfdir=/etc --with-unixODBC=shared --with-apxs=/usr/ sbin/apxs $ make clean $ make install which returns this aweful mess :/ Making install in odbc make[2]: Entering directory `/home/doug/php-4.2.2/ext/odbc' make[3]: Entering directory `/home/doug/php-4.2.2/ext/odbc' /bin/sh /home/doug/php-4.2.2/libtool --silent --mode=compile gcc -I. -I/home/dou g/php-4.2.2/ext/odbc -I/home/doug/php-4.2.2/main -I/home/doug/php-4.2.2 -I/u sr/i nclude/apache -I/home/doug/php-4.2.2/Zend -I/home/doug/php-4.2.2/ext/mysql/l ibmy sql -I/usr/local/include -I/home/doug/php-4.2.2/ext/xml/expat -DLINUX=22 -D EAPI -DEAPI_MM -DEAPI_MM_CORE_PATH=/var/run/httpd.mm -I/home/doug/php-4.2.2/TSRM -g -O2 -prefer-pic -c php_odbc.c touch php_odbc.slo In file included from php_odbc.c:37: php_odbc.h:120:17: sql.h: No such file or directory php_odbc.h:121:20: sqlext.h: No such file or directory make[3]: *** [php_odbc.slo] Error 1 make[3]: Leaving directory `/home/doug/php-4.2.2/ext/odbc' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/home/doug/php-4.2.2/ext/odbc' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/home/doug/php-4.2.2/ext' make: *** [install-recursive] Error 1 how do i let php know where the sql.h / sqlext.h files are? TIA -- any ideas are appreciated. ___ Doug Smith [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... can i use --with-unixODBC instead of --with-ibm-db2? I've had a lot of trouble getting php to talk to IBM DB2 (see
[PHP] File Question
I have been looking all over the manual and I have not found anything for __FILE__ does anyone know where I can get more info on its use in PHP? .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?
Dan, Thank you for the link unfortunately, even after initally logging in as db2inst1 and then su to root (w/o the dash) and stopping/starting apachectl -- i still had no luck :/ same old error: Warning: SQL error: , SQL state ËtøO@ÈØÿ¿6#A@ in SQLConnect in /var/www/html/db2php/db2lib.php on line 11 Thank you very much though still, i appreciate the ideas :) -Doug Dan Vande More [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I used this: Some of his info is wrong, or I had problems with, but hey, this worked: * Now we know DB2 works now to test it with PHP and Apache, first login as user db2inst1 then su to the user root, dont use su - , cause this will make the shell use the settings of root instead of db2inst1 and we need those settings so Apache can find the DB2 Instances. Now first stop apache (if started ofcourse) /usr/local/apache/bin/apachectl stop and start apache /usr/local/apache/bin/apachectl start . Now create a file in de apache docroot ( on my machine thats /usr/local/apache/htdocs/ ) called test.php for example and fill it with the following example: * http://people.a2000.nl/nlvanrey/docs/install-db2-php-apache-linux.html -Original Message- From: Doug Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 1:28 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2? I just checked my config, and I *actually* have that line in apachectl. Try that, and if it fixes it, I'll correct the doc. although my apache is built via rpm, i put the line (. /home/db2inst1/sqllib/db2profile) in apachectl and started httpd w/ apachectl, bt... unfortunately i'm still getting the Warning: SQL error: , SQL state ËtøO@Ùÿ¿6#A@ in SQLConnect in /var/www/html/db2php/db2lib.php on line 8 error... i also tried to add export DB2INSTANCE=db2inst1 in the same script and that didn't help either. could the problem be that i'm starting httpd (or apachectl) as root? i know the . /home/db2inst1/sqllib/db2profile is supposed to make apachectl inherit the db2 environment variables, but.. somehow it's not working :/ matt, thank you again :) -doug p.s. for the record__ ./configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbind ir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/includ e --libdir=/usr/lib --sysconfdir=/etc --with-apxs=/usr/sbin/apxs --with-ibm- db2 -- 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] File Question
I guess my question is does PHP support additional macros like this? .: B i g D o g :. - Original Message - From: B i g D o g [EMAIL PROTECTED] To: PHP GEN [EMAIL PROTECTED] Sent: Thursday, August 08, 2002 2:23 PM Subject: [PHP] File Question I have been looking all over the manual and I have not found anything for __FILE__ does anyone know where I can get more info on its use in PHP? .: B i g D o g :. -- 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] sucking news out of the usenet
that sound somehow more complicated that I have expected :-( I guess this is a lot of work. May have to skip that for another time. Thanx for your help, andy - http://www.OZforum.info Australia Information Forum Ilia A. [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Andy, I've recently written an newsgroup (NNTP) gateway between FUDforum and newsgroup, which allows read/write data sharing between the two. The solution for tracking down the reply to is done via 2 headers X-Reply-To or In-Reply-To or most commonly References headers. There are a number of mail clients that break the convention and send no such data, in which case you need to do match replies based on subject. The latter occurs only very rarely and in most cases you have a header with a unique ID against which you can match messages. -- Ilia Alshanetsky [EMAIL PROTECTED] http://fud.prohost.org/forum/ On August 8, 2002 04:10 pm, andy wrote: Hi guys, I am trying to build a usenet gateway which is collecting usenet posts and puts them into a phpbb forum. Same other way around. So I did read an excelent article on that published by Armel Fauveau at: http://www.phpbuilder.com/columns/armel20010427.php3?page=1 (this is where the code underneath is from. So getting the articles works. My problem is how to glue all the articles together which are relies. I am sure there is a way to find out which reply belongs to a post. I would like to feed the phpbb database with it. This is an example of an article including the header: Newsgroups: php.general Path: news.php.net Xref: news.php.net php.general:111709 Return-Path: Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 81897 invoked by uid 1007); 8 Aug 2002 18:28:33 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Reply-To: sebastian Date: Thu, 8 Aug 2002 20:27:21 +0200 Lines: 11 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Posted-By: 141.44.162.176 Subject: streaming mp3-audio??? From: [EMAIL PROTECTED] (Sebastian) hi @ all! i´m looking for an algorithm or class to stream mp3-audiofiles, such as easy as it can be. i found nothing on php.net and downloaded some phpscripts from hotscripts and sourceforge but they were all very cryptical and bad documentated. please help me, many thanks sebastian . Lots of text.. puhh! I hope this is somehow possible. Maybe one of you guys has a good idea on that. You can just cut and past the code underneath and try it out by yourself. Thanx for any help on that. Andy - http://www.OZforum.info Australia Information Forum ?php # http://www.phpbuilder.com/columns/armel20010427.php3?page=3 $cfgServer= news.php.net; $cfgPort= 119; $cfgTimeOut= 10; // open a socket if(!$cfgTimeOut) // without timeout $usenet_handle = fsockopen($cfgServer, $cfgPort); else // with timeout $usenet_handle = fsockopen($cfgServer, $cfgPort, $errno, $errstr, $cfgTimeOut); if(!$usenet_handle) { echo Connexion failed\n; exit(); } else { echo Connected\n; $tmp = fgets($usenet_handle, 1024); } ### # page 2 //$cfgUser= xx; //$cfgPasswd= yy; $cfgNewsGroup= php.general; // identification required on private server if($cfgUser) { fputs($usenet_handle, AUTHINFO USER .$cfgUser.\n); $tmp = fgets($usenet_handle, 1024); fputs($usenet_handle, AUTHINFO PASS .$cfgPasswd.\n); $tmp = fgets($usenet_handle, 1024); // check error if($tmp != 281 Ok\r\n) { echo 502 Authentication error\n; exit(); } } // select newsgroup fputs($usenet_handle, GROUP .$cfgNewsGroup.\n); $tmp = fgets($usenet_handle, 1024); if($tmp == 480 Authentication required for command\r\n) { echo $tmp\n; exit(); } $info = split( , $tmp); $first = $info[2]; $last = $info[3]; print First : $first\nbr; print Last : $last\nbr; ### # page 3 $cfgLimit= 10; // upload last articles $boucle=$last-$cfgLimit; while ($boucle = $last) { set_time_limit(0); fputs($usenet_handle, ARTICLE $boucle\n); #fputs($usenet_handle, BODY $boucle\n); $article=; $tmp = fgets($usenet_handle, 4096); if(substr($tmp,0,3) != 220 AND substr($tmp,0,3) != 222) { echo +--+\nbr; echo Error on article $boucle\nbr; echo +--+\nbr; } else { while($tmp!=.\r\n) { $tmp = fgets($usenet_handle, 4096); $article = $article.$tmp; } echo
[PHP] getting PHP --with-imap to work on OS X? (cross-post)
Hi folks, I am trying to get a web-based mail system set up on my OS X machine. I have successfully compiled and installed Apache, Postfix, UW-IMAP, MySQL, and a version of PHP 4.2.2 _without_ imap support. However, it seems that for a web mail client to work, I need to have imap support built in to PHP. Has anyone done this for OS X? I have looked everywhere, and can't find a next step. Like I said, I have UW-IMAP installed, and it is working correctly. Additionally, I have followed the instructions from PHP.NET, where it says to copy certain files from the c-client directory to my /usr/local/include directory. However, I always get errors when I make. Please, would someone be willing to offer detailed instructions? If I get this thing working, I'd be more than willing to post or mail my notes so that others can enjoy the fun. Thanks in advance, michael geary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP warning with 4.2
You should be able to fix this by changing the function DECLARATION for the argument in question to take the variable by reference instead of by value (which is the default). So it should be something like: OCIFetchInto ( $var1, $rvar2, $var3 ) What you are currently doing is specifying at call-time that I want you to accept this variable by reference, even if you are expecting it to be passed by value. This can be very dangerous from a data corruption point of view, which is likely why it is being deprecated. At 11:13 AM 8/8/2002 -0700, PHP List wrote: Hi, after upgrading to 4.2, I seem to be getting this warning: PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. on this line: OCIFetchInto ( $GLOBALS[oracle_statement], $row, OCI_NUM + OCI_RETURN_NULLS ) if I can't use $row anymore, what do I do? The warning says that future versions may not support this, so will this function be fixed? Or will this function be dissappearing? Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using ini_set with session.gc_maxlifetime
I've got a site on a server where I can't change the php.ini setting for session.gc_maxlifetime, which is set at the default 1440 seconds. My client wants to entend the time to an hour. The only way I am aware of how to do this kind of thing is through ini_set. However, the documentation says there are a number of configuration options which you can set using ini_set, but which don't work as expected because the options are already in effect before the script runs. Is session.gc_maxlifetime one of those options? After all, ini_set is only supposed to be in effect for the duration of the script, which is not going to work if the whole point of sessions is to allow information to be preserved between pages (scripts). So, can ini_set be used to set session.gc_maxlifetime in any meaningful way, and if not, is there another way to do it? Ta, Neil Innes _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Asking for help...
Okay, I give up. I can't figure this out. So, instead of spamming the list with my code, I'll ask for help and those who reply I'll send the code to. The problem is as follows: I'm building a multi page form (called form.php) which 'include's each $step one by one (step1.inc, step2.inc, etc., etc.). That page (form.php) submits to a process script (process.php) which does several things: - checks for each form field to be filled. if a required field is empty, flag $error - if the field is filled, session_register() it. - if there is an $error, resubmit the $step back to form.php - if there is no $error, submit $step+1 to form.php And the whole process gets repeated every time form.php is resubmitted. So, in theory, at the end of the 3 pages that I have, the last submit will cause process.php to grab all the variable/value combinations and (for now) sends me an email. Problems I'm facing: 1) Let's say a user leaves out a field (or more) and submits the page. process.php diligently causes an $error which sends the same $step back to form.php. Now the user fills in what was missing, but DELETES another field and resubmits. At this point, that variable was already registered, and deleting the value from the form has no effect. The old value is still there and gets submitted. I need to check for this somehow. 2) There are also optional fields on the form (thinks like a second field for Address, Telephone#, etc.) These will also need to be registered if they have been filled. And they are. Problem is, sometimes they're not (I can't seem to be able to pin down WHY). 3) If a required field hasn't been filled in the first go around, the whole process gets stuck. In other words, when the same form gets displayed again, and the user DOES fill in that field and resubmits it, it just comes back and says that field is still missing. Even though when I echo that variable prior to the process reaching the point where it checks if there is anything missing, I get a value returned - so the field IS filled. Still, it fails when it reaches the checks. I'm sure there are more, but right now that's what I'm faced with and it's driving me insane. So, if some brave soul out there wishes to read my (no doubt) crappy code and tell me what I did wrong, I'll appreciate it. Please reply to me off-list and I'll give you the current code. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Question
Ray, __FILE__ is the constant (there's also __LINE__) that is defined right within the file, so its value cannot be modified. Look up here: http://www.php.net/manual/en/language.constants.php Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: Ray Hunter [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 10:26 PM To: PHP GEN Subject: Re: [PHP] File Question I guess my question is does PHP support additional macros like this? .: B i g D o g :. - Original Message - From: B i g D o g [EMAIL PROTECTED] To: PHP GEN [EMAIL PROTECTED] Sent: Thursday, August 08, 2002 2:23 PM Subject: [PHP] File Question I have been looking all over the manual and I have not found anything for __FILE__ does anyone know where I can get more info on its use in PHP? .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Asking for help...
Op donderdag 08 augustus 2002 23:22, schreef Ashley M. Kirchner: DELETES another field and resubmits. At this point, that variable was already registered, and deleting the value from the form has no effect. The old value is still there and gets submitted. I need to check for this somehow. You shouldn't register before the form is complete right and not after every submit. something like: ? $error=''; if(isset($_POST['yes'])) { if($_POST['field1'])!=1)$error='field1 is not1 !'; etc... } if(empty($error)) { session_start(); $_SESSION['field1']=$_POST['field1']; header(Location: next_page); exit; } if(!empty($error)){ echo error.'br'} ? form action=?=$_SERVER['PHP_SELF']? method=post input type=text name=field1 value=?=isset($_POST['field1']) ? $_POST['field1'] : ''? etc input type=sumbit name=yes /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $http_host use case
Hi all, I make 2 sites with 2 domain names that use same scripts, Each has got its html templates in a special dir selected judgging from $HTTP_HOST values. I was wondering me how a web crawler (search engine robot) could refer those pages. Would crawler bring that parameter in order to refer well both sites... I see a short explanation of http_host at : http://www.php.net/manual/en/reserved.variables.php#reserved.variables.serve r = 'HTTP_HOST' Contents of the Host: header from the current request, if there is one. It makes me doubt. My server is an apache php 1.3.20 with 1 ip so http 1.1 is mandatory, how search engine works, did they affect this var correctly ? Is there any crawlers that doesnt support http 1.1 again ? If there isn't this var my site would melt down ! merci. a+. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please help with array_diff()
Hello! Please have a look at the following sample code and help me out if you can $db = new db_SQL(); $sql = SELECT Name, Email FROM whatever WHERE whatever=whatever; $db-query( $sql ); while ($db-next_record()) { //This is my first array $foo[] = array (name=$db-f(Name), email=$db-f(Email)); } $db2 = new db_SQL(); $sql2 = SELECT Name, Email FROM another_table WHERE foo=bar; $db2-query( $sql2 ); while ($db2-next_record()) { //This is my second array $bar[] = array (name=$db2-f(Name), email=$db2-f(Email)); } // Now i want to compare the two arrays $diff = array_diff($foo[0], $bar[0]); //And heres where it stops working as it should foreach ($diff as $element) { echo $element.br; } What is driving me crazy since more then 7 hours is that it ($element) will only output ONE difference, but i want ALL differences listed, why is this not working? As far as i know i am doing nothing wrong, or am i totally stupid? Thank you very much in advance for your time and help! Best regards from Vienna, Jürgen
[PHP] mysql_result
I need some help! I am getting a result out of my link Database an want it to Display the result in two collums like this: +-++ + Result 1+ Result 2 + +-++ +Result 3 + Result 4 + +-++ and so on please help! Thanx
[PHP] Help with multiple select
I need to get the data from the table and add it to the multiple select statement below. What I am trying to do is give the user a form to change his pervious selections. Now doing this if there is only one thing selected is easy. but I need a way to select multiple fields. The data in $mins would look like this 8,13,15,20. I tried this little script below but it does not work because of the , and I would also have to do it for ever option value. There must be a shorter way of doing this. $mins=2,3,5,6,7; TABLEtr td valign=topselect name=mins[] size=12 multiple option value=00 ? if ($mins==1){? option value=1 selected1 ?}else{? option value=11 ?}? ? if ($mins==2){? option value=2 selected2 ?}else{? option value=22 ?}? ? if ($mins==3){? option value=3 selected3 ?}else{? option value=33 ?}? option value=44 option value=55 option value=66 option value=77 option value=88 option value=99 option value=1010 option value= td valign=topselect name=mins[] size=12 multiple option value=1212 option value=1313 option value=1414 option value=1515 option value=1616 option value=1717 option value=1818 option value=1919 option value=2020 option value=2121 option value= option value=2323 /tr/table -- Best regards, Richard Kurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec root question
Hi, i wrote a script, which runs echo shell_exec(exim -bp); so it simply gives me the current mail queue. However, it only works when called by user root, because exim won't let group or others execute it. So, i cannot use it with apache, because it runs as nobody. Well, i saw scripts that can do so, but i have no clue how it is possible for them. Does anyone have an idea? I thought about adding a cron-job and let it update a file every 5 minutes with the current mail queue, but that will cause unnecesary load and it won't be up2date. So, any ideas are welcome, Thanks, Duncan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_result
??? Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: Sascha Braun [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:18 AM To: PHP Mailingliste Subject: [PHP] mysql_result I need some help! I am getting a result out of my link Database an want it to Display the result in two collums like this: +-++ + Result 1+ Result 2 + +-++ +Result 3 + Result 4 + +-++ and so on please help! Thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with multiple select
Try: $mins = 2,3,5,6,7; $ret = array_reverse(explode(',', $mins)); // now you have something like: // $ret[2] = 0; // $ret[3] = 1; // // etc, basically string became and array in reversed way... then in script... if(isset($mins[2])) ... if(isset($mins[3])) and so on . but, I would really recommend you to experiment some alternative ways with use of a loop. That would be way cleaner. Sincerely, Maxim Maletsky [EMAIL PROTECTED] PHP Beginner www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:38 AM To: php-general Subject: [PHP] Help with multiple select I need to get the data from the table and add it to the multiple select statement below. What I am trying to do is give the user a form to change his pervious selections. Now doing this if there is only one thing selected is easy. but I need a way to select multiple fields. The data in $mins would look like this 8,13,15,20. I tried this little script below but it does not work because of the , and I would also have to do it for ever option value. There must be a shorter way of doing this. $mins=2,3,5,6,7; TABLEtr td valign=topselect name=mins[] size=12 multiple option value=00 ? if ($mins==1){? option value=1 selected1 ?}else{? option value=11 ?}? ? if ($mins==2){? option value=2 selected2 ?}else{? option value=22 ?}? ? if ($mins==3){? option value=3 selected3 ?}else{? option value=33 ?}? option value=44 option value=55 option value=66 option value=77 option value=88 option value=99 option value=1010 option value= td valign=topselect name=mins[] size=12 multiple option value=1212 option value=1313 option value=1414 option value=1515 option value=1616 option value=1717 option value=1818 option value=1919 option value=2020 option value=2121 option value= option value=2323 /tr/table -- Best regards, Richard Kurth mailto:[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[2]: [PHP] Help with multiple select
Hello Maxim, Is this what you are saying to do. I don't understand way this would work and what I have hear does not work mins=1,4,6,; $ret = array_reverse(explode(',', $mins)); select name=mins[] id=mins size=12 multiple ? if(isset($mins[0])){? option value=0 selected0/option ?}else{? option value=00 ?} if(isset($mins[1])){? option value=1 selected1/option ?}else{? option value=11 ?} if(isset($mins[2])){? option value=2 selected2/option ?}else{? option value=22 ?} if(isset($mins[3])){? option value=3 selected3/option ?}else{? option value=33 ?} if(isset($mins[4])){? option value=4 selected4/option ?}else{? option value=44 ?} if(isset($mins[5])){? option value=5 selected5/option ?}else{? option value=55 ?} if(isset($mins[6])){? option value=6 selected6/option ?}else{? option value=66 ?}? Thursday, August 08, 2002, 3:51:46 PM, you wrote: MM Try: MM $mins = 2,3,5,6,7; MM $ret = array_reverse(explode(',', $mins)); MM // now you have something like: MM // $ret[2] = 0; MM // $ret[3] = 1; MM // MM // etc, basically string became and array in reversed way... MM then in script... MM if(isset($mins[2])) MM ... MM if(isset($mins[3])) MM and so on . MM but, I would really recommend you to experiment some alternative ways MM with use of a loop. That would be way cleaner. MM Sincerely, MM Maxim Maletsky MM [EMAIL PROTECTED] MM PHP Beginner MM www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:38 AM To: php-general Subject: [PHP] Help with multiple select I need to get the data from the table and add it to the multiple select statement below. What I am trying to do is give the user a form to change his pervious selections. Now doing this if there is only one thing selected is easy. but I need a way to select multiple fields. The data in $mins would look like this 8,13,15,20. I tried this little script below but it does not work because of the , and I would also have to MM do it for ever option value. There must be a shorter way of doing this. $mins=2,3,5,6,7; TABLEtr td valign=topselect name=mins[] size=12 multiple option value=00 ? if ($mins==1){? option value=1 selected1 ?}else{? option value=11 ?}? ? if ($mins==2){? option value=2 selected2 ?}else{? option value=22 ?}? ? if ($mins==3){? option value=3 selected3 ?}else{? option value=33 ?}? option value=44 option value=55 option value=66 option value=77 option value=88 option value=99 option value=1010 option value= td valign=topselect name=mins[] size=12 multiple option value=1212 option value=1313 option value=1414 option value=1515 option value=1616 option value=1717 option value=1818 option value=1919 option value=2020 option value=2121 option value= option value=2323 /tr/table -- Best regards, Richard Kurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best regards, rdkurthmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec problem
Hi, I want to launch a program which writes a file on the server. But the process is under the owner of webuser who doesn't have write permission, and I don't want to set the directory writable to all users. I've searched the doc and tried every way but couldn't find a solution. Anybody knows how to solve this? BTW, my php is a pretty old version and doesn't support suexec and ftp functions. Thanks a lot Xin Li __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] Help with multiple select
Change $mins to $ret in the HTML code. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 1:34 AM To: Maxim Maletsky; php-general Subject: Re[2]: [PHP] Help with multiple select Hello Maxim, Is this what you are saying to do. I don't understand way this would work and what I have hear does not work mins=1,4,6,; $ret = array_reverse(explode(',', $mins)); select name=mins[] id=mins size=12 multiple ? if(isset($mins[0])){? option value=0 selected0/option ?}else{? option value=00 ?} if(isset($mins[1])){? option value=1 selected1/option ?}else{? option value=11 ?} if(isset($mins[2])){? option value=2 selected2/option ?}else{? option value=22 ?} if(isset($mins[3])){? option value=3 selected3/option ?}else{? option value=33 ?} if(isset($mins[4])){? option value=4 selected4/option ?}else{? option value=44 ?} if(isset($mins[5])){? option value=5 selected5/option ?}else{? option value=55 ?} if(isset($mins[6])){? option value=6 selected6/option ?}else{? option value=66 ?}? Thursday, August 08, 2002, 3:51:46 PM, you wrote: MM Try: MM $mins = 2,3,5,6,7; MM $ret = array_reverse(explode(',', $mins)); MM // now you have something like: MM // $ret[2] = 0; MM // $ret[3] = 1; MM // MM // etc, basically string became and array in reversed way... MM then in script... MM if(isset($mins[2])) MM ... MM if(isset($mins[3])) MM and so on . MM but, I would really recommend you to experiment some alternative ways MM with use of a loop. That would be way cleaner. MM Sincerely, MM Maxim Maletsky MM [EMAIL PROTECTED] MM PHP Beginner MM www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:38 AM To: php-general Subject: [PHP] Help with multiple select I need to get the data from the table and add it to the multiple select statement below. What I am trying to do is give the user a form to change his pervious selections. Now doing this if there is only one thing selected is easy. but I need a way to select multiple fields. The data in $mins would look like this 8,13,15,20. I tried this little script below but it does not work because of the , and I would also have to MM do it for ever option value. There must be a shorter way of doing this. $mins=2,3,5,6,7; TABLEtr td valign=topselect name=mins[] size=12 multiple option value=00 ? if ($mins==1){? option value=1 selected1 ?}else{? option value=11 ?}? ? if ($mins==2){? option value=2 selected2 ?}else{? option value=22 ?}? ? if ($mins==3){? option value=3 selected3 ?}else{? option value=33 ?}? option value=44 option value=55 option value=66 option value=77 option value=88 option value=99 option value=1010 option value= td valign=topselect name=mins[] size=12 multiple option value=1212 option value=1313 option value=1414 option value=1515 option value=1616 option value=1717 option value=1818 option value=1919 option value=2020 option value=2121 option value= option value=2323 /tr/table -- Best regards, Richard Kurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best regards, rdkurthmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Help with multiple select
Hello Maxim, I had done that but when I run it using the numbers 1,3,4 in the $mins variables the fields that where selected where 0 1 and 2. If I change it to $mins=3,5 it select 0 1 . if I use $mins=3,4,6,8,10,22; it select 0 through 5 Thursday, August 08, 2002, 4:46:49 PM, you wrote: MM Change $mins to $ret in the HTML code. MM Sincerely, MM Maxim Maletsky MM PHP Beginner MM www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 1:34 AM To: Maxim Maletsky; php-general Subject: Re[2]: [PHP] Help with multiple select Hello Maxim, Is this what you are saying to do. I don't understand way this would work and what I have hear does not work mins=1,4,6,; $ret = array_reverse(explode(',', $mins)); select name=mins[] id=mins size=12 multiple ? if(isset($mins[0])){? option value=0 selected0/option ?}else{? option value=00 ?} if(isset($mins[1])){? option value=1 selected1/option ?}else{? option value=11 ?} if(isset($mins[2])){? option value=2 selected2/option ?}else{? option value=22 ?} if(isset($mins[3])){? option value=3 selected3/option ?}else{? option value=33 ?} if(isset($mins[4])){? option value=4 selected4/option ?}else{? option value=44 ?} if(isset($mins[5])){? option value=5 selected5/option ?}else{? option value=55 ?} if(isset($mins[6])){? option value=6 selected6/option ?}else{? option value=66 ?}? Thursday, August 08, 2002, 3:51:46 PM, you wrote: MM Try: MM $mins = 2,3,5,6,7; MM $ret = array_reverse(explode(',', $mins)); MM // now you have something like: MM // $ret[2] = 0; MM // $ret[3] = 1; MM // MM // etc, basically string became and array in reversed way... MM then in script... MM if(isset($mins[2])) MM ... MM if(isset($mins[3])) MM and so on . MM but, I would really recommend you to experiment some alternative MM ways MM with use of a loop. That would be way cleaner. MM Sincerely, MM Maxim Maletsky MM [EMAIL PROTECTED] MM PHP Beginner MM www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:38 AM To: php-general Subject: [PHP] Help with multiple select I need to get the data from the table and add it to the multiple select statement below. What I am trying to do is give the user a MM form to change his pervious selections. Now doing this if there is only MM one thing selected is easy. but I need a way to select multiple fields. The MM data in $mins would look like this 8,13,15,20. I tried this little MM script below but it does not work because of the , and I would also have MM to MM do it for ever option value. There must be a shorter way of doing MM this. $mins=2,3,5,6,7; TABLEtr td valign=topselect name=mins[] size=12 multiple option value=00 ? if ($mins==1){? option value=1 selected1 ?}else{? option value=11 ?}? ? if ($mins==2){? option value=2 selected2 ?}else{? option value=22 ?}? ? if ($mins==3){? option value=3 selected3 ?}else{? option value=33 ?}? option value=44 option value=55 option value=66 option value=77 option value=88 option value=99 option value=1010 option value= td valign=topselect name=mins[] size=12 multiple option value=1212 option value=1313 option value=1414 option value=1515 option value=1616 option value=1717 option value=1818 option value=1919 option value=2020 option value=2121 option value= option value=2323 /tr/table -- Best regards, Richard Kurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best regards, rdkurthmailto:[EMAIL PROTECTED] -- Best regards, rdkurthmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Matchmaking site
Hello, I am new to the list and don't know how kind you are helping complete beginners in PHP. I intend to set a personals matchmaking site for people interested in entheogens (http://singlemates.yage.net) I don't know where to begin, I have some PHP cookbooks handy and am looking to do it the easy way but have no idea how much work and knowledge is needed. What I want is for people to log in (using sessions?), post and modify profile with uploading photos and search for personals based on location, desired place to live, age, kind of relationship, etc. I intend to do it it by steps adding features as my php knowledge increase but would appretiate very much some tips and hints on where to begin and how to design this project. Some tips on where and what I shall learn for this project would be of great help. Thanks a lot, hope this may help other people interested in similar works, -Danalex
RE: Re[4]: [PHP] Help with multiple select
Can you give me thefull code (from the point you create 1,2,3 till you compose the whole HTML block)? I will slightly rewrite it for you. Or, simply look well inside the code and learn it well. It is not a tough problem at all - you just got confused by array_reverse() function. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 2:14 AM To: Maxim Maletsky; php-general Subject: Re[4]: [PHP] Help with multiple select Hello Maxim, I had done that but when I run it using the numbers 1,3,4 in the $mins variables the fields that where selected where 0 1 and 2. If I change it to $mins=3,5 it select 0 1 . if I use $mins=3,4,6,8,10,22; it select 0 through 5 Thursday, August 08, 2002, 4:46:49 PM, you wrote: MM Change $mins to $ret in the HTML code. MM Sincerely, MM Maxim Maletsky MM PHP Beginner MM www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 1:34 AM To: Maxim Maletsky; php-general Subject: Re[2]: [PHP] Help with multiple select Hello Maxim, Is this what you are saying to do. I don't understand way this would work and what I have hear does not work mins=1,4,6,; $ret = array_reverse(explode(',', $mins)); select name=mins[] id=mins size=12 multiple ? if(isset($mins[0])){? option value=0 selected0/option ?}else{? option value=00 ?} if(isset($mins[1])){? option value=1 selected1/option ?}else{? option value=11 ?} if(isset($mins[2])){? option value=2 selected2/option ?}else{? option value=22 ?} if(isset($mins[3])){? option value=3 selected3/option ?}else{? option value=33 ?} if(isset($mins[4])){? option value=4 selected4/option ?}else{? option value=44 ?} if(isset($mins[5])){? option value=5 selected5/option ?}else{? option value=55 ?} if(isset($mins[6])){? option value=6 selected6/option ?}else{? option value=66 ?}? Thursday, August 08, 2002, 3:51:46 PM, you wrote: MM Try: MM $mins = 2,3,5,6,7; MM $ret = array_reverse(explode(',', $mins)); MM // now you have something like: MM // $ret[2] = 0; MM // $ret[3] = 1; MM // MM // etc, basically string became and array in reversed way... MM then in script... MM if(isset($mins[2])) MM ... MM if(isset($mins[3])) MM and so on . MM but, I would really recommend you to experiment some alternative MM ways MM with use of a loop. That would be way cleaner. MM Sincerely, MM Maxim Maletsky MM [EMAIL PROTECTED] MM PHP Beginner MM www.phpbeginner.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:38 AM To: php-general Subject: [PHP] Help with multiple select I need to get the data from the table and add it to the multiple select statement below. What I am trying to do is give the user a MM form to change his pervious selections. Now doing this if there is only MM one thing selected is easy. but I need a way to select multiple fields. The MM data in $mins would look like this 8,13,15,20. I tried this little MM script below but it does not work because of the , and I would also have MM to MM do it for ever option value. There must be a shorter way of doing MM this. $mins=2,3,5,6,7; TABLEtr td valign=topselect name=mins[] size=12 multiple option value=00 ? if ($mins==1){? option value=1 selected1 ?}else{? option value=11 ?}? ? if ($mins==2){? option value=2 selected2 ?}else{? option value=22 ?}? ? if ($mins==3){? option value=3 selected3 ?}else{? option value=33 ?}? option value=44 option value=55 option value=66 option value=77 option value=88 option value=99 option value=1010 option value= td valign=topselect name=mins[] size=12 multiple option value=1212 option value=1313 option value=1414 option value=1515 option value=1616 option value=1717 option value=1818 option value=1919 option value=2020 option value=2121 option value= option value=2323 /tr/table -- Best regards, Richard Kurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best regards, rdkurthmailto:[EMAIL PROTECTED] -- Best regards, rdkurthmailto:[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] FILEMTIME
Hello, I amusing the following PHP code.. but I want to make it so that it also displays the time in 24 hr mode and the time is +3600 seconds. (1 hour) ? $last_modified = filemtime(about.php); print(Last Updated ); print(date(m/j/Y, $last_modified)); ? How can I do this? Thanks Mike
Re: [PHP] Most portable back button in php
I have this code on one of my sites... it sits inthe config file, so every page is able to establish their URL. For my site, the definition of URL is just the stuff after http://www.domain.com/. $script = $_SERVER['PHP_SELF']; $script = eregi_replace('^/', '', $script); $qs = $_SERVER['QUERY_STRING']; $this_ref = base64_encode($script.?.$qs); The result? $this_ref will look like dir/dir/file.php?getvar=foo if the current URL is http://www.mysite.com/dir/dir/file.php?getvar=foo The if I need to pass the referrer onto another script (in my case a login procedure), I just do this: A HREF=login.php?return_ref=?=$this_ref?login here/a login.php passes $_GET['return_ref'] around in the URL through the login form, the validation, the error messages, the password reminder script, and all sorts of other stuff, and once the user is finally logged in, I can do this: $return_ref = base64_decode($_GET['return_ref']); and supply them with: A HREF=?=$return_ref?Click here to continue/a ... or better still, once they're logged in, I just: header(Location: {$return_ref}); If you wanted to do it for a full domain URL, then store your full domain as a var $base_url, and prepend it to $this_ref $base_url = http://www.mydomain.com;; // without trailing slash $script = $_SERVER['PHP_SELF']; $qs = $_SERVER['QUERY_STRING']; $this_ref = base64_encode($base_url.$script.?.$qs); The only thing this doesn't cover is pages with POST variables, but I wouldn't want it to. Justin French on 09/08/02 1:40 AM, Henry ([EMAIL PROTECTED]) wrote: I have an idea then. How can I best generate a full URL from PHP_SELF and other variables on the referrer page such that I can generate the back link on the page I get to even if the referrer page is on a different server? as an eample if I know that the page to go back to will be at http://www.myprimary.com/referrer.php and I generate a page at http://www.mysecondary.com/info.php I can ensure that there is the following html in place a href=http://www.myprimary.com/referrer.php;go back/a TIA Henry Stas Maximov [EMAIL PROTECTED] wrote in message news:008601c23eef$cc25f260$ec64@nexus... Yes, indeed. Thanks, Justin, I forget to mention this one. It works really well on forums and comments, i.e. the cases when you do POSTs. The good thing here is that you passing the whole URL (taking it from PHP_SELF), so you save on the decision logic in the end. Regards, Stas - Original Message - From: Justin French [EMAIL PROTECTED] To: Stas Maximov [EMAIL PROTECTED]; Henry [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Thursday, August 08, 2002 4:03 PM Subject: Re: [PHP] Most portable back button in php Just to add in some more ideas, you can always pass the referring script to the second script manually... I do this when someone has to login, then return back to the original page they were on... I just get the URL + query string, base64_encode() it, then pass it around in the URL or POST until i need it, then base64_decode() it and header(Location: ...) the user to the right page. Works really well, depending on your situation. Justin -- 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] E-commerce site issue?
on 09/08/02 3:56 AM, The Gabster ([EMAIL PROTECTED]) wrote: Hi all, Using my own server (not through an ISP), how do I go about setting up an e-commerce site? So I can accept credit cards for purchases? Do you want to ACCEPT credit cards (process the purchases manually), or PROCESS credit cards via the server. There's a big difference. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Matchmaking site
Unless you have experience in other web based languages (other than HTML), I'd suggest this is a difficult place to start because you'll need: - user registration and management - session management - detailed searching systems - automated matchmaking and emailing systems - image resizing and validation systems - content management and approval of profiles - templating systems, code libraries and reuseable modules - form input validation This is a big job -- rather complex. It's the sort of thing you can't do well with modules either... deciding to do this, IMHO, will require lots of planning and knowledge how each one of the above systems will integrate with the rest, because it's the only way to avoid re-coding the thing 30 times, at great expense. Personally, I'd look at each one of the above issues separately in depth, trying to write things in a highly re-useable way, with extensive use of common config files, common functions, and common templates. Once you've got a grip on all the pieces, glueing it all together will be a lot less painful. Incidently, that's how I worked on my first projects :) Justin French on 09/08/02 9:59 AM, Oficina Digital ([EMAIL PROTECTED]) wrote: Hello, I am new to the list and don't know how kind you are helping complete beginners in PHP. I intend to set a personals matchmaking site for people interested in entheogens (http://singlemates.yage.net) I don't know where to begin, I have some PHP cookbooks handy and am looking to do it the easy way but have no idea how much work and knowledge is needed. What I want is for people to log in (using sessions?), post and modify profile with uploading photos and search for personals based on location, desired place to live, age, kind of relationship, etc. I intend to do it it by steps adding features as my php knowledge increase but would appretiate very much some tips and hints on where to begin and how to design this project. Some tips on where and what I shall learn for this project would be of great help. Thanks a lot, hope this may help other people interested in similar works, -Danalex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP multipart form data
hello, i have php 4.2.2 compiled with --enable-ftp running (as a module in apache under red-hat 6.2) and I can not get file uploads through a web page to work!?!? The form variable $userfile (which is the file input name) is returning false; Any ideas how to troubleshoot this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?
It seems way too difficult to configure db2 on linux. Let alone trying to do it on freebsd, which I hope to tackle that next week. I tell you though, I really love mysql, it's so easy to use, and configure. mysql just works. mysql's performance on a table I have that has roughly 250,000 rows of address entries, beats our as/400 with db2 by orders of magnitude and mytest box is a Celeron 300. Anyway, this is where I found the solution to the gibberish line that I put in my doc (see step 3) : http://www7b.boulder.ibm.com/dmdd/library/techarticle/scott/0614_scott.html You may find this of help: http://www.phpbuilder.com/mail/php-db/2001011/0076.php Oh, did you call your instance db2inst1? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open 10 http connections in parallel
Hello, I had to write a script to open 10 http connections for different links and get the response from the host. I do it by fopen each url one by one and save the response to a separated file. But it slow! I wonder if i can open 10 connnect (or more) in parallel? Thanks in advance. NoWhErEMaN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DynaPic Class funktion
On Friday 09 August 2002 04:13, Sascha Braun wrote: Hello, can somebody explain me, how this class is working and how I can use it? ? //Images Wrapper for thumbs and other stuffs, require GDLib //Riccardo Pasquini, 04/04/2001, v0.1 [EMAIL PROTECTED] Have you tried asking the author?? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I don't know what Descartes' got, But booze can do what Kant cannot. -- Mike Cross */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-INST] RH7.3 + PHP-4.2.2 : make install -- [install-sapi] Error 1
- Original Message - From: Bob Lockie [EMAIL PROTECTED] Sent: Thursday, August 08, 2002 2:20 PM Subject: Re: [PHP-INST] RH7.3 + PHP-4.2.2 : make install -- [install-sapi] Error 1 Run 'rm config.cache' and 'make clean' before each compile. What's the method of getting that into the standard configure script? It seems to cause a lot of trouble, and questions on the list. I have no idea why any writers of software that use config don't do a make clean and rm config.cache first. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Open 10 http connections in parallel
use C and fork() php (AFAIK) can't do parallel programming -Original Message- From: NoWhErEMan [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:58 PM To: [EMAIL PROTECTED] Subject: [PHP] Open 10 http connections in parallel Hello, I had to write a script to open 10 http connections for different links and get the response from the host. I do it by fopen each url one by one and save the response to a separated file. But it slow! I wonder if i can open 10 connnect (or more) in parallel? Thanks in advance. NoWhErEMaN -- 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] Please help with array_diff()
On Friday 09 August 2002 06:14, Gandalf wrote: $diff = array_diff($foo[0], $bar[0]); What does $foo[0] and $bar[0] contain? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Remember that there is an outside world to see and enjoy. -- Hans Liepmann */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Open 10 http connections in parallel
I've never done this before, but you probably could open these connections via a socket, and set them all non-blocking. Presumably you'd them have to write a loop that polled all connections to check if they'd closed, or time them out after some number of seconds. See http://php.he.net/manual/en/function.socket-set-blocking.php and http://php.he.net/manual/en/ref.network.php -steve At 1:28 PM +1000 8/9/02, Martin Towell [EMAIL PROTECTED] wrote: use C and fork() php (AFAIK) can't do parallel programming -Original Message- From: NoWhErEMan [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:58 PM To: [EMAIL PROTECTED] Subject: [PHP] Open 10 http connections in parallel Hello, I had to write a script to open 10 http connections for different links and get the response from the host. I do it by fopen each url one by one and save the response to a separated file. But it slow! I wonder if i can open 10 connnect (or more) in parallel? Thanks in advance. NoWhErEMaN -- ++ | Steve Edberg [EMAIL PROTECTED] | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | ++ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with selection
Could somebody look at this and tell me way it is not selecting the option fields in the $mins variable. I have looking at this all day and can not figure out what is wrong with it. ?php $mins=3,4,6,23,59; $ret=array_reverse(explode(',',$mins)); $td = td valign=topselect name=\mins[]\ id=\mins\ size=\12\ multiple; echo TABLE border=0tr; echo $td; for($i=0; $i60; $i++) { if($i=6) { echo option value=\$i\; if(isset($ret[$i])) echo ' selected'; echo $i/option; }else{ echo option value=\$i\$i; if(($i%11)==0) echo /select/td \n\n $td; }} echo /td/tr/table/td; ? -- Best regards, rdkurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Matchmaking site
On 9 Aug 2002 at 0:59, Oficina Digital wrote: Hello, I am new to the list and don't know how kind you are helping complete beginners in PHP. I intend to set a personals matchmaking site for people interested in entheogens (http://singlemates.yage.net) I don't know where to begin, I have some PHP cookbooks handy and am looking to do it the easy way but have no idea how much work and knowledge is needed. What I want is for people to log in (using sessions?), post and modify profile with uploading photos and search for personals based on location, desired place to live, age, kind of relationship, etc. I intend to do it it by steps adding features as my php knowledge increase but would appretiate very much some tips and hints on where to begin and how to design this project. Some tips on where and what I shall learn for this project would be of great help. Well I think you've made a good first step by asking others. Iike the idea of a core. If you cannot create an application that can grow then imho you did not do it right. So the idea that you can start with a limited set of features and grow your application is, imho, a good idea that is possible. Think. Sketch. Write don't code anything. Map it out in your mind, your imagination and on paper. It just so happens that I'm working on a singles type site; it is going to be one of those hot or not type sites. I've got the same idea you have. I'll start with something that people will find useful and then I'll grow it. If you were to do it in Perl I could get you started rather quickly as I have an architecture for Perl apps but I don't, not yet, for PHP apps. Mind you, I develop in a virtual environment and so I cannot use a lot of established archtitectures which requires more than one usually gets on a virtual server. Anyhow, think of the core of who your audience is and what they will do. Audience People will register login logout change preferences set preferences upload image(s) People have name age preferences etc. ... build up a data model here. Just think of them and what they will do and what you will need to know about them for them to do those things. I'm just thinking of the top of my head here. BY ALL MEANS do not re-write something someone else already wrote. Look into using modules from Pear and look for modules you can find here: http://pear.php.net/ Oh heck, I was looking in my bookmarks to recommend some links and I found this: http://www.cyber.com.au/users/clancy/phplib.html I need to read that myself. The are saying the right thing here. Lots of classes at this site: http://www.phpclasses.org/mirrors.html?page=%2Findex.html At least read, just read so later, in a few years perhaps, you will have only yourself to blame when you go back to code that was written on the wind: http://pear.php.net/manual/en/standards.php Whatever you do, don't just start coding. I'm working on someone else's PHP application right now. Files everywhere, tricks used to source differen files, I think the original programmer (seems that at least 2 had a hand in it) just gave up. I've refused to work on some old stuff I wrote. Better to re-write it I said. Not so much a rewrite as a reorganize. If you spend time thinking how to organize your code in the beginning you will find that growing your app will be a pleasure rather than a nightmare. Peter http://www.coremodules.com/ Web Development and Support at Affordable Prices 901-757-8322[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Open 10 http connections in parallel
What about the PCNTL functions? http://www.php.net/manual/en/ref.pcntl.php I haven't used them, but there's a fork function in there... On Fri, 9 Aug 2002, Martin Towell wrote: use C and fork() php (AFAIK) can't do parallel programming -Original Message- From: NoWhErEMan [mailto:[EMAIL PROTECTED]] Sent: Friday, August 09, 2002 12:58 PM To: [EMAIL PROTECTED] Subject: Open 10 http connections in parallel Hello, I had to write a script to open 10 http connections for different links and get the response from the host. I do it by fopen each url one by one and save the response to a separated file. But it slow! I wonder if i can open 10 connnect (or more) in parallel? Thanks in advance. NoWhErEMaN -- 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] Re: FILEMTIME
Mike Zagorski wrote: Hello, I amusing the following PHP code.. but I want to make it so that it also displays the time in 24 hr mode and the time is +3600 seconds. (1 hour) ? $last_modified = filemtime(about.php); print(Last Updated ); print(date(m/j/Y, $last_modified)); ? How can I do this? Thanks Mike Check out http://www.php.net/gmdate (for the timezone offset) and http://www.php.net/date (for the date formatting). /lasso ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP multipart form data
Mike Dunlop wrote: hello, i have php 4.2.2 compiled with --enable-ftp running (as a module in apache under red-hat 6.2) and I can not get file uploads through a web page to work!?!? The form variable $userfile (which is the file input name) is returning false; Any ideas how to troubleshoot this? Check your php.ini. Look for register_globals. Check if this is set to off (which is the default for 4.2.2). If it's off, you need to use $_GET['userfile'], $_POST['userfile'] or $_FILES['userfile'] (depending on the METHOD and ENCODING attributes of the FORM tag. This has been discussed numerous times on the list, so you shouldn't have any trouble finding more info about it... This is a good starting point in the manual: http://www.php.net/manual/en/language.variables.predefined.php Kindly /lasso ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] posting news via php - 535 error
Hi there, I am trying to write a script which is posting news to a newsserver. Unfortunatelly I do get a 535 error back which is not reported in: http://www.faqs.org/rfcs/rfc977.html Section 3.10.2 Maybe someone of you guys has a clue of an idea what is going wrong. connecting works, so I did not include the connect code. The code for posting is underneath. Thanx for any help on that. Andy $cfgServer= news.php.net; $cfgNewsGroup= php.general; $subject='Test'; $header=' Newsgroups: '.$cfgNewsGroup.' Path: '.$cfgServer.' Relay-Version: version B 2.10 2/13/83; site cbosgd.UUCP Posting-Version: version B 2.10 2/13/83; site eagle.UUCP From: [EMAIL PROTECTED] (Jerry Schwarz) Subject: '.$subject.' Message-ID: [EMAIL PROTECTED] Date: Friday, 10-Aug-2002 16:14:55 EST Followup-To: '.$cfgNewsGroup.' Expires: Saturday, 1-Jan-2003 00:00:00 EST Date-Received: Friday, 10-Aug-2002 16:59:30 EST Organization: Bell Labs, Murray Hill '; $body='\n This is a test. '; $message=$header.$body; $put = fputs($usenet_handle, POST $message\n); echo $put; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php