php-general Digest 6 Apr 2001 11:28:54 -0000 Issue 611 Topics (messages 47325 through 47429): How can I make this smaller 47325 by: Richard Kurth 47329 by: Matt McClanahan 47335 by: Chris Anderson 47336 by: Lindsay Adams Re: better functionality in query ? 47326 by: Jason Lotito 47346 by: Jerry Lake 47351 by: Joe Stump 47357 by: Jason Lotito 47416 by: Tim Ward 47427 by: Christian Reiniger Re: about php.ini 47327 by: Christian Reiniger 47331 by: Jason Lotito 47339 by: eschmid+sic.s.netic.de Re: How can I send command to ftp? 47328 by: Christian Reiniger Directory(parent) Structure 47330 by: Chris Anderson 47333 by: Joe Stump 47334 by: Jack Dempsey 47338 by: Chris Anderson 47371 by: Plutarck Re: PHP and CVS 47332 by: Joe Stump How can I chmod something with php. 47337 by: Brandon Orther 47361 by: David Robley MySql & PHP - Looking for the right command 47340 by: YoBro 47342 by: Joe Stump MySQL (about 1 database, many tables) 47341 by: Richard 47343 by: Lindsay Adams 47358 by: Richard Re: BUG - Someone else please verify B4 I file 47344 by: Plutarck Read one word in file 47345 by: Andrew V. Romero 47347 by: Joe Stump 47350 by: Chris Fry 47368 by: Plutarck Re: how to return strings from functions? 47348 by: Toby Butzon Re: scramble the code 47349 by: Plutarck Re: foreach ?! 47352 by: Yasuo Ohgaki fopen wierdness 47353 by: Jerry 47355 by: Steve Werby 47360 by: Richard 47365 by: Jerry 47367 by: Plutarck 47379 by: Steve Werby 47426 by: Christian Reiniger Re: array speed 47354 by: Yasuo Ohgaki Re: "YourName.BEST321.com" FREE§K¶O°ì¦W !!!!! 47356 by: David Robley 47369 by: Plutarck Re: drop-down menu variables 47359 by: Richard 47364 by: Joe Stump Re: Include / Require 47362 by: Plutarck Re: Mail() Speed? 47363 by: Plutarck Re: How can I make this smaller + something neet with global 47366 by: Plutarck Re: PHP sending email contents as an attachment, not in thebody 47370 by: Stuart J. Browne I'm equally curious 47372 by: Plutarck Re: output buffering 47373 by: Christian Dechery 47375 by: Plutarck ob_*() functions in Win9x 47374 by: Christian Dechery 47377 by: Plutarck probs with session_register() solved... 47376 by: Christian Dechery Addendum 47378 by: Plutarck Re: IF this then, move to this line... 47380 by: Wade DeWerff 47420 by: Stewart Taylor Re: PHP with Win2k or Linux 47381 by: John Re: Problems porting from MySQL Server to MSSQL7 Server 47382 by: John 47394 by: Michael Kimsal 47428 by: jlim.natsoft.com.my Re: close tcp-IP connection before php-skript finishes 47383 by: Steve Werby Re: Crack extension 47384 by: John doubt in ob_*() functions 47385 by: Christian Dechery 47388 by: Aaron Tuller mystery line 47386 by: Martin Skjöldebrand 47387 by: Tyler Longren 47389 by: David Robley 47395 by: Martin Skjöldebrand 47397 by: David Robley Problem with each() 47390 by: David Minor 47396 by: Jeff Carnahan Re: Building an array from a URL 47391 by: Mike Gifford 47411 by: Plutarck How to don´t write if exist 47392 by: Jan Grafström Passing Arrays Between Pages Using Forms 47393 by: Mike Gifford use NEWLY-ASSIGNED SESSION id? 47398 by: Derek Sivers fopen() redirected file & frameset file 47399 by: Thomas Edison Jr. fopen() Redirected File & Frameset File!!! 47400 by: Thomas Edison Jr. Using proxy servers with fsockopen() 47401 by: Vlad 47406 by: Plamen Slavov PHP and geocities 47402 by: Joseph Bannon 47403 by: CC Zona 47410 by: Plutarck Array of words in textfile? 47404 by: Jan Grafström 47407 by: Plutarck function and global problems 47405 by: Richard Kurth 47408 by: Plutarck 47412 by: Richard Kurth Re: sockets (long) 47409 by: Joseph Blythe Nearly all (1755) PHP functions in a text file 47413 by: Plutarck help me please :( 47414 by: Nilesh Parmar Re: inlude_path not in php.ini 47415 by: Alvin Tan 47419 by: Matt Williams help me on file writing 47417 by: hari t.v.s prakash Array problem 47418 by: Alexis Antonakis Using Templates and replace tags to create dynamic content 47421 by: Sharat Hegde Variables 47422 by: Cheng, Kynan (London) Update All fields? 47423 by: James Holloway 47424 by: Martin Cabrera Diaubalick Re: Apache latest + PHP latest + GD latest + Freetype latest + Jpeg latest 47425 by: Daniel B I problem: php-document in netscape is oly downloadable 47429 by: Markus Mattes 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] ----------------------------------------------------------------------
Is there another way to write this I would like to make it smaller also How would I write it so it is a function and I would be able to use all the data throughout the whole program every time I try the rest of the program does not see the data if(file_exists("userdata")) { $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); flock($fp2, 2); //unless ($use_flock == 0); while ($data = fgetcsv ($fp2, 1000, "|")) { $num = count ($data); $row++; for ($c=0; $c<$num; $c++) { } $domain=$data[0]; $tld=$data[1]; $firstname=$data[2]; $lastname=$data[3]; $userid=$data[4]; $passw=$data[5]; this part would like to make smaller $email=$data[6]; $package=$data[7]; $frontpage=$data[8]; $mysql=$data[9]; $userdatabase=$data[10]; $newuser =$data[11]; $newuserpass =$data[12]; } //close and del file fclose ($fp2); system ("del userdata");
On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote: > Is there another way to write this I would like to make it smaller > also How would I write it so it is a function and I would be able to use all > the data throughout the whole program every time I try the rest of the > program does not see the data > $domain=$data[0]; > $tld=$data[1]; > $firstname=$data[2]; > $lastname=$data[3]; > $userid=$data[4]; > $passw=$data[5]; this part would like to make smaller > $email=$data[6]; > $package=$data[7]; > $frontpage=$data[8]; > $mysql=$data[9]; > $userdatabase=$data[10]; > $newuser =$data[11]; > $newuserpass =$data[12]; Use list() list($domain,$tld,$firstname,$lastname,$userid,.....) = $data; If you want to put it in a function, declare them all globals beforehand. function myfunc() { global $domain,$tld,$firstname,$lastname,$userid...; Matt
Cool, not my thread, but i never knew about the list function. /me needs to read up an arrays more i guess ----- Original Message ----- From: "Matt McClanahan" <[EMAIL PROTECTED]> To: "Richard Kurth" <[EMAIL PROTECTED]> Cc: "PHP" <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 6:56 PM Subject: Re: [PHP] How can I make this smaller > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote: > > > Is there another way to write this I would like to make it smaller > > also How would I write it so it is a function and I would be able to use all > > the data throughout the whole program every time I try the rest of the > > program does not see the data > > > $domain=$data[0]; > > $tld=$data[1]; > > $firstname=$data[2]; > > $lastname=$data[3]; > > $userid=$data[4]; > > $passw=$data[5]; this part would like to make smaller > > $email=$data[6]; > > $package=$data[7]; > > $frontpage=$data[8]; > > $mysql=$data[9]; > > $userdatabase=$data[10]; > > $newuser =$data[11]; > > $newuserpass =$data[12]; > > Use list() > > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data; > > If you want to put it in a function, declare them all globals beforehand. > > function myfunc() > { > global $domain,$tld,$firstname,$lastname,$userid...; > > Matt > > -- > 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 4/5/01 3:56 PM, "Matt McClanahan" <[EMAIL PROTECTED]> wrote: > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote: > >> Is there another way to write this I would like to make it smaller >> also How would I write it so it is a function and I would be able to use all >> the data throughout the whole program every time I try the rest of the >> program does not see the data > >> $domain=$data[0]; >> $tld=$data[1]; >> $firstname=$data[2]; >> $lastname=$data[3]; >> $userid=$data[4]; >> $passw=$data[5]; this part would like to make smaller >> $email=$data[6]; >> $package=$data[7]; >> $frontpage=$data[8]; >> $mysql=$data[9]; >> $userdatabase=$data[10]; >> $newuser =$data[11]; >> $newuserpass =$data[12]; > > Use list() > > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data; > > If you want to put it in a function, declare them all globals beforehand. > > function myfunc() > { > global $domain,$tld,$firstname,$lastname,$userid...; > > Matt Umm, you can add them to the global space this way. Inside a function. $GLOBALS['domain']=data[0]; $GLOBLAS['tld']=data[1]; ... Can't you? Everyone? Or you can pass as a reference in the last parameter of your function call, the variable that you want returned as an array Function get_data($parm,$parm,&$array_parm) And set the values of $array_parm['variablename']=whatever Inside the function, and return $array_parm at the end of the function call. So, if you called your function as get_data("somethinghere","somethingelse",$returned_array); $returned_array['domain'] will equal whatever $data[0] was But I think adding the variable to the GLOBAL array will work fine.
> I'm in process of creating a online whitepages directory for > a small town phone company and I am having a little difficulty > in refining my selection. My search form has two fields; last > and first name. I would like to be able to have more of a wild > card approach and some refinement when a user enters both a > first and last name. I am unsure how to go about this, should > I restructure my query, or make changes to my PHP. here is the > query I am currently using. and the site is located at > http://whitepages.maadtelco.com/ any assistance/direction is certainly > appreciated. > > <snip> > $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER > BY last_name" or die("Nothing to see here"); > </snip> $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER BY last_name" or die("Nothing to see here"); Question, why are you 'die'ing on a variable assigntment? Wouldn't you want to 'die' on the actualy db_query()? Note the added '%', this is assuming you are using MySQL, though they are generally the same, I believe, with other DB's. The % is essentially wildcard of any amount. So, if the last_name was BOB it would find BOBBY BOBBER ADOBOB $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' $andor first_name LIKE '%$first_name' ORDER BY last_name" or die("Nothing to see here"); In this query, we are including the First Name. In this, we are also using the $andor variable, which you can define as AND, or OR, or allow the user to define it by using a radio box or the like when making the search. I suggest setting a default of OR for the variable $andor. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.
Damn, if I'd a known it was that easy ;) Thanks for the help, works great now. Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Jason Lotito [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 7:09 PM To: Jerry Lake; [EMAIL PROTECTED] Subject: RE: [PHP] better functionality in query ? > I'm in process of creating a online whitepages directory for > a small town phone company and I am having a little difficulty > in refining my selection. My search form has two fields; last > and first name. I would like to be able to have more of a wild > card approach and some refinement when a user enters both a > first and last name. I am unsure how to go about this, should > I restructure my query, or make changes to my PHP. here is the > query I am currently using. and the site is located at > http://whitepages.maadtelco.com/ any assistance/direction is certainly > appreciated. > > <snip> > $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER > BY last_name" or die("Nothing to see here"); > </snip> $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER BY last_name" or die("Nothing to see here"); Question, why are you 'die'ing on a variable assigntment? Wouldn't you want to 'die' on the actualy db_query()? Note the added '%', this is assuming you are using MySQL, though they are generally the same, I believe, with other DB's. The % is essentially wildcard of any amount. So, if the last_name was BOB it would find BOBBY BOBBER ADOBOB $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' $andor first_name LIKE '%$first_name' ORDER BY last_name" or die("Nothing to see here"); In this query, we are including the First Name. In this, we are also using the $andor variable, which you can define as AND, or OR, or allow the user to define it by using a radio box or the like when making the search. I suggest setting a default of OR for the variable $andor. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.
NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are making a phone book, which could get to be a lot of numbers. On the other hand 'foo%' oddly scales to hundreds of thousands of records without any problems (make sure it's key'd!). Which should work fine in your instance - just have people type in the first 4 letters of the persons name. --Joe On Thu, Apr 05, 2001 at 04:51:47PM -0700, Jerry Lake wrote: > Damn, if I'd a known it was that easy ;) > Thanks for the help, works great now. > > Jerry Lake - [EMAIL PROTECTED] > Web Designer > Europa Communications - http://www.europa.com > Pacifier Online - http://www.pacifier.com > > > -----Original Message----- > From: Jason Lotito [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 05, 2001 7:09 PM > To: Jerry Lake; [EMAIL PROTECTED] > Subject: RE: [PHP] better functionality in query ? > > > > > I'm in process of creating a online whitepages directory for > > a small town phone company and I am having a little difficulty > > in refining my selection. My search form has two fields; last > > and first name. I would like to be able to have more of a wild > > card approach and some refinement when a user enters both a > > first and last name. I am unsure how to go about this, should > > I restructure my query, or make changes to my PHP. here is the > > query I am currently using. and the site is located at > > http://whitepages.maadtelco.com/ any assistance/direction is certainly > > appreciated. > > > > <snip> > > $query = "select * from whitepages WHERE last_name LIKE '$last_name' ORDER > > BY last_name" or die("Nothing to see here"); > > </snip> > > > $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' ORDER > BY last_name" or die("Nothing to see here"); > > Question, why are you 'die'ing on a variable assigntment? Wouldn't you want > to 'die' on the actualy db_query()? > > Note the added '%', this is assuming you are using MySQL, though they are > generally the same, I believe, with other DB's. The % is essentially > wildcard of any amount. So, if the last_name was BOB > > it would find > > BOBBY > BOBBER > ADOBOB > > $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' > $andor first_name LIKE '%$first_name' ORDER > BY last_name" or die("Nothing to see here"); > > In this query, we are including the First Name. In this, we are also using > the $andor variable, which you can define as AND, or OR, or allow the user > to define it by using a radio box or the like when making the search. I > suggest setting a default of OR for the variable $andor. > > Jason Lotito > www.NewbieNetwork.net > Where those who can, teach; > and those who can, learn. > > > > -- > 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." * \******************************************************************************/
> > > I'm in process of creating a online whitepages directory for > > > a small town phone company and I am having a little difficulty > > > in refining my selection. My search form has two fields; last > > > and first name. I would like to be able to have more of a wild > > > card approach and some refinement when a user enters both a > > > first and last name. I am unsure how to go about this, should > > > I restructure my query, or make changes to my PHP. here is the > > > query I am currently using. and the site is located at > > > http://whitepages.maadtelco.com/ any assistance/direction is certainly > > > appreciated. > > > > > > <snip> > > > $query = "select * from whitepages WHERE last_name LIKE > '$last_name' ORDER > > > BY last_name" or die("Nothing to see here"); > > > </snip> > > > > > > $query = "SELECT * FROM whitepages WHERE last_name LIKE > '%$last_name%' ORDER > > BY last_name" or die("Nothing to see here"); > > > > Question, why are you 'die'ing on a variable assigntment? > Wouldn't you want > > to 'die' on the actualy db_query()? > > > > Note the added '%', this is assuming you are using MySQL, > though they are > > generally the same, I believe, with other DB's. The % is essentially > > wildcard of any amount. So, if the last_name was BOB > > > > it would find > > > > BOBBY > > BOBBER > > ADOBOB > > > > $query = "SELECT * FROM whitepages WHERE last_name LIKE '%$last_name%' > > $andor first_name LIKE '%$first_name' ORDER > > BY last_name" or die("Nothing to see here"); > > > > In this query, we are including the First Name. In this, we > are also using > > the $andor variable, which you can define as AND, or OR, or > allow the user > > to define it by using a radio box or the like when making the search. I > > suggest setting a default of OR for the variable $andor. > > > > Jason Lotito > On Thu, Apr 05, 2001 at 04:51:47PM -0700, Jerry Lake wrote: > > Damn, if I'd a known it was that easy ;) > > Thanks for the help, works great now. > > > -----Original Message----- > From: Joe Stump [mailto:[EMAIL PROTECTED]] > NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are > making a phone book, > which could get to be a lot of numbers. On the other hand 'foo%' > oddly scales to > hundreds of thousands of records without any problems (make sure > it's key'd!). > > Which should work fine in your instance - just have people type > in the first > 4 letters of the persons name. > > --Joe > Very true, good point. Good thing to keep in mind, and something I overlooked. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.
the way I'd do it is " ... WHERE lastname LIKE '$last_name%" AND firstname LIKE "$first_name%" this gets round the problem of blank first names and treats all names as being the start of a name, e.g. "Smith" will find "Smithson", but because of your ORDER BY, for an exact imnput, an exact match will always show first. haven't tried this at all but seems sound sql. 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: Jerry Lake [mailto:[EMAIL PROTECTED]] > Sent: 05 April 2001 22:23 > To: [EMAIL PROTECTED] > Subject: better functionality in query ? > > > I'm in process of creating a online whitepages directory for > a small town phone company and I am having a little difficulty > in refining my selection. My search form has two fields; last > and first name. I would like to be able to have more of a wild > card approach and some refinement when a user enters both a > first and last name. I am unsure how to go about this, should > I restructure my query, or make changes to my PHP. here is the > query I am currently using. and the site is located at > http://whitepages.maadtelco.com/ any assistance/direction is certainly > appreciated. > > <snip> > $query = "select * from whitepages WHERE last_name LIKE > '$last_name' ORDER > BY last_name" or die("Nothing to see here"); > </snip> > > Jerry Lake - [EMAIL PROTECTED] > Web Designer > Europa Communications - http://www.europa.com > Pacifier Online - http://www.pacifier.com > >
On Friday 06 April 2001 01:57, you wrote: > NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are making a > phone book, which could get to be a lot of numbers. On the other hand > 'foo%' oddly scales to hundreds of thousands of records without any > problems (make sure it's key'd!). Well, if you think a bit about it it's not odd at all. For "%foo%" the DB has to examine the entire string until it finds an occurence of "foo" or until it reaches the end - and it can not use any (normal) index. for it. For "foo%" it just has to examine the first three chars - that's even faster than "WHERE phone = 'foobar-something'" and works very nicely with a perfectly normal index. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God --------- and she was black.
On Thursday 05 April 2001 20:30, you wrote: > Hi all, > > i'm would to know if there is a doc that give all php.ini possiblities > with all variables that can be set or something like that Yes. Most people call it "PHP Manual" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e
> > On Thursday 05 April 2001 20:30, you wrote: > > Hi all, > > > > i'm would to know if there is a doc that give all php.ini possiblities > > with all variables that can be set or something like that > > Yes. Most people call it "PHP Manual" > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) Can I get a URL to it? No, no, Just Kidding, sorry, couldn't resist, sorry... oh...it has been a long week. =) Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.
On Fri, Apr 06, 2001 at 12:53:50AM +0200, Christian Reiniger wrote: > On Thursday 05 April 2001 20:30, you wrote: > > i'm would to know if there is a doc that give all php.ini possiblities > > with all variables that can be set or something like that > > Yes. Most people call it "PHP Manual" This was not the correct answer. He asked for configuration parameters and that is best answered with "read the output from ./configure --help". Besides that in every distribution is a file php.ini-dist with enough comments. The so called "PHP Manual" can be found at http://php.net/manual. I should know this, because I'm one of the editors. -Egon -- LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/ All known books about PHP and related books: http://php.net/books.php Concert Band of the University of Hohenheim: http://www.concert-band.de/ First and second bestselling book in German: http://www.php-buch.de/
On Thursday 05 April 2001 20:45, you wrote: > Hello, > > While connected to ftp can I send a command to the ftp? Yes -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e
I know using ../ in a path moves to the parent directory. But is there a way to move back farther then that?
../../../../../../../ -> ../n or chdir(); --Joe On Mon, Apr 02, 2001 at 06:44:30PM -0400, Chris Anderson wrote: > I know using ../ in a path moves to the parent directory. But is there a way to move >back farther then that? /******************************************************************************\ * 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." * \******************************************************************************/
Sure .. = parent ../.. = parent of that etc... / = root you can get to any directory on your server by using a combination of .. and directory names, or, and this is often a good idea, you can just specify the location from root, for example /path/to/my/file that way if you move the file with .. in it, it'll still find your file correctly........ jack Chris Anderson wrote: > > I know using ../ in a path moves to the parent directory. But is there a way to move >back farther then that?
funny thing is, I thought to try it, but thought it looked too strange to work ^_^ ----- Original Message ----- From: "Jack Dempsey" <[EMAIL PROTECTED]> To: "Chris Anderson" <[EMAIL PROTECTED]> Cc: "PHP" <[EMAIL PROTECTED]> Sent: Thursday, April 05, 2001 7:06 PM Subject: Re: [PHP] Directory(parent) Structure > Sure > > .. = parent > ../.. = parent of that > etc... > > / = root > > you can get to any directory on your server by using a combination of .. > and directory names, or, and this is often a good idea, you can just > specify the location from root, for example > > /path/to/my/file > > that way if you move the file with .. in it, it'll still find your file > correctly........ > > jack > > Chris Anderson wrote: > > > > I know using ../ in a path moves to the parent directory. But is there a way to move back farther then that? > > -- > 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] >
Why? Does this look weird to you? ../../../../../../../../../../../../../../../../../../../../../../../../../. ./../../../../../../../../../../../../../../../../../../../../../../../../.. /../../../../../../../../../../../../../../../../../../../../../../please/ju st/kill/me.ace Yeah ok, sometimes I go too far with nested folders. But I figure if anyone wants to go through 30 folders, unace, unrar, ungzp, untar, then run a self-extracting zip file that requires a password, then decrypt a 64 bit blowfish encryption file, then they deserve any information they'd like. Including myself. Or maybe I just like abusing nested technology. Go figure. Useful note: . = current directory. Alright, that wasn't that useful. -- Plutarck Should be working on something... ...but forgot what it was. ""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message 004001c0bbc8$cf447f80$1a1012d1@s3e8p3">news:004001c0bbc8$cf447f80$1a1012d1@s3e8p3... > funny thing is, I thought to try it, but thought it looked too strange to > work ^_^ > ----- Original Message ----- > From: "Jack Dempsey" <[EMAIL PROTECTED]> > To: "Chris Anderson" <[EMAIL PROTECTED]> > Cc: "PHP" <[EMAIL PROTECTED]> > Sent: Thursday, April 05, 2001 7:06 PM > Subject: Re: [PHP] Directory(parent) Structure > > > > Sure > > > > .. = parent > > ../.. = parent of that > > etc... > > > > / = root > > > > you can get to any directory on your server by using a combination of .. > > and directory names, or, and this is often a good idea, you can just > > specify the location from root, for example > > > > /path/to/my/file > > > > that way if you move the file with .. in it, it'll still find your file > > correctly........ > > > > jack > > > > Chris Anderson wrote: > > > > > > I know using ../ in a path moves to the parent directory. But is there a > way to move back farther then that? > > > > -- > > 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] >
This is what we use at work - it's a web frontend to RCS. It works great and we have employees all over the country (and world) using it from one location. It even publishes to the main server via rsync once you want to make your changes live (based on web editing ... but would work for other applications) http://sourceforge.net/projects/publishtron We just released it open source ... it's hackers only right now, but someone is working on making it all pretty and easy to install. --Joe On Thu, Apr 05, 2001 at 05:17:51PM -0400, ..s.c.o.t.t.. [gts] wrote: > do any of you know of any nice web-interfaces to CVS > done in PHP? > > since i write code at home and at work, i wanted to maintain > a single repository for files/code that i frequently use... > > thanks for any suggestions. > > -- > 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." * \******************************************************************************/
Hello, I have been looking for a chmod command in the ftp functions, and there isn't any. how can I chmod something? thanks Brandon
On Fri, 6 Apr 2001 05:45, Brandon Orther wrote: > Hello, > > I have been looking for a chmod command in the ftp functions, and there > isn't any. how can I chmod something? > > thanks > Brandon I think you need ftp_site() -- 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, I have a site that lists cars in a MySql database. I want to display on a page how many makes of each are in the database (Under the feild make) Like: Honda (30) //Then links to the honda page etc Toyota (25) Ford (7) Do you know what I mean. I know how to produce results from MySql, but I don't know how to get it to count how many hondas, toyotas etc on the same page from within the database. help! -- Regards, YoBro ------------------------------------------------------------- DO NOT REPLY TO THIS VIA EMAIL PLEASE USE THE NEWSGROUP All emails sent to this address are automatically deleted. This is to avoid SPAM! -------------------------------------------------------------
This is how you can do it (just tried it on my news with my news categoryID's) i'll modify slightly for your purpose with psuedo code ... SELECT carType,count(carType) FROM cars GROUP BY carType; --Joe On Fri, Apr 06, 2001 at 11:28:00AM +1200, YoBro wrote: > Hello, > > I have a site that lists cars in a MySql database. > I want to display on a page how many makes of each are in the database > (Under the feild make) > Like: > Honda (30) //Then links to the honda page etc > Toyota (25) > Ford (7) > > Do you know what I mean. I know how to produce results from MySql, but I > don't know how to get it to count how many hondas, toyotas etc on the same > page from within the database. > > > help! > > -- > Regards, > > > YoBro > ------------------------------------------------------------- > DO NOT REPLY TO THIS VIA EMAIL > PLEASE USE THE NEWSGROUP > All emails sent to this address are automatically deleted. > This is to avoid SPAM! > ------------------------------------------------------------- > > > > -- > 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." * \******************************************************************************/
Greetings. As "Frank K" wrote for some days ago, I was into the same thing, but I need help with the following: I am creating a messaging central, which is quite about the same as a web community if you like, or whatever. The thing is, I need to save all the users, mailboxes and login dates... But I only have one database, but infinite tables. Does anyone has any examples or tips? The following didn't go very well, but probably because I suck in MySQL: $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL auto_increment, uName text NOT NULL, uPwd text NOT NULL)"; What I was trying to do is to create one table which is called "users", which contains : uID (unique id, incremental!) uOnline (boolean) uName and uPWD And some other stuff, but as you can see, it did not go very well... Any help is appriciated! - Richard
If that query did not work, then maybe the user that you are connecting to the database as does not have table create privileges? The syntax of the query is correct I am a little confused why you are using a text type for those columns And you can probably stand to use unsigned for UiD, since I doubt that you will be using negative values. Note that the value you pass for bigint() only represents the field width that mysql should display. It has nothing to do with the size of the number it can store. On 4/5/01 4:33 PM, "Richard" <[EMAIL PROTECTED]> wrote: > Greetings. > > As "Frank K" wrote for some days ago, I was into the same thing, but I > need help with the following: I am creating a messaging central, which is > quite about the same as a web community if you like, or whatever. The thing > is, I need to save all the users, mailboxes and login dates... But I only > have one database, but infinite tables. Does anyone has any examples or > tips? The following didn't go very well, but probably because I suck in > MySQL: > > $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL > auto_increment, uName text NOT NULL, uPwd text NOT NULL)"; > > What I was trying to do is to create one table which is called "users", > which contains : > uID (unique id, incremental!) uOnline (boolean) uName and uPWD > > And some other stuff, but as you can see, it did not go very well... Any > help is appriciated! > > > - Richard > >
Well, that was what I wrote in my post.. I don't get this MySQL that well, and I didn't find that row very logical at all. But I got this email about it, so I will read it and keep on reporting. - Richard "Lindsay Adams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > If that query did not work, then maybe the user that you are connecting to > the database as does not have table create privileges? > > The syntax of the query is correct > I am a little confused why you are using a text type for those columns > And you can probably stand to use unsigned for UiD, since I doubt that you > will be using negative values. > > Note that the value you pass for bigint() only represents the field width > that mysql should display. It has nothing to do with the size of the number > it can store. > > On 4/5/01 4:33 PM, "Richard" <[EMAIL PROTECTED]> wrote: > > > Greetings. > > > > As "Frank K" wrote for some days ago, I was into the same thing, but I > > need help with the following: I am creating a messaging central, which is > > quite about the same as a web community if you like, or whatever. The thing > > is, I need to save all the users, mailboxes and login dates... But I only > > have one database, but infinite tables. Does anyone has any examples or > > tips? The following didn't go very well, but probably because I suck in > > MySQL: > > > > $query = "CREATE TABLE $tb_name ( UiD bigint(20) NOT NULL > > auto_increment, uName text NOT NULL, uPwd text NOT NULL)"; > > > > What I was trying to do is to create one table which is called "users", > > which contains : > > uID (unique id, incremental!) uOnline (boolean) uName and uPWD > > > > And some other stuff, but as you can see, it did not go very well... Any > > help is appriciated! > > > > > > - Richard > > > > > > > -- > 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. It's an "environment variable", so it should always be set, even if it is empty. It's just a matter that all variables are declared, THEN their values are assigned. That's how C works, and that's what PHP is built in, so that's the behavior. It makes it more standard with other applications, without loosing any real functionality. So it's annoying at times, but with just a switch-aroo of the functions you are using, you can do the same stuff. -- Plutarck Should be working on something... ...but forgot what it was. "Krznaric Michael" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > O.k. I understand that, now why would HTTP_POST_VARS be set if no data is > posted? Is this desired operation? > > Mike > > -----Original Message----- > From: Jeff Carnahan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 04, 2001 2:18 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] BUG - Someone else please verify B4 I file > > > In article <81A3043681E6824EBE672F7421C30E7E2A19A7 > @SRVTORONTO.RAND.COM>, [EMAIL PROTECTED] says... > }if (isset ($HTTP_POST_VARS)){ > } echo "Http Post Vars Set"; > > Remember, just because a variable is "set", it doesn't imply that the > variable has any data stored in it. In this case, while the > HTTP_POST_VARS array may be set, it does not contain any elements. > (It's size is zero.) > > Hence, it's not included in phpinfo(). > > -- > Jeff Carnahan - [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] >
I have a php script that reads a file that looks something like this: 1. Question One goes here: 2. Question two goes here: I need someway to have the script just read either the 1. or just the 1 When I first made the script I just had the program read the line using $questionBuffer = fgets($wq, 4096); and then I got the number by using a substring message: $currentQuestion = substr("$questionBuffer",0,1); and this works fine until I hit questions like 10 11... So how should I go about just getting the question number, ideally I would like to just read up until the first space is encountered. Is there a function to do that or will I need to create a for loop that goes through and compares each substring of 1 character to " ", and then once that " " is found, create a substring up until that " " character was found? Any ideas? --Andrew V. Romero To reply personally, remove all numbers from my address.
This is how I would do it ... <? $fp = fopen('/path/to/file','r'); while(!feof($fp)) { $line = trim(fgets($fp,4096)); if(strlen($line)) { $arr = explode(' ',$line); $numbers[] = $arr[0]; // if you want to make it remove the .'s then // do $numbers[] = str_replace('.','',$arr[0]); } } for($i = 0 ; $i < sizeof($numbers) ; ++$i) echo $numbers[$i]."\n"; ?> --Joe On Thu, Apr 05, 2001 at 04:50:37PM -0700, Andrew V. Romero wrote: > I have a php script that reads a file that looks something like this: > > 1. Question One goes here: > 2. Question two goes here: > > I need someway to have the script just read either the 1. or just the 1 > When I first made the script I just had the program read the line using > $questionBuffer = fgets($wq, 4096); and then I got the number by using > a substring message: $currentQuestion = substr("$questionBuffer",0,1); > and this works fine until I hit questions like 10 11... > So how should I go about just getting the question number, ideally I > would like to just read up until the first space is encountered. Is > there a function to do that or will I need to create a for loop that > goes through and compares each substring of 1 character to " ", and then > once that " " is found, create a substring up until that " " character > was found? Any ideas? > --Andrew V. Romero > To reply personally, remove all numbers from my address. > > > -- > 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." * \******************************************************************************/
You might want to use:- $aryQbuff = file("/pathto/filename", "r"); You will then have each line of the file in an array. Then:- $intNumLines = count($aryQbuff); for($i=0;$i<=$intNumLines;$i++) { $intQnum = explode(".", $aryQbuff[$i]); // $intQnum now has the question number in it // Do some processing } This is just one way - there are plenty of others. Chris "Andrew V. Romero" wrote: > I have a php script that reads a file that looks something like this: > > 1. Question One goes here: > 2. Question two goes here: > > I need someway to have the script just read either the 1. or just the 1 > When I first made the script I just had the program read the line using > $questionBuffer = fgets($wq, 4096); and then I got the number by using > a substring message: $currentQuestion = substr("$questionBuffer",0,1); > and this works fine until I hit questions like 10 11... > So how should I go about just getting the question number, ideally I > would like to just read up until the first space is encountered. Is > there a function to do that or will I need to create a for loop that > goes through and compares each substring of 1 character to " ", and then > once that " " is found, create a substring up until that " " character > was found? Any ideas? > --Andrew V. Romero > To reply personally, remove all numbers from my address. > > -- > 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] -- Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: [EMAIL PROTECTED] http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ********************************************************************** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed.
Once you get the first line into an array, you can just use explode on \n, or use a regex that searches for any group of characters that is not a whitespace character, then stops searching once it's found it. As Chris said, there are many many ways of doing it. -- Plutarck Should be working on something... ...but forgot what it was. "Chris Fry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You might want to use:- > > $aryQbuff = file("/pathto/filename", "r"); > > You will then have each line of the file in an array. > > Then:- > $intNumLines = count($aryQbuff); > for($i=0;$i<=$intNumLines;$i++) { > $intQnum = explode(".", $aryQbuff[$i]); > // $intQnum now has the question number in it > // Do some processing > } > > This is just one way - there are plenty of others. > > Chris > > "Andrew V. Romero" wrote: > > > I have a php script that reads a file that looks something like this: > > > > 1. Question One goes here: > > 2. Question two goes here: > > > > I need someway to have the script just read either the 1. or just the 1 > > When I first made the script I just had the program read the line using > > $questionBuffer = fgets($wq, 4096); and then I got the number by using > > a substring message: $currentQuestion = substr("$questionBuffer",0,1); > > and this works fine until I hit questions like 10 11... > > So how should I go about just getting the question number, ideally I > > would like to just read up until the first space is encountered. Is > > there a function to do that or will I need to create a for loop that > > goes through and compares each substring of 1 character to " ", and then > > once that " " is found, create a substring up until that " " character > > was found? Any ideas? > > --Andrew V. Romero > > To reply personally, remove all numbers from my address. > > > > -- > > 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] > > -- > Chris Fry > Quillsoft Pty Ltd > Specialists in Secure Internet Services and E-Commerce Solutions > 10 Gray Street > Kogarah > NSW 2217 > Australia > > Phone: +61 2 9553 1691 > Fax: +61 2 9553 1692 > Mobile: 0419 414 323 > eMail: [EMAIL PROTECTED] > http://www.quillsoft.com.au > > You can download our Public CA Certificate from:- > https://ca.secureanywhere.com/htdocs/cacert.crt > > ********************************************************************** > > This information contains confidential information intended only for > the use of the authorised recipient. If you are not an authorised > recipient of this e-mail, please contact Quillsoft Pty Ltd by return > e-mail. > In this case, you should not read, print, re-transmit, store or act > in reliance on this e-mail or any attachments, and should destroy all > copies of them. > This e-mail and any attachments may also contain copyright material > belonging to Quillsoft Pty Ltd. > The views expressed in this e-mail or attachments are the views of > the author and not the views of Quillsoft Pty Ltd. > You should only deal with the material contained in this e-mail if > you are authorised to do so. > > This notice should not be removed. > > > > -- > 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 you typecast the string to a numeric type somewhere between setting $result to '1234 - the number', you WILL get the typecasted value, which would be the integer 1234. This may explain why you're only getting the number at the beginning of the string. Now, the question is: is there a typecast? Keep in mind that a typecast may be hidden - you don't have to explicitly typecast { $var = (int)$var } to get this effect. It could be implicit with a function call, etc. --Toby Butzon David Robley wrote: > > On Wed, 4 Apr 2001 15:44, Vlad wrote: > > Hi all > > > > script example: > > > > function smth(){ > > $result = '1234 - the number'; > > return $result; > > } > > ... > > $res = smth(); > > ... > > After this $res takes value of 1234 not the actual string. > > Is any soolution here? > > > > Thanks, Vlad > > If you do > function smth(){ > $result = '1234 - the number'; > return $result; > } > $res = smth(); > echo $res; > > The output is > > 1234 - the number > > What else is in your script? > > -- > 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 > > -- > 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]
Use either $HTTP_GET_VARS to see only data submited with get, or only $HTTP_POST_VARS for data submited with POST. If it exists in post but not get, it should _not_ be shown in your browser. But just because something _should_ do something doesn't mean it will. For every correct behavior there is a programmer with the will and the way to completely f^#@ it up. ;) -- Plutarck Should be working on something... ...but forgot what it was. ""Joe Sheble (Wizaerd)"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > This isn't quite accurate. WHen a form's method is set to "GET" (which BTW > is the form's default method) the variables and their values are passed > along the URL. If your form's method is set to "POST" then nothing should > get passed along on the URL. If you see all your data in the URL, you're > not using a POST method or the forms action is specified as a url with > parameters. > > At 09:06 AM 4/5/01 -0400, Scott Fletcher wrote: > >For the data in the "post", when the user type in the data and press the > >submit button, the data is then carry over to the nextpage.html. In the URL > >bar, I can clearly see the data, so is there to scramble hte data where > >anyone won't see it in the URL box at the top of the web browser? > >Thanks, > > Scott > > > > > > > > > > > >-- > >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 ($mem_obj->home_email1!=='') > $vars["home_email1"] = "<input type=hidden name=home_email1 > value=$mem_obj->home_email1>"; I think I don't understand what you really want to do. Anyway what's $mem_obj? Does $mem_obj->home_email1 have $HTTP_POST_VARS['home_email1'] before you test it? Sound like this is the cause to me. Regards, -- Yasuo Ohgaki ""TV Karthick Kumar"" <[EMAIL PROTECTED]> wrote in message 031001c0bde4$f1638c00$[EMAIL PROTECTED]">news:031001c0bde4$f1638c00$[EMAIL PROTECTED]... > Hi List.. > > I have the following code, which actually sets up the value of of the > hidden variable and passes onto the next page and there I manipulate the > data and send them emails. > > But passing the hidden variables depends upon the mem_id, that is the > hidden variable has to be passed for 'n' number of records. For example, if > I have two records then the I am checking the first record and finding out > the available email id (the various chances are home_email1, home_email2, > work_email1, work_email2 etc. and I have max. 4 email addresses in each > record) and passing it as an hidden variable to the next page. Here it's > very important to note that, at times, 4 emails will be available or 4 > emails will NOT be available (it'll be empty) and sometimes only 1 or 2 will > be available. There are possibilities like this. > > Now, as I have this code in place, what's happening is : when I pass any > of the email address of the first record, it's getting passed, where the > home_email1 is available and then when I pass any of the email address of > the second record, it's getting passed - BUT it's getting overwritten and I > have the value of the second record and I lost the first one. > > What I want is - I want the hidden variables to be passed and kept for > the number of records selected and then I would use pass them as hidden > variables and use it in the next page. I know that I have to use Arrays for > this, but what's next ?. > > Here's my code: > > if ($mem_obj->home_email1!=='') > $vars["home_email1"] = "<input type=hidden name=home_email1 > value=$mem_obj->home_email1>"; > > if ($mem_obj->home_email2!=='') > $vars["home_email2"] = "<input type=hidden name=home_email2 > value=$mem_obj->home_email2>"; > > if ($mem_obj->work_email1!=='') > $vars["work_email1"] = "<input type=hidden name=work_email1 > value=$mem_obj->work_email1>"; > > if ($mem_obj->work_email2!=='') > $vars["work_email2"] = "<input type=hidden name=work_email2 > value=$mem_obj->work_email2>"; > > Any help is much useful to me. > > Thanks in advance. > > ~ Karthick > > > > -- > 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] >
im trying to fopen a url with something like to following : fopen("something.com/something.txt", r); this returns a "0" now when i rename the doc to something.htm, ill get the contents? Jerry Bonner Systems Analyst / Web Development --------------------------------- email: [[EMAIL PROTECTED]] icq : [34572902] phone: [507.344.1514] fax : [507.385.6017] --------------------------------- Prairie Lakes Internet
"Jerry" <[EMAIL PROTECTED]> wrote: > im trying to fopen a url with something like to following : > > fopen("something.com/something.txt", r); > > this returns a "0" If you're trying to open an external file make sure you prepend the URL with 'http://'. If that's a local file and it's not finding the file, make sure the path is correct. > now when i rename the doc to something.htm, ill get the contents? Which document - the one being called by fopen() or the one containing the PHP script? -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
No, you receive the handle to the file. You cannot rename the handle. <? $filename = "http://www.latest.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); echo $contents; fclose ($fd); ?> Should do the trick.. or something.. Modify it or whatever. - Richard "Jerry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > im trying to fopen a url with something like to following : > > fopen("something.com/something.txt", r); > > this returns a "0" > > now when i rename the doc to something.htm, ill get the contents? > > > Jerry Bonner > Systems Analyst / Web Development > --------------------------------- > email: [[EMAIL PROTECTED]] > icq : [34572902] > phone: [507.344.1514] > fax : [507.385.6017] > --------------------------------- > Prairie Lakes Internet > > > -- > 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] >
acutally i found my problem, what was happening was that script1 that was on the server that file resides had that file open at the same time that scirpt2 was trying to open via http, when i change that files name, the permissions changed, and script1 was unable to open the file, and so script2 was able to :p my bad. but it leads me to another question, is there a way to get the file size of something opened via httpd? Jerry Bonner Systems Analyst / Web Development --------------------------------- email: [[EMAIL PROTECTED]] icq : [34572902] phone: [507.344.1514] fax : [507.385.6017] --------------------------------- Prairie Lakes Internet On Thu, 5 Apr 2001, Steve Werby wrote: > "Jerry" <[EMAIL PROTECTED]> wrote: > > im trying to fopen a url with something like to following : > > > > fopen("something.com/something.txt", r); > > > > this returns a "0" > > If you're trying to open an external file make sure you prepend the URL with > 'http://'. If that's a local file and it's not finding the file, make sure > the path is correct. > > > now when i rename the doc to something.htm, ill get the contents? > > Which document - the one being called by fopen() or the one containing the > PHP script? > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ >
Technically yes. In an HTTP session, the server returns a header "Content-length" which lists the more or less exact size of the file being sent. But there isn't really an easy way of reading HTTP headers in php, yet. I really wish there were. You can use fsockopen to make your own http session, and you may be able to use the CURL functions. But I really haven't a clue how, as I haven't yet had the time to play with them much. Maybe if it works, that's an easy way to do it... -- Plutarck Should be working on something... ...but forgot what it was. "Jerry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > acutally i found my problem, what was happening was that script1 that was > on the server that file resides had that file open at the same time that > scirpt2 was trying to open via http, when i change that files name, the > permissions changed, and script1 was unable to open the file, and so > script2 was able to :p my bad. > > but it leads me to another question, is there a way to get the file size > of something opened via httpd? > > > Jerry Bonner > Systems Analyst / Web Development > --------------------------------- > email: [[EMAIL PROTECTED]] > icq : [34572902] > phone: [507.344.1514] > fax : [507.385.6017] > --------------------------------- > Prairie Lakes Internet > > On Thu, 5 Apr 2001, Steve Werby wrote: > > > "Jerry" <[EMAIL PROTECTED]> wrote: > > > im trying to fopen a url with something like to following : > > > > > > fopen("something.com/something.txt", r); > > > > > > this returns a "0" > > > > If you're trying to open an external file make sure you prepend the URL with > > 'http://'. If that's a local file and it's not finding the file, make sure > > the path is correct. > > > > > now when i rename the doc to something.htm, ill get the contents? > > > > Which document - the one being called by fopen() or the one containing the > > PHP script? > > > > -- > > Steve Werby > > President, Befriend Internet Services LLC > > http://www.befriend.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] >
"Steve Werby" <[EMAIL PROTECTED]> wrote: > acutally i found my problem, what was happening was that script1 that was > on the server that file resides had that file open at the same time that > scirpt2 was trying to open via http, when i change that files name, the > permissions changed, and script1 was unable to open the file, and so > script2 was able to :p my bad. > > but it leads me to another question, is there a way to get the file size > of something opened via httpd? If you use fread() to save the contents of the file into a variable and then use strlen() on the variable that will be pretty close. If it's important add on a few hundred bytes for the headers that don't get read in. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
On Friday 06 April 2001 03:12, you wrote: > Technically yes. > > In an HTTP session, the server returns a header "Content-length" which > lists the more or less exact size of the file being sent. Caution: The server is not required to send this header - PHP for example doesn't do it automatically. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God --------- and she was black.
Just make sure you use foreach() instead of while() when you loop many times. foreach() is roughly 50% faster when I benched them. And never pass type other than object or array. foreach() simply dose not work with error message. (i.e. You will get 'server not found or dns error' or empty output) Regards, -- Yasuo Ohgaki "Kurth Bemis" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > i'm concerned about the speed at which httpd (with php4.0.1pl1 compiles in > as a static mod) can "chew" through a 350 element 2d array. Can anyone > offer any information? > > ~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] >
On Thu, 5 Apr 2001 23:46, Zeus wrote: > I somehow got a feeling, someone is purposely, selling the php-general > list to some spam companies ;P > > ----- Original Message ----- > From: Water <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, April 05, 2001 6:12 PM > Subject: [PHP] "YourName.BEST321.com" FREE §K¶O°ì¦W !!!!! Hrm - I got three of these, one via php-general, one via the mirrors list and one direct to an address that isn't the one I use for php-general (although it might be the mirrors one). Hate spammers. -- 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
The spammers that use a foreign language are kind of fun though. Let's us use our imagination as to what they are saying. And we have fun trying to find an online translator that can make sense of it. Or not. -- Plutarck Should be working on something... ...but forgot what it was. "David Robley" <[EMAIL PROTECTED]> wrote in message 01040609565301.10051@www">news:01040609565301.10051@www... > On Thu, 5 Apr 2001 23:46, Zeus wrote: > > I somehow got a feeling, someone is purposely, selling the php-general > > list to some spam companies ;P > > > > ----- Original Message ----- > > From: Water <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, April 05, 2001 6:12 PM > > Subject: [PHP] "YourName.BEST321.com" FREE §K¶O°ì¦W !!!!! > > Hrm - I got three of these, one via php-general, one via the mirrors list > and one direct to an address that isn't the one I use for php-general > (although it might be the mirrors one). > > Hate spammers. > > -- > 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 > > -- > 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] >
You must set: <option>some text</option> if it's a SELECT list. Use <input type="select" value="DEFAULT TEXT GOES HERE"> to set an initialized text. Use .VALUE to check if it's empty or not... But beware, sometimes it forgets the contents... If you would use the JavaScript "alert(text)" function... - Richard ""Joao Monteiro"" <[EMAIL PROTECTED]> wrote in message 9aahf3$bph$[EMAIL PROTECTED]">news:9aahf3$bph$[EMAIL PROTECTED]... > when i edit variables with a form the ones wich are simple text get > corrected ok, but the ones chosen from drop-down menus only get added to > existing variables... > what am i doing wrong? > > Thanx > > Joao Monteiro > > > > -- > 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] >
You should all check out libHTMLForm at http://www.nirvani.net/software - it has all sorts of functions for writing HTML forms easily and painlessly. I use it all the time now (shameless plug - my roommate wrote it a while back). --Joe On Fri, Apr 06, 2001 at 02:35:11AM +0200, Richard wrote: > You must set: > > <option>some text</option> > > > if it's a SELECT list. Use <input type="select" value="DEFAULT TEXT GOES > HERE"> to set an initialized text. > > Use .VALUE to check if it's empty or not... But beware, sometimes it forgets > the contents... If you would use the JavaScript "alert(text)" function... > > > - Richard > ""Joao Monteiro"" <[EMAIL PROTECTED]> wrote in message > 9aahf3$bph$[EMAIL PROTECTED]">news:9aahf3$bph$[EMAIL PROTECTED]... > > when i edit variables with a form the ones wich are simple text get > > corrected ok, but the ones chosen from drop-down menus only get added to > > existing variables... > > what am i doing wrong? > > > > Thanx > > > > Joao Monteiro > > > > > > > > -- > > 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] /******************************************************************************\ * 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." * \******************************************************************************/
This is a good time for a quick lesson on just exactly what include/require actually does. The following two examples are exactly the same, in almost every way: === Example 1 === example1A.php: <?php $greeting = "Hello"; include("example1B.php"); echo $greeting; ?> example1B.php: <?php $greeting .= " World!"; ?> The output is "Hello World!", and that's all. === Example 2 === example2.php: <?php $greeting = "Hello"; $greeting .= " World!"; echo $greeting; ?> The output is "Hello World!" When you include a file it is almost exactly the same as if you went into the included file, cut out all the code, then went back into your first file and pasted it in. So what you can use an included file almost exactly as you would use a function, without declaring anything as global! But there are obvious reasons why functions are better than includes, but you probably know that ;) Example: first file: <?php $greeting = "Hello there"; // Let's pretend these variables are actually set by someone POSTing data. $var1 = "Hi there"; $var2 = "Ho there"; $var3 = "Me there"; $var4 = "My there"; include("include.php"); echo $text; ?> include.php: <?php if ($var1) { $greeting .= ", " . $var1; } if ($var2) { $greeting .= ", " . $var2; } if ($var3) { $greeting .= ", " . $var3; } if ($var4) { $greeting .= ", " . $var4; } ?> Now you could do the exact same thing by just making the include file into a function. Or you could just paste it into your original file. But the output remainds the same, no matter how you slice it. QUESTION ANSWER: The following: > $sql = "..." > $result = ....; > include 'variables.php?table=$table'; Can be like this: $table = "tablename"; $sql = "..."; $result = "..."; include ("variables.php"); The values of $table, $sql, and $result will all be the same in variables.php as they are in your source file. Isn't that nice? Aren't you glad that I took 4 pages of text just to explain that single phrase? Shouldn't I get a pulitser for taking so little content and putting it into so much display? I should work for microsoft, shouldn't I? -- Plutarck Should be working on something... ...but forgot what it was. ""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I have a DB project going and every time I query the DB for data > from a particular table, I want to include a set of variables (that get > set based on the query result). I was thinking of doing something like > this: > > $sql = "..." > $result = ....; > include 'variables.php?table=$table'; > > However, every time I try that, it tells me it can't find > 'variables.php'. However, if I rename the file to 'variables.inc', it > does find it (though it doesn't pass any arguments to it then). > > The first method tells me it's not in the include path. Okay, > easily fixable in php.ini, however, I don't want this extra path info to > apply to the whole server (which is running several vhosts). How can I > adjust the include path just for this particular vhost? > > Or, is there a better way to do what I'm trying to accomplish? Make > it a function perhaps? A call that would look kinda like this perhaps: > variables($table) ? But then, how do I get to the actual variables? > > AMK4 > > -- > W | > | I haven't lost my mind; it's backed up on tape somewhere. > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > SysAdmin / Websmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 Arapahoe Ave #6 > .................. . . . . Boulder, CO 80303, USA > > > > -- > 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] >
Many people seem to sware that opening a direct connection to sendmail is faster than using the mail function, and often avoids errors more often. Your mileage may vary, but I gather that a direct connection is faster, though not by much so don't get too concerned, than using mail. So feel free to use either one. -- Plutarck Should be working on something... ...but forgot what it was. ""PHP User"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Would opening a direct connection to sendmail be a bad thing to do in terms of speed and server time? > Right now I loop through an array of email addresses, and just send them each out with mail() would something like this be better or worse in terms of the amount of time and resources it uses on the server? > > <? > function send_mail($to, $from, $subject, $body) { > $path_to_sendmail = "/usr/sbin/sendmail"; > $fp = popen("$path_to_sendmail -t", "w"); > $num = fputs($fp, "To: $to\n"); > $num += fputs($fp, "From: $from\n"); > $num += fputs($fp, "Subject: $subject\n\n"); > $num += fputs($fp, "$body"); > pclose($fp); if ($num>0) { return 1; } else { return 0; } } > ?> > > > ***************************************************************** > Sign up for these FREE offers and have the chance to win money and prizes! > Click Here http://winwith.chek.com/promotions.php3?partnerid=7" > ***************************************************************** > > -- > 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] >
Um...I think you could just use "global". As in: global $domain, $tld, $firstname, $lastname, $userid; Once a variable is declared global, any change to that variable inside the function is reflected outside of the function. So: function before_after () { global $var; echo $var . "<BR>"; $var = "After"; echo $var . "<BR>"; } $var = "Before"; echo $var . "<BR>"; before_after(); echo $var . "<BR>"; Hey, it is PHP. It's supposed to be simple ;) Unless of course I'm wrong in this untested example, in which PHP was designed to make you suffer agonizing pain and terror that strikes to the very depth of your soul. Or not. Because it does work. But there is one odd behavior I noticed. If you change a variable inside a function, then declare it global, declaring it global reverts it's value to what it was before the function adjusted it (when global is inside the function, that is). But if you first declare it global THEN change the value, it works as above. Kinda neet, I thought. -- Plutarck Should be working on something... ...but forgot what it was. "Lindsay Adams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On 4/5/01 3:56 PM, "Matt McClanahan" <[EMAIL PROTECTED]> wrote: > > > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote: > > > >> Is there another way to write this I would like to make it smaller > >> also How would I write it so it is a function and I would be able to use all > >> the data throughout the whole program every time I try the rest of the > >> program does not see the data > > > >> $domain=$data[0]; > >> $tld=$data[1]; > >> $firstname=$data[2]; > >> $lastname=$data[3]; > >> $userid=$data[4]; > >> $passw=$data[5]; this part would like to make smaller > >> $email=$data[6]; > >> $package=$data[7]; > >> $frontpage=$data[8]; > >> $mysql=$data[9]; > >> $userdatabase=$data[10]; > >> $newuser =$data[11]; > >> $newuserpass =$data[12]; > > > > Use list() > > > > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data; > > > > If you want to put it in a function, declare them all globals beforehand. > > > > function myfunc() > > { > > global $domain,$tld,$firstname,$lastname,$userid...; > > > > Matt > > Umm, you can add them to the global space this way. > Inside a function. > > $GLOBALS['domain']=data[0]; > $GLOBLAS['tld']=data[1]; > ... > > > Can't you? Everyone? > > Or you can pass as a reference in the last parameter of your function call, > the variable that you want returned as an array > > Function get_data($parm,$parm,&$array_parm) > > And set the values of $array_parm['variablename']=whatever > Inside the function, and return $array_parm at the end of the function call. > > So, if you called your function as > > get_data("somethinghere","somethingelse",$returned_array); > > $returned_array['domain'] will equal whatever $data[0] was > > But I think adding the variable to the GLOBAL array will work fine. > > > > -- > 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] >
"Lindsay Adams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > According to the headers in your email, you are using Outlook Express. > > I think it is a microsoft issue. Because when I write a long email in OE, > and send it to myself, I get it as an attachment. > > If I write it in Eudora, and pick up my mail with Eudora, it comes as one > message, no attachment, but if I check mail in OE, it suddenly adds the > message as an attachment. > > So, I don't think you can get around this with PHP functions, because I > doubt the issue lies there. > > On 4/3/01 3:50 AM, "Tom Pinder" <[EMAIL PROTECTED]> wrote: > > > I'm using PHP to send emails. The problem I have is that when the emails > > reach a certain length, the emails are sent with the email contents as an > > attachment, not as part of the body. > > > > I've looked thru all the mailing lists, but I can't find a reference to a > > similar problem. Has anyone come across this before? > > > > Is there is any way to control this behaviour? Is there a way of forcing > > mail() or imap_mail() to include the contents in the email body? > > > > imap_mail ($testAddress, $title, $emailContents, "from:[EMAIL PROTECTED]"); > > mail ($testAddress, $title, $emailContents, "from:[EMAIL PROTECTED]"); The issue probably lies (as Lindsay said) in Outlook express, more accurately in the memo box type that is being used. Microsoft has a terrible habbit of (in their 'free' stuff atleast) using the Memo box (which has a limit of 32kb) for quick-view types of things. Anything over that and you'd see what you are. bkx
I know that to do this somehow ignore_user_abort should probably be set to true for the purpose of the script itself. Then something could be done...but I wonder along with you, is there a way to tell the client "That's all there is! stop waiting!" *scratches head* Perhaps the outbut buffer may be part of the answer? Perhaps PHP could use ob_start, then use ob_get_length to see how how much content must be sent. Then send a header with the content length, and clear the buffer. Could that perhaps make apache end the session? Or perhaps some socket use to forcefully close the connection, but that may make apache angry and create some errors...but then again, it probably wouldn't. This would answer all kinds of problems with mail() slowing down a script, or sleep() use, etc. Anyone have other theories or better yet, a solution? This would allow me to have _so_ much fun playing around with the possibilities, no matter how intensive it'd have to be. Does any other language have something exactly like this? Like Perl/C CGI, ASP, or JSP? Or is this purely a question of web-server support? -- Plutarck Should be working on something... ...but forgot what it was. "Peter Kuppelwieser" <[EMAIL PROTECTED]> wrote in message 01040622051504.23709@pjotr">news:01040622051504.23709@pjotr... > Hello! > > I have an problem with on of our scripts, and some caching proxy servers > > the script produces output, then it does a flush(), > After this, the script does a sleep(10) and then it does a db-query without > producing html output. > > normally the browsers get the page after the flush() command > but on some proxy servers, the page is forwarded to the browser > only after the proxy server has terminated the connection to the apache > webserver (after the 10 secs). > > my question: > > Is it possible to terminate the tcpIP connection, before the php script ends? > (I think this would solve my problem) > Any other Ideas? > > Thank you, Peter Kuppelwieser > > -- > 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] >
At 00:26 5/4/2001 -0500, Plutarck wrote: >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. exactly... I don't want to set this option to an entire site just because of one little script I'm having trouble setting a header() or setcookie()... and I wanna use them in the middle of the output... something like ASP's <% response.flush=true %>, it can be set anywhere u want... but of course... the best way is to code right and not to mess with headers once the output has started... but sometimes I wish I could, u know? It would really make somethings a lot simpler... ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
I know what you mean. Until I decided to kill all but one single echo/print call, which is in a function I call at the bottom of the script, I often ran into problems where I needed to echo something at the top of a really really long control loop, but nested deep within it I had to set a cookie or use a redirect. Which is why I killed all my echo/print calls in favor of a single function which I include at the bottom of my script ;) -- Plutarck Should be working on something... ...but forgot what it was. "Christian Dechery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > At 00:26 5/4/2001 -0500, Plutarck wrote: > >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. > > exactly... I don't want to set this option to an entire site just because > of one little script I'm having trouble setting a header() or > setcookie()... and I wanna use them in the middle of the output... > something like ASP's <% response.flush=true %>, it can be set anywhere u > want... > but of course... the best way is to code right and not to mess with headers > once the output has started... but sometimes I wish I could, u know? It > would really make somethings a lot simpler... > ____________________________ > . 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] >
While struggling to get MS SQL error messages from PHP, someone here gave me the idea of capturing the output when executing a query and even offered me the code (thanks again)... I tried, the code was correct, but nothing happened... I develop under Win98Me with Apache... but the script will run in Win2k with IIS... does any of the ob_*() function family works under Win9x, or just in UNIX and Win2k/NT? Is there a reasonable explanation for this? I see this as a real fault... means that nobody developing in Win9X platforms can get MS SQL error messages, or anything that needs some more of output handling, and not just relying on *_error() functions... ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
I just tried it, and it seems to work like a charm on my Win98 machine (WAMP). So far I have no problems with output buffering on my machine. Test script: <?php function alter_buffer($buffer) { $buffer = ereg_replace("he", "MWUAHAHA", $buffer); return $buffer; } ob_start("alter_buffer"); echo "hi! "; echo "ho! "; echo "he! "; ob_end_flush(); ?> Should output: hi! ho! MWUAHAHA! So as far as I know, at very least version 4.0.4pl1 supports Windows. Haven't tried anything with the gzhandler yet, but I'm told it works fine as long as you are using the windows port of it. -- Plutarck Should be working on something... ...but forgot what it was. "Christian Dechery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > While struggling to get MS SQL error messages from PHP, someone here gave > me the idea of capturing the output when executing a query and even offered > me the code (thanks again)... I tried, the code was correct, but nothing > happened... > > I develop under Win98Me with Apache... but the script will run in Win2k > with IIS... > > does any of the ob_*() function family works under Win9x, or just in UNIX > and Win2k/NT? Is there a reasonable explanation for this? > > I see this as a real fault... means that nobody developing in Win9X > platforms can get MS SQL error messages, or anything that needs some more > of output handling, and not just relying on *_error() functions... > ____________________________ > . 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] >
After about 4 or 5 posts asking for help with session_register() with no replies I finally got my array into session vars... I tried the manual, just not thoroughly enough in the users contribution section... and there was the answer to all my problems... one single sentence "in order to register session vars, the MUST be global"... this should be crucial manual information, don't u think? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
Note on my example by comparing it to a similar example at zend: Note that this example requires PHP 4.0.4 (not yet released at the time of writing) or later, compiled with zlib support turned on. Earlier versions of PHP may not support the optional argument for ob_start(), and don't include the gzencode() function. So if you are using an older version of PHP, you need to kill all the flashy parts of my example (har har) and just use a pure ob_start() and ob_end_flush calls. -- Plutarck Should be working on something... ...but forgot what it was. ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9aj9co$i1b$[EMAIL PROTECTED]">news:9aj9co$i1b$[EMAIL PROTECTED]... > I just tried it, and it seems to work like a charm on my Win98 machine > (WAMP). > > So far I have no problems with output buffering on my machine. Test script: > > <?php > function alter_buffer($buffer) > { > $buffer = ereg_replace("he", "MWUAHAHA", $buffer); > return $buffer; > > } > > ob_start("alter_buffer"); > echo "hi! "; > echo "ho! "; > echo "he! "; > ob_end_flush(); > ?> > > Should output: > > hi! ho! MWUAHAHA! > > So as far as I know, at very least version 4.0.4pl1 supports Windows. > Haven't tried anything with the gzhandler yet, but I'm told it works fine as > long as you are using the windows port of it. > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > "Christian Dechery" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > While struggling to get MS SQL error messages from PHP, someone here gave > > me the idea of capturing the output when executing a query and even > offered > > me the code (thanks again)... I tried, the code was correct, but nothing > > happened... > > > > I develop under Win98Me with Apache... but the script will run in Win2k > > with IIS... > > > > does any of the ob_*() function family works under Win9x, or just in UNIX > > and Win2k/NT? Is there a reasonable explanation for this? > > > > I see this as a real fault... means that nobody developing in Win9X > > platforms can get MS SQL error messages, or anything that needs some more > > of output handling, and not just relying on *_error() functions... > > ____________________________ > > . 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] > > > > > > -- > 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] >
this is mostly a C++ function, java has something similar as well but break would be the closest -----Original Message----- From: CC Zona <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Thursday, April 05, 2001 1:03 PM Subject: Re: [PHP] IF this then, move to this line... >In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Brandon Orther) wrote: > >> Is there a way to make my script jump to a certain line in my code if a >> certain variable is true. like use an if then statement to check for a >> certain value, then if it is true jump back to line 34 (Any line really). > >You can't specify by line number, but you might want to see the docs on >"break" <http://php.net/manual/en/control-structures.break.php> and >"continue" <http://php.net/manual/en/control-structures.continue.php>. >Both allow you to specify how many levels to go back. > >-- >CC > >-- >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]
You could use continue to skip to the start of a loop. e.g. while (1) { start of code you want to jump back too . . . if (so and so is true) continue; . . . . break; // exit loop } Unlike c php does not have a goto command. However what you describe does not sound like very good programming practice anyway. You should be able to arrange your code using functions etc so that you dont need this sort of goto method. -Stewart -----Original Message----- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: 05 April 2001 18:43 To: PHP User Group Subject: [PHP] IF this then, move to this line... Hello, Is there a way to make my script jump to a certain line in my code if a certain variable is true. like use an if then statement to check for a certain value, then if it is true jump back to line 34 (Any line really). Thanks 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]
Watch out for 1. file names are case sensitive on Unix. Even mysql table names are case-sensitive on Unix. 2. behaviour of environment/server variables is sometimes different. The plus side is PHP on Linux tends to be more reliable and more extensions work. Regards, John ""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
Hello Adrian, There are some concurrency issues with mssql if you are using mssql_pconnect. Try switching to mssql_connect. Also check to see if transactions are enabled in mssql. Your SQL insert syntax looks ok. Regards, John PS: for porting mysql to mssql, have a look at http://php.weblogs.com/adodb for the ADODB database wrapper library. ""Adrian Jurjica"" <[EMAIL PROTECTED]> wrote in message 001401c0bd38$51d05580$[EMAIL PROTECTED]">news:001401c0bd38$51d05580$[EMAIL PROTECTED]... Can anyone help me? Today I was informed that the backend for my project will not be MySQL, but MSSQL 7.0. No problems, I said, but after porting database from MySQL to MSSQL I find that the UPDATE statement doesn't work. Strange is that INSERT statement in a php query does not work second time (ie, i made a script for taking records from MySQL and insert in MSSQL; first query work, but second doesn't). Code is here: 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??? Adrian JURJICA ================================ Tel.: +40-94-128879 E-mail: [EMAIL PROTECTED] ================================ Nu ocoliti pe Internet: http://oneblackcat.f2s.com http://www.terrasat.ro http://www.transcondor.com http://aimmr.go.ro ================================
Hi John - Can you elaborate on the concurrency issues? Thanks. John wrote: > Hello Adrian, > > There are some concurrency issues with mssql if you are using > mssql_pconnect. Try switching to mssql_connect. Also check to see if > transactions are enabled in mssql. > > Your SQL insert syntax looks ok. > > Regards, John
Hello Michael Some people have reported with the ADODB database class library that they were having problems with inserts and updates when using mssql_pconnect. Switching to regular mssql_connect the problems disappeared. I suspect it has something to do with persistent connections having inconsistent transaction handling settings. Eg. - Connection A is setup by user 1 to use transactions. - Connection B is setup by user 2 not to use transactions. - Connection A is reused by user 2, who thinks he doesn't need transactions, but connection A actually requires a commit to work because of user 1's previous setting... People using Interbase have reported this problem also. Regards, john > Hi John - > > Can you elaborate on the concurrency issues? > Thanks. > > > John wrote: > > > Hello Adrian, > > > > There are some concurrency issues with mssql if you are using > > mssql_pconnect. Try switching to mssql_connect. Also check to see if > > transactions are enabled in mssql. > > > > Your SQL insert syntax looks ok. > > > > Regards, John > --- "Stressed spelled backwards is desserts." [EMAIL PROTECTED] NATSOFT MALAYSIA (60)3-706 1216 Visit this web site for Asian and local Internet news http://webfeet.editthispage.com/ My PHP website: http://php.weblogs.com/
"Peter Kuppelwieser" <[EMAIL PROTECTED]> wrote: > I have an problem with on of our scripts, and some caching proxy servers > > the script produces output, then it does a flush(), > After this, the script does a sleep(10) and then it does a db-query without > producing html output. > > normally the browsers get the page after the flush() command > but on some proxy servers, the page is forwarded to the browser > only after the proxy server has terminated the connection to the apache > webserver (after the 10 secs). > > my question: > > Is it possible to terminate the tcpIP connection, before the php script ends? > (I think this would solve my problem) Perhaps register_shutdown_function() will do the trick. I've used it on scripts where a call to an external command or long DB operation took a long time, but didn't affect the browser output. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Hi AZ, Where can we get it, what does it do, and do we smoke it? Regards, John PS: Last is a joke, but I am sincerely curious -- what does it do? <[EMAIL PROTECTED]> wrote in message 9agj7e$7ba$[EMAIL PROTECTED]">news:9agj7e$7ba$[EMAIL PROTECTED]... > Anyone using the crack extension in PHP? > > AZ > > > > > -- > 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] >
take a look at this small code: ob_start(); echo "something<br>"; echo "something else<br>"; $string=ob_get_contents(); ob_end_flush(); echo $string."<br>"; shouldn't this be the output? something something else so why it outputs this? something something else something something else ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
umm, no, you assigned $string to the output and you flushed it and you echoed $string. maybe you mean ob_end_clean()? -aaron At 12:22 AM -0300 4/6/01, Christian Dechery wrote: >take a look at this small code: > >ob_start(); >echo "something<br>"; >echo "something else<br>"; >$string=ob_get_contents(); >ob_end_flush(); > >echo $string."<br>"; > >shouldn't this be the output? > >something >something else > >so why it outputs this? > >something >something else >something >something else >____________________________ >. 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]
It's not first of April today is it? In: <? if ($id != "") { print "<center>"; print "<p>TID detail view - Document #<b><?php echo $id; ?></b></p>"; $sql="select * from tid_tbl where id=" . $id; $result1=mysql_query($sql, $mysql_link); $row = mysql_fetch_array($result1); echo '<table border="1">'; echo '<tr><td BGCOLOR="' . $headerbg . '">Subject</td><td>' . $row["subject"] . '</td></tr>'; echo '<tr><td BGCOLOR="' . $headerbg . '" valign="top">Issue/Info</td><td>' . ereg_replace (13, "", nl2br($row["body"])) . '</td></tr>'; echo '<tr><td BGCOLOR="' . $headerbg . '">Author</td><td>' . $row["author"] . '</td></tr>'; echo '<tr><td BGCOLOR="' . $headerbg . '">' . $contact . '</td><td>' . $row["company"] . '</td></tr>'; echo '</table></center>'; } ?> The third line (starting print "<p> TID detail") is my mystery line. If I comment it out ("// print "<p> TID detail...") the parser chokes on on the last line (or I suppose somewhere between). While I totally delete it everything is OK. What is the parser seeing that I'm not? M.
In line 3, you don't need your <? ?> tags again. This is how you have it: print "<p>TID detail view - Document #<b><?php echo $id; ?></b></p>"; this is how it should be: print "<p>TID detail view - Document #<b>$id</b></p>"; Tyler Longren -----Original Message----- From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 10:31 PM To: [EMAIL PROTECTED] Subject: [PHP] mystery line It's not first of April today is it? In: <? if ($id != "") { print "<center>"; print "<p>TID detail view - Document #<b><?php echo $id; ?></b></p>"; $sql="select * from tid_tbl where id=" . $id; $result1=mysql_query($sql, $mysql_link); $row = mysql_fetch_array($result1); echo '<table border="1">'; echo '<tr><td BGCOLOR="' . $headerbg . '">Subject</td><td>' . $row["subject"] . '</td></tr>'; echo '<tr><td BGCOLOR="' . $headerbg . '" valign="top">Issue/Info</td><td>' . ereg_replace (13, "", nl2br($row["body"])) . '</td></tr>'; echo '<tr><td BGCOLOR="' . $headerbg . '">Author</td><td>' . $row["author"] . '</td></tr>'; echo '<tr><td BGCOLOR="' . $headerbg . '">' . $contact . '</td><td>' . $row["company"] . '</td></tr>'; echo '</table></center>'; } ?> The third line (starting print "<p> TID detail") is my mystery line. If I comment it out ("// print "<p> TID detail...") the parser chokes on on the last line (or I suppose somewhere between). While I totally delete it everything is OK. What is the parser seeing that I'm not? M. -- 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 Fri, 6 Apr 2001 13:00, Martin Skjöldebrand wrote: > It's not first of April today is it? Only where you are :-) > > In: > > <? if ($id != "") { > > print "<center>"; > print "<p>TID detail view - Document #<b><?php echo $id; ?></b></p>"; > > > $sql="select * from tid_tbl where id=" . $id; > $result1=mysql_query($sql, $mysql_link); > $row = mysql_fetch_array($result1); > echo '<table border="1">'; > echo '<tr><td BGCOLOR="' . $headerbg . '">Subject</td><td>' . > $row["subject"] . '</td></tr>'; > echo '<tr><td BGCOLOR="' . $headerbg . '" > valign="top">Issue/Info</td><td>' . ereg_replace (13, "", > nl2br($row["body"])) . '</td></tr>'; echo '<tr><td BGCOLOR="' . > $headerbg . '">Author</td><td>' . $row["author"] . '</td></tr>'; > echo '<tr><td BGCOLOR="' . $headerbg . '">' . $contact . '</td><td>' . > $row["company"] . '</td></tr>'; > echo '</table></center>'; > } > ?> > > The third line (starting print "<p> TID detail") is my mystery line. > If I comment it out ("// print "<p> TID detail...") the parser chokes > on on the last line (or I suppose somewhere between). > While I totally delete it everything is OK. What is the parser seeing > that I'm not? > > M. If you change that to: print "<p>TID detail view - Document #<b>$id</b></p>"; it should work; It's probably getting confused by the php open/close tags in the middle of a set of php tags. -- 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
Tyler Longren wrote: > In line 3, you don't need your <? ?> tags again. > This is how you have it: > print "<p>TID detail view - Document #<b><?php echo $id; ?></b></p>"; > > this is how it should be: > print "<p>TID detail view - Document #<b>$id</b></p>"; Ofcourse, I've seen that all the time - and yet ... oh well ... a bug in the carbon based part of the system I suppose. Thanks, Martin S.
On Fri, 6 Apr 2001 13:50, Martin Skjöldebrand wrote: > Tyler Longren wrote: > > In line 3, you don't need your <? ?> tags again. > > This is how you have it: > > print "<p>TID detail view - Document #<b><?php echo $id; ?></b></p>"; > > > > this is how it should be: > > print "<p>TID detail view - Document #<b>$id</b></p>"; > > Ofcourse, I've seen that all the time - and yet ... > oh well ... a bug in the carbon based part of the system I suppose. > > Thanks, > > Martin S. That's PWCKI or Problem With Chair to Keyboard Interface :-) -- 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
I recall reading this somewhere in the past, but can't find the answer after looking for a couple of hours. I am getting this warning: Warning: Variable passed to each() is not an array or object in myfile.inc on line 1 Here's what I'm doing: While doing: $each_array = each($HTTP_POST_VARS) print("key: $each_array[0] value: $each_array[1]"); When I get to an array within HTTP_POST_VARS, it prints: key: var_name value: Array ok, but when I try to do an each on that array: (and maybe this is where I am wrong) $each_array2 = each($each_array[0]) I get the error that what I'm passing to the each is not an array. Can someone help me or point me to the right place? Thanks, David Minor
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... }print("key: $each_array[0] value: $each_array[1]"); } }When I get to an array within HTTP_POST_VARS, it prints: }key: var_name value: Array } }ok, but when I try to do an each on that array: (and maybe this is where I }am wrong) }$each_array2 = each($each_array[0]) } There's your problem.. Your trying to do each(..) on, what in your example above, is set to "var_name" ... Try changing that to: $each_array2 = each($each_array[1]); It's the second variable in your example that's an Array, (or it may just be a string set to the word "Array".. Who knows?.. =) -- Jeff Carnahan - [EMAIL PROTECTED]
Hi Joe, this would be useful if I wanted to write to a URL, but I need to read from it. Perhaps I wasn't clear in this. Mike Joe Stump wrote: > 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." * > \******************************************************************************/ -- 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
You'll probably want to play with the following function: http://www.php.net/manual/en/function.parse-url.php -- Plutarck Should be working on something... ...but forgot what it was. "Mike Gifford" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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] >
Hi! I want php to check if a word already exist and then don´t write it to the file. This is my file list.txt: car, cat, dog, ... and my php which need some more function: ------ $fp = fopen("list.txt", "a"); $string = "$word".","." "; fwrite ($fp, $string); fclose ($fp); ------- I want to add: If the variable word exist, don´t add it to the string. Thanks for any tips. Regards Jan
Hello, I've currently got a list which is generated from a single database table: http://openconcept.ca/rabble/newsfeeds.phtml I can now select from this list and be presented with a more concenced list of links into which changes can be made and summaries added: http://openconcept.ca/rabble/superRSS.phtml?superRSS3=1259&superRSS177=1189 I can do this by ignoring the key, I can pull out the data (thanks btw, for folks who responded to my earlier posting that brought me to this place). I've included the code I've used here: while(list($key,$value)=each($HTTP_GET_VARS)) { $rdf_query = mysql_query("SELECT * FROM dbrss WHERE ID='$value' ORDER BY Feed",$db); while ($rdf_array = mysql_fetch_array($rdf_query)) { echo "News Feed: " . stripslashes($rdf_array["Feed"]); } } >From here though I'd like to write all of the changes to these fields to the database. However, I'm having trouble with this, as I am no longer dealing with simple key, value relationships, but rather with arrays of arrays. Sending the data along via GET, gives you something like this: http://openconcept.ca/rabble/superRSS.phtml?ID%5B%5D=1259&Title%5B%5D=The+Zapatistas+on+the+march+again2&URL%5B%5D=http%3A%2F%2Fwww.infoshop.org%2Fnews6%2Fzaps_march.html&Abstract%5B%5D=aa&ID%5B%5D=1189&Title%5B%5D=Rich+World%27s+Trade+Ministers+Discuss+New+Trade+Round+2&URL%5B%5D=http%3A%2F%2Fwww.wtowatch.org%2Fwtowatch%2Fnews%2Findex.cfm%3FID%3D2108&Abstract%5B%5D=aa&new_superRSS=new_superRSS A real mess to convert into something you'd like to insert back into the DB using: $insert = mysql_query("INSERT into dbrss (Feed, Title, URL, Abstract) VALUES ('$Feed[$v]','$Title[$v]','$URL[$v]','$Abstract[$v]')",$db); Any suggestions on how to deal with this issue? -- 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
My PHP script (with --trans-sid enabled) assigns a session ID for people without cookies. No big deal, right? BUT THE BIG QUESTION IS: Can I immediately know what long string PHP assigned to the session, without having to click to a different page first? I want one single PHP page to #1 - assign a session #2 - then use header ("Location: http://someurl.php?PHPSESSID=" . $userid) immediately in that same page. ((The reason why would take too long to explain.)) So... HOW COULD I DO THIS? (without cookies enabled?)
the fopen() function alongwith the fgets() can easily get a line from any file containg our query and print it out using this code : <? $fd = fopen ("try.txt", "r") or Die ("Could not open"); while (!feof ($fd)) { $buffer = fgets($fd, 10000); if (ereg ("whatIwant", $buffer)) { echo $buffer; }}fclose ($fd); ?> however, if i open a url file which is actually being redirected to a new file...how to read that file? if $fd = fopen("http://www.to.com/nothin","r"); and this url actually redirects to a new file... i need to read the contents of this new file. There is no address for this new file as it is generated using the parameters sent to the "nothing" cgi file. Also, what if this new file has a frameset... i need to read contents of only one of the frame file. I know the "frame name" of the frameset in which i got the file... but how to make fopen() actually reach that frameset file.? is it possible?? Regards, T. Edison jr. --- Felix Kronlage <[EMAIL PROTECTED]> wrote: > On Mon, Apr 02, 2001 at 04:38:16AM -0700, Thomas > Edison Jr. wrote: > > > For example i want the file pointer to search & if > > found, print the word "enter" from the open file. > how > > to do this? > > work your way trough the file with fgets() and > compare > each line to a regular-expression (ereg*() or > preg_*()) > > -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 | > ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
the fopen() function alongwith the fgets() can easily get a line from any file containg our query and print it out using this code : <? $fd = fopen ("try.txt", "r") or Die ("Could not open"); while (!feof ($fd)) { $buffer = fgets($fd, 10000); if (ereg ("whatIwant", $buffer)) { echo $buffer; }}fclose ($fd); ?> however, if i open a url file which is actually being redirected to a new file...how to read that file? if $fd = fopen("http://www.to.com/nothin","r"); and this url actually redirects to a new file... i need to read the contents of this new file. There is no address for this new file as it is generated using the parameters sent to the "nothing" cgi file. Also, what if this new file has a frameset... i need to read contents of only one of the frame file. I know the "frame name" of the frameset in which i got the file... but how to make fopen() actually reach that frameset file.? is it possible?? Regards, T. Edison jr. --- Felix Kronlage <[EMAIL PROTECTED]> wrote: > On Mon, Apr 02, 2001 at 04:38:16AM -0700, Thomas > Edison Jr. wrote: > > > For example i want the file pointer to search & if > > found, print the word "enter" from the open file. > how > > to do this? > > work your way trough the file with fgets() and > compare > each line to a regular-expression (ereg*() or > preg_*()) > > -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 | > ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Hi all Is any way to open socet connections using proxy servers from php script? Thanks
try this $desired_agent="User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)\n"; $datei = fsockopen($proxyaddr, $proxyport, &$errno, &$errstr,30); if( !$datei ) { echo "proxy not available !"; fclose($resultfile); } else { fputs($datei,"GET $filewanted/ HTTP/1.0\n"); fputs($datei,$desired_agent); fputs($datei,"\n"); while (!feof($datei)) { $zeile = fgets($datei,1000); echo "$zeile"; } } ----- Original Message ----- From: "Vlad" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday 06 April 2001 Ç. 9:18 AM Subject: [PHP] Using proxy servers with fsockopen() Hi all Is any way to open socet connections using proxy servers from php script? Thanks -- 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. Can you give me the coding for this? > To fake geocities you'll need to set the referer, I believe. Not sure what > it needs to be set to, however. What is the code for this as well? Thanks, J Say I'm Hot! - Post Your Picture! http://www.sayimhot.com
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Joseph Bannon") wrote: > > Sure you can, but the only way I know of is to use fsockopen() and use > > fputs() to mimick an HTTP connection session. > > Can you give me the coding for this? The annotated docs contain many code samples to learn from, use, adapt, whatever. Tip: the quick way to jump to a function in the manual is to append the function's name to "http://www.php.net/". So... <http://www.php.net/fsockopen> <http://www.php.net/fputs> -- CC
Also check out the CURL group of functions in the manual. As for code, nope. Never needed to do it, and you won't find the code you need anywhere. You'll have to write it yourself. Which is kind of the point, I thought... You'll find all the info you need in the manual under fsockopen, fgets, fputs, and probably a few RFCs. Check zend for the output buffering article to get some information also. The rest is up to you to hack out. -- Plutarck Should be working on something... ...but forgot what it was. ""Joseph Bannon"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[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. > > Can you give me the coding for this? > > > > > To fake geocities you'll need to set the referer, I believe. Not sure what > > it needs to be set to, however. > > What is the code for this as well? > > > Thanks, > J > > > > > > > Say I'm Hot! - Post Your Picture! > http://www.sayimhot.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] >
Hi! I want to read a textfile (cat, dog, rat,) and get it like this: $namesArray = array("cat,", "dog,", "rat,"); If I can do this than I can go on and make changes in my array. Like the examples in php manual. Thanks in advance for any tips. Regards Jan
If they are all in a format like that, first just read the text file with fopen/fread into one big string. Then use: $refined_string = explode(" ", $bigstring); That's the main way to do it, but the preferable way is using a regular expression with either the ereg or preg functions. -- Plutarck Should be working on something... ...but forgot what it was. "Jan Grafström" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi! > I want to read a textfile (cat, dog, rat,) and get it like this: > $namesArray = array("cat,", "dog,", "rat,"); > If I can do this than I can go on and make changes in my array. > Like the examples in php manual. > > > Thanks in advance for any tips. > > 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] >
I can not seem to get this figuered out I whant to run this function to pull data out of a file and thin use the data in the rest of the program. When I do this I get a Parse error: parse error in c:/httpd/htdocs/autosetup/auto/test.php on line 25 <?php function getdata( ){ ############################################################################ ##### global $domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, $frontpage,$mysql,$userdatabase,$newuser,$newuserpass; if(file_exists("userdata")) { $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); flock($fp2, 2); //unless ($use_flock == 0); while ($data = fgetcsv ($fp2, 1000, "|")) { $num = count ($data); $row++; for ($c=0; $c<$num; $c++) { } list($domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, $frontpage,$mysql,$userdatabase,$newuser,$newuserpass) = $data; } //close and del file fclose ($fp2); //system ("del userdata"); } getdata( ) echo $domain; <--This is line 25 which is outside of the function echo $tld; echo $firstname; echo $lastname; echo $userid; echo $passw; echo $email; echo $package; echo $frontpage; echo $mysql; echo $userdatabase; echo $newuser; echo $newuserpass; ?>
Look at the line directly above where you're parse error is. It semi-lacks part of the lower intentestional tract. That will seem funny to you tommarrow. -- Plutarck Should be working on something... ...but forgot what it was. PS: No it won't. ""Richard Kurth"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I can not seem to get this figuered out I whant to run this function to pull > data out of a file and thin use the data in the rest of the program. When I > do this I get a Parse error: parse error in > c:/httpd/htdocs/autosetup/auto/test.php on line 25 > > > <?php > function getdata( ){ > ############################################################################ > ##### > global $domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, > $frontpage,$mysql,$userdatabase,$newuser,$newuserpass; > > if(file_exists("userdata")) { > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > flock($fp2, 2); //unless ($use_flock == 0); > while ($data = fgetcsv ($fp2, 1000, "|")) { > $num = count ($data); > $row++; > for ($c=0; $c<$num; $c++) { > > } > list($domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, > $frontpage,$mysql,$userdatabase,$newuser,$newuserpass) = $data; > > } > > //close and del file > fclose ($fp2); > //system ("del userdata"); > } > getdata( ) > > echo $domain; <--This is line 25 which is outside of the function > echo $tld; > echo $firstname; > echo $lastname; > echo $userid; > echo $passw; > echo $email; > echo $package; > echo $frontpage; > echo $mysql; > echo $userdatabase; > echo $newuser; > echo $newuserpass; > > > ?> > > > -- > 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 have to wait tell tomorrow I feel funny already Thanks Richard > Look at the line directly above where you're parse error is. > > It semi-lacks part of the lower intentestional tract. > > > That will seem funny to you tommarrow. > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > PS: No it won't. > > ""Richard Kurth"" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I can not seem to get this figuered out I whant to run this function to > pull > > data out of a file and thin use the data in the rest of the > program. When > I > > do this I get a Parse error: parse error in > > c:/httpd/htdocs/autosetup/auto/test.php on line 25 > > > > > > <?php > > function getdata( ){ > > > ################################################################## > ########## > > ##### > > global $domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, > > $frontpage,$mysql,$userdatabase,$newuser,$newuserpass; > > > > if(file_exists("userdata")) { > > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > > flock($fp2, 2); //unless ($use_flock == 0); > > while ($data = fgetcsv ($fp2, 1000, "|")) { > > $num = count ($data); > > $row++; > > for ($c=0; $c<$num; $c++) { > > > > } > > list($domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, > > $frontpage,$mysql,$userdatabase,$newuser,$newuserpass) = $data; > > > > } > > > > //close and del file > > fclose ($fp2); > > //system ("del userdata"); > > } > > getdata( ) > > > > echo $domain; <--This is line 25 which is outside of the function > > echo $tld; > > echo $firstname; > > echo $lastname; > > echo $userid; > > echo $passw; > > echo $email; > > echo $package; > > echo $frontpage; > > echo $mysql; > > echo $userdatabase; > > echo $newuser; > > echo $newuserpass; > > > > > > ?> > > > > > > -- > > 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] > >
Yasuo Ohgaki wrote: > 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 :) Yasuo, There is one mention of set_nonblock() in the manual under accept_connect() under the socket functions. I believe that the new socket functions non blocking mode is dead in the current version of php at least under linux. Regards, Joseph
First of all I use Edit Plus, which uses a list of PHP functions to know what words to highlight in the code. Well now that I have a seriously throbbing headache, I've done it. Finally. If you use a program that needs a list of functions for syntax highlighting, I've finally got one that has every function according to PHP get_defined_functions (includes quite a few undocumented functions), the PHP manual, and quite a few others it failed to mention but should be highlighted. unset() is a good example, along with print/echo, I managed to put it together. Every entry on it's own line (so it's seperated by "\n"). My head feels like it is being used as the repository for Anna Nichole Smith's silicone breast implants (both failed and spare parts for future use). In any case, there are 1755 entries in the blasted thing. If it's in the PHP manual or get_defined_functions, it's in there. And damn is that alot. Here is the link to the text file: http://crazyoddball.hypermart.net/php.stx.txt However I learned so many cool things with so many functions I'd like to use, but I have a severe headache and have to go to work (I'll be in a car the whole time, so no computer) in one hour, and I haven't slept. And I'm not getting paid for this either. Ah yes, this is GeekLife. But I have no caffiene in my system. So this is the GranolaGeekLife...GGL...giggle? Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be useful. I certainly hope so, because compiling the whole thing was overkill if I'm the only one that will use it :) -- Plutarck Should be working on something... ...but forgot what it was.
Hi :) Well, I have installed php on my Windows 98 machine. But i am unable to use the imap funcationality. I have the php_imap.dll in my php.ini file for which i have removed the semicolon (;extension = php_imap.dll) . But it dosent seem to work .I suppose i should have (php_imap4r2.dll ). Can anyone please send me a copy of the file if u have it please :) thanx in advance bye Nilesh
Michael, This works for us: <Location /> php_value include_path "/usr/local/etc/httpd/htdocs/site/inc:." </Location> in the httpd.conf. good luck, @lvin -----Original Message----- From: Temeschinko, Michael [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 05, 2001 11:40 PM To: 'Steve Werby'; Temeschinko, Michael; Php-General (E-Mail) Subject: RE: [PHP] inlude_path not in php.ini > -----Original Message----- > From: Steve Werby [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 05, 2001 4:57 PM > To: Temeschinko, Michael; Php-General (E-Mail) > Subject: Re: [PHP] inlude_path not in php.ini > > > "Temeschinko, Michael" <[EMAIL PROTECTED]> wrote: > > How do I set the php-iclude path if I have not acess to php.ini? > > > > I know in .htacess but al I try ends in an Internal Server Error > > I use php4.0.4pl1 > > Please post what you tried. It might be a difference in the > syntax between > PHP3 and PHP4 if you're using the old style. The new style is: > > php_flag include_path ".:./lib" this line make an error too :-( I tried php_value include_path ".:./foo" php_value include_path=".:./foo" php_value include_path .:./foo php_value include_path=.:./foo php_flag include_path .:./foo # but flag is not right according to the documentation nothing :-( It seems I must change al my includes to relative pathnames (../../php) greetings from sunny (today :-) Germany Michael -- 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 > php_value include_path ".:./foo" > php_value include_path=".:./foo" > php_value include_path .:./foo > php_value include_path=.:./foo > php_flag include_path .:./foo # but flag is not right > according to the > documentation > > nothing :-( > > It seems I must change al my includes to relative pathnames (../../php) > It maybe you are not allowed to change the stuff in .htaccess. I think rights for this are assigned in httpd.conf. HTH M@
hi, I'm hari. I've need a help from you. Pls look by code. $string="line1\nline\2line3"; $fp=fopen( "somefile", "w"); fwrite( $fp, $string); fclose( $fp); Then the file contents will be line1\nline\2line3 Instead I'm looking for. line1 line2 line3 Pls help me on some true program way. But I did it manually by pressing enter key like $string="<-' line1<-' line2<-' line3"; But this should't convenient to me with thanks, hari. _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com
Hi, I am having big problems with merging two arrays. I just can't seem to get my head around it. I have two arrays which I wish to merge, but I want to EXCLUDE duplicate values. Any suggestions, as my numerous attempts have proved unsuccessful. BTW I'm using PHP4. Many thanks Alexis
Hello, I am trying to create the subject text of an email message which needs to be sent to a user. The text will have some tags which need to be replaced with the appropriate values. Does anyone have some code / PHP class which they can share which would do the following: Template will be of the form: ************************** Dear __NAME__, Your current account number __ACCOUNT_NUMBER__ has a balance of __BALANCE__ as on __DATE__ Thanks, Administrator ************************** The code will be passed the template and a list of values which will replace the above tags __NAME__, __ACCOUNT_NUMBER___, ... If you need some clarifications, please contact me. Sending email is not a problem at all. I know this is not hugely difficult, but I am looking at some ready to use code, if possible. Thanks in advance. Regards, Sharat
Hello, Can anyone help me to achieve this using PHP: I would like to have a personal photographic portfolio site with thumbnails. Clicking on the thumbnail would bring up another page which has an enlarged version of the photo on a standard 'template page'. In other words the photo src is a variable. Thing is I know not much about PHP/CGI/JS and I am using free ISPs like Freeserve (UK) and Yahoo Geocities, so I don't know what is the best way to approach this. Thanks for any pointers. Kynan
Hi There, I currently have a MySQL table, with around 700 populated rows in it. I'd like to know if there's a quick and easy way to update one column across all of the rows in the database. I shouldn't imagine it's a difficult job, but I'm having a mental block :) Thanks in advance. -- James
Hello James In your update statement, do not include a WHERE clause HTH ----- Original Message ----- From: James Holloway <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 06, 2001 11:05 AM Subject: [PHP] Update All fields? > Hi There, > > I currently have a MySQL table, with around 700 populated rows in it. I'd > like to know if there's a quick and easy way to update one column across all > of the rows in the database. I shouldn't imagine it's a difficult job, but > I'm having a mental block :) > > Thanks in advance. > > -- > > James > > > > -- > 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've posted this email one week ago. I think it may help you a little with some new ideas. Don't forget the other good advices like 'make clean' in gd, php and apache and.. so on..directories and removing config.cache from php directory before making a new recompilation. Hope it helps! =============old message, about jpeg support installation You need the jpeg support. Shortly, do this: (I will use my version names, so you can easyly find something, if you find newer ones, it's your bussiness) 1. search the internet for: jpegsrc.v6b.tar.gz gd-1.8.3.tar.gz apache_1.3.14.tar.gz php-4.0.4.tar.gz 2. unzip all files in a tmp directory (let's say /tmp ): tar zxvf jpegsrc.v6b.tar.gz the same for gd, php, apache... 3. modify the 'Makefile' of the jpeg kit, to meet your requirements (only the paths to be correct, as your are) then issue: ./configure --enable-shared --enable-static then make make install 4. modify the gd Makefile: put there the your paths and uncomment the 'CFLAGS' line that enables the jpeg support (something like CFLAGS -DHAVE jpeg) then issue: make make install 5. now configure php and apache and compile them. it should work. it took me alot these days to discover all of this..
We have successfully installed php3 and php4 under AIX4.3.3 with Apache1.3.19. Now we can see the php3-documents in the browser(NS4.7). In opposition to that the php4-documents are only downloadable. Is there any setting that is not described in the manual we have to do therewith the browser can show us both types of php? Thanks for help, Markus Mattes