php-general Digest 25 Jan 2001 06:45:47 -0000 Issue 475 Topics (messages 36451 through 36574): -> 36451 by: Karl J. Stubsjoen 36452 by: Cal Evans 36454 by: Karl J. Stubsjoen 36458 by: Joe Stump 36459 by: Chris Lee 36460 by: Cal Evans Re: mysql_fetch_array strangeness 36453 by: Markus Fischer Re: Form data is not "remembered" 36455 by: Alex Black Re: building a language pack 36456 by: Alex Black 36457 by: Robert S. White 36476 by: Maciek Uhlig SMTP interface in php? 36461 by: George Schlossnagle 36464 by: Alex Black Re: Test for Cookies 36462 by: Brian V Bonini 36472 by: Karl J. Stubsjoen looking for people for open source project 36463 by: Joe Stump login authentication / session handling... 36465 by: johnny p. 36552 by: Richard Lynch Re: Integration of PHP with MS Outlook? 36466 by: Alex Black PHP - Interrupted Scripts, 36467 by: Timo Mika Gläßer 36469 by: Joe Stump 36471 by: Joe Stump 36488 by: Rasmus Lerdorf php / mysql 36468 by: Timo Mika Gläßer Re: [PHP-INST] php / mysql 36470 by: Ashley M. Kirchner mysql_insert_id() 36473 by: Boget, Chris 36475 by: Sam Masiello 36477 by: Boget, Chris 36487 by: Sam Masiello 36489 by: Boget, Chris 36493 by: Sam Masiello 36496 by: Boget, Chris Redirect 36474 by: Karl J. Stubsjoen 36486 by: Thor M. Steindorsson how to rename a database 36478 by: Fang Li 36480 by: Cal Evans 36531 by: Chris Doyle Re: eval() to string??? 36479 by: Steve Edberg PHP Editors summary page (was Re: Re: [PHP] PHP Editors) 36481 by: Toby Butzon 36484 by: eschmid+sic.s.netic.de Test for Cookies (Stored vs. Session) 36482 by: Karl J. Stubsjoen Re: Funny php://stdout behaviour 36483 by: Toby Butzon Help with INSERT query 36485 by: Darren Evans 36490 by: Thor M. Steindorsson 36492 by: Darren Evans Processing PHP within a string variable 36491 by: Matt 36497 by: Alexander Skwar 36504 by: Toby Butzon 36508 by: Matt Loop Through all Querystring Variables 36494 by: Karl J. Stubsjoen 36500 by: Steve Edberg 36501 by: Philip Olson Cookie semi-security. 36495 by: April 36498 by: Toby Butzon 36528 by: Alex Black Function / syntax varying from version to version? 36499 by: Steven Deaton 36505 by: Cal Evans Re: Function / syntax varying from version to version?] -- CORRECTION 36502 by: Steven Deaton Date/Time from Unix timestamp 36503 by: CDitty 36506 by: Ernest E Vogelsinger 36509 by: Hardy Merrill Re: Turning off scrollbar 36507 by: Chris Hayes 36525 by: Alex Black how do you erase quotes from variable? 36510 by: Michael Zornek 36511 by: Boget, Chris 36512 by: Nik Gare 36515 by: Rasmus Lerdorf Any PHP API for Meeting-Pro? 36513 by: James R. Butzen 36553 by: Richard Lynch Look for and Trim Last Character 36514 by: Karl J. Stubsjoen 36516 by: Rasmus Lerdorf easy question. 36517 by: Nathan Cook 36519 by: jeremy brand 36520 by: Steven Deaton 36523 by: Alex Black 36529 by: Chris Hayes I give - Whats wrong 36518 by: Karl J. Stubsjoen 36521 by: jeremy brand 36522 by: Rasmus Lerdorf 36526 by: Chris Hayes 36527 by: Karl J. Stubsjoen 36530 by: Pickup, Jordan IMAP PROBLEM 36524 by: Jochen Kächelin Re: Editors, again (was Re: [PHP] Beginner in php!) 36532 by: Brian White Finding an '&' 36533 by: Karl J. Stubsjoen 36534 by: James R. Butzen 36535 by: Philip Olson Greek PHP mailing list 36536 by: Subbie Mitsman 36554 by: Richard Lynch 36557 by: Stephan Ahonen 36558 by: Brian White regular expression help 36537 by: Jamie Burns --with-mysql, yet mysql_errno() is "undefined"? 36538 by: CC Zona 36539 by: Rasmus Lerdorf directory reading 36540 by: Pat Hanna Re: PHP Editors 36541 by: John R.Marshall No Cookies 36542 by: Website4S.aol.com 36555 by: Richard Lynch more about Last_insert_id 36543 by: Jacky.lilst 36556 by: Richard Lynch Status of debugger_on( ) (fwd) 36544 by: tarique.sanisoft.com Urgent help needed, sound scary when anyone did that on title :-) 36545 by: Jacky.lilst 36546 by: Joe Stump 36547 by: Jacky.lilst 36560 by: Maxim Maletsky 36561 by: Jacky.lilst Re: HTTP_REFERER vs. session_whatever() vs. header() 36548 by: Richard Lynch Re: HELP!!! PDFLIB FOR PHP!!!!! 36549 by: Richard Lynch Re: problem with imagecolorsforindex() 36550 by: Richard Lynch Re: Displaying Date correctly 36551 by: Richard Lynch HOWTO: Installation on Cobalt RaQ (RaQ3 or RaQ4) 36559 by: Derek Sivers Search for the documentation 36562 by: Jamie 36563 by: jeremy brand 36565 by: Rasmus Lerdorf 36566 by: Hrishi 36569 by: Philip Olson 36571 by: Joe Sheble (Wizaerd) Ideas?? (OT- MySQL) 36564 by: Website4S.aol.com multiple function returns 36567 by: Jamie 36568 by: jeremy brand warning 1 is not mysql result index 36570 by: Jacky.lilst 36572 by: Christopher Allen How do you do this? 36573 by: Sefton 36574 by: David Harrison 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] ----------------------------------------------------------------------
What does -> do? As in: $Something->then_something_over_here
It's means that what's on the right is part of the object on the left. i.e. $myObject->myMethod(); fires the method myMethod() of the object $myObject. echo $myObject->myAttribute; displays the value of the attribute myAttribute of the object $myObject. Clear as mud? ;) Cal http://www.calevans.com -----Original Message----- From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 1:05 PM To: PHP Mailing List Subject: [PHP] -> What does -> do? As in: $Something->then_something_over_here -- 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]
Aisch! Hmmm... yep, clear as mud. Let me describe what I we have going on: We have a function called ToForm which looks like it verifies values coming in from a POST. This function is invoked like this: $generic->ToForm("cart_id", NO_DEFAULT_VALUE); $generic->ToForm("email_address", NO_DEFAULT_VALUE); I don't understand the $generic-> and what happens when it "becomes" something twice. The ToForm function looks like this: function ToFORM($val, $default, $makeuppercase=0) { global $FORM, $$val; if(!empty(${$val})) $FORM[$val] = trim(${$val}); else if($default != NO_DEFAULT_VALUE) $FORM[$val] = $default; if($makeuppercase) $FORM[$val] = strtoupper($FORM[$val]); } Thanks for the help! Karl ----- Original Message ----- From: "Cal Evans" <[EMAIL PROTECTED]> To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 12:08 PM Subject: RE: [PHP] -> > It's means that what's on the right is part of the object on the left. > > i.e. > > $myObject->myMethod(); > > fires the method myMethod() of the object $myObject. > > echo $myObject->myAttribute; > > displays the value of the attribute myAttribute of the object $myObject. > > Clear as mud? ;) > > Cal > http://www.calevans.com > > > -----Original Message----- > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 1:05 PM > To: PHP Mailing List > Subject: [PHP] -> > > > What does -> do? > As in: > $Something->then_something_over_here > > > -- > 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] > >
$Something is an instance of a class - so like this: class Foo { var $test function echo_test() { echo $this->test; } } $foo = new Foo; $foo->test = 'this'; $foo->echo_test(); --Joe On Wed, Jan 24, 2001 at 12:05:17PM -0700, Karl J. Stubsjoen wrote: > What does -> do? > As in: > $Something->then_something_over_here > > > -- > 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 Hacker [EMAIL PROTECTED] http://www.miester.org/
<? class generic { var $test_1; var $test_2; function set_var($var_1, $var_2) { $this->test_1 = $var_1; $this->test_2 = $var_2; } } $something = new generic; $something->set_var(10, 12); echo $something->test_1 . "<br>\n"; echo $something->test_2 . "<br>\n"; ?> all classes do is organize data, its a nice way of doing it too. all the -> is access that data/function. Im not quite sure what you mean when you say "generic-> becomes something twice" as far as I can see, nothing is becoming nothing. Chris Lee Mediawaveonline.com ""Karl J. Stubsjoen"" <[EMAIL PROTECTED]> wrote in message 008201c0863a$62814cc0$0afc020a@kstubsjoen">news:008201c0863a$62814cc0$0afc020a@kstubsjoen... > Aisch! Hmmm... yep, clear as mud. Let me describe what I we have going on: > > We have a function called ToForm which looks like it verifies values coming > in from a POST. This function is invoked like this: > > $generic->ToForm("cart_id", NO_DEFAULT_VALUE); > $generic->ToForm("email_address", NO_DEFAULT_VALUE); > > I don't understand the $generic-> and what happens when it "becomes" > something twice. The ToForm function looks like this: > > function ToFORM($val, $default, $makeuppercase=0) { > global $FORM, $$val; > if(!empty(${$val})) > $FORM[$val] = trim(${$val}); > else if($default != NO_DEFAULT_VALUE) > $FORM[$val] = $default; > if($makeuppercase) > $FORM[$val] = strtoupper($FORM[$val]); > } > > Thanks for the help! > > Karl > > > ----- Original Message ----- > From: "Cal Evans" <[EMAIL PROTECTED]> > To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List" > <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 12:08 PM > Subject: RE: [PHP] -> > > > > It's means that what's on the right is part of the object on the left. > > > > i.e. > > > > $myObject->myMethod(); > > > > fires the method myMethod() of the object $myObject. > > > > echo $myObject->myAttribute; > > > > displays the value of the attribute myAttribute of the object $myObject. > > > > Clear as mud? ;) > > > > Cal > > http://www.calevans.com > > > > > > -----Original Message----- > > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 24, 2001 1:05 PM > > To: PHP Mailing List > > Subject: [PHP] -> > > > > > > What does -> do? > > As in: > > $Something->then_something_over_here > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
$generic is an object. Somewhere you've got a line in your code that instantiates it. (i.e. $generic = new ...) Cal http://www.calevans.com -----Original Message----- From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 1:18 PM To: Cal Evans; PHP Mailing List Subject: Re: [PHP] -> Aisch! Hmmm... yep, clear as mud. Let me describe what I we have going on: We have a function called ToForm which looks like it verifies values coming in from a POST. This function is invoked like this: $generic->ToForm("cart_id", NO_DEFAULT_VALUE); $generic->ToForm("email_address", NO_DEFAULT_VALUE); I don't understand the $generic-> and what happens when it "becomes" something twice. The ToForm function looks like this: function ToFORM($val, $default, $makeuppercase=0) { global $FORM, $$val; if(!empty(${$val})) $FORM[$val] = trim(${$val}); else if($default != NO_DEFAULT_VALUE) $FORM[$val] = $default; if($makeuppercase) $FORM[$val] = strtoupper($FORM[$val]); } Thanks for the help! Karl ----- Original Message ----- From: "Cal Evans" <[EMAIL PROTECTED]> To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 12:08 PM Subject: RE: [PHP] -> > It's means that what's on the right is part of the object on the left. > > i.e. > > $myObject->myMethod(); > > fires the method myMethod() of the object $myObject. > > echo $myObject->myAttribute; > > displays the value of the attribute myAttribute of the object $myObject. > > Clear as mud? ;) > > Cal > http://www.calevans.com > > > -----Original Message----- > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 1:05 PM > To: PHP Mailing List > Subject: [PHP] -> > > > What does -> do? > As in: > $Something->then_something_over_here > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Because, basically, in php an array is a hash with just numbers as keys. m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0
> If the form page is not being cached, it would probably get reloaded > when they clicked back, thus losing the data. > > I'd suggest redrawing the form with the fields populated and with the > appropriate error messages. Then you don't need to mess with caches or > sessions for that matter, and the user doesn't need to take an extra > step to get back to the form. yep, best way is to move the control of your form into the php script itself, so the script can spit up the form with errors, saying "you screwed this, and that up" instead of making them go back, which 90% of the time will force them to re-enter the data, and we all know how much that sucks :) in short, don't use the php script like most people use cgi scripts. have it control the entire peocess. -alex
I'm of the opinion that abstracting all "lang-specific" strings to an xml file is the easiest, cleanest way to go. that means "layman" authors can translate without screwing up your code, and you can get a lot of languages fast. it's also pretty convenient to get the strings out, and to add new ones. just assign an id, like: <string> <id>12</id> <lang:en>hello, world</lang:en> <lang:fr>bonjour, monde</lang:fr> </string> or something :) _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] > Newsgroups: php.general > Date: 24 Jan 2001 10:08:55 -0800 > Subject: [PHP] building a language pack > > I'm the author of an opensource php auctioning system and have recently been > receving alot of emails concerning the availibility of different languages. > I was wondering what the best way to build a sort of language pack would be > (one file for french, one for english, one for german, etc). Something like > replacing one file containing the language specs & translations would > translate the entire system. I'm just looking for recommendations before I > start asking volunteers to translate the words. Thanks. > > > > > > _______________________________________________________ > Send a cool gift with your E-Card > http://www.bluemountain.com/giftcenter/ > > > > -- > 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] >
is xml compatible with php? i don't know anything about xml. any places on the net i can get a quick overview of it? ----- Original Message ----- From: Alex Black <[EMAIL PROTECTED]> To: <> Sent: Wednesday, January 24, 2001 2:17 PM Subject: Re: [PHP] building a language pack > I'm of the opinion that abstracting all "lang-specific" strings to an xml > file is the easiest, cleanest way to go. that means "layman" authors can > translate without screwing up your code, and you can get a lot of languages > fast. > > it's also pretty convenient to get the strings out, and to add new ones. > > just assign an id, like: > > <string> > <id>12</id> > <lang:en>hello, world</lang:en> > <lang:fr>bonjour, monde</lang:fr> > </string> > > or something :) > > _alex > > > -- > Alex Black, Head Monkey > [EMAIL PROTECTED] > > The Turing Studio, Inc. > http://www.turingstudio.com > > vox+510.666.0074 > fax+510.666.0093 > > Saul Zaentz Film Center > 2600 Tenth St Suite 433 > Berkeley, CA 94710-2522 > > > > > > From: [EMAIL PROTECTED] > > Newsgroups: php.general > > Date: 24 Jan 2001 10:08:55 -0800 > > Subject: [PHP] building a language pack > > > > I'm the author of an opensource php auctioning system and have recently been > > receving alot of emails concerning the availibility of different languages. > > I was wondering what the best way to build a sort of language pack would be > > (one file for french, one for english, one for german, etc). Something like > > replacing one file containing the language specs & translations would > > translate the entire system. I'm just looking for recommendations before I > > start asking volunteers to translate the words. Thanks. > > > > > > > > > > > > _______________________________________________________ > > Send a cool gift with your E-Card > > http://www.bluemountain.com/giftcenter/ > > > > > > > > -- > > 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] _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
try http://stphp.sourceforge.net Maciek > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 7:09 PM > To: [EMAIL PROTECTED] > Subject: [PHP] building a language pack > > > I'm the author of an opensource php auctioning system and have > recently been > receving alot of emails concerning the availibility of different > languages. > I was wondering what the best way to build a sort of language > pack would be > (one file for french, one for english, one for german, etc). > Something like > replacing one file containing the language specs & translations would > translate the entire system. I'm just looking for > recommendations before I > start asking volunteers to translate the words. Thanks. > > > > > > _______________________________________________________ > Send a cool gift with your E-Card > http://www.bluemountain.com/giftcenter/ > > > > -- > 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] > > >
Is there a generic SMTP interface library for php? Something akin to perl's Net::SMTP. php's mail() is not terribly flexible for sending mass mail, and I was going to write one that's a lower-level interface, but I don't want to waste my time re-inventing the wheel if one already exists.... Thanks, George
yes, manuel lemos has a fantastic one at phpclasses.upperdesign.com I've got it running a couple places, it works _really_ well :) but I've never done mass mailing with it. -alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] (George Schlossnagle) > Organization: Community Connect, Inc. > Newsgroups: php.general > Date: 24 Jan 2001 11:38:11 -0800 > Subject: [PHP] SMTP interface in php? > > Is there a generic SMTP interface library for php? Something akin to > perl's Net::SMTP. php's mail() is not terribly flexible for sending > mass mail, and I was going to write one that's a lower-level interface, > but I don't want to waste my time re-inventing the wheel if one already > exists.... > > Thanks, > > George > > > -- > 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'll need to at least reload the page so the cookie can be sent back to the server after it's set..... Try this: it's taken directly from the annotations on the setcookie function page of the php manual. <?php $status = 0; if (isset($myTstCky) && ($myTstCky == "ChocChip")) $status = 1; if (!isset($CCHK)) { setcookie("myTstCky", "ChocChip"); header("Location: $PHP_SELF?CCHK=1"); exit; } ?> <html> <head><title>Cookie Check</title></head> <body bgcolor="#FFFFFF" text="#000000"> Cookie Check Status: <?php printf ('<font color="#%s">%s</font> ;', $status ? "00FF00" : "FF0000", $status ? "PASSED!" : "FAILED!"); ?> </body> </html> > -----Original Message----- > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 1:42 PM > To: [EMAIL PROTECTED]; PHP Mailing List > Subject: Re: [PHP] Test for Cookies > > > > By trying to set a cookie and read it back. > > Okay....here is the scenario: > > User originates from STATIC Html page, > Links to my PHP Cookie Test Page > I set a cookie in my PHP Cookie Test Page > Can I then check (safely) for cookies right away in my PHP Cookie > Test Page > without involving a 3rd page? > > Karl > > > -- > 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] > >
In IE | Tools | Internet Options | Security | Custom Level You'll find 2 items under Cookies - Allow cookies that are stored on your computer - Allow per-session cookies (not stored) Both haveing the options (enabled / prompt / disabled) The cookie test script is succesful if and only if "per-session" is enabled. Okay, my question is: Does the 2nd Cookie Option "Per Session" imply that "that as long as the browser(s) have not been closed down, that as long as any instance of IE is running, that we have infact NOT terminated a "Session" and a cookie which has been set in this session is available? No matter where the user browses to, the number of browser windows he opens, closes, jumps back and forth between (just as long as at least 1 instance of IE is running the entire time), is this "cookie session" still intact?" And what about NS? Karl ----- Original Message ----- From: "Brian V Bonini" <[EMAIL PROTECTED]> To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 12:56 PM Subject: RE: [PHP] Test for Cookies > You'll need to at least reload the page so > the cookie can be sent back to the server > after it's set..... > > Try this: it's taken directly from the annotations > on the setcookie function page of the php manual. > > <?php > $status = 0; > if (isset($myTstCky) && ($myTstCky == "ChocChip")) $status = 1; > if (!isset($CCHK)) > setcookie("myTstCky", "ChocChip"); > header("Location: $PHP_SELF?CCHK=1"); > exit; > } > ?> > <html> > <head><title>Cookie Check</title></head> > <body bgcolor="#FFFFFF" text="#000000"> > Cookie Check Status: > <?php > printf ('<font color="#%s">%s</font> > ;', > $status ? "00FF00" : "FF0000", > $status ? "PASSED!" : "FAILED!"); > ?> > </body> > </html> > > > -----Original Message----- > > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 24, 2001 1:42 PM > > To: [EMAIL PROTECTED]; PHP Mailing List > > Subject: Re: [PHP] Test for Cookies > > > > > > > By trying to set a cookie and read it back. > > > > Okay....here is the scenario: > > > > User originates from STATIC Html page, > > Links to my PHP Cookie Test Page > > I set a cookie in my PHP Cookie Test Page > > Can I then check (safely) for cookies right away in my PHP Cookie > > Test Page > > without involving a 3rd page? > > > > Karl > > > > > > -- > > 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've started a little pet project on the side and I'm looking to enlist people in it - no better place to find PHP coders than here I suppose. If you are interested in donating a few hours here and there to an Open Source project then visit http://www.miester.org/geekshare for more info. Thanks! --Joe -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
Ok, I'm probably asking something that's been asked rediculous amounts of times before, but I'll go ahead and ask again since I'm finding it difficult to find a common method, or a preferred login and session handling process. So, here goes... I am trying to do what everyone else in the web industry is doing, but I'm a bit new to session handling and login authentication. I have apache + mysql + php4 + ssl on my RH6.2 machine. I have --enable-track-vars on and this is my current setup: 1. login page has username and password text boxes and a link to my https login.php page. 2. after submit, login.php starts a session, opens the database, checks username and password, if valid ?? sets session variable $LOGGED_IN or something like it, sets $USERNAME, and loads the default php page for the user. If not valid, sets a session variable indicating the error, loads the login page again and displays an error message. login page destroys the session. 3. default page loads and check the value of $LOGGED_IN. if 1, then continue loading page for $USERNAME, otherwise loads login page with error. All other pages follow this same procedure. Questions about this: - I also want to have a timeout on the login, user configurable. How would I add this in? Initially a 3 hour timeout would be nice. I'm storing last login and last activity times in the databse as TIMESTAMP values. Should I check this along with $LOGGED_IN before loading the pages? - What is the default timeout on a session? Can I configure that somehow? I can't seem to find a way to make php changes... someone mentioned php.ini somewhere, but I've modified this file with no effect. Even when moved to the configured directory for php.ini (found by doing phpinfo() call). Any assistance, although most likely redundant, would be appreciated. There's so much to sift through and perhaps if someone just points to a good doc on authentication processes, that would help. Thanks for all the help, johnny p.
> 1. login page has username and password text boxes and a link to my https > login.php page. If you're trying to keep the username/password safe in SSL, both the receiving login.php *AND* the page with the FORM in it need to live on the secure server. > 2. after submit, login.php starts a session, opens the database, checks > username and password, if valid ?? sets session variable $LOGGED_IN or > something like it, sets $USERNAME, and loads the default php page for the > user. If not valid, sets a session variable indicating the error, loads the > login page again and displays an error message. login page destroys the > session. create table users(username text unique not null, password text); <?php if ((isset($USERNAME) && isset($PASSWORD)){ $query = "select count(*) from users where username = '$USERNAME' and password('$PASSWORD') = password"; $matches = mysql_query($query) or die(mysql_error()); $count = mysql_result($matches, 0, 0); if (!$count){ header("Location: login.php?msg=" . urlencode("Invalid Login")); exit; } } if (isset($msg)){ echo $msg, "<BR>\n": ?> <FORM ACTION=login.php METHOD=POST> <INPUT NAME=USERNAME> <INPUT TYPE=PASSWORD NAME=PASSWORD> <INPUT TYPE=SUBMIT> </FORM> <?php exit; } session_start(); session_register('USERNAME'); #load/display default page for $USERNAME ?> > 3. default page loads and check the value of $LOGGED_IN. if 1, then > continue loading page for $USERNAME, otherwise loads login page with error. > All other pages follow this same procedure. > > Questions about this: > - I also want to have a timeout on the login, user configurable. How would > I add this in? Initially a 3 hour timeout would be nice. I'm storing last > login and last activity times in the databse as TIMESTAMP values. Should I > check this along with $LOGGED_IN before loading the pages? Sure, or have a cron job (man 5 crontab) that deletes anybody older than 3 hours. You could select their last activity, and if it's older than X, send a header like the Invalid Login, only saying Session Expired. Otherwise, update their last activity. > - What is the default timeout on a session? Can I configure that somehow? > I can't seem to find a way to make php changes... someone mentioned php.ini > somewhere, but I've modified this file with no effect. Even when moved to > the configured directory for php.ini (found by doing phpinfo() call). Did you stop/start apache to make it reload it after you moved it?... > Any assistance, although most likely redundant, would be appreciated. > There's so much to sift through and perhaps if someone just points to a good > doc on authentication processes, that would help. There's some sample code on http://zend.com as well as other code archives. Find the one that looks least puzzling and study it. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
if you're using exchange server, I _think_ that runs on top of SQL server. so, yes, if all the above is true, and assuming it's possible to figure out the schema and what all the fields are for. then you could have php talk to SQL server, and insert records. my _guess_ is that I'm probably wrong, and outlook uses some terrible internal db that's hyper proprietary, which doesn't accept connections :) _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] ("Chris Lee") > Newsgroups: php.general > Date: 24 Jan 2001 10:10:06 -0800 > Subject: Re: [PHP] Integration of PHP with MS Outlook? > > Well, php is server side, so wahtever you want todo serverside php can > probably try todo. is outlook express on the server? if not I doubt you'll > have any luck at all. > > You might be able to do this is if you had php dynamically write VBscript > and email that to the client. I dont know about that. > > PHP on a windows box can use windows DOM, if outlook express was on the > server then you might be able to use this too, I cant say for sure. All I > can say for sure is that php is serverside, so if ou want php todo anything > but serverside your looking in the wrong spot. > > Chris Lee > Mediawaveonline.com > > > > > "Jon Haworth" <[EMAIL PROTECTED]> wrote in message > 431205EC9190D4119E2800D0B720FA3F397343@BOOTROS">news:431205EC9190D4119E2800D0B720FA3F397343@BOOTROS... >> Hi list, >> >> Is it possible to get PHP to create entities in Outlook, specifically > tasks >> and calendar entries? >> >> TIA >> Jon >> >> >> Please visit us on the Internet: >> http://www.witanjardine.co.uk >> >> 'The information included in this e-mail is of a confidential nature and > is >> intended only for the addressee. If you are not the intended addressee, > any >> disclosure, copying or distribution by you is prohibited and may be >> unlawful. Disclosure to any party other than the addressee, whether >> inadvertent or otherwise is not intended to waive privilege of >> confidentiality' >> >> >> -- >> 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] >
Hi, I had this problem over and over again: A script takes a long time to execute and is interrupted in the middle of its action by either a IE-Crash or and Proxy-Error. Can one prevent or circumvent that problem??? Thanks for your fast response in advance, Timo Mika Gläßer ___________________________________________________ Timo Mika Gläßer (mailto:[EMAIL PROTECTED]) GewinnIDEE AG Mexikoring 29 D-22297 Hamburg Tel. ++49 (040) 631282-22 Fax. ++49 (040) 631282-10
try set_time_limit(0) for starters. Otherwise I'm clueless. --Joe On Wed, Jan 24, 2001 at 09:31:17PM +0100, Timo Mika Gl??er wrote: > Hi, > I had this problem over and over again: A script takes a long time to > execute and is interrupted in the middle of its action by either a IE-Crash > or and Proxy-Error. Can one prevent or circumvent that problem??? > > Thanks for your fast response in advance, > > Timo Mika Gläßer > > ___________________________________________________ > > Timo Mika Gläßer (mailto:[EMAIL PROTECTED]) > > > GewinnIDEE AG > Mexikoring 29 > D-22297 Hamburg > > Tel. ++49 (040) 631282-22 > Fax. ++49 (040) 631282-10 > > > > > > -- > 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 Hacker [EMAIL PROTECTED] http://www.miester.org/
set_time_limit(0) sets the limit to 0 or inifinate. But it will end like any other script (ie end of script or exit;) --Joe On Wed, Jan 24, 2001 at 09:41:44PM +0100, Timo Mika Gl??er wrote: > and what does set_time_limit(0) do??? set it to infinity??? > > i have some fucntion call in there which sets the time-limit each time a > loop is called ... the documentation says that this does prolong the > excution time... is that correct??? > > - timO > > > > -----Ursprüngliche Nachricht----- > Von: Joe Stump [mailto:[EMAIL PROTECTED]] > Gesendet: Mittwoch, 24. Januar 2001 21:43 > An: Timo Mika Gl??er > Betreff: Re: [PHP] PHP - Interrupted Scripts, > > > By default PHP cuts off execution at 30 seconds. > > --Joe > > On Wed, Jan 24, 2001 at 09:36:17PM +0100, Timo Mika Gl??er wrote: > > why setting time-limit to 0??? > > > > > > - timo > > > > -----Ursprüngliche Nachricht----- > > Von: Joe Stump [mailto:[EMAIL PROTECTED]] > > Gesendet: Mittwoch, 24. Januar 2001 21:37 > > An: Timo Mika Gl??er > > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > Betreff: Re: [PHP] PHP - Interrupted Scripts, > > > > > > try set_time_limit(0) for starters. Otherwise I'm clueless. > > > > --Joe > > > > On Wed, Jan 24, 2001 at 09:31:17PM +0100, Timo Mika Gl??er wrote: > > > Hi, > > > I had this problem over and over again: A script takes a long time to > > > execute and is interrupted in the middle of its action by either a > > IE-Crash > > > or and Proxy-Error. Can one prevent or circumvent that problem??? > > > > > > Thanks for your fast response in advance, > > > > > > Timo Mika Gläßer > > > > > > ___________________________________________________ > > > > > > Timo Mika Gläßer (mailto:[EMAIL PROTECTED]) > > > > > > > > > GewinnIDEE AG > > > Mexikoring 29 > > > D-22297 Hamburg > > > > > > Tel. ++49 (040) 631282-22 > > > Fax. ++49 (040) 631282-10 > > > > > > > > > > > > > > > > > > -- > > > 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 Hacker > > [EMAIL PROTECTED] > > http://www.miester.org/ > > > > > > -- > > Joe Stump, PHP Hacker > [EMAIL PROTECTED] > http://www.miester.org/ > > > -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
Read this: http://www.php.net/manual/en/features.connection-handling.php -Rasmus On Wed, 24 Jan 2001, [iso-8859-1] Timo Mika Gläßer wrote: > Hi, > I had this problem over and over again: A script takes a long time to > execute and is interrupted in the middle of its action by either a IE-Crash > or and Proxy-Error. Can one prevent or circumvent that problem??? > > Thanks for your fast response in advance, > > Timo Mika Gläßer > > ___________________________________________________ > > Timo Mika Gläßer (mailto:[EMAIL PROTECTED]) > > > GewinnIDEE AG > Mexikoring 29 > D-22297 Hamburg > > Tel. ++49 (040) 631282-22 > Fax. ++49 (040) 631282-10 > > > > > > -- > 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, we're basically developing for DB2 or Oracle and don't usually need MySQl-Support with PHP. So in order to make the httpd binary a little smaller is it possible to compile PHP4 without any MySQL-Support added? Thanks for your response in advance. Yours, Timo Mika Gläßer ___________________________________________________ Timo Mika Gläßer (mailto:[EMAIL PROTECTED]) GewinnIDEE AG Mexikoring 29 D-22297 Hamburg Tel. ++49 (040) 631282-22 Fax. ++49 (040) 631282-10
Timo Mika Gläßer wrote: > we're basically developing for DB2 or Oracle and don't usually need > MySQl-Support with PHP. So in order to make the httpd binary a little > smaller is it possible to compile PHP4 without any MySQL-Support added? Configure & compile PHP with the --without-mysql flag. 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
I'm having intermittent problems with this function. Most of the time, it returns the proper value. However, sometimes it doesn't return anything at all even when the insert query executes without error and I can see the new data in the database. I try to get the last insert id both by supplying the link-resource and not but still get the same results. When I echo out the link-resource (what mysql() returns), all I'm gettins is a numerical one (1). What gives? Chris
When you are using mysql_insert_id, you don't want to pass it the result of your previous SQL statement as in: $result = mysql"mydb", "My SQL statement", $my_connect) ; $last_id = mysql_insert_id($result) Rather, you want to pass it the link identifier from your mysql_connect like: $result = mysql("mydb", "My SQL statement", $my_connect) ; $last_id = mysql_insert_id($my_connect) HTH Sam Masiello Systems Analyst Chek.Com (716) 853-1362 x289 [EMAIL PROTECTED] -----Original Message----- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 3:50 PM To: Php (E-mail) Subject: [PHP] mysql_insert_id() I'm having intermittent problems with this function. Most of the time, it returns the proper value. However, sometimes it doesn't return anything at all even when the insert query executes without error and I can see the new data in the database. I try to get the last insert id both by supplying the link-resource and not but still get the same results. When I echo out the link-resource (what mysql() returns), all I'm gettins is a numerical one (1). What gives? Chris
> When you are using mysql_insert_id, you don't want to pass it > the result of your previous SQL statement as in: > $result = mysql"mydb", "My SQL statement", $my_connect) ; > $last_id = mysql_insert_id($result) This is what it sounds like it's looking for in the documentation. It could be just how I'm reading it. :p > Rather, you want to pass it the link identifier from your > mysql_connect like: > $result = mysql("mydb", "My SQL statement", $my_connect) ; > $last_id = mysql_insert_id($my_connect) Tried this, too, with no luck. :( I'm using mysql_pconnect() and mysql_connect() and neither seems to help my situation. Chris
You probably stated this in your previous post, but what is the result from your call to mysql() ? Is this call failing so that when you get to mysql_insert_id(), the id doesn’t exist? HTH Sam Masiello Systems Analyst Chek.Com (716) 853-1362 x289 [EMAIL PROTECTED] -----Original Message----- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 4:20 PM To: 'Sam Masiello'; Php (E-mail) Subject: RE: [PHP] mysql_insert_id() > When you are using mysql_insert_id, you don't want to pass it > the result of your previous SQL statement as in: > $result = mysql"mydb", "My SQL statement", $my_connect) ; > $last_id = mysql_insert_id($result) This is what it sounds like it's looking for in the documentation. It could be just how I'm reading it. :p > Rather, you want to pass it the link identifier from your > mysql_connect like: > $result = mysql("mydb", "My SQL statement", $my_connect) ; > $last_id = mysql_insert_id($my_connect) Tried this, too, with no luck. :( I'm using mysql_pconnect() and mysql_connect() and neither seems to help my situation. Chris
> You probably stated this in your previous post, but what is > the result from your call to mysql() ? Is this call failing so > that when you get to mysql_insert_id(), the id doesn't exist? I did. It's returning a numerical one (1). What I'm doing now is as follows. It's getting me the value but I'm so afraid that if 2 queries get sent almost simultaneously it's going to screw everything up... $link = mysql_pconnect( "localhost", "thisuser", "thatpass" ); $result = mysql( $dbname, $dbquery ); $id = mysql_insert_id( $link ); if( !$id ) { $id = mysql_insert_id(); } if( !$id ) { $insertIDQuery = "SELECT last_insert_id()"; // get values from above query, etc., etc. } You get the gist of it... I cannot believe this stupid thing won't work otherwise... And it's not consistent when it works and doesn't. Very odd. *sigh* Chris
Instead of checking if(!$id), perhaps you would be better off to check the result of your query (which in this example was successful, since you got a return from mysql() ). Also, what is the last_insert_id() function that you are referencing in your $insertIDQuery string? As for things getting messed up when two queries hit the system at the same time, you shouldn’t need to worry about that either because the two people coming in would have different values for the $link variable and since mysql_insert_id goes off of the link identifier of the connection (which will be different for the two different people running queries), you should not have a conflict. HTH Sam Masiello Systems Analyst Chek.Com (716) 853-1362 x289 [EMAIL PROTECTED] -----Original Message----- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 4:49 PM To: 'Sam Masiello'; Php (E-mail) Subject: RE: [PHP] mysql_insert_id() > You probably stated this in your previous post, but what is > the result from your call to mysql() ? Is this call failing so > that when you get to mysql_insert_id(), the id doesn't exist? I did. It's returning a numerical one (1). What I'm doing now is as follows. It's getting me the value but I'm so afraid that if 2 queries get sent almost simultaneously it's going to screw everything up... $link = mysql_pconnect( "localhost", "thisuser", "thatpass" ); $result = mysql( $dbname, $dbquery ); $id = mysql_insert_id( $link ); if( !$id ) { $id = mysql_insert_id(); } if( !$id ) $insertIDQuery = "SELECT last_insert_id()"; // get values from above query, etc., etc. } You get the gist of it... I cannot believe this stupid thing won't work otherwise... And it's not consistent when it works and doesn't. Very odd. *sigh* Chris
> Instead of checking if(!$id), perhaps you would be better off to check the > result of your query (which in this example was successful, since you got > a return from mysql() ). I am. I just didn't include it in my previous message as it as I was trying to keep extraneous code down to a minimum. Plus, I mentioned in my initial post that there were no errors being returned and mysql() was in fact returning a 1 (true) as opposed to a 0 (false) as it's result. Both indicate that the query was successful. > Also, what is the last_insert_id() function that you are referencing in your > $insertIDQuery string? Internal mySQL function. > As for things getting messed up when two queries hit the system at the same > time, you shouldn't need to worry about that either because the two people > coming in would have different values for the $link variable and since > mysql_insert_id goes off of the link identifier of the connection (which will be > different for the two different people running queries), you should not have a > conflict. My worry comes from the fact that I'm running an internal mySQL function and I'm not certain that mySQL would know who was who and which insert ID to return for 2 simultaneous queries. But now that I think about it, I see that worry is misplaced. Chris
What is wrong with this redirect: <? $rdrct = "http://www.dogpile.com"; header ("Location: " . $rdrct); exit; ?> Thanks! Karl
try this: <? $rdrct = "http://www.dogpile.com"; header ("Location: $rdrct"); exit; ?> Thor M. Steindorsson - [EMAIL PROTECTED] http://www.netwood.net - Find Out Why We're Better. -----Original Message----- From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 1:03 PM To: PHP Mailing List Subject: [PHP] Redirect What is wrong with this redirect: <? $rdrct = "http://www.dogpile.com"; header ("Location: " . $rdrct); exit; ?> Thanks! Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Does anyone know how to rename a database in MySQL? Thanks! fang
Step 1: Ask this question on the MySQL mailing list. :) (Sorry, I couldn't resist) The easiest way I can think of is to use MySQLDump to dump the schema and data, delete the original database, change the output of mysqldump to reflect the new database name and pump it back into mysql. Depending on your database size, this may or may not work. Cal http://www.calevans.com -----Original Message----- From: Fang Li [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 3:21 PM To: [EMAIL PROTECTED] Subject: [PHP] how to rename a database Does anyone know how to rename a database in MySQL? Thanks! fang -- 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]
Prehaps you can rename the database file in mysql/bin ie. database_name.sql to new_database_name.sql and that will work? _______________________________ This email may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you have received this email in error, please contact the sender and delete all copies. Opinions, conclusions or other information expressed or contained in this email are not given or endorsed by the sender unless otherwise affirmed independently by the sender. _________________________________ ----- Original Message ----- From: "Fang Li" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 25, 2001 7:20 AM Subject: [PHP] how to rename a database > > Does anyone know how to rename a database in MySQL? > Thanks! > > fang > > -- > 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] > >
>-----Ursprüngliche Nachricht----- >Von: Robert S. White [mailto:[EMAIL PROTECTED]] >Gesendet: Mittwoch, 24. Januar 2001 16:20 >An: [EMAIL PROTECTED] >Betreff: Re: [PHP] eval() to string??? > > >How is this going to help me? > >I want to evaluate the code in $php_code to *another* string... > From http://www.php.net/manual/en/function.eval.php : "A return statement will terminate the evaluation of the string immediatley. In PHP 4 you may use return to return a value that will become the result of the eval() function while in PHP 3 eval() was of type void and did never return anything." So, if you're using PHP4, just ensure that there is a return in$php_code that returns the desired value: $thing = eval($php_code); It's helpful to read the notes at the above URL - escaping things correctly for eval() can be tricky... - steve >----- Original Message ----- >From: Thomas Weber <> >To: Php-General <> >Sent: Wednesday, January 24, 2001 10:14 AM >Subject: AW: [PHP] eval() to string??? > > >> try >> >> eval("\$php_code;"); >> >> -----Ursprüngliche Nachricht----- >> Von: [ rswfire ] [mailto:[EMAIL PROTECTED]] >> Gesendet: Mittwoch, 24. Januar 2001 15:36 >> An: [EMAIL PROTECTED] >> Betreff: [PHP] eval() to string??? >> >> >> I want to evaluate some PHP code to a string. How can I do this? >> >> $php_code = "echo 'hello';" >> >> I would like to evaluate the code to "hello" in another string... >> >> > > -- -- +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
Just when this thread seems to die it comes back... Perhaps the PHP page should have a page of editors with feature lists/ups & downs to each editor... a little research & a public page by one person (and maybe intermittent updates; moderated feedback might also be good) would save us from even arguing over which is the best. Everybody could look at the feature lists and decide on their own. Just a thought... feedback? --Toby ----- Original Message ----- From: "Piotr Duszynski" <[EMAIL PROTECTED]> To: "Randy" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 5:14 AM Subject: Re: Re: [PHP] PHP Editors > > Everyone has their favorite editor, and FWIW mine is editplus. I've > > programmed for almost 20 years with many different editors and in > > my opinion, this is the best editor I've ever used. It works > > great with PHP. > > www.editplus.com > > I use PHPED (www.phped.com). It has some bugs but I like it. What is > important that it has online manual (F1 clicked on word you search for) > > -- > > Piotr Duszynski > > http://www.softomat.com.pl > http://filmomat.3miasto.pl > http://www.3miasto.pl > > -- > 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 Wed, Jan 24, 2001 at 04:29:11PM -0500, Toby Butzon wrote: > Perhaps the PHP page should have a page of editors with > feature lists/ups & downs to each editor... a little > research & a public page by one person (and maybe > intermittent updates; moderated feedback might also be good) > would save us from even arguing over which is the best. > Everybody could look at the feature lists and decide on > their own. There is an link to a big editors list at php.net. Look yourself around, I'm using XEmacs for browsing the web, and the w3-mode is dog slow. -Egon -- http://www.linuxtag.de/ http://php.net/books.php http://www.concert-band.de/ http://www.php-buch.de/
So my Point is: What if you require "stored cookies" - cookies written to the users disk? Hmmm, this cookie test would return true if "per-session" cookies was enabled and "stored cookies" was disabled. Karl ----- Original Message ----- From: "Karl J. Stubsjoen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 1:49 PM Subject: Re: [PHP] Test for Cookies > In IE | Tools | Internet Options | Security | Custom Level > > You'll find 2 items under Cookies > - Allow cookies that are stored on your computer > - Allow per-session cookies (not stored) > Both haveing the options (enabled / prompt / disabled) > > The cookie test script is succesful if and only if "per-session" is enabled. > Okay, my question is: > Does the 2nd Cookie Option "Per Session" imply that "that as long as the > browser(s) have not been closed down, that as long as any instance of IE is > running, that we have infact NOT terminated a "Session" and a cookie which > has been set in this session is available? No matter where the user browses > to, the number of browser windows he opens, closes, jumps back and forth > between (just as long as at least 1 instance of IE is running the entire > time), is this "cookie session" still intact?" > > And what about NS? > > Karl > > > ----- Original Message ----- > From: "Brian V Bonini" <[EMAIL PROTECTED]> > To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>; "PHP Mailing List" > <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 12:56 PM > Subject: RE: [PHP] Test for Cookies > > > > You'll need to at least reload the page so > > the cookie can be sent back to the server > > after it's set..... > > > > Try this: it's taken directly from the annotations > > on the setcookie function page of the php manual. > > > > <?php > > $status = 0; > > if (isset($myTstCky) && ($myTstCky == "ChocChip")) $status = 1; > > if (!isset($CCHK)) > > > setcookie("myTstCky", "ChocChip"); > > header("Location: $PHP_SELF?CCHK=1"); > > exit; > > } > > ?> > > <html> > > <head><title>Cookie Check</title></head> > > <body bgcolor="#FFFFFF" text="#000000"> > > Cookie Check Status: > > <?php > > printf ('<font color="#%s">%s</font> > > ;', > > $status ? "00FF00" : "FF0000", > > $status ? "PASSED!" : "FAILED!"); > > ?> > > </body> > > </html> > > > > > -----Original Message----- > > > From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, January 24, 2001 1:42 PM > > > To: [EMAIL PROTECTED]; PHP Mailing List > > > Subject: Re: [PHP] Test for Cookies > > > > > > > > > > By trying to set a cookie and read it back. > > > > > > Okay....here is the scenario: > > > > > > User originates from STATIC Html page, > > > Links to my PHP Cookie Test Page > > > I set a cookie in my PHP Cookie Test Page > > > Can I then check (safely) for cookies right away in my PHP Cookie > > > Test Page > > > without involving a 3rd page? > > > > > > Karl > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
> >One thing that occurs to me -- stdout starts off by being the browser, so > >it's kinda funky to open it -- You've already got it open... I *think* it > >really only makes sense to fopen() stdout from the command line. At least, > >I'm not clear on what it would mean to open it from a HTTP environment... > > You may be right, it's quite weird. The use it was intended for was to generate > an HTML page on the fly or a static one, according to certain conditions. Perhaps, then, you might use a function which would decide what to do and use the appropriate method... for ex: function foo($out) { if (USE_STDOUT) { echo $out; } else fopen($file, $mode); // write to file and close it } } Just an idea; may not be anything like what you need but I thought I'd throw it out there ;) --Toby
I recently downloaded a phpDownload app. I'm having problems with it and can not reach the creator of this app. The INSERT query from the Admin portion of this app will not insert the info passed from a form. Can someone offer any help with this? Here is a portion of the code: } else { // Insert new entry $query = "INSERT INTO Downloads (Name, Description, FileSize, FileName, DownloadCount, Category, Redirect) VALUES ('"; $query .= addslashes($Name) . "','" . addslashes($Description) . "'," . $FileSize . ",'" . addslashes($FileName) . "'," . $DownloadCount . "," . $Categories . ",'" . addslashes($Redirect) ."')"; } Darren Evans Senior Site Coordinator www.bombs-away.net
Some of your single quotes between values are missing (the . "','" . ), messing up the query. However it would probably be easier to do the addslashes() beforeyou do the query so you don't have to break the query up like that. So I'd do it like this: }else{ // Insert new entry $Name = addslashes($Name); $Description = addslashes($Description); $FileName = addslashes($FileName); $Redirect = addslashes($Redirect); $query = "INSERT INTO Downloads (Name, Description, FileSize, FileName, DownloadCount, Category, Redirect) VALUES ('$Name', '$Description', '$FileSize', '$FileName', '$DownloadCount', '$Categories', '$Redirect')"; } Thor M. Steindorsson - [EMAIL PROTECTED] http://www.netwood.net - Find Out Why We're Better. -----Original Message----- From: Darren Evans [mailto:d_evans*@earthlink.net] Sent: Wednesday, January 24, 2001 1:51 PM To: [EMAIL PROTECTED] Subject: [PHP] Help with INSERT query I recently downloaded a phpDownload app. I'm having problems with it and can not reach the creator of this app. The INSERT query from the Admin portion of this app will not insert the info passed from a form. Can someone offer any help with this? Here is a portion of the code: } else { // Insert new entry $query = "INSERT INTO Downloads (Name, Description, FileSize, FileName, DownloadCount, Category, Redirect) VALUES ('"; $query .= addslashes($Name) . "','" . addslashes($Description) . "'," . $FileSize . ",'" . addslashes($FileName) . "'," . $DownloadCount . "," . $Categories . ",'" . addslashes($Redirect) ."')"; } Darren Evans Senior Site Coordinator www.bombs-away.net -- 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]
""Thor M. Steindorsson"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Some of your single quotes between values are missing (the . "','" . ), > messing up the query. > However it would probably be easier to do the addslashes() beforeyou do the > query so you don't have to break the query up like that. > > So I'd do it like this: Thank you VERY much Thor! It worked like a charm! :o) Darren
On a project I am working on, I have a string variable, and inside the string is a mixture of PHP code and HTML. I want to be able to output the string with the PHP code inside the string processed. Right now the PHP isn't processed on output, it is merely cut out. I have been able to do this by writing the contents of the string to file and then including the file, however this is not a viable method for what I'm working on here. I was wondering if there is any way to output and process PHP code that is contained within a string? Thanks.
So sprach Matt am Wed, Jan 24, 2001 at 03:56:37PM -0600: > string is a mixture of PHP code and HTML. I want to be able to output the > string with the PHP code inside the string processed. Right now the PHP http://www.php.net/manual/en/function.eval.php Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die guenstige Art an Linux Distributionen zu kommen Uptime: 4 hours 59 minutes
Hmm... that may work for what you're trying to do and it may not... if your string contains something like this: $str = <<<END_STRING <b>This is some HTML</b><br> <i>Powered by PHP <?php echo phpversion() ?></i> END_STRING; You're going to have a bit of a problem processing that with eval. I'm not completely sure on this one, but you might try this: eval('?>' . $str); Assuming your string looks like the $str above, the beginning '?>' should drop eval out of PHP mode, print the HTML, execute the PHP commands when it goes back into PHP mode, etc... it should all work that way. --Toby ----- Original Message ----- From: "Alexander Skwar" <[EMAIL PROTECTED]> To: "Matt" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 5:02 PM Subject: Re: [PHP] Processing PHP within a string variable > So sprach Matt am Wed, Jan 24, 2001 at 03:56:37PM -0600: > > string is a mixture of PHP code and HTML. I want to be able to output the > > string with the PHP code inside the string processed. Right now the PHP > > http://www.php.net/manual/en/function.eval.php > > Alexander Skwar > -- > How to quote: http://learn.to/quote (german) http://quote.6x.to (english) > Homepage: http://www.digitalprojects.com | http://www.iso-top.de > iso-top.de - Die guenstige Art an Linux Distributionen zu kommen > Uptime: 4 hours 59 minutes > > -- > 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] > >
Haha, well I apologize for not seeing this earlier when I was hunting through the documentation. Silly me. Thanks a bunch! At 04:02 PM 1/24/2001 , you wrote: >So sprach Matt am Wed, Jan 24, 2001 at 03:56:37PM -0600: > > string is a mixture of PHP code and HTML. I want to be able to output the > > string with the PHP code inside the string processed. Right now the PHP > >http://www.php.net/manual/en/function.eval.php > >Alexander Skwar >-- >How to quote: http://learn.to/quote (german) http://quote.6x.to (english) >Homepage: http://www.digitalprojects.com | http://www.iso-top.de > iso-top.de - Die guenstige Art an Linux Distributionen zu kommen > Uptime: 4 hours 59 minutes > >-- >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] >
What is the simplest way to set up a procedure to loop through all passed querystring values and/or form values? I'm very new to PHP, and don't know how to set up loops at all. Thanks! Karl
At 3:07 PM -0700 1/24/01, Karl J. Stubsjoen wrote: >What is the simplest way to set up a procedure to loop through all passed >querystring values and/or form values? > >I'm very new to PHP, and don't know how to set up loops at all. > reset($HTTP_GET_VARS); while (list($VariableName, $VariableValue) = each($HTTP_GET_VARS)) { echo "GET variable $VariableName was set to $VariableValue<br>\n"; } Of course, you would want to do your own processing in place of the echo. If you want to use POSTed or cookie variables, replace the _GET_ in the above snippet with _POST_ or _COOKIE_, respectively. The reset(), by the way, resets the array pointer to the beginning of the array. It's not always needed, but I tend to do it anyway. It IS necessary, however, ig you use the above snippet within an enclosing loop. - steve -- +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
Assuming you are using GET (since you have a QUERY_STRING in url) : foreach ($HTTP_GET_VARS as $key => $value) { print "<br>$key is $value \n"; } For form you can use POST and loop through HTTP_POST_VARS too. These are predefined variables : http://www.php.net/manual/en/language.variables.predefined.php That should get you started :-) Foreach is php4+ specific, manual has examples using a while loop too, see : http://www.php.net/manual/en/control-structures.foreach.php Note that if you're passing arrays through your forms (which everyone should do!!!) then adjust accordingly. A quick method to just view (dump) the data is using : print_r($SOME_SPIFFY_VARIABLE_ARRAY); -OR- var_dump($A_HUGE_ARRAY_TO_DISPLAY); Those are two very beautiful functions to play with, for debugging and such. Viewing $HTTP_GET_VARS through them will quickly show you what is passing. I recommend surrounding those "debugging functions" with <pre> as it creates a much prettier output to browser. But I digress. Oh, phpinfo() will tell you which predefined variables you get to play with as each server is setup differently. Regards, Philip Olson On Wed, 24 Jan 2001, Karl J. Stubsjoen wrote: > What is the simplest way to set up a procedure to loop through all passed > querystring values and/or form values? > > I'm very new to PHP, and don't know how to set up loops at all. > > Thanks! Karl > > > -- > 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] >
Stupid question, but I'm stumped. I'm passing a persons id through a cookie, then using that to determine if they're allowed to be doing what they're trying to do (change listings, etc.). Right now, I'm getting the value of the cookie by just accessing $cookie_id, without anything fancy. The problem is, if someoen just denies a cookie and adds ?cookie_id=9 at the end, they might as well be the person with an id of 9. Is there a way for me to check and be sure that that value came from a cookie, and not the url bar?
Enable track_vars in php's config and use $PHP_COOKIE_VARS['cookie_id'] to get the value of the cookie. --Toby ----- Original Message ----- From: "April" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 5:06 PM Subject: [PHP] Cookie semi-security. > Stupid question, but I'm stumped. > > I'm passing a persons id through a cookie, then using that to determine if > they're allowed to be doing what they're trying to do (change listings, > etc.). Right now, I'm getting the value of the cookie by just accessing > $cookie_id, without anything fancy. The problem is, if someoen just denies a > cookie and adds ?cookie_id=9 at the end, they might as well be the person > with an id of 9. Is there a way for me to check and be sure that that > value came from a cookie, and not the url bar? > > > -- > 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] > >
well, first off, you should md5 the cookie value or something to avoid having the value correlate directly with your system values. I like to use at least one level of "shift" in apps, to make sure that user input is never taken verbatim. -alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] ("Toby Butzon") > Newsgroups: php.general > Date: 24 Jan 2001 14:10:40 -0800 > Subject: Re: [PHP] Cookie semi-security. > > Enable track_vars in php's config and use > $PHP_COOKIE_VARS['cookie_id'] to get the value of the > cookie. > > --Toby > > ----- Original Message ----- > From: "April" <[EMAIL PROTECTED]> > To: "PHP General" <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 5:06 PM > Subject: [PHP] Cookie semi-security. > > >> Stupid question, but I'm stumped. >> >> I'm passing a persons id through a cookie, then using that > to determine if >> they're allowed to be doing what they're trying to do > (change listings, >> etc.). Right now, I'm getting the value of the cookie by > just accessing >> $cookie_id, without anything fancy. The problem is, if > someoen just denies a >> cookie and adds ?cookie_id=9 at the end, they might as > well be the person >> with an id of 9. Is there a way for me to check and be > sure that that >> value came from a cookie, and not the url bar? >> >> >> -- >> 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] >
Using the following snippet of code..... -------------------------------------- <?php class User { var $login = $REMOTE_USER; var $retval; -------------------------------------- works perfectly fine in PHP 3.0.16...yet.. this: -------------------------------------- <?php define("RUSER", $REMOTE_USER); class User { var $login = RUSER; # var $login = $REMOTE_USER; var $retval; -------------------------------------- does not work with PHP 4.0.3pl1. Any ideas anyone? Any help would be greatly appreciated. Thanks in advance... ---Steven
Guessing here: Define can't take a variable. It has to have a constant. define("RUSER", 1); would compile but not give you the results you want. I'm not sure you can do what you want. have you tried: define("RUSER", '$REMOTE_USER'); Cal http://www.calevans.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steven Deaton Sent: Wednesday, January 24, 2001 4:17 PM To: [EMAIL PROTECTED] Subject: [PHP] Function / syntax varying from version to version? Using the following snippet of code..... -------------------------------------- <?php class User { var $login = $REMOTE_USER; var $retval; -------------------------------------- works perfectly fine in PHP 3.0.16...yet.. this: -------------------------------------- <?php define("RUSER", $REMOTE_USER); class User { var $login = RUSER; # var $login = $REMOTE_USER; var $retval; -------------------------------------- does not work with PHP 4.0.3pl1. Any ideas anyone? Any help would be greatly appreciated. Thanks in advance... ---Steven -- 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]
What I meant to say, was that the top snippet works in php 3.0.16 but does not work in php 4.0.3pl1 yet the bottom corrected snippet works fine. Question being... why the changes, and does anyone have any clues about this occuring? Sorry about that. :) -------- Original Message -------- Return-Path: [EMAIL PROTECTED] Received: from toye.php.net (va.php.net [198.186.203.51])by dns.apolloi.com (8.9.3/8.9.3) with SMTP id OAA01626for <[EMAIL PROTECTED]>; Wed, 24 Jan 2001 14:17:27 -0800 (PST)(envelope-from [EMAIL PROTECTED]) Received: (qmail 9228 invoked by uid 1013); 24 Jan 2001 22:14:24 -0000 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: <mailto:[EMAIL PROTECTED]> list-unsubscribe: <mailto:[EMAIL PROTECTED]> list-post: <mailto:[EMAIL PROTECTED]> Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 9222 invoked from network); 24 Jan 2001 22:14:24 -0000 Sender: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> Date: Wed, 24 Jan 2001 14:16:41 -0800 From: Steven Deaton <[EMAIL PROTECTED]> Organization: Apollo Interactive X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17-21mdksecure i686) X-Accept-Language: en MIME-Version: 1.0 To: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [PHP] Function / syntax varying from version to version? X-Mozilla-Status: 8001 X-Mozilla-Status2: 00000000 X-UIDL: 1b26bb69bf17e49175b00f4e54bd6e53 Using the following snippet of code..... -------------------------------------- <?php class User { var $login = $REMOTE_USER; var $retval; -------------------------------------- works perfectly fine in PHP 3.0.16...yet.. this: -------------------------------------- <?php define("RUSER", $REMOTE_USER); class User { var $login = RUSER; # var $login = $REMOTE_USER; var $retval; -------------------------------------- does not work with PHP 4.0.3pl1. Any ideas anyone? Any help would be greatly appreciated. Thanks in advance... ---Steven -- 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]
Ok, I have looked at all my sources, including the manual and I cannot find any method of converting the Unix timestamp to a displayable date/time. I have probably just overlooked it each time, but all I can find are methods to convert the current date/time to a Unix timestamp. Can anyone give me an example? ie....what date/time does 977676902 come out to? Thanks CDitty
At 23:10 24.01.2001, CDitty said: --------------------[snip]-------------------- >Ok, I have looked at all my sources, including the manual and I cannot find >any method of converting the Unix timestamp to a displayable date/time. I >have probably just overlooked it each time, but all I can find are methods >to convert the current date/time to a Unix timestamp. > >Can anyone give me an example? ie....what date/time does 977676902 come >out to? --------------------[snip]-------------------- Perl says it is "Sun Dec 24 17:55:02 2000" ...ebird >O Ernest E. Vogelsinger (\) http://www.1-at-web.at/ ^ ICQ# 13394035
CDitty [[EMAIL PROTECTED]] wrote: > Ok, I have looked at all my sources, including the manual and I cannot find > any method of converting the Unix timestamp to a displayable date/time. I > have probably just overlooked it each time, but all I can find are methods > to convert the current date/time to a Unix timestamp. > > Can anyone give me an example? ie....what date/time does 977676902 come > out to? Look at http://www.php.net/manual/en/html/ref.datetime.html, specifically "date" for converting a unix timestamp into a usable date, and "mktime" for converting a date into a unix timestamp. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com
> (Wac == "[EMAIL PROTECTED]") [EMAIL PROTECTED] writes: > > Wac> Can anyone tell me how to turn off the bottom scrollbar in both > Wac> IE and Netscape?? Open the page from another page using javascript to open a window with feature not to scroll. See FAQS on www.irt.org or the Netscape Javascript guide. -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
you cannot independently control the bottom scrollbar. if you want to get rid of it, find the problem in your table code, or if you layout is just too wide, make it less-wide :) I wish I could control that too, but nay. -alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] ("Chris Hayes") > Newsgroups: php.general > Date: 24 Jan 2001 14:25:55 -0800 > Subject: Re: [PHP] Turning off scrollbar > >> (Wac == "[EMAIL PROTECTED]") [EMAIL PROTECTED] writes: >> >> Wac> Can anyone tell me how to turn off the bottom scrollbar in both >> Wac> IE and Netscape?? > > Open the page from another page using javascript to open a window with > feature not to scroll. > See FAQS on www.irt.org or the Netscape Javascript guide. > > > -------------------------------------------------------------------- > -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- > -------------------------------------------------------------------- > > > > -- > 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 variable(s) that hold the string: "name" and I'd like to kill the quotes so it contains: name I am aware of the strlen() function but can find the concant Little Help? Mike
> I have a variable(s) that hold the string: > "name" > and I'd like to kill the quotes so it contains: > name > I am aware of the strlen() function but can find the concant $newVar = eregi_replace( "\"", "", $varWithAboveData ); Chris
In article <a05001900b69508a9435a@[38.241.81.150]>, Michael Zornek <[EMAIL PROTECTED]> wrote: > I have a variable(s) that hold the string: > "name" > and I'd like to kill the quotes so it contains: > name $name = ereg_replace("\"","",$name); Maybe, Nik -- <hr>
> I have a variable(s) that hold the string: > > "name" > > and I'd like to kill the quotes so it contains: > > name $new = str_replace('"','',$old); Using a regex as others have suggested is a bad idea for something this trivial. -Rasmus
Hi All, I have a client uses Meeting-Pro database. Is there any API I can use with PHP that will allow me to interact with Meeting-Pro db? Thanks in advance for any comments. James R. Butzen NEBIS Tech. Support http://www.nebis.com
> I have a client uses Meeting-Pro database. Is there any API I can use with > PHP that will allow me to interact with Meeting-Pro db? If Meeting-Pro does ODBC, start looking for ODBC drivers/bridge on openlinksw.com and easyodbc.com (.org?) etc. If Meeting-Pro does not do ODBC, you probably will have to find a hacker to write a driver and that's a lot of work...
Hello, I'd like to check for a character at the end of a string, if it exists remove it, example: Looking for - Z In string - StringZ Result would be - String -or- Looking for - Z In string - StringZzz Result would be - StringZzz (no change) Thanks! Karl BTW: You guys are great!
> Hello, I'd like to check for a character at the end of a string, if it > exists remove it, example: > > Looking for - Z > In string - StringZ > Result would be - String > > -or- > Looking for - Z > In string - StringZzz > Result would be - StringZzz (no change) if($str{strlen($str)-1}=='Z') $str = substr($str,0,-1); -Rasmus
I have always wrote code this like: if(($fname) && ($lname) && ($email)) { echo "test"; } Is there an easier way to write the IF line? Thank You .:: Nathan Cook [ [EMAIL PROTECTED] ] ::. Systems & Network Administrator :: Programmer [ phone - 208.343.3110 ][ pager - 208.387.9983 ]
if ($fname && $lname && $email) echo "test"; If by easier you mean typing less. ;) Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "LINUX is obsolete" -- Andy Tanenbaum, January 29th, 1992 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.JEEP-FOR-SALE.com/ -- I need a buyer Get your own Free, Private email at http://www.smackdown.com/ On Wed, 24 Jan 2001, Nathan Cook wrote: > Date: Wed, 24 Jan 2001 16:27:12 -0700 > From: Nathan Cook <[EMAIL PROTECTED]> > To: Php List <[EMAIL PROTECTED]> > Subject: [PHP] easy question. > > I have always wrote code this like: > > if(($fname) && ($lname) && ($email)) > { echo "test"; } > > Is there an easier way to write the IF line? > > Thank You > > .:: Nathan Cook [ [EMAIL PROTECTED] ] ::. > Systems & Network Administrator :: Programmer > [ phone - 208.343.3110 ][ pager - 208.387.9983 ] > > > -- > 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] > >
the only thing I can think of, would be to eliminate the () around $fname, $lname, and $email if they all test true in the first place, the () are kinda obsolete. :) Nathan Cook wrote: > > I have always wrote code this like: > > if(($fname) && ($lname) && ($email)) > { echo "test"; } > > Is there an easier way to write the IF line? > > Thank You > > .:: Nathan Cook [ [EMAIL PROTECTED] ] ::. > Systems & Network Administrator :: Programmer > [ phone - 208.343.3110 ][ pager - 208.387.9983 ] > > -- > 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(($fname) && ($lname) && ($email)) { echo "test"; } > > Is there an easier way to write the IF line? if (isset($fname) && isset($lname) && isset($email)) { echo "test"; } I believe the parens in your code don't do anything. anyway, best o' my knowledge that's the way to do it. "_) -a > Thank You > > .:: Nathan Cook [ [EMAIL PROTECTED] ] ::. > Systems & Network Administrator :: Programmer > [ phone - 208.343.3110 ][ pager - 208.387.9983 ] > > > -- > 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] >
proposed IF: >> if(($fname) && ($lname) && ($email)) Alex: > if (isset($fname) && isset($lname) && isset($email)) { > echo "test"; > I believe the parens in your code don't do anything. anyway, best o' my > knowledge that's the way to do it. First IF tests whether the vars are 'true', Alex's IF tests whether they exist. Chris -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
I've tried and tried to figure out what is wrong with this function, but I can't. Could you please have a look. This function reconstructs the querystring values passed in the querystring: function PassOnGetVars() { global $HTTP_GET_VARS; #initialize retrn value $retrn = "?"; #loop through each Get Var reset ($HTTP_GET_VARS); while (list($VariableName, $VariableValue) = each ($HTTP_GET_VARS)) { retrn =. "$VariableName\=$VariableValue"; retrn =. "&"; } #return the value return($retrn); } I've tried both versions of =. and .= (struggling to remember which is correct. But this isn't the error, I get the same error regardles of the .= The error I get is line 60 (which is) retrn .= "$VariableName=$VariableValue"; Thanks! Karl
I don't think you need the \=, just the = should do. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "LINUX is obsolete" -- Andy Tanenbaum, January 29th, 1992 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.JEEP-FOR-SALE.com/ -- I need a buyer Get your own Free, Private email at http://www.smackdown.com/ On Wed, 24 Jan 2001, Karl J. Stubsjoen wrote: > Date: Wed, 24 Jan 2001 16:34:41 -0700 > From: Karl J. Stubsjoen <[EMAIL PROTECTED]> > To: PHP Mailing List <[EMAIL PROTECTED]> > Subject: [PHP] I give - Whats wrong > > I've tried and tried to figure out what is wrong with this function, but I > can't. Could you please have a look. This function reconstructs the > querystring values passed in the querystring: > > function PassOnGetVars() { > global $HTTP_GET_VARS; > #initialize retrn value > $retrn = "?"; > > #loop through each Get Var > reset ($HTTP_GET_VARS); > while (list($VariableName, $VariableValue) = each ($HTTP_GET_VARS)) > { > retrn =. "$VariableName\=$VariableValue"; > retrn =. "&"; > } > > #return the value > return($retrn); > } > > I've tried both versions of =. and .= (struggling to remember which is > correct. But this isn't the error, I get the same error regardles of the .= > The error I get is line 60 (which is) > > retrn .= "$VariableName=$VariableValue"; > > Thanks! Karl > > > -- > 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 of course just check $QUERY_STRING As for your error, you a missing a $ in front of retrn at the beginning of that line. -Rasmus On Wed, 24 Jan 2001, Karl J. Stubsjoen wrote: > I've tried and tried to figure out what is wrong with this function, but I > can't. Could you please have a look. This function reconstructs the > querystring values passed in the querystring: > > function PassOnGetVars() { > global $HTTP_GET_VARS; > #initialize retrn value > $retrn = "?"; > > #loop through each Get Var > reset ($HTTP_GET_VARS); > while (list($VariableName, $VariableValue) = each ($HTTP_GET_VARS)) > { > retrn =. "$VariableName\=$VariableValue"; > retrn =. "&"; > } > > #return the value > return($retrn); > } > > I've tried both versions of =. and .= (struggling to remember which is > correct. But this isn't the error, I get the same error regardles of the .= > The error I get is line 60 (which is) > > retrn .= "$VariableName=$VariableValue"; > > Thanks! Karl > > > -- > 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] >
Karl, it's .= (read the fine manual ;-) ) > retrn =. "$VariableName\=$VariableValue"; > retrn =. "&"; Variables in PHP need a $dollarsign. Money makes the world go round.... Chris Send reply to: "Karl J. Stubsjoen" <[EMAIL PROTECTED]> From: "Karl J. Stubsjoen" <[EMAIL PROTECTED]> To: "PHP Mailing List" <[EMAIL PROTECTED]> Date sent: Wed, 24 Jan 2001 16:34:41 -0700 Subject: [PHP] I give - Whats wrong > I've tried and tried to figure out what is wrong with this function, but I > can't. Could you please have a look. This function reconstructs the > querystring values passed in the querystring: > > function PassOnGetVars() { > global $HTTP_GET_VARS; > #initialize retrn value > $retrn = "?"; > > #loop through each Get Var > reset ($HTTP_GET_VARS); > while (list($VariableName, $VariableValue) = each ($HTTP_GET_VARS)) > { > } > > #return the value > return($retrn); > } > > I've tried both versions of =. and .= (struggling to remember which is > correct. But this isn't the error, I get the same error regardles of the .= > The error I get is line 60 (which is) > > retrn .= "$VariableName=$VariableValue"; > > Thanks! Karl > > > -- > 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] -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
Freak'n Duhh! My eyes are still blury to PHP *obviously*. Thanks! So $QUERY_STRING eh? I'll look that one up. Karl ----- Original Message ----- From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Karl J. Stubsjoen" <[EMAIL PROTECTED]> Cc: "PHP Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 4:31 PM Subject: Re: [PHP] I give - Whats wrong > You could of course just check $QUERY_STRING > > As for your error, you a missing a $ in front of retrn at the beginning of > that line. > > -Rasmus > > On Wed, 24 Jan 2001, Karl J. Stubsjoen wrote: > > > I've tried and tried to figure out what is wrong with this function, but I > > can't. Could you please have a look. This function reconstructs the > > querystring values passed in the querystring: > > > > function PassOnGetVars() { > > global $HTTP_GET_VARS; > > #initialize retrn value > > $retrn = "?"; > > > > #loop through each Get Var > > reset ($HTTP_GET_VARS); > > while (list($VariableName, $VariableValue) = each ($HTTP_GET_VARS)) > > { > > retrn =. "$VariableName\=$VariableValue"; > > retrn =. "&"; > > } > > > > #return the value > > return($retrn); > > } > > > > I've tried both versions of =. and .= (struggling to remember which is > > correct. But this isn't the error, I get the same error regardles of the .= > > The error I get is line 60 (which is) > > > > retrn .= "$VariableName=$VariableValue"; > > > > Thanks! Karl > > > > > > -- > > 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] > > > >
Could it be the lack of $? It should be $retrn =. "$VariableName\=$VariableValue"; I do that all the time. The syntax is so close to javascript that when I'm typing I often leave out the dollar sign. Especially when I have php and javascript in the same file. On Wednesday, January 24, 2001 4:35 PM, Karl J. Stubsjoen [SMTP:[EMAIL PROTECTED]] wrote: > I've tried and tried to figure out what is wrong with this function, but I > can't. Could you please have a look. This function reconstructs the > querystring values passed in the querystring: > > function PassOnGetVars() { > global $HTTP_GET_VARS; > #initialize retrn value > $retrn = "?"; > > #loop through each Get Var > reset ($HTTP_GET_VARS); > while (list($VariableName, $VariableValue) = each ($HTTP_GET_VARS)) > { > retrn =. "$VariableName\=$VariableValue"; > retrn =. "&"; > } > > #return the value > return($retrn); > } > > I've tried both versions of =. and .= (struggling to remember which is > correct. But this isn't the error, I get the same error regardles of the .= > The error I get is line 60 (which is) > > retrn .= "$VariableName=$VariableValue"; > > Thanks! Karl > > > -- > 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 want to set a link to download an email-attachment, but I don't know where to point the link to get the attachment - I am only able to view an attached image or text! -- ********************************************** * Jochen Kächelin * * Ihr WEBberater - Werbeagentur Pulvermüller * * Stuttgarter Str. 3 - D-73033 Göppingen * * www.wa-p.de - mailto:[EMAIL PROTECTED] * **********************************************
That is a very useful looking link and it has gone into to my "very useful PHP links" box. I will point out that "codecharge" and "phpedit" don't appear to be on that list ... At 06:19 AM 1/24/01 -0800, Steve Edberg wrote: >At 4:40 PM +0600 1/24/01, Tshering Norbu wrote: >>Here is collection I got from this list; >> >>www.editplus.com >>www.codecharge.com >>www.phpedit.com >>www.ultraedit.com > >See this list: > > http://www.itworks.demon.co.uk/phpeditors.htm > >Some of the comments are a bit out of date - for instance, BBEdit 6.0 >(Macintosh) now has PHP syntax highlighting - but it's a got starting point. > > - steve > > >> >>----- Original Message ----- >>From: kaab kaoutar <[EMAIL PROTECTED]> >>To: <[EMAIL PROTECTED]> >>Sent: Wednesday, January 24, 2001 4:28 PM >>Subject: [PHP] Beginner in php! >> >> >>> Hi guys! >>> >>> I'm working on an NT workstation, i used to work with asp, but i heard a >>lot >>> about php! that i decided to start working with it ! >>> so i'm using PWS4 and i'm wondering which free php editor is more suitible >>> for me ? and also what links to get free more tutorials, i got one of >>phpnet >>> but still .... >>> >>> Regards >>> _________________________________________________________________________ >> > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > >-- >+--- "They've got a cherry pie there, that'll kill ya" ------------------+ >| Steve Edberg University of California, Davis | >| [EMAIL PROTECTED] Computer Consultant | >| http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | >+-------------------------------------- FBI Special Agent Dale Cooper ---+ > >-- >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] ------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED]
Should this correctly find '&' or is & and special searching character? # looking for an & at the end $retrn = AASIDFIFJ& if($str{strlen($retrn)-1}=='&') Thanks!
try $retrn = "AASIDFIFJ&"; -----Original Message----- From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 4:17 PM To: PHP Mailing List Subject: [PHP] Finding an '&' Should this correctly find '&' or is & and special searching character? # looking for an & at the end $retrn = AASIDFIFJ& if($str{strlen($retrn)-1}=='&') 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]
fyi, that little snippet that rasmus presented is being used incorrectly, i think you are actually wanting : if($retrn{strlen($retrn)-1} == '&') as $str was just the string which in this case seems to be $retrn . also, i think this tutorial will help you with strings : Using Strings : ---------------------------------------------- http://www.zend.com/zend/tut/using-strings.php print it out too, seriously, it's helpful and should be referred to on occasion. regards, -- philip olson http://www.cornado.com be outside the box. On Wed, 24 Jan 2001, Karl J. Stubsjoen wrote: > Should this correctly find '&' or is & and special searching character? > > # looking for an & at the end > $retrn = AASIDFIFJ& > > if($str{strlen($retrn)-1}=='&') > > 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] >
Hello, for whom it may concern: We created a greek mailing list for PHP questions, discussions etc. Many people lack of fluency of the english language (including me =) so this list was a MUST. Subscribe by sending an email at: [EMAIL PROTECTED] Thanks, Demetris Glezos ----------------------- &Ggr;&egr;&igr;&agr; &sgr;&agr;&sfgr;, &ggr;&igr;&agr; &tgr;&ogr;&ugr;&sfgr; &egr;&ngr;&dgr;&igr;&agr;&phgr;&egr;&rgr;&oacgr;&mgr;&egr;&ngr;&ogr;&ugr;&sfgr; &dgr;&eegr;&mgr;&igr;&ogr;&ugr;&rgr;&ggr;&eeacgr;&sgr;&agr;&mgr;&egr; &mgr;&igr;&agr; &egr;&lgr;&lgr;&eegr;&ngr;&igr;&kgr;&eeacgr; &lgr;&iacgr;&sgr;&tgr;&agr; &ggr;&igr;&agr; &sgr;&ugr;&zgr;&eegr;&tgr;&eeacgr;&sgr;&egr;&igr;&sfgr;, &agr;&pgr;&ogr;&rgr;&iacgr;&egr;&sfgr; &kgr;&lgr;&pgr; &sgr;&egr; &thgr;&eacgr;&mgr;&agr;&tgr;&agr; PHP. &Mgr;&pgr;&ogr;&rgr;&egr;&iacgr;&tgr;&egr; &ngr;&agr; &ggr;&rgr;&agr;&phgr;&tgr;&egr;&iacgr;&tgr;&egr; &sgr;&tgr;&eacgr;&lgr;&ngr;&ogr;&ngr;&tgr;&agr;&sfgr; email &sgr;&tgr;&ogr;: [EMAIL PROTECTED] &Egr;&ugr;&khgr;&agr;&rgr;&igr;&sgr;&tgr;&ohacgr;, &Dgr;&eegr;&mgr;&eeacgr;&tgr;&rgr;&eegr;&sfgr; &Ggr;&lgr;&eacgr;&zgr;&ogr;&sfgr;
> &Ggr;&egr;&igr;&agr; &sgr;&agr;&sfgr;, > > &ggr;&igr;&agr; &tgr;&ogr;&ugr;&sfgr; &egr;&ngr;&dgr;&igr;&agr;&phgr;&egr;&rgr;&oacgr;&mgr;&egr;&ngr;&ogr;&ugr;&sfgr; &dgr;&eegr;&mgr;&igr;&ogr;&ugr;&rgr;&ggr;&eeacgr;&sgr;&agr;&mgr;&egr; &mgr;&igr;&agr; &egr;&lgr;&lgr;&eegr;&ngr;&igr;&kgr;&eeacgr; > &lgr;&iacgr;&sgr;&tgr;&agr; &ggr;&igr;&agr; &sgr;&ugr;&zgr;&eegr;&tgr;&eeacgr;&sgr;&egr;&igr;&sfgr;, &agr;&pgr;&ogr;&rgr;&iacgr;&egr;&sfgr; &kgr;&lgr;&pgr; &sgr;&egr; &thgr;&eacgr;&mgr;&agr;&tgr;&agr; PHP. > > &Mgr;&pgr;&ogr;&rgr;&egr;&iacgr;&tgr;&egr; &ngr;&agr; &ggr;&rgr;&agr;&phgr;&tgr;&egr;&iacgr;&tgr;&egr; &sgr;&tgr;&eacgr;&lgr;&ngr;&ogr;&ngr;&tgr;&agr;&sfgr; email &sgr;&tgr;&ogr;: > [EMAIL PROTECTED] > > &Egr;&ugr;&khgr;&agr;&rgr;&igr;&sgr;&tgr;&ohacgr;, > > &Dgr;&eegr;&mgr;&eeacgr;&tgr;&rgr;&eegr;&sfgr; &Ggr;&lgr;&eacgr;&zgr;&ogr;&sfgr; Ah, the good ol' days of sitting in college Match classes not understanding all those letters on the chalkboard. :-) Good Luck! -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
> Ah, the good ol' days of sitting in college Match classes not understanding > all those letters on the chalkboard. :-) At least you're not sitting in high school calculus and actually understanding everything on the board, but not being able to use any of it because Texas Instruments is the only company that's figured out how to do algebraic manipulation, and you can't exactly run a server on your calculator. =) Those little calculators are really fun for making stupid programs during study hall, though.
>At least you're not sitting in high school calculus and actually >understanding everything on the board, but not being able to use any of it >because Texas Instruments is the only company that's figured out how to do >algebraic manipulation, and you can't exactly run a server on your >calculator. =) Are you sure - I thought HP calculators could do it as well? ( Now drifted WAY off topic for the list ... ) Regs Brian ( an engineer by training ... ) ------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED]
can anyone help me figure out a regular expression to find the value of a tag element? for example: <tag element="my value"> <tag element=value> <tag element="my value" nextelement> <tag element=value nextelement> <tag element = "my value"> <tag element = value> <tag element = "my value" nextelement> <tag element = value nextelement> so in each of the above i need to find either "my value" or "value"... i tried this but it wont work for every situation: ereg("element[ ]*[=][ ]*[\"]?([^\">]*)[ |\"|>].*" ... thanks for your help - regular expressions are not my best area! jamie.
I use mysql_* functions all the time, PHP was definitely compiled --with-mysql, yet for some reason I'm getting "Fatal error: Call to undefined function: mysql_errorno()" for this one mysql function. Ex.: mysql_query($query,$connect); //echo of $query is successful at commandline, and $connect works for other queries on same page if(mysql_errorno($connect)==1062) //returns "fatal error" { $query_status="SKIPPED"; break; } Is this normal? Does PHP need to be compiled with some extra setting to support this function? The manual says this is supported in PHP3 & PHP 4 function, so I wasn't expecting to have a problem using it with PHP 4.0.3pl1. (MySQL is v.3.23.28-gamma; server is Apache 1.3.12) PHP configured with: './configure' '--with-gd' '--enable-track-vars' '--with-apxs=/usr/sbin/apxs' '--enable-sysvsem' '--enable-sysvshm' '--with-zlib' '--prefix=/usr' '--with-config-file-path=/etc/httpd/conf' '--enable-memory-limit' '--with-pgsql=/usr' '--with-db2=/usr' '--with-gdbm=/usr' '--with-ndbm=/usr' '--with-dbase' '--enable-trans-sid' '--with-xml=/usr' '--enable-debugger' '--enable-ftp' '--with-ttf' '--with-jpeg-dir=/usr' '--enable-bcmath' '--enable-trans-sid' '--with-mysql=/usr' '--with-xpm-dir=/usr/X11R6' '--with-png-dir=/usr' '--with-imap' '--with-dom' '--with-imap-ssl' '--with-mhash=/usr' '--with-mcrypt=/usr' This one really has me stumped. -- CC
The function is mysql_errno() not mysql_errorno() -Rasmus On Wed, 24 Jan 2001, CC Zona wrote: > I use mysql_* functions all the time, PHP was definitely compiled > --with-mysql, yet for some reason I'm getting "Fatal error: Call to > undefined function: mysql_errorno()" for this one mysql function. Ex.: > > mysql_query($query,$connect); //echo of $query is successful at > commandline, and $connect works for other queries on same page > if(mysql_errorno($connect)==1062) //returns "fatal error" > { > $query_status="SKIPPED"; > break; > } > > Is this normal? Does PHP need to be compiled with some extra setting to > support this function? The manual says this is supported in PHP3 & PHP 4 > function, so I wasn't expecting to have a problem using it with PHP > 4.0.3pl1. (MySQL is v.3.23.28-gamma; server is Apache 1.3.12) > > PHP configured with: './configure' '--with-gd' '--enable-track-vars' > '--with-apxs=/usr/sbin/apxs' '--enable-sysvsem' '--enable-sysvshm' > '--with-zlib' '--prefix=/usr' '--with-config-file-path=/etc/httpd/conf' > '--enable-memory-limit' '--with-pgsql=/usr' '--with-db2=/usr' > '--with-gdbm=/usr' '--with-ndbm=/usr' '--with-dbase' '--enable-trans-sid' > '--with-xml=/usr' '--enable-debugger' '--enable-ftp' '--with-ttf' > '--with-jpeg-dir=/usr' '--enable-bcmath' '--enable-trans-sid' > '--with-mysql=/usr' '--with-xpm-dir=/usr/X11R6' '--with-png-dir=/usr' > '--with-imap' '--with-dom' '--with-imap-ssl' '--with-mhash=/usr' > '--with-mcrypt=/usr' > > This one really has me stumped. > > -- > 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] >
I'm trying to read the contents of a directory and it's subdirectories. I use w while loop with readdir($handle) and then an if statement with filetype($file)=="dir" and that works that far. The contents of the subdirectory is listed. After that breaks out of the if statement though, the script goes back through the while loop and reads the next entry. The problem is that the next file is a dir but the filetype function doesn't return "dir", it returns nothing. I can only get through one subdirectory, then all the other files in the main directory are listed even though they are directories. Their contents are not displayed. I need to use the names of the subdirectories for viewing and their locations. What is going wrong? <snipet> //sub directory function function subdir($path, $root) { chdir($path); $handle2=opendir("."); $file2=readdir($handle2); $file2=readdir($handle2); while($file2=readdir($handle2)) { ?> <tr bgcolor="<?php if ($j%2==0) echo "#FFFFFF"; else echo "#FFFFcF"; ?>"> <td><a href="http://www.wentworthco.com/shoponline/customerimages/<?php echo $root."/".$file2;?>">[VIEW]</a></td> <td><?php echo $file2;?></td> <td><a href="deleteimage.php3?file=<?php echo $file2;?>&root=<?php $root;?>">[DELETE]</a></td> </tr> <? $j++; } } $j=2; chdir("/home/fpusers/booe/shoponline/customerimages/"); $handle=opendir("."); $file=readdir($handle); $file=readdir($handle); while($file=readdir($handle)) { if (filetype($file)=="dir") { subdir("/home/fpusers/booe/shoponline/customerimages/".$file."/", $file); } else { ?> <tr bgcolor="<?php if ($j%2==0) echo "#FFFFFF"; else echo "#FFFFcF"; ?>"> <td><a href="http://www.wentworthco.com/shoponline/customerimages/<?php echo $file;?>/">[VIEW]</a></td> <td><?php echo $file;?></td> <td><a href="deleteimage.php3?file=<?php $file;?>">[DELETE]</a></td> <? $j++; } } </snipet>
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > I use PHPED (www.phped.com). It has some bugs but I like it. What is > important that it has online manual (F1 clicked on word you search for) EditPlus can do that if you have the manual in winhelp format. :-) -- John R. Marshall - Web Developer JRM Studios - http://www.jrmstudios.com The Hotrodding Network - http://www.hotrodding.net
Hiya, I have a secure area on my site which users log into, once logged in all areas are linked together but I use a hidden form to authenticate, it works great but the only problem is if refreshed it makes the user log in again, just wondering if there are any other decent ways to authnticate without using cookies?? Cheers Ade
You can pass their user_id in the URL as a GET instead of hidden FORM. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Wednesday, January 24, 2001 8:25 PM Subject: [PHP] No Cookies > Hiya, > > I have a secure area on my site which users log into, once logged in all > areas are linked together but I use a hidden form to authenticate, it works > great but the only problem is if refreshed it makes the user log in again, > just wondering if there are any other decent ways to authnticate without > using cookies?? > > Cheers > Ade > > -- > 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 got here the syntax that is suppose to get the id from the "just inserted" record and store it in value, did not work so far and I cannot see what is wrong in there, can anyone give me a hint what is wrong here? ( And the reason I did not use mysql_insert_id here is because the ID field at my tables are all BIGINT so mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for teh value of $FirstLast, it showed that there is no value in there. Sniplet is like this: $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; $resultsql1 = mysql_query($sql1); $sqlLastID = "select LAST_INSERT_ID() from firsttable"; $resultlast = mysql_query($sqlLastID); $FirstLast = mysql_result($resultlast,0,0); $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) values('$FirstLast','Jacky','Chany')"; $resultsql2 = mysql_query($sql2); $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; $resultlast2 = mysql_query($sqlLastIDsec); $secondLast = mysql_result($resultlast2,0,0); $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; $resultsql3 = mysql_query($sql3); $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; $resultlast3 = mysql_query($sqlLastIDthird); $ThirdLast = mysql_result($resultlast3,0,0); ****************** what have I done wrong? Please enlighten me here Thanks Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
$sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; $resultsql1 = mysql_query($sql1); Add ... or die(mysql_error()) to the end of that line. $sqlLastID = "select LAST_INSERT_ID() from firsttable"; $resultlast = mysql_query($sqlLastID); Add the same thing here. $FirstLast = mysql_result($resultlast,0,0); $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) values('$FirstLast','Jacky','Chany')"; $resultsql2 = mysql_query($sql2); And here as well. $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; $resultlast2 = mysql_query($sqlLastIDsec); And here. $secondLast = mysql_result($resultlast2,0,0); $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; $resultsql3 = mysql_query($sql3); Everywhere you have mysql_query() $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; $resultlast3 = mysql_query($sqlLastIDthird); $ThirdLast = mysql_result($resultlast3,0,0); -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
Hello Can someone tell me the present status of debugger_on( ) function? Does it still exist? the documentation says it does! Is there someone who is really using it? Thanks in advance Tarique -- ========================================= B2B Application Providers http://www.sanisoft.com Vortal for Nagpur http://nagpurcity.net =========================================
Hi people, I got here the syntax that is suppose to get the id from the "just inserted" record and store it in value, did not work so far and I cannot see what is wrong in there, can anyone give me a hint what is wrong here? ( And the reason I did not use mysql_insert_id here is because the ID field at my tables are all BIGINT so mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the value of $FirstLast, it showed that there is no value in there. Sniplet is like this: ( I tried to keep this down as much as try to give most detail at the same time, so apologize for too long sniplet). $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; $resultsql1 = mysql_query($sql1); $sqlLastID = "select LAST_INSERT_ID() from firsttable"; $resultlast = mysql_query($sqlLastID); $FirstLast = mysql_result($resultlast,0,0); $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) values('$FirstLast','Jacky','Chany')"; $resultsql2 = mysql_query($sql2); $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; $resultlast2 = mysql_query($sqlLastIDsec); $secondLast = mysql_result($resultlast2,0,0); $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; $resultsql3 = mysql_query($sql3); $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; $resultlast3 = mysql_query($sqlLastIDthird); $ThirdLast = mysql_result($resultlast3,0,0); ****************** what have I done wrong? Please enlighten me here Thanks Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
remove the result - so just type $id = mysql_insert_id() and it should work fine. --Joe On Thu, Jan 25, 2001 at 10:21:17AM -0600, Jacky@lilst wrote: > Hi people, > I got here the syntax that is suppose to get the id from the "just inserted" record >and store it in value, did not work so far and I cannot see what is wrong in there, >can anyone give me a hint what is wrong here? ( And the reason I did not use >mysql_insert_id here is because the ID field at my tables are all BIGINT so >mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, >the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql >index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I >did echo for the value of $FirstLast, it showed that there is no value in there. > > Sniplet is like this: ( I tried to keep this down as much as try to give most detail >at the same time, so apologize for too long sniplet). > > $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; > $resultsql1 = mysql_query($sql1); > $sqlLastID = "select LAST_INSERT_ID() from firsttable"; > $resultlast = mysql_query($sqlLastID); > $FirstLast = mysql_result($resultlast,0,0); > > $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) >values('$FirstLast','Jacky','Chany')"; > $resultsql2 = mysql_query($sql2); > $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; > $resultlast2 = mysql_query($sqlLastIDsec); > $secondLast = mysql_result($resultlast2,0,0); > > $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, >Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; > $resultsql3 = mysql_query($sql3); > $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; > $resultlast3 = mysql_query($sqlLastIDthird); > $ThirdLast = mysql_result($resultlast3,0,0); > > ****************** > what have I done wrong? Please enlighten me here > Thanks > > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for yourself" -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
I don't think I can use mysql_insert_id() because the ID field in the tables are all BIGINT Auto_Increment and I saw that in the manual, it said mysql_insert_id will not work corerctly with this type of data. I hope I am wrong though. But if it is as the manual said, what else could I do? Direct quote from the manul at the part about mysql_insert_id() is here: ******************************************* mysql_insert_id() converts the return type of the native MySQL C API function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column has a column type of BIGINT, the value returned by mysql_insert_id() will be incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID(). ******************************************** cheers Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Joe Stump <[EMAIL PROTECTED]> To: Jacky@lilst <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 9:25 PM Subject: Re: [PHP] Urgent help needed, sound scary when anyone did that on title :-) > remove the result - so just type $id = mysql_insert_id() and it should work > fine. > > --Joe > > > On Thu, Jan 25, 2001 at 10:21:17AM -0600, Jacky@lilst wrote: > > Hi people, > > I got here the syntax that is suppose to get the id from the "just inserted" record and store it in value, did not work so far and I cannot see what is wrong in there, can anyone give me a hint what is wrong here? ( And the reason I did not use mysql_insert_id here is because the ID field at my tables are all BIGINT so mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the value of $FirstLast, it showed that there is no value in there. > > > > Sniplet is like this: ( I tried to keep this down as much as try to give most detail at the same time, so apologize for too long sniplet). > > > > $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; > > $resultsql1 = mysql_query($sql1); > > $sqlLastID = "select LAST_INSERT_ID() from firsttable"; > > $resultlast = mysql_query($sqlLastID); > > $FirstLast = mysql_result($resultlast,0,0); > > > > $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) values('$FirstLast','Jacky','Chany')"; > > $resultsql2 = mysql_query($sql2); > > $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; > > $resultlast2 = mysql_query($sqlLastIDsec); > > $secondLast = mysql_result($resultlast2,0,0); > > > > $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; > > $resultsql3 = mysql_query($sql3); > > $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; > > $resultlast3 = mysql_query($sqlLastIDthird); > > $ThirdLast = mysql_result($resultlast3,0,0); > > > > ****************** > > what have I done wrong? Please enlighten me here > > Thanks > > > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for yourself" > > -- > > Joe Stump, PHP Hacker > [EMAIL PROTECTED] > http://www.miester.org/ >
you know Jacky, there's another, less cool and less reliable way to get the last inserted id: SELECT id FROM table ORDER BY id DESC; it will sort them all giving you the biggest id *number* (not what mysql keeps) and you can keep it for as many milliseconds your script will run more... So if nothing else works for you - try this... (depends on how secure & stable you want your application to be, of course...) Cheers, Maxim Maletsky -----Original Message----- From: Jacky@lilst [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 1:21 AM To: [EMAIL PROTECTED] Subject: [PHP] Urgent help needed, sound scary when anyone did that on title :-) Hi people, I got here the syntax that is suppose to get the id from the "just inserted" record and store it in value, did not work so far and I cannot see what is wrong in there, can anyone give me a hint what is wrong here? ( And the reason I did not use mysql_insert_id here is because the ID field at my tables are all BIGINT so mysql_insert_id won't work, so I have to use LAST_INSERT_ID() instead). By the way, the error after the page is executed keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the value of $FirstLast, it showed that there is no value in there. Sniplet is like this: ( I tried to keep this down as much as try to give most detail at the same time, so apologize for too long sniplet). $sql1 = "insert into firsttable (firstname, lastname) values('Jack','Chan')"; $resultsql1 = mysql_query($sql1); $sqlLastID = "select LAST_INSERT_ID() from firsttable"; $resultlast = mysql_query($sqlLastID); $FirstLast = mysql_result($resultlast,0,0); $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) values('$FirstLast','Jacky','Chany')"; $resultsql2 = mysql_query($sql2); $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; $resultlast2 = mysql_query($sqlLastIDsec); $secondLast = mysql_result($resultlast2,0,0); $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; $resultsql3 = mysql_query($sql3); $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; $resultlast3 = mysql_query($sqlLastIDthird); $ThirdLast = mysql_result($resultlast3,0,0); ****************** what have I done wrong? Please enlighten me here Thanks Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
I did try mysql_error() to see waht exactly is my problem and here hwat I really need to know. My sniplet was all correct about using last_insert_id() and the message from mysql_error(0 tells me that "no selected database". Although I did use mysql_select_db already and I am sure there is nothing wrong with that part of code. The real problem is when I don't think I added user to this database properly previously so I simply went to grab another username that provide me the access to the database, but unfortunately different one, stupid me. So what I cannot do here is that now I have database on mysql server call "FreeSale" and I need to add user in it, how do I do that properly? cheers Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself" ----- Original Message ----- From: Maxim Maletsky <[EMAIL PROTECTED]> To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 24, 2001 10:22 PM Subject: RE: [PHP] Urgent help needed, sound scary when anyone did that on title :-) > you know Jacky, there's another, less cool and less reliable way to get the > last inserted id: > > SELECT id FROM table ORDER BY id DESC; > > it will sort them all giving you the biggest id *number* (not what mysql > keeps) and you can keep it for as many milliseconds your script will run > more... > > So if nothing else works for you - try this... > (depends on how secure & stable you want your application to be, of > course...) > > Cheers, > Maxim Maletsky > > -----Original Message----- > From: Jacky@lilst [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 26, 2001 1:21 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Urgent help needed, sound scary when anyone did that on > title :-) > > > Hi people, > I got here the syntax that is suppose to get the id from the "just inserted" > record and store it in value, did not work so far and I cannot see what is > wrong in there, can anyone give me a hint what is wrong here? ( And the > reason I did not use mysql_insert_id here is because the ID field at my > tables are all BIGINT so mysql_insert_id won't work, so I have to use > LAST_INSERT_ID() instead). By the way, the error after the page is executed > keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the > line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the > value of $FirstLast, it showed that there is no value in there. > > Sniplet is like this: ( I tried to keep this down as much as try to give > most detail at the same time, so apologize for too long sniplet). > > $sql1 = "insert into firsttable (firstname, lastname) > values('Jack','Chan')"; > $resultsql1 = mysql_query($sql1); > $sqlLastID = "select LAST_INSERT_ID() from firsttable"; > $resultlast = mysql_query($sqlLastID); > $FirstLast = mysql_result($resultlast,0,0); > > $sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname) > values('$FirstLast','Jacky','Chany')"; > $resultsql2 = mysql_query($sql2); > $sqlLastIDsec = "select LAST_INSERT_ID() from secondtable"; > $resultlast2 = mysql_query($sqlLastIDsec); > $secondLast = mysql_result($resultlast2,0,0); > > $sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname, > Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; > $resultsql3 = mysql_query($sql3); > $sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable"; > $resultlast3 = mysql_query($sqlLastIDthird); > $ThirdLast = mysql_result($resultlast3,0,0); > > ****************** > what have I done wrong? Please enlighten me here > Thanks > > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > -- > 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] >
> // echo $test."<br>"; > "//" . Without the remark, the code work but I get the error message > stating .... > > Warning: Cannot add header information - headers already sent by (output > started at test.php) in test.php on line ** Yes. A header is called a header because it comes out ahead of the actual page content. So what your browser *REALLY* sees is stuff like this: ------------------------ Content-type: text/html Content-length: 1035 Expiration: Jan 14 2001 20:46:37 GMT Cookie: user_id "a7fjeju48dj934jdjcu8" <HTML> <BODY>test</BODY> </HTML> ------------------------ Note the blank line between the headers and the HTML tag. That innocent blank line is very, very significant. It signifies the *END* of the headers and the beginning of the content. So, here's the deal. When you print something out, or have an HTML tag, or have a blank line, PHP has to send that out as part of the Content. Now, in order to do that, PHP has to send out your headers first, then the blank line, then whatever your content is. If you later try to send out a header, using the http://php.net/header function, or http://php.net/setcookie or http://php.net/session-start (sessions use cookies to track users), IT IS TOO LATE. That boat already sailed. Once the headers go out, and the blank line after them, you can't get more headers to be in front of that blank line that signified the end of the headers. > When I put in the remark, the 2nd file, test.php couldn't use > $GLOBAL["HTTP_REFERER"] because it couldn't find the last file. I was > thinking that maybe the HTTP_REFERER couldn't reach the last file because of > the way the header work. What exactly are you trying to do with the referer in the 2nd file? Print it? What? Why?
I think you can get the SDK from adobe.com Search for "fDF" I think. You may wish to specify your OS in your next plea, so people can help more. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Bruno Freire <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Wednesday, January 24, 2001 10:42 AM Subject: [PHP] HELP!!! PDFLIB FOR PHP!!!!! > I need learn how to install this library to create pdf files dinamicaly.!!! >
> I have this code in a php script, which takes all pixels from a PNG image > and produces a second "image" > with random numbers in HTML format this time. (an example can be found at > http://www.cyprusnews.org/sub/prog2.php). > > Instead of getting ALL shades of red from the pallette, I get only 8-9 > shades: those corresponding to > values of red with R value 0,51,102,153,204,255. Those are the values of the infamous Netscape 216 "web-safe" colors... Check the docs for anything about 216 or "web-safe" > Anyone can explain that? > > Here's the code: > > $im = imagecreatefrompng("vac3.png"); > $dimx = imagesx($im); > $dimy = imagesy($im); > > for ($f=0; $f<$dimy; $f+=5) { > for ($i=0; $i<$dimx; $i+=5) { > $colsat = imagecolorat($im,$i,$f); > $colss = imagecolorsforindex($im,$colsat); > $r = dechex($colss[red]); > $g = dechex($colss[green]); > $b = dechex($colss[blue]); > if ($colss[red] < 16) $r = "0" . $r; // assure that 13 becomes #0D and > not D > if ($colss[green] < 16) $g = "0" . $g; > if ($colss[blue] < 16) $b = "0" . $b; > $rndn = rand(0,9); > echo "<font color=#".$r.$g.$b.">".$rndn."0"; > } > echo "<br>"; > } > ImageDestroy($im); > > > thanks > > subbie > > > -- > 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] >
http://mysql.org should have documentation a date_format() function or something like that somewhere in there. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Sam <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Wednesday, January 24, 2001 11:48 AM Subject: [PHP] Displaying Date correctly > Hi all, > > I was wondering how I can display a date in this format 'DD/MM/YY' > As when I do a select statement and display the date I get it in this format > 'DD-MM-YYY 00:00:00' > Which is kind of annoying. > > I am using mySQL and also PHP. > > Thanks in advance. > > Sam Rose > > > -- > 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 run about 8 Cobalt RaQ3 and RaQ4 boxes, and this is the installation procedure that always works for me. Don't use the Cobalt RPMs. They're bad & out of date. ------------------------------------------------------------- GET THE SOURCE TARBALLS for MySQL and PHP4 from the command line: lynx http://mysql.he.net/Downloads/MySQL-3.23/mysql-3.23.32.tar.gz Then D - download, and enter to save to disk. That's the newest source tarball from a fast mirror site. To untar it, do this: tar -xvfz mysql-3.23.32.tar.gz Do the same for the newest PHP at lynx http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz HOW TO SET UP A NEW RAQ SERVER: ******** TO MAKE MySQL: ## - FIRST: TO MAKE A USER NAME 'mysql' GROUP NAME 'mysql' TO SAFELY RUN MYSQL UNDER /usr/sbin/groupadd mysql /usr/sbin/useradd mysql -g mysql ./configure --prefix=/usr/local/mysql-3.23 --with-mysqld-user=mysql --with-lz make make install ## - MAKE A "SYMLINK" SO THAT NO MATTER WHAT VERSION OF MYSQL WE'RE ON, IT'LL ALWAYS BE AT /USR/LOCAL/MYSQL cd /usr/local ln -s mysql-3.23.28 mysql ## - SET THE DATA DIRECTORY TO BE /VAR/DB - MAKE A SYMLINK FOR IT HERE IN THE MYSQL FOLDER cd mysql ln -s /var/db var ## - INSTALL THE BASIC DATABASE NEEDED TO RUN bin/mysql_install_db ## - if there's a problem, do the next step then come back and do this step again. ## - GO SET PERMISSIONS FOR THE DATA DIRECTORY cd /var chown mysql:mysql -R db chmod 700 -R db ## - COPY THE STARTUP/INIT/CONFIG FILES TO THE RIGHT PLACE cd share/mysql cp mysql.server /etc/rc.d/init.d/ cp my-small.cnf /var/db/my.cnf ## - PUT STARTUP FILES IN EVERY STARTUP FOLDER - so if they reboot the server, MySQL starts! cd /etc/rc.d/init.d/ chmod 755 mysql.server cd ../rc3.d ln -s ../init.d/mysql.server S88mysql cd ../rc4.d ln -s ../init.d/mysql.server S88mysql cd ../rc6.d ln -s ../init.d/mysql.server K18mysql cd ../rc0.d ln -s ../init.d/mysql.server K18mysql ## - SYMLINK THE COMMANDS INTO THE PATH SO WE CAN JUST TYPE "mysql" FROM ANYWHERE cd /usr/bin ln -s /usr/local/mysql/bin/* ./ cd /usr/sbin ln -s /usr/local/mysql/bin/* ./ ## - START IT! safe_mysqld & mysqladmin -u root -p password 'somesecretpassword' mysql -u root -p use mysql; delete from user where user=''; exit; from now on, connect to mysql with 'mysql -u root -p' then type the magic password afterwards. ******** TO MAKE PHP4: ## - weird little bug workaround - was looking in wrong directory for Apache cd /usr/bin ln -s /usr/sbin/httpd httpd ## - GO BACK TO THE PHP4 INSTALLATION DIRECTORY (/home/sites/home/users/admin/software/php4.0.3/) ./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr/local/mysql --enable-track-vars --enable-trans-sid --enable-ftp make make install vi php.ini-dist ## - CHANGE THESE LINES: #### under [mail function] sendmail_path = /usr/sbin/sendmail -t -i ## COPY THE CONFIGURATION FILE TO WHERE PHP LOOKS FOR IT cp php.ini-dist /usr/local/lib/php.ini ## WE HAVE TO ADD MySQL TO THE LIBRARY PATH vi /etc/ld.so.conf ## - ADD THESE LINES AT THE END; /usr/local/mysql/lib/mysql /sbin/ldconfig ## MAKE APACHE PHP-READY: vi /etc/httpd/conf/srm.conf find this line: DirectoryIndex index.html index.htm etc.... and add the 2 more options: index.php index.php3 find the line talking about PHP: change it from "php3" to just: AddType application/x-httpd-php .php .php3 .htm .html ## READY TO RESTART APACHE: go into /etc/httpd/conf/httpd.conf and IF there is a line that reads this: LoadModule php4_module lib/apache/libphp4.so amend it to read this: LoadModule php4_module /usr/lib/apache/libphp4.so then restart httpd: /etc/rc.d/init.d/httpd restart
I'm one of those ppl who find it hard to sit and read documentation especially manuals like the PHP one - presented HTML with no inbuilt search functions. Being a fairly novice programmer and more of a designer I'm not even that familiar with the programming terms to figure out what sections to find what I'm looking for. Sooo -has anyone written a PHP search script for the documentation. I'd like to be able to be able to do it similar to the windows (or most other) find box where it will sort through all the pages until it hits the string I'm after then if that's not it I can hit next and go onto the next matching string that it finds... I guess what I'm thinking of would have to run in a framed html [search at top and manual at bottom] but any other suggestions would be welcomed. Jamie
The PHP manual online is searchable. If you are reading the HTML version on your local machine, doesn't your browser have "find"? Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "LINUX is obsolete" -- Andy Tanenbaum, January 29th, 1992 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.JEEP-FOR-SALE.com/ -- I need a buyer Get your own Free, Private email at http://www.smackdown.com/ On Thu, 25 Jan 2001, Jamie wrote: > Date: Thu, 25 Jan 2001 12:50:44 +0800 > From: Jamie <[EMAIL PROTECTED]> > To: PHP <[EMAIL PROTECTED]> > Subject: [PHP] Search for the documentation > > I'm one of those ppl who find it hard to sit and read documentation > especially manuals like the PHP one - presented HTML with no inbuilt search > functions. Being a fairly novice programmer and more of a designer I'm not > even that familiar with the programming terms to figure out what sections to > find what I'm looking for. > Sooo > -has anyone written a PHP search script for the documentation. I'd like to > be able to be able to do it similar to the windows (or most other) find box > where it will sort through all the pages until it hits the string I'm after > then if that's not it I can hit next and go onto the next matching string > that it finds... I guess what I'm thinking of would have to run in a framed > html [search at top and manual at bottom] but any other suggestions would be > welcomed. > > Jamie > > > -- > 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] > >
The online manual is searchable. Hence the big "Search" button. But if you don't like that and prefer a Windows-like searchable thing, well then just download that. It is listed right there on: http://www.php.net/docs.php -Rasmus On Thu, 25 Jan 2001, Jamie wrote: > I'm one of those ppl who find it hard to sit and read documentation > especially manuals like the PHP one - presented HTML with no inbuilt search > functions. Being a fairly novice programmer and more of a designer I'm not > even that familiar with the programming terms to figure out what sections to > find what I'm looking for. > Sooo > -has anyone written a PHP search script for the documentation. I'd like to > be able to be able to do it similar to the windows (or most other) find box > where it will sort through all the pages until it hits the string I'm after > then if that's not it I can hit next and go onto the next matching string > that it finds... I guess what I'm thinking of would have to run in a framed > html [search at top and manual at bottom] but any other suggestions would be > welcomed. > > Jamie > > > -- > 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 dont you download the BIG one-file manual compilation from http://www.php.net and use the find t0ol in your web browser ? just my $0.020000 ------------------------------------------- Yeah, there are more important things in life than money, but they won't go out with you if you don't have any. ----- Original Message ----- From: "Jamie" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Thursday, January 25, 2001 10:20 AM Subject: [PHP] Search for the documentation > I'm one of those ppl who find it hard to sit and read documentation > especially manuals like the PHP one - presented HTML with no inbuilt search > functions. Being a fairly novice programmer and more of a designer I'm not > even that familiar with the programming terms to figure out what sections to > find what I'm looking for. > Sooo > -has anyone written a PHP search script for the documentation. I'd like to > be able to be able to do it similar to the windows (or most other) find box > where it will sort through all the pages until it hits the string I'm after > then if that's not it I can hit next and go onto the next matching string > that it finds... I guess what I'm thinking of would have to run in a framed > html [search at top and manual at bottom] but any other suggestions would be > welcomed. > > Jamie > > > -- > 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] > > > >
go here : http://www.php.net/tips.php it will turn your browser into a search machine. or, get the toolbar thingee from google : http://services.google.com/navclient/welcome.html it is FAR superior then the windows find thing as it highlights words. the manual everyone is talking about is called "HTML Version" and can be found here : http://php.net/docs.php and there is *never* a time where google toolbar can't be used when windows find can, remember that! :-) although that's a different discussion. but just turn on highlight, enter the term and press term button and presto! will go to next term and all will be highlighted like magic. but in all reality, searching php.net is most useful as it searches user comments too, so : http://php.net/search.php you can even specify what to search. i like to search "the mailing list" as it is so useful, add a mailing list search too via instructions under that tips.php page, i have this : alias : ml url : http://marc.theaimsgroup.com/?l=php-general&r=1&w=2&q=b&s=%s that will make more sense after reading tips page. adding little search aliases to the browser is most useful. regards, philip olson http://www.cornado.com/ On Thu, 25 Jan 2001, Jamie wrote: > I'm one of those ppl who find it hard to sit and read documentation > especially manuals like the PHP one - presented HTML with no inbuilt search > functions. Being a fairly novice programmer and more of a designer I'm not > even that familiar with the programming terms to figure out what sections to > find what I'm looking for. > Sooo > -has anyone written a PHP search script for the documentation. I'd like to > be able to be able to do it similar to the windows (or most other) find box > where it will sort through all the pages until it hits the string I'm after > then if that's not it I can hit next and go onto the next matching string > that it finds... I guess what I'm thinking of would have to run in a framed > html [search at top and manual at bottom] but any other suggestions would be > welcomed. > > Jamie > > > -- > 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] >
or you download the PDF manual, and search it as well... Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com ================================= > -----Original Message----- > From: Hrishi [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 10:09 PM > To: Jamie > Cc: PHP General Discussion > Subject: Re: [PHP] Search for the documentation > > > why dont you download the BIG one-file manual compilation from > http://www.php.net and use the find t0ol in your web browser ? > > just my $0.020000 > ------------------------------------------- > Yeah, there are more important things in life than money, but > they won't go > out with you if you don't have any. > ----- Original Message ----- > From: "Jamie" <[EMAIL PROTECTED]> > To: "PHP" <[EMAIL PROTECTED]> > Sent: Thursday, January 25, 2001 10:20 AM > Subject: [PHP] Search for the documentation > > > > I'm one of those ppl who find it hard to sit and read documentation > > especially manuals like the PHP one - presented HTML with no inbuilt > search > > functions. Being a fairly novice programmer and more of a > designer I'm not > > even that familiar with the programming terms to figure out > what sections > to > > find what I'm looking for. > > Sooo > > -has anyone written a PHP search script for the documentation. > I'd like to > > be able to be able to do it similar to the windows (or most other) find > box > > where it will sort through all the pages until it hits the string I'm > after > > then if that's not it I can hit next and go onto the next > matching string > > that it finds... I guess what I'm thinking of would have to run in a > framed > > html [search at top and manual at bottom] but any other > suggestions would > be > > welcomed. > > > > Jamie > > > > > > -- > > 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] > > >
Hi, I am creating a web site which allows users to post projects and then others to place bids. I am setting up two tables in MySQL 'Projects' & 'Bids' my problem is how best to cross reference. What I was thinking of doing is creating a number of fields in the Projects table... Bid1 Bid2 Bid3 etc and then inserting the BidID from the bids table into Bid1, and if that is already used then it will go into Bid2. But how many Bid# shall I create?? I`m sure there must be a faster method than this, anyone have any suggestions?? TIA Ade
Can anyone help me I'm trying to read two results from a function by passing them out via an array but I'm not sure how to access them once I have done that. In the PHP manual it shows a list call which I can't seem to even find what the hell it does the code below runs without any errors but does not seem to work. here the function gest passed the language and currency preference and a variable (1,0) to decide what it will do with them - update the preferences of the user or read out and define the preferences. (once updated I want it to read out the prefs aswell) function PrefChange($lang,$curry,$state){ global $DB_Server, $HTTP_Host, $DB_Login, $DB_Password, $DB_Name, $DocRoot ; if ($state){//read preferences from page if (!($result = mysql_db_query($DB_Name,"SELECT language_pref, currency_pref FROM users WHERE user_id ='$cookie_user'"))){ DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server, $DB_Login, $DB_Password, mysql_errno(), mysql_error())); while ($row = mysql_fetch_array($results)){ $lang_pref = $row["language_pref"]; $currancy_pref = $row["currency_pref"]; return array($lang_pref,$currancy_pref); } } } else {///update preferences from page if (!($result = mysql_db_query($DB_Name,"UPDATE users SET language_pref='$lang' AND currency_pref='$curry' WHERE user_id='$cookie_user'"))){ DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server, $DB_Login, $DB_Password, mysql_errno(), mysql_error())); PrefChange(0,0,1) ; } } } an example of what I'd like to do when calling the function (here I'm only reading the prefrences from the DB ), a select box that is showing the preference that is chosen with the preference read from the above function and the list created by the function below <select name="form_lang_pref" style="font-family:verdana, Arial;font-size:8pt" CLASS:menu"> <? list ($form_language_pref, $form_currency_pref) = PrefChange(0,0,1); $select_id = $form_language_pref; $db = mysql_connect("$DB_Server", "$DB_Login, $DB_Password"); mysql_select_db("$DB_Name",$db); $results = mysql_query("SELECT * FROM language ORDER BY language ",$db); while ($row = mysql_fetch_array($results)){ $rowid = $row["language_id"]; $name = $row["language"]; if ($rowid == $select_id) { echo("<option SELECTED value=\"$id\">$name</option>\n"); } else { echo("<option value=\"$id\">$name</option>\n"); } // endwhile; } echo("</select>"); ?>
$array[0] will be the lang_pref and $array[1] will be the currency_pref. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "LINUX is obsolete" -- Andy Tanenbaum, January 29th, 1992 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.JEEP-FOR-SALE.com/ -- I need a buyer Get your own Free, Private email at http://www.smackdown.com/ On Thu, 25 Jan 2001, Jamie wrote: > Date: Thu, 25 Jan 2001 13:04:27 +0800 > From: Jamie <[EMAIL PROTECTED]> > To: PHP <[EMAIL PROTECTED]> > Subject: [PHP] multiple function returns > > Can anyone help me I'm trying to read two results from a function by passing > them out via an array but I'm not sure how to access them once I have done > that. In the PHP manual it shows a list call which I can't seem to even find > what the hell it does the code below runs without any errors but does not > seem to work. > > here the function gest passed the language and currency preference and a > variable (1,0) to decide what it will do with them - update the preferences > of the user or read out and define the preferences. (once updated I want it > to read out the prefs aswell) > > function PrefChange($lang,$curry,$state){ > global $DB_Server, $HTTP_Host, $DB_Login, $DB_Password, $DB_Name, $DocRoot ; > > if ($state){//read preferences from page > if (!($result = mysql_db_query($DB_Name,"SELECT language_pref, > currency_pref FROM users WHERE user_id ='$cookie_user'"))){ > DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server, > $DB_Login, $DB_Password, > mysql_errno(), mysql_error())); > while ($row = mysql_fetch_array($results)){ > $lang_pref = $row["language_pref"]; > $currancy_pref = $row["currency_pref"]; > return array($lang_pref,$currancy_pref); > } > } > } else {///update preferences from page > if (!($result = mysql_db_query($DB_Name,"UPDATE users SET > language_pref='$lang' AND currency_pref='$curry' WHERE > user_id='$cookie_user'"))){ > DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server, > $DB_Login, $DB_Password, > mysql_errno(), mysql_error())); > PrefChange(0,0,1) ; > } > } > } > > > an example of what I'd like to do when calling the function (here I'm only > reading the prefrences from the DB ), a select box that is showing the > preference that is chosen with the preference read from the above function > and the list created by the function below > > <select name="form_lang_pref" style="font-family:verdana, > Arial;font-size:8pt" CLASS:menu"> > <? > list ($form_language_pref, $form_currency_pref) = PrefChange(0,0,1); > > $select_id = $form_language_pref; > $db = mysql_connect("$DB_Server", "$DB_Login, $DB_Password"); > mysql_select_db("$DB_Name",$db); > $results = mysql_query("SELECT * FROM language ORDER BY language > ",$db); > > while ($row = mysql_fetch_array($results)){ > $rowid = $row["language_id"]; > $name = $row["language"]; > if ($rowid == $select_id) { > echo("<option SELECTED value=\"$id\">$name</option>\n"); > } else { > echo("<option value=\"$id\">$name</option>\n"); > } > // endwhile; > } > echo("</select>"); > ?> >
I want to get the result from first row (the one next from ID field) of the table using $HotelName = mysql_result($resultHotel,0,1) or die(mysql_error()); // Note that there is data in the table for sure and I got the error back said Warning : 1 is not a Mysql result Index ...... ( and point to that aprticular line of course ). What is wrong here? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
I want to get the result from first row (the one next from ID field) of the table using $HotelName = mysql_result($resultHotel,0,1) or die(mysql_error()); A suggestion: Why don't you use mysql_fetch_row or any other function that reaches beyond just getting 1 field? this would be easier perhaps for you visualize the data you are trying to get. http://www.php.net/manual/en/function.mysql-fetch-row.php
Hello, I am still new to PHP but so far, I am getting things sorted reasonably ok with some great from this group and other sites. I have a MySql Database, that is working great, but when my results are returned there is alot of information. How do you display say only 15 results when doing a query from MySql, and display a next button for the next lot of 15. I can get it to return all, but not in numbers. I don't even know where to start. Any ideas would be bloody marvellous. Thanks dudes & dudess's. Chris
PHPBuilder.com has an article on this: http://www.phpbuilder.com/columns/rod20000221.php3 --david > -----Original Message----- > From: Sefton [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 25 January 2001 4:41 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How do you do this? > > > Hello, > > I am still new to PHP but so far, I am getting things sorted > reasonably ok > with some great from this group and other sites. > > I have a MySql Database, that is working great, but when my > results are > returned there is alot of information. > > How do you display say only 15 results when doing a query > from MySql, and > display a next button for the next lot of 15. > > I can get it to return all, but not in numbers. I don't even > know where to > start. > > Any ideas would be bloody marvellous. Thanks dudes & dudess's. > > Chris > > > > -- > 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] >