php-general Digest 5 Apr 2001 10:36:38 -0000 Issue 609 Topics (messages 47137 through 47227): More Email ereg Validation 47137 by: Dan Wilson 47147 by: Jason Murray 47163 by: Jeff Carnahan 47207 by: Renze Munnik Re: PHP + IRC 47138 by: Jason Brooke 47142 by: Peter Houchin 47146 by: John Donagher 47191 by: Geir Eivind Mork 47193 by: Jack Dempsey 47205 by: Geir Eivind Mork 47206 by: Geir Eivind Mork Re: Problems porting from MySQL Server to MSSQL7 Server 47139 by: dennis moore can I detect html email capability? 47140 by: Matthew Delmarter 47227 by: Yasuo Ohgaki Installation problems - PHP4.0.1 / PDFLib / --with-dom 47141 by: Jason Murray Re: socket functions 47143 by: Joseph Blythe mysql and php 47144 by: Augusto Cesar Castoldi 47220 by: Christian Reiniger Requiring variables to be pre-declared? 47145 by: Eric Knudstrup 47150 by: junk-php.aontic.com Re: Building an array from a URL 47148 by: Mike Gifford 47155 by: Joe Stump 47157 by: Mike Gifford 47158 by: Mike Gifford 47170 by: Joe Stump Re: PHP.net is slow 47149 by: junk-php.aontic.com Crack extension 47151 by: junk-php.aontic.com Re: help - parsing text file 47152 by: Plutarck PHP with Win2k or Linux 47153 by: Frank K 47159 by: Plutarck 47164 by: Chris Adams Re: Emails from database... 47154 by: David Robley 47196 by: David Robley Re: insert into multiple tables 47156 by: David Robley PHPSESSID sticks to every link after upgrate of Apache/PHP 47160 by: Maxim Maletsky 47161 by: Joseph Blythe 47175 by: Plutarck output buffering 47162 by: Christian Dechery 47174 by: Plutarck Uploading data with 'application/octet-stream' encoding ? 47165 by: Peter Choynowski sockets (long) 47166 by: Joseph Blythe 47169 by: Plutarck 47177 by: Joseph Blythe 47210 by: Yasuo Ohgaki Is their a function for this? 47167 by: Black S. 47212 by: Renze Munnik headers & passthru() 47168 by: Nikolai Vladychevski 47171 by: David Robley 47176 by: Plutarck Fastest way to encrypt database storage? 47172 by: Floyd Piedad Left Join Across Two Databases 47173 by: Jonathan Chum 47179 by: Plutarck 47223 by: Christian Reiniger Re: Monthly Drawing Winner! 47178 by: Plutarck Re: XML 47180 by: Plutarck 47181 by: Soeren Staun-Pedersen 47183 by: Josh McDonald 47186 by: Plutarck 47189 by: Soeren Staun-Pedersen Re: Check whether I have php installed as cgi or api??? 47182 by: Plutarck RH7 4.0.4pl1 RPMs 47184 by: maatt Re: problems with session_register()... 47185 by: slavko dervisevic Re: session question 47187 by: Plutarck Re: geocities and php 47188 by: Plutarck Re: is this syntax correct? 47190 by: Plutarck 47200 by: Jacky.lilst Re: TheCasino.com: You have been removed! 47192 by: Harshdeep S Jawanda Reg exps. 47194 by: elias 47203 by: Martin Cabrera Diaubalick Help would be appreciated 47195 by: Richard Kurth 47226 by: nicuc.ac.jp Re: column names 47197 by: Tim Ward current location 47198 by: Paul Juliano 47199 by: Dominick Vansevenant 47214 by: Paul Juliano 47225 by: nicuc.ac.jp Re: file upload question 47201 by: Renze Munnik 47204 by: Yasuo Ohgaki Re: APC breaking under freebsd! 47202 by: Yasuo Ohgaki how do I delete session 47208 by: Jacky.lilst 47213 by: Renze Munnik 47215 by: Jacky.lilst 47216 by: Felix Kronlage 47217 by: Renze Munnik 47224 by: nicuc.ac.jp Re: [PHP-DB] mysql_result() 47209 by: Jordan Elver Re: any other way ? 47211 by: Geir Eivind Mork Re: ms acces to mySQL 47218 by: Geir Eivind Mork Re: Select case equivelent 47219 by: Christian Reiniger 47221 by: Geir Eivind Mork "YourName.BEST321.com" FREE 免費域名 !!!!! 47222 by: Water Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
I'm trying to parse the different "parts" of an email address both for validation and munging. I have the following regex: ([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{3}) This works great, except it doesn't accept the country code domains (.au, etc). So I changed the number of characters to {2,3} at the end of the regex: ([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{2,3}) But then this works for the country code domains, but cuts off a character of the 3 char domains because it matches the 2 characters as well. So if I'm using the [EMAIL PROTECTED] email address I end up with $1 = "my", $2 = "domain" and $3 = "om" What do I do to catch both cases correctly? Thanks in advance! -Dan
> This works great, except it doesn't accept the country code > domains (.au, etc). So I changed the number of characters to {2,3} at the > end of the regex: > ([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{2,3}) > > But then this works for the country code domains, but cuts > off a character of the 3 char domains because it matches the 2 characters as > well. So if I'm using the [EMAIL PROTECTED] email address I end up with $1 = > "my", $2 = "domain" and $3 = "om" > > What do I do to catch both cases correctly? Function validEmail($emailaddress) { // Decides if the email address is valid. Checks syntax and DNS // records, for total smartass value. Returns "valid", "invalid-mx" // or "invalid-form". if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $emailaddress, $check)) { if ( checkdnsrr(substr(strstr($check[0], '@'), 1), "ANY") ) { return "valid"; } else { return "invalid-mx"; } } else { return "invalid-form"; } } If it gets through the first match with ".om", it won't get through the checkdnsrr(). Jason
In article <000501c0bd59$b637e7b0$[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... }I'm trying to parse the different "parts" of an email address both for }validation and munging. } }I have the following regex: }([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{3}) } }This works great, except it doesn't accept the country code domains (.au, }etc). So I changed the number of characters to {2,3} at the end of the }regex: }([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{2,3}) } Here's a quick patch.. =) ([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{2}[a-z]?) -- Jeff Carnahan - [EMAIL PROTECTED]
Jason Murray wrote: > > Function validEmail($emailaddress) > { > // Decides if the email address is valid. Checks syntax and DNS > // records, for total smartass value. Returns "valid", "invalid-mx" > // or "invalid-form". > > if > (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", > $emailaddress, $check)) > { > if ( checkdnsrr(substr(strstr($check[0], '@'), 1), "ANY") ) > { return "valid"; } > else > { return "invalid-mx"; } > } > else > { > return "invalid-form"; > } > } > > If it gets through the first match with ".om", it won't get through the > checkdnsrr(). > > Jason > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] Good idea... that $. Also the checkdnsrr is a nice feature. But.... I'll have to remind you on a previous thread about quite the same problem. The checkdnsrr can slow down the performance of your own site. It _can_ make it terribly slow. Draw your own conclusion. -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
Yes - see the network and/or socket functions sections in the manual at http://www.php.net You might want to use the IRC RFC as a reference on the protocol jason > Hello PHP, > > Is there any ways to use php with irc? > > -- > Best regards,
yeah have a look on phpbuilder.com phpwizard.net zend.com they all & most likely many others have things on php & irc -----Original Message----- From: Puarot [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 7:00 AM To: PHP List Subject: [PHP] PHP + IRC Hello PHP, Is there any ways to use php with irc? -- Best regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
There is an irc (ircg) extension now, although it is undocumented in the manual. On Thu, 5 Apr 2001, Jason Brooke wrote: > Yes - see the network and/or socket functions sections in the manual at > http://www.php.net > You might want to use the IRC RFC as a reference on the protocol > > jason > > > > > Hello PHP, > > > > Is there any ways to use php with irc? > > > > -- > > Best regards, > > > > > -- John Donagher Application Engineer Intacct Corp. - Powerful Accounting on the Web 408-395-0989 720 University Ave. Los Gatos CA 95032 www.intacct.com Public key available off http://www.keyserver.net Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD
On 04 Apr 2001 16:53:28 -0400, John Donagher wrote: > > There is an irc (ircg) extension now, although it is undocumented in the > manual. > Who do one have to bribe/kill/beat to get the info about that when one hasn't time/knowledge enough to snoop around in the sources? -- php developer / CoreTrek AS | It's possible that I'm just an idiot, Sandnes / Rogaland / Norway | and don't recognize a sleepy slavemaster web: http://www.moijk.net/ | when I see one. -- Larry
<vent> It'd be nice to have someone to do our dirtywork for us, but this list isn't (IMHO) about finding people who DO have the time/knowledge to "snoop around in the sources" for us... posting a message like that, with that kind of tone, won't get you help from any list...its late, i'm tired of coding java, and posting a message basically describing your frustration because someone won't give you the nicely packaged annotated ball of information you're looking for because you don't have the time to do it is just plain irritating... </vent> best to all, jack Geir Eivind Mork wrote: > > On 04 Apr 2001 16:53:28 -0400, John Donagher wrote: > > > > There is an irc (ircg) extension now, although it is undocumented in the > > manual. > > > > Who do one have to bribe/kill/beat to get the info about that when one > hasn't time/knowledge enough to snoop around in the sources? > > -- > php developer / CoreTrek AS | It's possible that I'm just an idiot, > Sandnes / Rogaland / Norway | and don't recognize a sleepy slavemaster > web: http://www.moijk.net/ | when I see one. -- Larry > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
On 05 Apr 2001 03:32:10 -0400, Jack Dempsey wrote: > <vent> > It'd be nice to have someone to do our dirtywork for us, but this list > isn't (IMHO) about finding people who DO have the time/knowledge to > "snoop around in the sources" for us... Where is the sense of humor? :) I just asked if anyone had a functionset / any documentation for that particular feature. I ought to have included a smiley but I didn't think anyone would be offended by my message. it was ment as a joke. So to anyone that got offended, knock on my door and I'll give you a cold beer to cool down the temper with :) -- php developer / CoreTrek AS | Please take note: Sandnes / Rogaland / Norway | web: http://www.moijk.net/ |
On 05 Apr 2001 03:32:10 -0400, Jack Dempsey wrote: > <vent> > It'd be nice to have someone to do our dirtywork for us, but this list > isn't (IMHO) about finding people who DO have the time/knowledge to > "snoop around in the sources" for us... Where is the sense of humor? :) I just asked if anyone had a functionset / any documentation for that particular feature. I ought to have included a smiley but I didn't think anyone would be offended by my message. it was ment as a joke. So to anyone that got offended, knock on my door and I'll give you a cold beer to cool down the temper with :) -- php developer / CoreTrek AS | Please take note: Sandnes / Rogaland / Norway | web: http://www.moijk.net/ |
my_update("update sometable set col1=".$var1." where col2=".$var2); and function: function my_update($query){ global $host,$user,$psw,$name; $conn=mssql_pconnect($host,user,psw) or die("Error: connection failed!"); $rdb=mssql_select_db($name,$conn) or die("Error: DB does not exist"); $rez_q=mssql_query($query,$conn) or die("Error: Invalid SQL"); } The same code and function work fine in MySQL. Why doesn't work in MSSQL Server??? You need to fully examine your SQL statements against the format that MSSQL wants to see.
Hello all, Out of curiosity I am looking at what can be done with email marketing. I am currently looking at a solution that apparently can "send a query to an email address to detect if it can receive images. If so it sends an HTML email, otherwise just text." (quote) Does this sound correct? I never knew such things could be done. If so, can it be done with PHP? I look forward to your reply... Regards, Matthew Delmarter
You cannot detect directly, but you can do 1) Send e-mail ask user to reply 2) Get mailer header from e-mail, then decided if it support HTML e-mail However, I think it would be more appropriate to let the user choose mail format via. web site. It's just a matter of writing a URL in mail. Regards, -- Yasuo Ohgaki ""Matthew Delmarter"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello all, > > Out of curiosity I am looking at what can be done with email marketing. I am > currently looking at a solution that apparently can "send a query to an > email address to detect if it can receive images. If so it sends an HTML > email, otherwise just text." (quote) > > Does this sound correct? I never knew such things could be done. If so, can > it be done with PHP? > > I look forward to your reply... > > Regards, > > Matthew Delmarter > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi folks, We're trying to install the above on a new development box here, and it seems to be failing. The system administrator has given me this to pass on and query: =============================================================== I'm using PHP version 4.0.4pl1. I tried the configure line: ./configure --with-apxs=/usr/local/apache/bin/apxs --with-pdflib --with-dom It broke with the following error: --- checking whether to include Pdflib 3.x support... yes yes checking for PDF_show_boxed in -lpdf... no configure: error: pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so --- Running that configure line without the '--with-dom' switch worked. It appears the 'PDF_show_boxed' test is affected, as it reports 'yes' if compiled without '--with-dom'. =============================================================== PDFLib was installed prior to attempting compilation. Can anyone shed some light on this please? Thanks Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair!
Yasuo Ohgaki wrote: > Did you read the Manual? The manual is my bible I always read it before I post. Also searched google and the list archives. > socket_set_blocking As far as I can tell this does not work for the new socket functions, the file descriptor does not seem to be compatible? (it returns an error) You have to use set_nonblocking() which doesn't seem to work. > There is note that says it does not work with PHP4/Win32. I may need to check > BugDB to find out status of this problem. I am running linux so this should not matter. Thanks for your reply, Regards Joseph
I'm sending this command to mysql UPDATE fusuario u, fgrupos g SET g.cdgrupo=1, u.celular="99823640", u.nome="Augusto X", u.sobrenome="Cesar Castoldi", u.cidade="Florinópolis", u.emailpessoal="[EMAIL PROTECTED]", u.idade="19", u.sexo="M", u.operadora="T", u.email="", u.ddd="048" WHERE g.cdgrupo=1 and u.cdusuario=g.cdusuario and u.cdusuario=1 and u.celular="99823640" and u.ddd="048" and u.ativo=1 and g.ativo=1 and I receive this error message: Mensagens do MySQL : You have an error in your SQL syntax near 'u, fgrupos g SET g.cdgrupo=1, u.celular="99823640", u.nome="Augusto X", u.sobren' at line 1 Why? How can I update with 2 or more tables? regards, Augusto
On Thursday 05 April 2001 02:15, you wrote: > I'm sending this command to mysql > > UPDATE fusuario u, fgrupos g SET g.cdgrupo=1, u.celular="99823640", > u.nome="Augusto X", u.sobrenome="Cesar Castoldi", > u.cidade="Florinópolis", u.emailpessoal="[EMAIL PROTECTED]", > u.idade="19", u.sexo="M", u.operadora="T", u.email="", u.ddd="048" > WHERE g.cdgrupo=1 and u.cdusuario=g.cdusuario and u.cdusuario=1 and > u.celular="99823640" and u.ddd="048" and u.ativo=1 and g.ativo=1 > > and I receive this error message: > > Mensagens do MySQL : You have an error in your SQL syntax near 'u, > fgrupos g SET g.cdgrupo=1, u.celular="99823640", u.nome="Augusto X", > u.sobren' at line 1 > > Why? How can I update with 2 or more tables? use separate queries -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032
Being new to PHP from the C world, is there anyway that I can enforce that variables are declared for being used? There have been a couple of times where I have been driven nuts trying to find out why something isn't working and found that a variable name was off. Eric
Try setting your error level to E_ALL when being driven nuts... You'll get lots of useful feedback. August ""Eric Knudstrup"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Being new to PHP from the C world, is there anyway that I can enforce that > variables are declared for being used? > There have been a couple of times where I have been driven nuts trying to > find out why something isn't working and found that a variable name was off. > > Eric > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I tried this, but it converted [ and ] to url friendly codes. Does this still work? Mike Joe Stump wrote: > FYI you can send data like this on the url: > > http://www.foo.com/script.php?test[joe]=stump&test[harry]=bar&test[jane]=scott > > Then $test will be an array that translates to this in PHP: > > <? > > $test = array( > joe => 'stump', > harry => 'bar', > jane => 'scott'); > > ?> > > --Joe > > On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote: > > Hello, > > > > I'm trying to build an array out of data submitted from a URL. > > > > Essentially, I want to pull certain records out of a database which have been > > selected on another form. > > > > The URL presently looks like this: > > superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRSS175=1188 > > > > I'd like to take these independent variables and merge them into a single array: > > $array_superRSS = implode (":", $superRSS[]); > > > > So I can then pipe these values directly into another function: > > > > while ($array_superRSS) { > > display_superRSS($array_superRSS[]); > > } > > > > Obviously I'm missing a step or two here, but would really appreciate someone > > filling in some of the gaps. > > > > Thanks! > > > > Mike > > -- > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > Offering everything your organization needs for an effective web site. > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > If a book doesn't make us better, then what on earth is it for? - Alice Walker > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > /******************************************************************************\ > * Joe Stump - PHP/SQL/HTML Developer * > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > * "Better to double your money on mediocrity than lose it all on a dream." * > \******************************************************************************/ -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Featured Client: http://www.aboriginalrightscoalition.ca/ If a book doesn't make us better, then what on earth is it for? - Alice Walker
It works for me in production. On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote: > I tried this, but it converted [ and ] to url friendly codes. Does this still > work? > > Mike > > Joe Stump wrote: > > FYI you can send data like this on the url: > > > > http://www.foo.com/script.php?test[joe]=stump&test[harry]=bar&test[jane]=scott > > > > Then $test will be an array that translates to this in PHP: > > > > <? > > > > $test = array( > > joe => 'stump', > > harry => 'bar', > > jane => 'scott'); > > > > ?> > > > > --Joe > > > > On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote: > > > Hello, > > > > > > I'm trying to build an array out of data submitted from a URL. > > > > > > Essentially, I want to pull certain records out of a database which have been > > > selected on another form. > > > > > > The URL presently looks like this: > > > superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRSS175=1188 > > > > > > I'd like to take these independent variables and merge them into a single array: > > > $array_superRSS = implode (":", $superRSS[]); > > > > > > So I can then pipe these values directly into another function: > > > > > > while ($array_superRSS) { > > > display_superRSS($array_superRSS[]); > > > } > > > > > > Obviously I'm missing a step or two here, but would really appreciate someone > > > filling in some of the gaps. > > > > > > Thanks! > > > > > > Mike > > > -- > > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > > Offering everything your organization needs for an effective web site. > > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > > If a book doesn't make us better, then what on earth is it for? - Alice Walker > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > /******************************************************************************\ > > * Joe Stump - PHP/SQL/HTML Developer * > > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > > * "Better to double your money on mediocrity than lose it all on a dream." * > > \******************************************************************************/ > > -- > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > Offering everything your organization needs for an effective web site. > Featured Client: http://www.aboriginalrightscoalition.ca/ > If a book doesn't make us better, then what on earth is it for? - Alice Walker /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/
Hi Joe, I don't doubt that at all.. However, my strings aren now looking like this. http://openconcept.ca/rabble/superRSS.phtml?Title%5B1000%5D=RBC+Dominion+Securities+investigates+&URL%5B1000%5D=http%3A%2F%2Fcbc.ca%2Fcgi-bin%2Ftemplates%2Fview.cgi%3F%2Fnews%2F2001%2F04%2F04%2Frbcds_010404&Abstract%5B1000%5D=RBC+Dominion+Securities+said+Wednesday+morning+it+is+launching+an++investigation+of+some+suspicious+trading.+%0D%0A&Title%5B1184%5D=Indigenous+Peoples+Critical+of+The+Human+Genome+Project&URL%5B1184%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2113&Abstract%5B1184%5D=aa&new_superRSS=new_superRSS I've got the $Title[1000]=, but it looks like Title%5B1000%5D= Also, I'm having trouble extracting arrays from arrays.. I just want to insert the new values (for articleID 1000, etc.) into a table.. Any suggestions? Mike Joe Stump wrote: > It works for me in production. > > On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote: > > I tried this, but it converted [ and ] to url friendly codes. Does this still > > work? > > > > Mike > > > > Joe Stump wrote: > > > FYI you can send data like this on the url: > > > > > > http://www.foo.com/script.php?test[joe]=stump&test[harry]=bar&test[jane]=scott > > > > > > Then $test will be an array that translates to this in PHP: > > > > > > <? > > > > > > $test = array( > > > joe => 'stump', > > > harry => 'bar', > > > jane => 'scott'); > > > > > > ?> > > > > > > --Joe > > > > > > On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote: > > > > Hello, > > > > > > > > I'm trying to build an array out of data submitted from a URL. > > > > > > > > Essentially, I want to pull certain records out of a database which have been > > > > selected on another form. > > > > > > > > The URL presently looks like this: > > > > >superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRSS175=1188 > > > > > > > > I'd like to take these independent variables and merge them into a single >array: > > > > $array_superRSS = implode (":", $superRSS[]); > > > > > > > > So I can then pipe these values directly into another function: > > > > > > > > while ($array_superRSS) { > > > > display_superRSS($array_superRSS[]); > > > > } > > > > > > > > Obviously I'm missing a step or two here, but would really appreciate someone > > > > filling in some of the gaps. > > > > > > > > Thanks! > > > > > > > > Mike > > > > -- > > > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > > > Offering everything your organization needs for an effective web site. > > > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > > > If a book doesn't make us better, then what on earth is it for? - Alice Walker > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > /******************************************************************************\ > > > * Joe Stump - PHP/SQL/HTML Developer * > > > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > > > * "Better to double your money on mediocrity than lose it all on a dream." * > > > \******************************************************************************/ > > > > -- > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > Offering everything your organization needs for an effective web site. > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > If a book doesn't make us better, then what on earth is it for? - Alice Walker > > /******************************************************************************\ > * Joe Stump - PHP/SQL/HTML Developer * > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > * "Better to double your money on mediocrity than lose it all on a dream." * > \******************************************************************************/ -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Featured Client: http://www.aboriginalrightscoalition.ca/ If a book doesn't make us better, then what on earth is it for? - Alice Walker
Hell Knut, "Knut H. Hassel Nielsen" wrote: > Did you try to see if $HTTP_GET_VARS can help you ? It's useful for pulling down the URL variables into an array, however I'd now like to go to the next step of pulling out data of an array of arrays... All of the files here are in a database. http://openconcept.ca/rabble/newsfeeds.phtml Select a number of them and it brings you here: http://openconcept.ca/rabble/superRSS.phtml?superRSS173=1170&superRSS177=1189 Pulls in the right data and everything. However, I'd now like to write this data to a database (after making minor adjustments): http://openconcept.ca/rabble/superRSS.phtml?Title%5B1170%5D=ANTI-FTAA+TOUR+TO+THE+NORTHEASTERN+UNITED+STATES&URL%5B1170%5D=http%3A%2F%2FProtest.Net%2Fview.cgi%3Fview%3D2052&Abstract%5B1170%5D=dd&Title%5B1189%5D=Rich+World%27s+Trade+Ministers+Discuss+New+Trade+Round&URL%5B1189%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2108&Abstract%5B1189%5D=dd&new_superRSS=new_superRSS However I now have an array of arrays to seperate and it doesn't seem to be working like the first one did. > Its an array of every variable posted by GET (the way you described) It was a GET & not POST indeed. > Else : > Split the different key/values with the delimiter '&' and thereafter split the > elements in the array by '=' How do I pull in this data if not as an array? Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Featured Client: http://www.aboriginalrightscoalition.ca/ If a book doesn't make us better, then what on earth is it for? - Alice Walker
Ok - say you have this: $foo = array( 0 => 'joe', 1 => 'stump', 2 => 'there'); while(list($key,$val) = each($foo)) $args[] = 'array['.$key.']='.$val; $url = 'http://www.server.com/script.html'; $url .= '?'.implode('&',$args); header("Location: $url"); exit; That has worked for me before and will most likely work again. --Joe On Wed, Apr 04, 2001 at 09:42:20PM -0400, Mike Gifford wrote: > Hi Joe, > > I don't doubt that at all.. However, my strings aren now looking like this. > > >http://openconcept.ca/rabble/superRSS.phtml?Title%5B1000%5D=RBC+Dominion+Securities+investigates+&URL%5B1000%5D=http%3A%2F%2Fcbc.ca%2Fcgi-bin%2Ftemplates%2Fview.cgi%3F%2Fnews%2F2001%2F04%2F04%2Frbcds_010404&Abstract%5B1000%5D=RBC+Dominion+Securities+said+Wednesday+morning+it+is+launching+an++investigation+of+some+suspicious+trading.+%0D%0A&Title%5B1184%5D=Indigenous+Peoples+Critical+of+The+Human+Genome+Project&URL%5B1184%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2113&Abstract%5B1184%5D=aa&new_superRSS=new_superRSS > > I've got the $Title[1000]=, but it looks like Title%5B1000%5D= > > Also, I'm having trouble extracting arrays from arrays.. I just want to insert > the new values (for articleID 1000, etc.) into a table.. > > Any suggestions? > > Mike > > Joe Stump wrote: > > It works for me in production. > > > > On Wed, Apr 04, 2001 at 08:56:53PM -0400, Mike Gifford wrote: > > > I tried this, but it converted [ and ] to url friendly codes. Does this still > > > work? > > > > > > Mike > > > > > > Joe Stump wrote: > > > > FYI you can send data like this on the url: > > > > > > > > http://www.foo.com/script.php?test[joe]=stump&test[harry]=bar&test[jane]=scott > > > > > > > > Then $test will be an array that translates to this in PHP: > > > > > > > > <? > > > > > > > > $test = array( > > > > joe => 'stump', > > > > harry => 'bar', > > > > jane => 'scott'); > > > > > > > > ?> > > > > > > > > --Joe > > > > > > > > On Wed, Apr 04, 2001 at 12:00:48PM -0400, Mike Gifford wrote: > > > > > Hello, > > > > > > > > > > I'm trying to build an array out of data submitted from a URL. > > > > > > > > > > Essentially, I want to pull certain records out of a database which have been > > > > > selected on another form. > > > > > > > > > > The URL presently looks like this: > > > > > >superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRSS175=1188 > > > > > > > > > > I'd like to take these independent variables and merge them into a single >array: > > > > > $array_superRSS = implode (":", $superRSS[]); > > > > > > > > > > So I can then pipe these values directly into another function: > > > > > > > > > > while ($array_superRSS) { > > > > > display_superRSS($array_superRSS[]); > > > > > } > > > > > > > > > > Obviously I'm missing a step or two here, but would really appreciate someone > > > > > filling in some of the gaps. > > > > > > > > > > Thanks! > > > > > > > > > > Mike > > > > > -- > > > > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > > > > Offering everything your organization needs for an effective web site. > > > > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > > > > If a book doesn't make us better, then what on earth is it for? - Alice >Walker > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > >/******************************************************************************\ > > > > * Joe Stump - PHP/SQL/HTML Developer * > > > > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > > > > * "Better to double your money on mediocrity than lose it all on a dream." * > > > > >\******************************************************************************/ > > > > > > -- > > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > > Offering everything your organization needs for an effective web site. > > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > > If a book doesn't make us better, then what on earth is it for? - Alice Walker > > > > /******************************************************************************\ > > * Joe Stump - PHP/SQL/HTML Developer * > > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > > * "Better to double your money on mediocrity than lose it all on a dream." * > > \******************************************************************************/ > > -- > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > Offering everything your organization needs for an effective web site. > Featured Client: http://www.aboriginalrightscoalition.ca/ > If a book doesn't make us better, then what on earth is it for? - Alice Walker /******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/
With the exception of some true downtime, I really love the new design, just wish it was easier to write to the folks responsible to say thanks. Fast, lightweight, and good looking... They're too modest. Bravo guys... August ""Matt Friedman"" <[EMAIL PROTECTED]> wrote in message 002f01c0bd37$60142dc0$03284d18@mattq3h8budilr">news:002f01c0bd37$60142dc0$03284d18@mattq3h8budilr... > I don't know about everyone else but I've found that since the changeover to > the new design of the php.net site, it's been very unreliable. > > I used to be able to look up a function in seconds if I didn't quite > remember the usage. Now, I find that the doesn't won't even come up at > times. > > Other times the search is very slow. If others have noticed this perhaps we > can alert the developers to the situation. > > How about a downloadalbe version of the site? Does such a thing exist? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Anyone using the crack extension in PHP? AZ
If it's always in that format you could do an explode on "\n", then run the regex on only the elements of the array you need to rip something from. So you can build a much simpler and smaller regex to do your work. -- Plutarck Should be working on something... ...but forgot what it was. "Kurth Bemis" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > arg - i' at wits end. i need to parse a text file into a mysql insert > statement. the statement isn't the problem its parsing the text > file. heres a sample of the file > > West Chesterfield > (603) 256-8278 V.90 > (603) 307-2100 V.90 & K56flex > (603) 307-2200 ISDN / DOV > Hinsdale336 > West Chesterfield256, 307, 614 > Westmoreland399 > Brattleboro, VT(802) 251, 254, 257, 258, 451 > Jacksonville, VT(802) 368, 659 > Newfane, VT(802) 221, 365 > Putney, VT(802) 387, 536 > Williamsville, VT(802) 348 > Wilmington, VT(802) 464 > > i need to get the town the number is located (west chesterfield in this > case) the 2 numbers (V.90 and ISDN - there may be more but i only need one > of each),town(state), and the number. I'm still struggling with rexexp > expressions...and just can't seem to hack this one around. I'm not opposed > to perl.....:-) can ANYONE offer any help? > > ~kurth > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Does anyone know is there are advantages to running linux while developing php? I just would like to know if there is anything special to installing and developing on linux before I move from Win2k?? Thanks, -Frank
While developing PHP...not really. The only real advantage is that you can make the path to your files more similar/the same as your server will have, so you can just upload all your scripts without modifying any lines. Other than the fact that LAMP is a bit more stable/faster than WAMP (or at least some people say that...I haven't really noticed), going out of your way to develop under Linux rather than Win32 isn't all that justifiable. I develop on Windows 98 and deploy under Linux, and I've never seen a problem. The joys of platform independent programming languages ;) -- Plutarck Should be working on something... ...but forgot what it was. ""Frank K"" <[EMAIL PROTECTED]> wrote in message 001401c0bd76$44529fb0$c6483018@frankk">news:001401c0bd76$44529fb0$c6483018@frankk... Does anyone know is there are advantages to running linux while developing php? I just would like to know if there is anything special to installing and developing on linux before I move from Win2k?? Thanks, -Frank
On 4 Apr 2001 19:12:52 -0700, Frank K <[EMAIL PROTECTED]> wrote: >Does anyone know is there are advantages to running linux while = >developing php? I just would like to know if there is anything special = >to installing and developing on linux before I move from Win2k?? Three advantages: - it's free - it will more closely follow your production server's environment, which can be handy for more involved things and, of course, any custom extensions you have developed. This is also nice to prevent little problems like different-case links to files which work fine on case-insensitive filesystems. - it's a native environment - the Win32 port isn't as mature, so you may run into problems (e.g. 4.0.5RC1 on my Win32 Apache setup dies nastily if you use MySQL). Also, since IIS is extremely feature-poor compared with Apache, you may need to run Apache. If you have to install all of this Unix software, you might just want to do it under Unix in the first place. Two disadvantages: - Fewer clients - if you need to support, say, IE, you need a Windows box to test with. This becomes worse when you're dealing with things like Flash. - You need to know a lot more Unix. I personally find Unix much easier to use than NT but someone without my Unix background would disagree. My preferred environment is a Unix (Linux, OpenBSD) server running Samba and a WinNT/2K client. This allows you to use Unix as a server and still test with all of the Win32 software a modern developer needs to worry about.
On Wed, 4 Apr 2001 16:58, Dhaval Desai wrote: > Hi! > > > This is my code for sending email to all the emails in > my database: > > $connect = mysql_connecT(); > $query = "select email from table"; > $execute = mysql_db_query("database", $query); > > while($r=mysql_fetch_array($execute)) > { > $email .= $r('email') > > mail("$email", "My Subject", "Line 1\nLine 2\nLine > 3"); > } > > > > Will this send email to all the emails in the > database? > Is there any otehr wya of doing it? > > > Thank You > > Dhaval Desai If you fix your syntax in the line starting $email, and if you comma separate the list of email addresses, and put the mail function outside the loop, and there aren't too many mails for your MTA, you might have some success. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
On Thu, 5 Apr 2001 16:27, you wrote: > Hi! > > Do u mean the code should be like this? > > > $connect = mysql_connect(); > $query = "select email from table"; > $execute = mysql_db_query("database", $query); > while($r=mysql_fetch_array($execute)) > { > $try = $r('email'); Your syntax is wrong here - see the example in the docs for mysql_fetch_array > $email .= $try . ";"; and multiple addresses are separated by comma > } > > mail("$email", "My Subject", "Line 1\nLine 2\nLine > 3"); > It might be wise to just echo what you are proposing to pass to mail() until you get it right. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
On Thu, 5 Apr 2001 02:29, Toni Barskile wrote: > Can someone please help me w/the following code? I'm trying to insert > data collected on a form into two tables into my database. I > know the SQL statements work because I tested them individually, but I > keep getting the error "Couldn't execute query 2". Does > anyone have any suggestions? > > Thanks in Advance > > > Toni > > > <?php > $sql = "INSERT INTO users (fname, lname, compid, status, dept, room, > bldg, phone) VALUES ('$fname', '$lname', '$compid', > '$status', '$dept', '$room', '$bldg', '$phone')"; > $sql1 = "INSERT INTO tickets (ticket_num, compid, date_rpt, time_rpt, > request_type, hardware, model, dci, dci_num, software_type, > software_pkg, problem, comments, entered_by) VALUES ('$ticket_num', > '$compid', '$date_rpt', '$time_rpt', '$request_type', > '$hardware','$model','$dci','$dci_num','$software_type','$software_pkg' >,'$problem','$comments','$entered_by')"; > > /*create connection*/ > $connection = mysql_connect("hostname","user","password") or die > ("Couldn't connect to the server"); > > /*select database*/ > $db = mysql_select_db("db_name", $connection) or die ("Couldn't select > database"); > > /*execute query and get result*/ > $sql_result = mysql_query($sql, $connection) or die ("Couldn't execute > query1"); > $sql_result1 = mysql_query($sql1, $connection) or die ("Couldn't > execute query2"); > > if (!sql_result){ > echo "<p>Couldn't add record!"; > } else{ > > echo " > <p> Record Added!</p> > <table cellspacing=5 cellpadding=5> > /*More code down here...*/ Try using mysql_error() instead of the 'die' so you get an error message back from mysql. My guess is that you are attempting to insert strings into integer fileds. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
Hello, my co-worker has reinstalled Apache and PHP over the last night. The Apache was upgraded to the new version while PHP was re-installed the same. PHP.ini was untouched. Site uses sessions and, somehow, after this upgrade started carrying PHPSESSID through HREF. What should look for to bring the sessions using Cookies? from PHP-INI: NOTE : this was untouched. ================================================ [Session] session.save_handler = files ; handler used to store/retrieve data session.save_path = /tmp ; argument passed to save_handler ; in the case of files, this is the ; path where data files are stored session.use_cookies = 1 ; whether to use cookies session.name = PHPSESSID ; name of the session ; is used as cookie name session.auto_start = 0 ; initialize session on request startup session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted session.cookie_path = / ; the path the cookie is valid for session.cookie_domain = ; the domain the cookie is valid for session.serialize_handler = php ; handler used to serialize data ; php is the standard serializer of PHP session.gc_probability = 1 ; percentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime = 1440 ; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process session.referer_check = ; check HTTP Referer to invalidate ; externally stored URLs containing ids session.entropy_length = 0 ; how many bytes to read from the file session.entropy_file = ; specified here to create the session id ; session.entropy_length = 16 ; session.entropy_file = /dev/urandom session.cache_limiter = nocache ; set to {nocache,private,public} to ; determine HTTP caching aspects session.cache_expire = 180 ; document expires after n minutes session.use_trans_sid = 1 ; use transient sid support if enabled ; by compiling with --enable-trans-sid ================================================= Has upgrade of apache (modules, etc) anything to do with it? I can't really give you any more details since my co-coworker is unreachable right now, and this is kinda urgent. Cheers, Max. Maxim Maletsky - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Webmaster, J-Door.com / J@pan Inc. LINC Media, Inc. TEL: 03-3499-2175 x 1271 FAX: 03-3499-3109 http://www.j-door.com <http://www.j-door.com/> http://www.japaninc.net <http://www.japaninc.net/> http://www.lincmedia.co.jp <http://www.lincmedia.co.jp/>
Maxim Maletsky wrote: > > Site uses sessions and, somehow, after this upgrade started carrying > PHPSESSID through HREF. Sounds to me like php was compliled with the --enable-trans-sid option which does exactly that. Just a guess. Regards Joseph
Hm...what browser are you using to test the site? By using the trans_id option I believe that tells PHP to append the sessid into the url if the cookie is not being accepted. Try turning it off and trying it, and you may need to comment out the url.rewriter thing directly under that option. Try having someone else test your site using a different browser. Try IE 5, 5.5, and the new version of Netscape. All with cookies enabled. If your site still is appending to the url, then something else is wrong. -- Plutarck Should be working on something... ...but forgot what it was. "Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message DC017B079D81D411998C009027B7112A015ED065@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED065@EXC-TYO-01... > > Hello, > > my co-worker has reinstalled Apache and PHP over the last night. > > The Apache was upgraded to the new version while PHP was re-installed the > same. > PHP.ini was untouched. > > Site uses sessions and, somehow, after this upgrade started carrying > PHPSESSID through HREF. > > What should look for to bring the sessions using Cookies? > > from PHP-INI: > > NOTE : this was untouched. > > > ================================================ > [Session] > session.save_handler = files ; handler used to store/retrieve data > session.save_path = /tmp ; argument passed to save_handler > ; in the case of files, this is the > ; path where data files are stored > session.use_cookies = 1 ; whether to use cookies > session.name = PHPSESSID ; name of the session > ; is used as cookie name > session.auto_start = 0 ; initialize session on request startup > session.cookie_lifetime = 0 ; lifetime in seconds of cookie > ; or if 0, until browser is restarted > session.cookie_path = / ; the path the cookie is valid for > session.cookie_domain = ; the domain the cookie is valid for > session.serialize_handler = php ; handler used to serialize data > ; php is the standard serializer of PHP > session.gc_probability = 1 ; percentual probability that the > ; 'garbage collection' process is > started > ; on every session initialization > session.gc_maxlifetime = 1440 ; after this number of seconds, stored > ; data will be seen as 'garbage' and > ; cleaned up by the gc process > session.referer_check = ; check HTTP Referer to invalidate > ; externally stored URLs containing ids > session.entropy_length = 0 ; how many bytes to read from the file > session.entropy_file = ; specified here to create the session > id > ; session.entropy_length = 16 > ; session.entropy_file = /dev/urandom > session.cache_limiter = nocache ; set to {nocache,private,public} to > ; determine HTTP caching aspects > session.cache_expire = 180 ; document expires after n minutes > session.use_trans_sid = 1 ; use transient sid support if enabled > ; by compiling with --enable-trans-sid > ================================================= > > > Has upgrade of apache (modules, etc) anything to do with it? > > I can't really give you any more details since my co-coworker is unreachable > right now, and this is kinda urgent. > > Cheers, > Max. > > > > Maxim Maletsky - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > Webmaster, J-Door.com / J@pan Inc. > LINC Media, Inc. > TEL: 03-3499-2175 x 1271 > FAX: 03-3499-3109 > > http://www.j-door.com <http://www.j-door.com/> > http://www.japaninc.net <http://www.japaninc.net/> > http://www.lincmedia.co.jp <http://www.lincmedia.co.jp/> > > > > > ---------------------------------------------------------------------------- ---- > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
as I saw on the manual output_buffering cannot be changed at runtime... so there is NO WAY? If I want output_buffering I'll have to do it on all my pages? and does it really cost that much in performance? is it worthed? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
http://www.php.net/manual/en/ref.outcontrol.php If you want to use output buffering you must use the ob_* family of functions. In any script where you want it used you _must_ use it explicitly, or so do in an included file. Unless you can change the php.ini, there is no way to force all pages to use output buffering. I don't reccommend you do such a thing anyway. If you aren't using output compression all it does is allow bad programming practices. One exception is for hosting companies that want to force ads to be displayed on the page with the auto_prepend type settings. Output buffering should only be used if you have a specific reason for doing so. Kind of like all PHP functions :) It doesn't cost much in performance except when a script pumps out a very large amount of data. If you want to print a 10mb text file to the browser it is a considerably _BAD_ idea to force PHP to buffer that all up into one chunk before puking it out. But, enter the gz_handler functions. If you want to compress your output, then you have a reason for using output buffering. The cost in performance varies widely, but if your server is already under a considerable load you probably shouldn't use it. But it's very cool to use if you have the extra processor power, but wait for 4.0.5 to do it. Many people complain about memory leaks and sub-standard output buffering functions. It's supposed to all be fixed in the new version, so feel free to play around with it :) Still, it's better to be able to set it only in the places you want it run rather than making all output use it. -- Plutarck Should be working on something... ...but forgot what it was. "Christian Dechery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > as I saw on the manual output_buffering cannot be changed at runtime... so > there is NO WAY? If I want output_buffering I'll have to do it on all my pages? > > and does it really cost that much in performance? is it worthed? > ____________________________ > . Christian Dechery (lemming) > . http://www.tanamesa.com.br > . Gaita-L Owner / Web Developer > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Upload goes fine but I can't find the data :-( Any idea what PHP var holds it ( if any ). $HTTP_SERVER_VARS['CONTENT_LENGTH'] has the right value, so apache has received the data - any ideas ? Thanks, Peter P.S. If I change encoding to application/x-www-form-urlencoded I get the data - but I really want to use octet-stream ( and not multipart/form-data :) )
Hey all, People who have been recieving this list for a while may remember me going through all this a while back, so I am not really a newbie when using sockets. I am basically trying to rewrite my Online Credit Card Verification (OCV) client with the new socket functions. In thoery the following should work: --- example1 socket functions ---- $socket = socket(AF_INET, SOCK_STREAM, 0); $conn = connect($socket, some_ip_address, some_port); set_nonblock($socket); $packet = "a request"; write($socket, $packet, some_length); $start = time(); $buffer = ""; while ( empty($buffer) && (time() < $start + 30 )) { read($socket, $buffer, some_length); } This does not work will hang until the script times out (max execution time is exceeded). ----- exampe 2 network and file system functions ----- $socket = fsockopen (some_address, some_port, $errno, $errstr, 30); set_socket_blocking($socket, 0); $packet = "a request"; fputs ($socket, $packet); $start = time(); while ( empty($buffer) && (time() < $start + 30 )) { $buffer = fgets($socket, some_length); } Works! After 30 seconds fgets is timed out. The lengths I am reading and writing are correct as all request and response lengths are pre-determined. I cannot use set_socket_blocking($socket, 0) in example 1 instead of set_nonblock($socket) as it will generate an errora s follows: Warning: Supplied argument is not a valid File-Handle resource ... I believe that in example 1 the socket is not being set to nonblock mode? Can anyone verfiy this, give me a better way, or maybe just put me out of my misery :-) Regards, Joseph
Very recently (a few days at most ago) someone was complaining about the problem you are having. According to them they can't get the socket function to accept socket nonblocking. It would seem that the function is broken, so you can't set nonblocking to a valid value at the current time. Hopefully it will be fixed in 4.0.5, due out in a few days. -- Plutarck Should be working on something... ...but forgot what it was. "Joseph Blythe" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hey all, > > People who have been recieving this list for a while may remember me > going through all this a while back, so I am not really a newbie when > using sockets. I am basically trying to rewrite my Online Credit Card > Verification (OCV) client with the new socket functions. > > In thoery the following should work: > > --- example1 socket functions ---- > > $socket = socket(AF_INET, SOCK_STREAM, 0); > $conn = connect($socket, some_ip_address, some_port); > set_nonblock($socket); > > $packet = "a request"; > write($socket, $packet, some_length); > > $start = time(); > $buffer = ""; > > while ( empty($buffer) && (time() < $start + 30 )) { > read($socket, $buffer, some_length); > } > This does not work will hang until the script times out (max execution > time is exceeded). > > ----- exampe 2 network and file system functions ----- > > $socket = fsockopen (some_address, some_port, $errno, $errstr, 30); > set_socket_blocking($socket, 0); > > $packet = "a request"; > fputs ($socket, $packet); > > $start = time(); > > while ( empty($buffer) && (time() < $start + 30 )) { > $buffer = fgets($socket, some_length); > } > > Works! After 30 seconds fgets is timed out. > > The lengths I am reading and writing are correct as all request and > response lengths are pre-determined. > > I cannot use set_socket_blocking($socket, 0) in example 1 instead of > set_nonblock($socket) as it will generate an errora s follows: > > Warning: Supplied argument is not a valid File-Handle resource ... > > I believe that in example 1 the socket is not being set to nonblock mode? > > Can anyone verfiy this, give me a better way, or maybe just put me out > of my misery :-) > > Regards, > > Joseph > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Plutarck wrote: > Very recently (a few days at most ago) someone was complaining about the > problem you are having. > > According to them they can't get the socket function to accept socket > nonblocking. > > It would seem that the function is broken, so you can't set nonblocking to a > valid value at the current time. > > Hopefully it will be fixed in 4.0.5, due out in a few days. It was probaly me as I posted a message about this a few days ago ;-) I really hope that it does get fixed in 4.0.5 Oh well as they say !@#$ happens, Thanks, Joseph
set_nonblock() is in PHP C source, but not in the PHP Manual. May be it's dead? It seems it take one parameter (file descriptor), let us know if it works. I might want to use it in the future :) >From socket.c 529 /* {{{ proto bool set_nonblock(int fd) 530 Sets nonblocking mode for file descriptor fd */ 531 PHP_FUNCTION(set_nonblock) 532 { 533 zval **fd; 534 int ret; 535 536 if (ZEND_NUM_ARGS() != 1 || 537 zend_get_parameters_ex(1, &fd) == FAILURE) { 538 WRONG_PARAM_COUNT; 539 } 540 convert_to_long_ex(fd); 541 542 ret = fcntl(Z_LVAL_PP(fd), F_SETFL, O_NONBLOCK); 543 544 RETURN_LONG(((ret < 0) ? -errno : ret)); 545 } 546 /* }}} */ Hope this helps. -- Yasuo Ohgaki "Joseph Blythe" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Plutarck wrote: > > > Very recently (a few days at most ago) someone was complaining about the > > problem you are having. > > > > According to them they can't get the socket function to accept socket > > nonblocking. > > > > It would seem that the function is broken, so you can't set nonblocking to a > > valid value at the current time. > > > > Hopefully it will be fixed in 4.0.5, due out in a few days. > > > It was probaly me as I posted a message about this a few days ago ;-) > > I really hope that it does get fixed in 4.0.5 > > Oh well as they say !@#$ happens, > > Thanks, > > Joseph > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Basically I have array variables, lets say: ------------------------------------------- $folder[0] = "basic"; $folder[1] = "standard"; $folder[2] = "knowledge"; Fruther down in the code: ------------------------------------------- $totalsub_basic = "10"; $totalsub_standard = "24"; $totalsub_knowledge = "12"; Everything runs fine until "$total_count" how do I take the value of $folder[$i], lets say "standard" append that to "totalsub" and get the value of "$totalsub_standard"????? ------------------------------------------- $i = 0; while($i < $level_0_links) { echo "First While Loop"; if (ereg("^/$folder[$i]?", $PHP_SELF)) { $a = 0; $total_count = (eval("$totalsub_$folder[$i]")); <------- while ($a < $total_count) { echo "$a"; $i++; } } $i++; } Thanks Everyone!
"Black S." wrote: > > Basically I have array variables, lets say: > ------------------------------------------- > $folder[0] = "basic"; > $folder[1] = "standard"; > $folder[2] = "knowledge"; > > Fruther down in the code: > ------------------------------------------- > $totalsub_basic = "10"; > $totalsub_standard = "24"; > $totalsub_knowledge = "12"; > > Everything runs fine until "$total_count" how do I take the value of > $folder[$i], lets say "standard" append that to "totalsub" and get the value > of "$totalsub_standard"????? > ------------------------------------------- > $i = 0; > while($i < $level_0_links) { > echo "First While Loop"; > > if (ereg("^/$folder[$i]?", $PHP_SELF)) { > $a = 0; > $total_count = (eval("$totalsub_$folder[$i]")); <------- > while ($a < $total_count) { > echo "$a"; > $i++; > } > } > > $i++; > } > > Thanks Everyone! > Why not use some hash io separate variables? And, eh, why do you quote integer values? What I would suggest is something like this: /* Just as you already had.... */ $folder[0] = "basic"; $folder[1] = "standard"; $folder[2] = "knowledge"; /* -- HASH -- */ $totalsub{"basic"} = 10; $totalsub{"standard"} = 24; $totalsub{"knowledge"} = 12; In this way it's easy to access the totalsub-values: e.g.: $totalsub{$folder[0]} -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
Hi, i got this problem, when I use an executable to produce the output for the html php sends headers screwing it all. For example, my script is like this: <? ..... some stuff in php using database to prepare tempfile .... .... passthru("cat $tempfile | /usr/local/bin/somecgi"); unlink($tempfile); exit; ?> in this example PHP does not generate HTML code, but the problem is it still sends header "Content-type: text/html". Why? I really dont need this , because my "somecgi" script produces its own headers and actualy it is redirecting. So, this "content-type: text/html" that php generates is really screwing it all and redirect is failing. How can I disable php printing headers at all? I am sure no HTML nor headers are printed during php execution before "passthru" command. To make sure I placed a call to headers_sent() before passthru() and it returned false, after passthru() it returns true. Any ideas what to do? Thanks a lot nikolai
On Thu, 5 Apr 2001 13:29, Nikolai Vladychevski wrote: > Hi, > > i got this problem, when I use an executable to produce the output for > the html php sends headers screwing it all. For example, my script is > like this: > > > <? > ..... > some stuff in php using database to prepare tempfile > .... > .... > passthru("cat $tempfile | /usr/local/bin/somecgi"); > unlink($tempfile); > exit; > ?> > > in this example PHP does not generate HTML code, but the problem is it > still sends header "Content-type: text/html". Why? I really dont need > this , because my "somecgi" script produces its own headers and > actualy it is redirecting. So, this "content-type: text/html" that php > generates is really screwing it all and redirect is failing. How can I > disable php printing headers at all? > > I am sure no HTML nor headers are printed during php execution before > "passthru" command. To make sure I placed a call to headers_sent() > before passthru() and it returned false, after passthru() it returns > true. > > Any ideas what to do? > Thanks a lot > nikolai php -q should prevent headers being produced. php -h for any other help. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
If your program does not explicitly set the content type header, then I believe it is Apache which will send it automatically. So that may be part of your problem. -- Plutarck Should be working on something... ...but forgot what it was. "Nikolai Vladychevski" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > i got this problem, when I use an executable to produce the output for > the html php sends headers screwing it all. For example, my script is > like this: > > > <? > ..... > some stuff in php using database to prepare tempfile > .... > .... > passthru("cat $tempfile | /usr/local/bin/somecgi"); > unlink($tempfile); > exit; > ?> > > in this example PHP does not generate HTML code, but the problem is it > still sends header "Content-type: text/html". Why? I really dont need > this , because my "somecgi" script produces its own headers and actualy > it is redirecting. So, this "content-type: text/html" that php generates > is really screwing it all and redirect is failing. How can I disable php > printing headers at all? > > I am sure no HTML nor headers are printed during php execution before > "passthru" command. To make sure I placed a call to headers_sent() > before passthru() and it returned false, after passthru() it returns > true. > > Any ideas what to do? > Thanks a lot > nikolai > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi, I want to store all data into mySQL database in encrypted format and then show it only after decrypting it. What is the fastest way of doing it? Floyd
I have one table on one database and another table on another database. I want to perform a left join these two tables in MySQL. I don't think it's possible, but cuious if there is a "method" that can be coded in PHP to do this? If you think there's is a problem with my schema, well the boss wants to have the user data on another database totally seperated from features of the portal. So I have a big problem on my hands. Any help would be much grateful!
Quit? LOL Seriously, you may be forced to do 2 querries to mysql. Use mysql_db_query twice, and it should, in an ideal world, work. Of course it's a pain in the royal ass to combine the two querry results into something useful, but at least you can "do it". It won't be pretty, but it can be done...now don't you feel better? ;) -- Plutarck Should be working on something... ...but forgot what it was. "Jonathan Chum" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have one table on one database and another table on another > database. I want to perform a left join these two tables in MySQL. I > don't think it's possible, but cuious if there is a "method" that can > be coded in PHP to do this? > > If you think there's is a problem with my schema, well the boss wants > to have the user data on another database totally seperated from > features of the portal. So I have a big problem on my hands. > > Any help would be much grateful! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On Thursday 05 April 2001 07:23, you wrote: > I have one table on one database and another table on another > database. I want to perform a left join these two tables in MySQL. I > don't think it's possible, but cuious if there is a "method" that can > be coded in PHP to do this? > > If you think there's is a problem with my schema, well the boss wants > to have the user data on another database totally seperated from > features of the portal. So I have a big problem on my hands. > > Any help would be much grateful! SELECT * FROM database1.table1A, database2.table2 B where (A.id = B.id); should work fine -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032
I say we should split it among each message on the general list. So that's 10000 pennies 104000 ways...that means we all get paid...woohoo! Hot damn, we now all get paid 0.0961538461538461538461538461538462 pennies for every message we post! Cha CHING! <?php if ($HTTP_POST_VARS["content"] == "spam") { ob_start(); echo $content; ob_end_clean(); } ?> ;-) -- Plutarck Should be working on something... ...but forgot what it was. ""Knut H. Hassel Nielsen"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hehehehe ;) How much is that on each of us ? And were do we collect this ? On Wed, 4 Apr 2001 [EMAIL PROTECTED] wrote: > > Dear PHP Group [EMAIL PROTECTED], > > Congratulations! You just won US$10.00!! > > We just gave away US$25,000.00!! And you PHP Group [EMAIL PROTECTED] are > among the lucky 2500 people randomly selected to receive a FREE US$10.00 Trial > Account at TheCasino.com - the Internet's Premier Online Casino! > ........ -- Knut ------ Knut H. Hassel Nielsen Principal Engineer / Avdelingsingeni鷨 Norwegian University of Science and Technology / NTNU Department of Computer and Information Science / IDI N-7491 Trondheim, Norway Phone Office / Telefon jobb : (+47) 73 59 18 46 Fax Office / Telefax jobb : (+47) 73 59 17 33 Cell. Phone / Mobiltelefon : 91 59 86 06 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
If memory serves, I was told that "PHP at the present time can not validate an XML document". It does everything else, but you will have to validate everything on your own. In other words there is no current PHP function that can parse an .xml document and judge if it is Well Formed or not. -- Plutarck Should be working on something... ...but forgot what it was. ""Andreas Sisask"" <[EMAIL PROTECTED]> wrote in message 9afcdk$jug$[EMAIL PROTECTED]">news:9afcdk$jug$[EMAIL PROTECTED]... > I have a docdef.dtd file which defines a document. Now, if I parse some > doc1.xml file which refers to this > docdef.dtd, that is it contains the line > > <!DOCTYPE whateva SYSTEM "docdef.dtd"> > > I want to chek if the doc1.xml really is correct as defined - has the syntax > (elements, nesting and whatever I have defined in docdef1.dtd) > > And as I got answers from several people, it is not possible. > > Andreas > > "Joe Stump" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED]... > > AFAIK php doesn't care about extensions (ie .html vs .htm) - if it's valid > > XML and expat supports it then you should be good to go. I've parsed .rdf > just > > fine... > > > > --Joe > > > > On Wed, Apr 04, 2001 at 03:09:36PM +0200, Andreas Sisask wrote: > > > Hello, > > > > > > Does php have some feature of using .dtd or .xsd in parsing an .xml > file? > > > I mean for example if I parse some .xml (which refers to some .dtd) it > > > checks that the .xml is correct or if not then > > > gives quite exact error about it. > > > > > > Andreas > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > /*************************************************************************** > ***\ > > * Joe Stump - PHP/SQL/HTML Developer > * > > * http://www.care2.com - http://www.miester.org - > http://gtk.php-coder.net * > > * "Better to double your money on mediocrity than lose it all on a > dream." * > > > \*************************************************************************** > ***/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
> If memory serves, I was told that "PHP at the present time can not validate > an XML document". It does everything else, but you will have to validate > everything on your own. > > In other words there is no current PHP function that can parse an .xml > document and judge if it is Well Formed or not. There is a whole discussion on whether a webserver should validate documents, or this be handled beforehand (with the nsgml parser f.ex). Some argue that validating XML documents each time before producing basically the same output is kind of ineffecient, others argue that they want to be sure that whenever an XML page is changed that it is right. In my oppinion the first is the best, as small errors in an XML page which occured when it quickly had to be hacked should not result in a showstopper on the live website. If somebody fubars the tags according to the DTD, then let them do that, at least the site is up to date, and not full of validating errors. This is the scheme I use on SunSITE.dk: 1. Write a DTD for your XML standard. 2. Create a PHP parser which translates the XML pages into HTML. 3. Edit the xml documents, and use 'nsgml' (or similar sgml parser) on them to ensure that they are right according to the DTD. (Validate outside the webserver, process inside) Regards, Soeren Staun-Pedersen - [EMAIL PROTECTED] ------ "The internet is full, beat it" - Me.
valid and well-formed are different, can php verify neither? G is for the gang of money I make. F is for the gang of fools I break. U is for the undisputed champ. N is 'cause you never gonna get the mic back. K is for the niggaz that I knock on they back. http://www.gfunk007.com/ ----- Original Message ----- From: "Plutarck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 04, 2001 11:07 PM Subject: Re: [PHP] XML > If memory serves, I was told that "PHP at the present time can not validate > an XML document". It does everything else, but you will have to validate > everything on your own. > > In other words there is no current PHP function that can parse an .xml > document and judge if it is Well Formed or not. > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > ""Andreas Sisask"" <[EMAIL PROTECTED]> wrote in message > 9afcdk$jug$[EMAIL PROTECTED]">news:9afcdk$jug$[EMAIL PROTECTED]... > > I have a docdef.dtd file which defines a document. Now, if I parse some > > doc1.xml file which refers to this > > docdef.dtd, that is it contains the line > > > > <!DOCTYPE whateva SYSTEM "docdef.dtd"> > > > > I want to chek if the doc1.xml really is correct as defined - has the > syntax > > (elements, nesting and whatever I have defined in docdef1.dtd) > > > > And as I got answers from several people, it is not possible. > > > > Andreas > > > > "Joe Stump" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED]... > > > AFAIK php doesn't care about extensions (ie .html vs .htm) - if it's > valid > > > XML and expat supports it then you should be good to go. I've parsed > .rdf > > just > > > fine... > > > > > > --Joe > > > > > > On Wed, Apr 04, 2001 at 03:09:36PM +0200, Andreas Sisask wrote: > > > > Hello, > > > > > > > > Does php have some feature of using .dtd or .xsd in parsing an .xml > > file? > > > > I mean for example if I parse some .xml (which refers to some .dtd) it > > > > checks that the .xml is correct or if not then > > > > gives quite exact error about it. > > > > > > > > Andreas > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > /*************************************************************************** > > ***\ > > > * Joe Stump - PHP/SQL/HTML Developer > > * > > > * http://www.care2.com - http://www.miester.org - > > http://gtk.php-coder.net * > > > * "Better to double your money on mediocrity than lose it all on a > > dream." * > > > > > > \*************************************************************************** > > ***/ > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Neither. As far as I know no validation can be done whatsoever. You can, however, use any XML validator that is currently available. But you won't be able to use "native" or automatic validation. Just have to be really careful about your output so you don't create a bad document. And the only time you can know it is bad is when someone complains about it. -- Plutarck Should be working on something... ...but forgot what it was. ""Josh McDonald"" <[EMAIL PROTECTED]> wrote in message 002601c0be26$e0b559f0$f897093d@gfunkxshb7wjkd">news:002601c0be26$e0b559f0$f897093d@gfunkxshb7wjkd... > valid and well-formed are different, can php verify neither? > > G is for the gang of money I make. > F is for the gang of fools I break. > U is for the undisputed champ. > N is 'cause you never gonna get the mic back. > K is for the niggaz that I knock on they back. > > http://www.gfunk007.com/ > > > ----- Original Message ----- > From: "Plutarck" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, April 04, 2001 11:07 PM > Subject: Re: [PHP] XML > > > > If memory serves, I was told that "PHP at the present time can not > validate > > an XML document". It does everything else, but you will have to validate > > everything on your own. > > > > In other words there is no current PHP function that can parse an .xml > > document and judge if it is Well Formed or not. > > > > > > -- > > Plutarck > > Should be working on something... > > ...but forgot what it was. > > > > > > ""Andreas Sisask"" <[EMAIL PROTECTED]> wrote in message > > 9afcdk$jug$[EMAIL PROTECTED]">news:9afcdk$jug$[EMAIL PROTECTED]... > > > I have a docdef.dtd file which defines a document. Now, if I parse some > > > doc1.xml file which refers to this > > > docdef.dtd, that is it contains the line > > > > > > <!DOCTYPE whateva SYSTEM "docdef.dtd"> > > > > > > I want to chek if the doc1.xml really is correct as defined - has the > > syntax > > > (elements, nesting and whatever I have defined in docdef1.dtd) > > > > > > And as I got answers from several people, it is not possible. > > > > > > Andreas > > > > > > "Joe Stump" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED]... > > > > AFAIK php doesn't care about extensions (ie .html vs .htm) - if it's > > valid > > > > XML and expat supports it then you should be good to go. I've parsed > > .rdf > > > just > > > > fine... > > > > > > > > --Joe > > > > > > > > On Wed, Apr 04, 2001 at 03:09:36PM +0200, Andreas Sisask wrote: > > > > > Hello, > > > > > > > > > > Does php have some feature of using .dtd or .xsd in parsing an .xml > > > file? > > > > > I mean for example if I parse some .xml (which refers to some .dtd) > it > > > > > checks that the .xml is correct or if not then > > > > > gives quite exact error about it. > > > > > > > > > > Andreas > > > > > > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > /*************************************************************************** > > > ***\ > > > > * Joe Stump - PHP/SQL/HTML Developer > > > * > > > > * http://www.care2.com - http://www.miester.org - > > > http://gtk.php-coder.net * > > > > * "Better to double your money on mediocrity than lose it all on a > > > dream." * > > > > > > > > > > \*************************************************************************** > > > ***/ > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
> valid and well-formed are different, can php verify neither? It can validate well-formed. Regards, Soeren Staun-Pedersen - [EMAIL PROTECTED] ------ "The internet is full, beat it" - Me.
First, I believe it's listed in phpinfo when you use phpinfo() inside a php script. "embedding" refers to sticking code inside of a text file. PHP is an "html embedded language", so you basically just build an html page and place php inside of it. That is why PHP requires an opening "tag" and a closing "tag". If it wasn't embedded, that would probably mean it had to be compiled in some way. -- Plutarck Should be working on something... ...but forgot what it was. "Brandon Orther" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > Can I check to see if cgi is installed as a cgi or an api? What does PHP > embedded mean? > > thanXor > Brandon > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Anyone else started getting problems after upgrading to these? Seem to get getting whitespace prepended to my post vars. Wondering if it's the RPMs or 4.0.4pl1 itself. Matt -- Matt Kynaston remove the green eggs before replying
Hello Christian, you must register first, then set the value! session_register("script_total_time"); $script_total_time=(float)$total_time; $step_times_array[$step]=$total_time; session_register("step_times"); $step_times=serialize($step_times_array); Tuesday, April 03, 2001, 2:35:10 AM, you wrote: CD> Why does one variable gets registered and the other don't (the order CD> doesn't alter anything.. I've tried)... CD> <snip> CD> $script_total_time=(float)$total_time; CD> session_register("script_total_time"); CD> $step_times_array[$step]=$total_time; CD> $step_times=serialize($step_times_array); CD> //echo "step_times=\"$step_times\""; CD> session_register("step_times"); CD> </snip> CD> after that (and there are no mentions to either of those vars after that), CD> these are the contents of the session-cookie: CD> script_total_time|d:4.8891049623489;!step_times| CD> step_times simply doesn't get registered... CD> BTW... the commented echo above outputs: CD> step_times="a:1:{s:8:"download";d:4.8891049623489;}" CD> what is wrong with my code? CD> ____________________________ CD> . Christian Dechery (lemming) CD> . http://www.tanamesa.com.br CD> . Gaita-L Owner / Web Developer -- Best regards, slavko mailto:[EMAIL PROTECTED]
First use session_register(). Then give the variable a value. So just rearrange your code, like this: <?php session_start(); $SID = date("Y F j H:i:s"); session_register("SID"."fillista"); $fillista = "fillista.xml"; print "SID=".$SID; ?> That should do it. -- Plutarck Should be working on something... ...but forgot what it was. "Jan Grafstr闣" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi! > I am trying to learn about sessions and set up this file, > > <? > session_start(); > $fillista = "fillista.xml"; > session_register("SID"."fillista"); > $SID = date("Y F j H:i:s"); > print "SID=".$SID; > ?> > > This seams not to work on the file fillista.xml, I can still read it > afterwords in IE:s cache. How do I pass the session to a xml-file on > server? > > Thanks for any help. > > Regards > jan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Sure you can, but the only way I know of is to use fsockopen() and use fputs() to mimick an HTTP connection session. Obviously not a fun way of doing it, but it's the only way I'm aware of. To fake geocities you'll need to set the referer, I believe. Not sure what it needs to be set to, however. -- Plutarck Should be working on something... ...but forgot what it was. ""Joseph Bannon"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I notice that geocities does not allow you to reference images that are on > their servers to your homepage on another server/host. Is there a way to > make PHP send different host information to geocities' server? > > Thanks, > J > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Re-arrange the code. <?php session_register("$test"); $test = "foo"; ?> Always use session_register first, then follow it with assigning the variable a value. May not be required in the future, but do it anyway for clarity. I don't think you need the global line at all. global is used inside of functions and classes, not in an "non-nested" piece of code. -- Plutarck Should be working on something... ...but forgot what it was. ""Jacky"" <[EMAIL PROTECTED]> wrote in message 004001c0bbb3$bada9080$[EMAIL PROTECTED]">news:004001c0bbb3$bada9080$[EMAIL PROTECTED]... Hi all is this syntax correct to work on session in php4? <?php global $test; $test = "foo"; session_register("$test"); ?> but nest page when I call variable $test to echo it, nothing come up? what did I do wrong? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
I have setup session here <?php global $test; $test = "foo"; session_register("test"); ?> and newbie as I am, still don't know how to delete value of this, I actually using this right at the bottom of the page where I want session value to be deleted. <?php session_unset(); ?> Did not work, of course, so what do I do? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Wade Halsey <[EMAIL PROTECTED]> To: Jacky@lilst <[EMAIL PROTECTED]> Sent: Monday, April 02, 2001 3:48 AM Subject: Re: [PHP] is this syntax correct? > do you have > session_start(); > at the top of the next page? > > ----- Original Message ----- > From: Jacky@lilst <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, April 02, 2001 10:43 PM > Subject: Re: [PHP] is this syntax correct? > > > > I also tried this syntax: > > <?php > > global $test; > > $test = "foo"; > > session_register("test"); > > ?> > > > > and it still not work as when I go to next page, and try echo $test, > nothing > > come up. > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > ----- Original Message ----- > > From: Joseph Bannon <[EMAIL PROTECTED]> > > To: Jacky@lilst <[EMAIL PROTECTED]> > > Sent: Monday, April 02, 2001 3:44 AM > > Subject: RE: [PHP] is this syntax correct? > > > > > > > > So what is the right way to do? > > > > > > > > > I resent my email to the list. I've done mostly DB work, so I need to > know > > > what those functions do. > > > > > > J > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > >
_If_ only subscribers are allowed to post to this list (which it should be) and _if_ [EMAIL PROTECTED] is a subscriber and _if_ this address is setup to re-send this email to any address that replies.... things might be getting a little circular! Sweet dreams! Can't somebody unsubscribe [EMAIL PROTECTED]? [EMAIL PROTECTED] wrote: > http://www.TheCasino.com: Better Than Life! (tm) > Since 1999 - Now With 100% "Buffer Bonuses" On All Deposits!! > > Dear [EMAIL PROTECTED], > > This email is to confirm that we have "removed" you from our mailing > list - per your request! > > You will no longer be considered for TheCasino.com Monhtly Prize Drawings. > > Please let us know if we can be of further assistance. > > The Support Staff > TheCasino.com, Corp. > [EMAIL PROTECTED] > http://www.theCasino.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Regards, Harshdeep Singh Jawanda.
Hello. I've been learning about reg exps a while ago, and only from little examples... I wish i know a site where i can learn reg exps very very well with lots of examples and stuff. I really like reg exps but i find no resource to learn it well? Any one can help? -elias
Hello Elias, Try this tutorial at phpbuilder.com http://www.phpbuilder.com/columns/dario19990616.php3 HTH (It helped me) ----- Original Message ----- From: elias <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 7:47 PM Subject: [PHP] Reg exps. > Hello. > I've been learning about reg exps a while ago, and only from little > examples... > I wish i know a site where i can learn reg exps very very well with lots of > examples and stuff. > I really like reg exps but i find no resource to learn it well? > Any one can help? > > -elias > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I am trying to write a script that pulls data from a data base and then writes the script to be run again by php. I have added a sample below. There is a lot more to this script but in general what it does is set up new sites on a server. Would it be better to have it write the code one time and save it as a php file or write it on the fly. I hope you understand what I am asking.The script that it writes will be run by cron as root using php as a cgi not attached to the web server. $query = "SELECT pid,plan,quota,maxusers,shell,cgi,ssi,ssl,anonymousftp,bandwith FROM plans"; $result=mysql_db_query($dbName,$query); while ($row = mysql_fetch_array($result)) { $pid=$row["pid"] ; $plan=$row["plan"] ; $quot=$row["quota"] ; $maxusers=$row["maxusers"]; echo "if (\$package == 'Pack$pid') //$plan"; echo "<br>"; echo "{"; echo "<br>"; echo "\$quota = \"$quot\";"; echo "<br>"; echo "\$nuser= \"$maxusers\";"; echo "<br>"; echo "\$baseip=&ip();"; echo "<br>"; echo "}"; echo "<br>"; }
I'm not figure out what your question is. -- -Tuna- ""Richard Kurth"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to write a script that pulls data from a data base and then > writes the script to be run again by php. I have added a sample below. There > is a lot more to this script but in general what it does is set up new > sites on a server. Would it be better to have it write the code one time and > save it as a php file or write it on the fly. I hope you understand what I > am asking.The > script that it writes will be run by cron as root using php as a cgi not > attached to the web server. > > $query = "SELECT > pid,plan,quota,maxusers,shell,cgi,ssi,ssl,anonymousftp,bandwith FROM plans"; > $result=mysql_db_query($dbName,$query); > while ($row = mysql_fetch_array($result)) { > $pid=$row["pid"] ; > $plan=$row["plan"] ; > $quot=$row["quota"] ; > $maxusers=$row["maxusers"]; > > echo "if (\$package == 'Pack$pid') //$plan"; > echo "<br>"; > echo "{"; > echo "<br>"; > echo "\$quota = \"$quot\";"; > echo "<br>"; > echo "\$nuser= \"$maxusers\";"; > echo "<br>"; > echo "\$baseip=&ip();"; > echo "<br>"; > echo "}"; > echo "<br>"; > > } > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
SHOW COLUMNS FROM tablename is the MySQL query Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Steve Werby [mailto:[EMAIL PROTECTED]] > Sent: 03 April 2001 23:59 > To: [EMAIL PROTECTED]; Mauricio Junqueira > Subject: Re: [PHP] column names > > > "Mauricio Junqueira" <[EMAIL PROTECTED]> wrote: > > does anyone knows how to retrive information about the > columns names of a > > table? > > In MySQL use mysql_field_name(), in PostgreSQL use pg_fieldname(). > > > I know that is possible to use show table mytable using isql but > > I need to get information about the columns using sql. > > that information is to be accessed with a php script. so, > I'm looking > > for something resembling "select info from table...." > > Check the online manual for more functions and other databases. > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ > >
Hi, What's the php function to find out what server a php page is located? For example, the php page is at www.myserver.com. The php page should be able to display "Welcome to www.myserver.com". If the same php page is at www.yourserver.com, it should be able to display "Welcome to www.yourserver.com". __________________________________ www.edsamail.com
$SERVER_NAME gives you the location D. -----Original Message----- From: Paul Juliano [mailto:[EMAIL PROTECTED]] Sent: donderdag 5 april 2001 10:29 To: [EMAIL PROTECTED] Subject: [PHP] current location Hi, What's the php function to find out what server a php page is located? For example, the php page is at www.myserver.com. The php page should be able to display "Welcome to www.myserver.com". If the same php page is at www.yourserver.com, it should be able to display "Welcome to www.yourserver.com". __________________________________ www.edsamail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Silly me, it's $HTTP_HOST. :) Paul Juliano wrote: >Hi, > >What's the php function to find out what server a php page is located? >For example, the php page is at www.myserver.com. The php page should be able >to display "Welcome to www.myserver.com". If the same php page is at >www.yourserver.com, it should be able to display "Welcome to www.yourserver.com". > > __________________________________ www.edsamail.com
$SERVER_NAME function that you looking for. -- -Tuna- ""Paul Juliano"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > Hi, > > What's the php function to find out what server a php page is located? > For example, the php page is at www.myserver.com. The php page should be able > to display "Welcome to www.myserver.com". If the same php page is at > www.yourserver.com, it should be able to display "Welcome to www.yourserver.com". > > __________________________________ > www.edsamail.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Joe Stump wrote: > > I'm in the habit of putting all my form variables into an array (ie: > <input type="text" name="f[firstname]" value="<? echo $f['firstname']; ?>">) so > that I have a nice little package to pass to functions. My question is can you > put files into those as well? If so how does it handle the $file_name and > $file_size variables PHP creates? > > --Joe > > /******************************************************************************\ > * Joe Stump - PHP/SQL/HTML Developer * > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > * "Better to double your money on mediocrity than lose it all on a dream." * > \******************************************************************************/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] Yes. You can just make a file-upload element in your form. E.g.: <INPUT type="file" name="f[myFile]"> In your "result-page" you can use the uploaded file pretty straightforward: temp-filename: $f[myFile] filename: $f_name[myFile] size: $f_size[myFile] mimetype: $f_type[myFile] -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
Yes. Refer to PHP Manual. There is description for that. -- Yasuo Ohgaki "Joe Stump" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm in the habit of putting all my form variables into an array (ie: > <input type="text" name="f[firstname]" value="<? echo $f['firstname']; ?>">) so > that I have a nice little package to pass to functions. My question is can you > put files into those as well? If so how does it handle the $file_name and > $file_size variables PHP creates? > > --Joe > > > > /******************************************************************************\ > * Joe Stump - PHP/SQL/HTML Developer * > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > * "Better to double your money on mediocrity than lose it all on a dream." * > \******************************************************************************/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I don't use FreeBSD, so how about try to ask in apc mailing list? You may get better support with APC mailing list. -- from APC home page-- Join the APC mailing list, send an e-mail message with 'subscribe' as the subject to [EMAIL PROTECTED] For other readers, APC now support encoding script (well the author uses term "compile", refer to README.compiler) like Zend Encoder. APC is getting better and better :) Regards, -- Yasuo Ohgaki "Dan Phoenix" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Trying to enable apc under freebsd php. Running into problems compiling it > right into apache. > > gcc -I. -I/usr/home/dphoenix/freebsd/php-4.0.4pl1/ext/apc > -I/usr/home/dphoenix/freebsd/php-4.0.4pl1/main > -I/usr/home/dphoenix/freebsd/php-4.0.4pl1 > -I/usr/home/dphoenix/freebsd/apache_1.3.19/src/include > -I/usr/home/dphoenix/freebsd/apache_1.3.19/src/os/unix > -I/usr/home/dphoenix/freebsd/php-4.0.4pl1/Zend -I/usr/local/curl/include > -I/usr/local/include/freetype -I/usr/local/gd -I/usr/local/mysql/include > -I/usr/home/dphoenix/freebsd/php-4.0.4pl1/ext/xml/expat/xmltok > -I/usr/home/dphoenix/freebsd/php-4.0.4pl1/ext/xml/expat/xmlparse > -I/usr/home/dphoenix/freebsd/php-4.0.4pl1/TSRM -DXML_BYTE_ORDER=12 -O2 > -c apc_sem.c && touch apc_sem.lo > apc_sem.c:33: redefinition of `union semun' > *** Error code 1 > > any ideas? > > trying DSO method returns this > > [root@frodo apc]# phpize > aclocal: not found > autoconf: Undefined macros: > configure.in:43:AC_PROG_LIBTOOL > You should add the contents of `/usr/local/share/aclocal/libtool.m4' to > `aclocal.m4'. > [root@frodo apc]# > > very interesting....not sure how to proceed at this point. > as it is i had to cd into ports collection to install autoconf for this > apc thing. Any ideas would be great. > > > > -- > Dan > > +------------------------------------------------------+ > | BRAVENET WEB SERVICES | > | [EMAIL PROTECTED] | > | make installworld | > | ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail | > | ln -s /var/qmail/bin/newaliases /usr/sbin/newaliases | > +______________________________________________________+ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi all I wen tto check manual, not quite get it though. I have set up session and I want that deleted, but it did not work so far with session_unset or session_unregister. I figure I may have used them incorrectly here is what i did <?php session_start(); global $name; $name = "foo"; session_register("name"); ....... session_unregister("name"); ?> It appears to me that the value is still there all the time, unles I close the browser. what did I do wrong?? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
Jacky wrote: > > Hi all > I wen tto check manual, not quite get it though. I have set up session and I want >that deleted, but it did not work so far with session_unset or session_unregister. > I figure I may have used them incorrectly > here is what i did > > <?php > session_start(); > global $name; > $name = "foo"; > session_register("name"); > ....... > > session_unregister("name"); > ?> > > It appears to me that the value is still there all the time, unles I close the >browser. what did I do wrong?? > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for yourself" If you want to delete the complete session.... session_destroy. http://www.php.net/manual/en/function.session-destroy.php -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
how? Like this session_destroy("name"); how about if I want to register that variable to be session again ( without closing browser and start everything all over again)? can I still do that? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Felix Kronlage <[EMAIL PROTECTED]> To: Jacky <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 3:59 AM Subject: Re: [PHP] how do I delete session > On Thu, Apr 05, 2001 at 03:47:43PM -0500, Jacky wrote: > > > session_unregister("name"); > > ?> > > It appears to me that the value is still there all the time, > > unles I close the browser. what did I do wrong?? > > use session_destroy() to completly kill a session. > > -fkr > -- > gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 > |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | > |all your base are belong to us | shame on me | fkr@IRCnet | > >
On Thu, Apr 05, 2001 at 04:10:16PM -0500, Jacky@lilst wrote: > how? > Like this session_destroy("name"); > how about if I want to register that variable to be session again ( without > closing browser and start everything all over again)? can I still do that? session_destroy() *completly* kills the session. You call it and the session is gone. you might want to check the manual at php.net for the description (and the difference) betweend session_unregister() and session_destroy(). -fkr -- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkr@IRCnet |
"Jacky@lilst" wrote: > > how? > Like this > session_destroy("name"); > how about if I want to register that variable to be session again ( without > closing browser and start everything all over again)? can I still do that? > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" In order to completely destroy the session: session_destroy(); No arguments, just void. -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
session_register("name") ; = assign variable to session session_unregister("name") ; = unassign the variable make complete kill the session (and all the variable in session) use : session_destroy() ; -- -Tuna- ""Jacky"" <[EMAIL PROTECTED]> wrote in message 00b001c0be11$a9e2abe0$[EMAIL PROTECTED]">news:00b001c0be11$a9e2abe0$[EMAIL PROTECTED]... Hi all I wen tto check manual, not quite get it though. I have set up session and I want that deleted, but it did not work so far with session_unset or session_unregister. I figure I may have used them incorrectly here is what i did <?php session_start(); global $name; $name = "foo"; session_register("name"); ....... session_unregister("name"); ?> It appears to me that the value is still there all the time, unles I close the browser. what did I do wrong?? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
Thanks for everyones help with this one, all suggestions appreciated. Cheers, Jord On Wednesday 04 April 2001 17:06, you wrote: > Jordan, > > If you know your result is going to product one row, try using: > > $row=mysql_fetch_array($result, MSQL_ASSOC); > // returns an assoc array where the field names are keys, field value is > value > > $id=row[id]; > $name=row[name]; > etc. > > Best regards, > Andrew > -------------------------------------- > Andrew Hill - OpenLink Software > Director Technology Evangelism > eBusiness Infrastructure Technology > http://www.openlinksw.com > > -----Original Message----- > > > From: Jordan Elver [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, April 04, 2001 11:46 AM > > To: PHP Database Mailing List; PHP General Mailing List > > Subject: [PHP-DB] mysql_result() > > > > > > Hi, > > If I knnow that a query will only retrun one row, can I do thiss (below) > > rather than using a while loop for one record? > > > > $id = @mysql_result($result, 0, 'id'); > > $name = @mysql_result($result, 0, 'name'); > > $email = @mysql_result($result, 0, 'email'); > > $address1 = @mysql_result($result, 0, 'address1'); > > $address2 = @mysql_result($result, 0, 'address2'); > > $town_city = @mysql_result($result, 0, 'town_city'); > > $postcode = @mysql_result($result, 0, 'postcode'); > > > > Cheers, > > > > Jord > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
On 04 Apr 2001 17:25:14 +0100, TV Karthick Kumar wrote: > Instead I would like to get rid of one comma in between the email > address and just display and sepearte it with only comma, instead of two > commas and it should work for all the combinations that's possible. > > What are the possible ways to do that ?. Even I am trying out here. > My Code: try: <? unset($vars['send_email']); $email = array("home_email1","home_email2","work_email1","work_email2"); foreach ($email as $em) { if (strlen($svars[$em])) { if (strlen($vars['send_email'])) $vars['send_email'] .= ", "; $vars['send_email'] .= $svars[$em]; } } ?> -- php developer / CoreTrek AS | Clarke's Conclusion: Never let your Sandnes / Rogaland / Norway | sense of morals interfere with doing the web: http://www.moijk.net/ | right thing.
On 04 Apr 2001 16:59:24 +0200, bizzk wrote: > Hi, > Does anyone has some program/script that converts a MS-Acces database to > mySQL (prefferable in a .sql, .mysql or .txt file so i can upload it in > phpMyAdmin). http://www.mysql.com/downloads/contrib.html#SEC546 -- php developer / CoreTrek AS | "Plaese porrf raed." -- Prof. Michael Sandnes / Rogaland / Norway | O'Longhlin, S.U.N.Y. Purchase web: http://www.moijk.net/ |
On Wednesday 04 April 2001 20:07, you wrote: > I have a list of conditions I want to test against. > In ASP, I would do: > > Select Case foo > case "bar1" > foobar = "fooey" > case "bar2" > foobar = "fooey2" > case "bar3" > foobar = "fooey3" > case else > foobar = "NoBar" > End Select > > How do I do the equivelent in PHP? Try reading the manual. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032
On 05 Apr 2001 11:53:21 +0200, Christian Reiniger wrote: switch ($foo) { case "bar1": $foobar="fooey"; break; <etc...> default: $foobar = "NoBar"; } > > I have a list of conditions I want to test against. > > In ASP, I would do: > > How do I do the equivelent in PHP? > Try reading the manual. -- php developer / CoreTrek AS | Old programmers never die, they just hit Sandnes / Rogaland / Norway | account block limit. web: http://www.moijk.net/ |
Dear Webmaster, Does your homepage address look long and difficult to remember like this: http://www.myhomepage.com/entertainment/w/love/index.html? Wouldn't you like it better if it was like http://YOURNAME.best321.com In that case, Cool168 has the solution for you, and the best thing about it all is that it's totally free! JOIN IT NOW!!!!!!! http://best321.com/forward/script.pl?do=step1 我們推出的免費域名,為您提供YourSiteName.BEST321.com的轉向域名,使您的站點更容易被人記住,并可為您建立一定的网站品牌,對您的站點的發展大有幫助。我們的免費中轉域名對您的网站的內容不做特別限制;我們得到海外商業集團的支持,使用高速的服務器,穩定性好;我們的域名登記修改都非常方便,在几分鐘內就可得到屬于您自己的轉向域名。BEST321.com免費域名,在同類服務中絕對是您的首選! JOIN NOW! http://best321.com/forward/script.pl?do=step1 Yours, Water ------------------------------------------------------------------------- To be removed from this mailing list click on the link below http://www.best321.com/mail/mail.cgi?[EMAIL PROTECTED]