[PHP] PHP 4.0.4pl1 HEAD request problem
Software: Apache/1.3.19 (Unix) PHP/4.0.4pl1 mod_ssl/2.8.2 OpenSSL/0.9.6 and PHP is built as a loadable module for Apache. HEAD requests to PHP pages that have calls to ob_start() and ob_end_flush() do not work properly. index.php - *without* ob_start() / ob_end_flush() - ? phpinfo(); ? Here's the response from a HEAD request to that index.php: -- HTTP/1.1 200 OK Date: Fri, 07 Sep 2001 21:11:00 GMT Server: Apache/1.3.19 (Unix) PHP/4.0.4pl1 mod_ssl/2.8.2 OpenSSL/0.9.6 X-Powered-By: PHP/4.0.4pl1 Connection: close Content-Type: text/html Connection closed by foreign host. === index.php - *with* ob_start() / ob_end_flush() -- ? ob_start(); phpinfo(); ob_end_flush(); ? Here's the response from a HEAD request to that index.php: -- Connection closed by foreign host. Is this a bug with PHP 4.0.4pl1? -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Calling Functions without all the arguments
Chris Aitken [[EMAIL PROTECTED]] wrote: On Fri, 13 Apr 2001, Chris Aitken wrote: --- Warning: Missing argument 2 for stripe() in /location/to/included/file.php on line 257 Warning: Missing argument 3 for stripe() in /location/to/included/file.php on line 257 --- Okay, ive managed to do some more playing, and come up with some more info. The above error only shows up when I have a function being called without all the arguments filled in. For example, if I have a function as "function blah($foo,$bar)" and call the function with both $foo and $bar set, it will run just fine. But if I call it with only $foo it comes up with these errors. The thing is, the previous version of PHP must have alowed me to call functions without all the arguments and it never batted an eyelid or gave an error. My question is, is there something I didnt compile into the new PHP, or is there a line in php.ini file I need to modify so that it doesnt show these errors up (or should I adjust my code so that I dont call functions without all the arguments) ? I found the same problem - when we upgraded to PHP4, function calls that used to work and NOT provide all the parameters, started failing. The way I fixed it was to give each parameter a default value *IN* the function definition, like: function abc($a='', $b='') // assigns null as parameter defaults that way, every parameter gets a value, even if all the parameters were not supplied in the call. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] register_globals on or off?
hi [[EMAIL PROTECTED]] wrote: Hi, Could someone explain what the following passage in php.ini means: You should do your best to write your scripts so that they do not require ; register_globals to be on; Using form variables as globals can easily lead ; to possible security problems, if the code is not very well thought of. If register_globals is off, does that mean you cannot access form variables by just referring to their name? And, if that is so, how do you pass information from forms to your action script? If you had register_globals Off *AND* track_vars On, you could change: from: $frmCompanyName to: $HTTP_GET_VARS["frmCompanyName"] or $HTTP_POST_VARS["frmCompanyName"] depending on your action method. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] very dumb question, need help
At the top of every script that will register or use session variables, I do "session_register" - something like this: script_1.php ?php session_start(); session_register("test"); $test = "myname"; ? script_2.php ?php session_start(); echo "Value of \$test = $test"; // value should be "myname" ? HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Jacky [[EMAIL PROTECTED]] wrote: Hi all I have been to look at manual about session, in php4, still not quite get it. Basically if I have sniplet below in one page, how do I assign value into that session and how do I call it up in next page? I sthe way I assign value into session correct? ( I think it did not, because it did not work, but still need to show what I did, so help can get to the right point easier). Note: that I simply hardcode value into session just to see if it will like it. * ?php session_register("test"); $test = "myname"; ? * 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]
Re: [PHP] Sessions help please
[EMAIL PROTECTED] [[EMAIL PROTECTED]] wrote: Hi, I am going to use sessions to authenticate and protect my pages, this is what I have so far... User logs in via form, this is checked via a SQL call, if the correct username and password are entered I run the following: session_start(); session_register("UserName","Password"); You have to register each "field" like this: session_register("UserName"); // register UserName as a session var $UserName = $new_value_for_username; // give UserName session var a new value. session_register("Password"); // register Password as a session var $Password = $new_value_of_password; // give Password session var a new value. Then in the next script, after you do session_start();, you will have access to those previously registered session variables by just using $UserName and $Password. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com header ("Location: Http://www.domain.com/members/index.php"); The bit where I get lost is 1) how to authenticate this on each page and 2) How to close the session after the browser has closed. I have tried many tutorials etc but none seem to go into great detail in those areas. Anyone know of any decent tutorials or any snippets I can learn from. 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] -- 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] OCI8 server errors - client
I have an Oracle client on a webserver talking to an Oracle server through Oracle networking and the PHP OCI8 interface. When an error occurs on the server, the 'message' that OCIError receives on the client is Error while trying to retrieve text for error ORA-03113 This seems to happen with the Oracle "Programmers" client install. There was only one client install that had more stuff than "Programmer" and I think that was "Administrator". Why am I not getting proper Oracle error 'message's on the client when the Oracle server has an error? Is this normal, or did I do something wrong? TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Custom Session Handlers with Oracle?
There's a pretty good tutorial on this here: http://www.zend.com/zend/tut/session.php and Ying Zhang's "Customer Session Handlers in PHP4" can be adapted to MySQL - see http://www.phpbuilder.com/columns/ying2602.php3 And www.php.net's session page is OK for reference at http://php.net/manual/en/ref.session.php Between those 3 you should be able to get sessions working with MySQL. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Michael Champagne [[EMAIL PROTECTED]] wrote: Has anyone out there implemented custom session handlers using Oracle? If so, is there any code out there that might point me on how to do this. I've found the article on phpbuilder.net that details doing this for with DBM but I can't find anything for doing this with Oracle. Thanks! -- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: [EMAIL PROTECTED] hm: [EMAIL PROTECTED] ** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ** -- 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]
Re: [PHP] addslashes Question
Jeff, here's what I do: 1. set magic_quotes_gpc On in php.ini * this will automatically quote all GET, POST, and COOKIE variables - read up on magic_quotes_gpc. 2. at the top of each script, stripslashes all the COOKIE, GET, and POST variables, since they will have been automatically quoted by magic_quotes_gpc. 3. At the top of the the routine that INSERT's or UPDATE's fields in the database, for all string variables invoke addslashes - this will properly quote all characters(I think there's only 4 - single quote, double quote, NULL character, and I can't remember what the 4th one is - look at the manual under "addslashes"). Then you can INSERT or UPDATE the columns with those addslash'ed values. There's many different ways to do this, but this is what works best for me. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Jeff Oien [[EMAIL PROTECTED]] wrote: I have a form to modify a record in a MySQL database. The record contains this: 3" Brush The code in question is like this: while ($row = mysql_fetch_array($result)) { $desc1 = $row['desc1']; -- input type="text" name="desc1" value="?php echo "$desc1"; ?" I've tried using addslashes to the variable in various ways and it always returns: 3\ What am I doing wrong? Sorry this is probably the 1000th time this has been asked. Jeff Oien -- 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] -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP w/ Oracle OCI8 - how stable?
I'm thinking of using PHP to talk to an Oracle database with the OCI8 interface - is PHP's OCI8 interface stable? Anything unusual I should know about? I'm using: Redhat 6.1 Linux PHP 4.0.4pl1 Oracle 8i 8.1.6 Apache 1.3.14 TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problem with VARIABLES
Ian, I think what you want is a variable variable - have a look at http://www.php.net/manual/en/html/language.variables.variable.html I think you might want something like this: ${$Color$Temp[$f]} HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Ian LeBlanc [[EMAIL PROTECTED]] wrote: I have this page where I am printing some items that are defined by size and color which all the info is pulled from a database. in the first item loop PRINT ("tdinput type=\"text\" name=\"$Color$Temp[$f]\" size=\"3\"/td\n"); translated looks like this. tdinput type="text" name=\"WhiteS" size="3"/td meaning the color white and the size Small. Now the next loop does what it is suppose to and returns a value of tdinput type="text" name=\"BlackS" size="3"/td These get posted to the next page. Now for the PROBLEM without hard coding it how can I get the value of BlackS meaning I know the color and sizes but how do I put the variable together to print the value of it. On the 2nd page I would like to echo $Color$Temp[$f] but that does not return the value of the item. I need $Color$Temp[$f] to turn into the variable not a value. So I can echo the variable. Someone please help. (*NOTE* the reason I do not want to hard code it is that I have a list of 102 colors which makes for a really long script.) PLEASE CC ME ON THE MESSAGE BECAUSE I AM ONLY SUBSCRIBED TO THE DIGEST (I will have to wait some 12 odd hours for the answer) Regards, Ian LeBlanc Web Development Rask, Inc. - www.rask.com Phone: (727) 517-2000 Fax: (727) 517-2001 -- 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]
Re: [PHP] Oracle error messages
Rudolf Visagie [[EMAIL PROTECTED]] wrote: Hi All, Does anybody have an idea how to stop the automatic error and warning messages from the Oracle data base being displayed on the screen. I want to do my own error message display but by the time I get the error message using OCIError it was already displayed on the screen anyway. In your php.ini file, you want to set "display_errors = Off", and "log_errors = On". Rudolf Visagie [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] -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting path of script
How 'bout using a Perl regex with $HTTP_SERVER_VARS["SCRIPT_NAME"] like this: echo "Starting with SCRIPT_NAME=[" . $HTTP_SERVER_VARS["SCRIPT_NAME"] . "]BR"; if (preg_match("/(\S+)\/\S+$/", $HTTP_SERVER_VARS["SCRIPT_NAME"], $matches)) { echo "Found $matches[1]br"; } HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Jordan Elver [[EMAIL PROTECTED]] wrote: Hi, I want to get the path of a script. I know about HTTP_SERVER_VARS["SCRIPT_FILENAME"] this returns someting like: /phpcode/misc/phpinfo.php But I want to strip off the file name and just have the directory path, like: /phpcode/misc/ Any ideas? Jord -- 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]
Re: [PHP] Inserting DATE in mySQL!!
CC Zona [[EMAIL PROTECTED]] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] ("Thomas Edison Jr.") wrote: I'm using the following code to insert date into my mySQL table named "Booking". I've created variables that store the date with dashes "-" seperating them. But it's not working. It's giving me an error on the $SQl line. following is the code : ?php $db = mysql_connect("localhost","root"); mysql_select_db("motorola",$db); $realsdate="$syear"."-"."$smonth"."-"."$stdate"; $realedate="$eyear"."-"."$emonth"."-"."$endate"; $realstime="$shh".":"."$smm"."-"."$sttime"; $realetime="$ehh".":"."$emm"."-"."$entime"; $sql = INSERT INTO booking (room,sdate,edate,stime,etime,purpose,reserved) VALUES ('$rooms','$realsdate','$realedate','$realstime','$realetime','$purpose','$res '); $result = mysql_query($sql) or Die ("An unexpected error occured. Please go back and book again."); ? Your value for the variable "sql" isn't enclosed in quotes. BTW, tracking down problems with a sql query gets easier when you give yourself a more informative die() message, such as: or die ("MySQL says: " . mysql_errorno() . " " . mysql_error() . "\nPHP ^ Just a technicality, but I think I remember this to be mysql_errno(). But CC is right - in your "die", give yourself as much info about the error as possible. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com says: $errormsg"); -- 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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete an element from an array
kaab kaoutar [[EMAIL PROTECTED]] wrote: Thanks! but i know this function! i can't do that cause my varibale is multidimenssional, and i don't want to update all that ! for one element ! we can't decrement the length of the array ?! no way ? Here's an example of a multidimensional array - I "unset" one of the values in the middle - I don't know why this won't work for you: ? $arr1 = array("a" = array('1' = "a111", '2' = "a222", '3' = "a333"), "b" = array('1' = "b111", '2' = "b222", '3' = "b333"), "c" = array('1' = "c111", '2' = "c222", '3' = "c333")); foreach ($arr1 as $key1 = $value1) { echo "br"; echo "key=[$key1], value=[$value1]br"; foreach ($value1 as $key2 = $value2) { echo " key2=[$key2], value2=[$value2]br"; } } unset($arr1["b"]["2"]); echo "brbrUnset b2 nowbrbr"; foreach ($arr1 as $key1 = $value1) { echo "br"; echo "key=[$key1], value=[$value1]br"; foreach ($value1 as $key2 = $value2) { echo " key2=[$key2], value2=[$value2]br"; } } ? Here's the output displayed on the browser: --- key=[a], value=[Array] key2=[1], value2=[a111] key2=[2], value2=[a222] key2=[3], value2=[a333] key=[b], value=[Array] key2=[1], value2=[b111] key2=[2], value2=[b222] key2=[3], value2=[b333] key=[c], value=[Array] key2=[1], value2=[c111] key2=[2], value2=[c222] key2=[3], value2=[c333] Unset b2 now key=[a], value=[Array] key2=[1], value2=[a111] key2=[2], value2=[a222] key2=[3], value2=[a333] key=[b], value=[Array] key2=[1], value2=[b111] key2=[3], value2=[b333] key=[c], value=[Array] key2=[1], value2=[c111] key2=[2], value2=[c222] key2=[3], value2=[c333] From: Hardy Merrill [EMAIL PROTECTED] To: kaab kaoutar [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] delete an element from an array Date: Mon, 5 Mar 2001 10:57:49 -0500 Have a look at http://www.php.net/manual/en/function.unset.php "unset" may do what you want. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com kaab kaoutar [[EMAIL PROTECTED]] wrote: Hi! FIRST OF ALL THANKS ! well do u mean that the only way to remove an elemnt from an array is to copy it into another array? it does not suit me cause the array is a session variable and i need to update it ! Thanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- 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] _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] function -- global variables
Augusto Cesar Castoldi [[EMAIL PROTECTED]] wrote: I have a html form and his "action" is a php file. this is the php file: function checasenha($ID) { ^^^ $as="\""; global $ID, $limite, $cdusuario, $usuario, $senha; ^^^ . . . } checasenha($ID); -- Warning: Variable used in global statement already exists in the function in /home/httpd/html/fiesc_sessao/checa_senha.php3 on line 13 The "line 13" is "global $ID, $limite." What's could be the problem? Notice my ^'s above - you are already defining $ID in your function declaration. You can't do that *and* declare $ID as a global. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com regards, Augusto Cesar Castoldi -- 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] include_once
Redhat 6.1 Linux PHP 4.0.4pl1 Apache 1.3.14 Anyone using "include_once"? I'm executing a PHP script "A.php" by referring to it in my Netscape browser URL - script A.php does an include_once of "B.php" - B.php contains a database connect function that does a connect to an Oracle database. I purposely brought down the Oracle database to force a connect error. I have an "error_log" statement in the connect failure that prints to our webserver error log - the connect error was reported fine. ***THEN, I added more text to the error_log output for that connect failure, but the new text is *NOT* appearing in any subsequent connect failures. Why won't my new text appear in the error? I've tried changing the "include_once" to "include", and the same thing happened. I even tried restarting the webserver, but it had no affect. This is driving me nuts! Help please. TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] include_once
Solved - I was changing a copy of the code that the webserver was NOT looking at. "include_once" works fine. Appologies. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Hardy Merrill [[EMAIL PROTECTED]] wrote: Redhat 6.1 Linux PHP 4.0.4pl1 Apache 1.3.14 Anyone using "include_once"? I'm executing a PHP script "A.php" by referring to it in my Netscape browser URL - script A.php does an include_once of "B.php" - B.php contains a database connect function that does a connect to an Oracle database. I purposely brought down the Oracle database to force a connect error. I have an "error_log" statement in the connect failure that prints to our webserver error log - the connect error was reported fine. ***THEN, I added more text to the error_log output for that connect failure, but the new text is *NOT* appearing in any subsequent connect failures. Why won't my new text appear in the error? I've tried changing the "include_once" to "include", and the same thing happened. I even tried restarting the webserver, but it had no affect. This is driving me nuts! Help please. TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ora_error segfaults
I'm receiving consistent segfaults when invoking ora_error after an ora_exec error. When I give SELECT abc FROM customer and "abc" is *NOT* a valid column name for "customer" table, then ora_parse is successful, but ora_exec fails - and if as a result of the failure I try to call ora_error I get a segfault. Has anyone else seen this - any solutions? TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mcrypt and encrypted field length
First, can anyone point me to a good "mcrypt" primer or tutorial? Second, how can I determine what type and length I should make a database field that will hold encrypted data? Is there some table somewhere which tells how long a resulting encrypted field will be based on the encryption type and/or length of the plaintext field? Example: If I have a 20 character field and want to use Triple DES to encrypt it, can I find out how long the resulting field will be - what is the longest it will be? Will the resulting encrypted field always be the same length? Should I make the data type some variation of "text" or "varchar"? TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session-variables
Look at http://www.php.net/manual/en/html/ref.session.html HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com spider [[EMAIL PROTECTED]] wrote: Is it ok to mail questions to this list? If so; Is there something similar like the "session variables" of ASP in PHP, or do one have to use (client-side) cookies instead? /thanks/me -- 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]
Re: [PHP] Session Code debug help requested
Matt, I'm not sure I understand your situation, but here's how I use sessions: 1. at the start of every PHP script, do "session_start();" 2. after session_start(), for every session variable you want to register, do "session_register("var_name");" 3. from that point forward, to give that session variable a value, that will be carried forward into other scripts (after the other script does a "session_start()"), just do $var_name = "new value"; or to print the current value of $var_name, just do echo "Value of session variable \$var_name = $var_name"; that's it. You only need to do session_destroy() when you actually want to destroy all the session variables for the current session - if you do that in every script, then you obviously won't be carrying over any session variable values from one script to the next. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Matthew Mundy [[EMAIL PROTECTED]] wrote: Hello all. Sorry, I know sessions come up a lot. I am attempting to use sessions for login tracking. The session starts fine, sends the cookie fine(login as the session name), registers login as a session var, then location should switch to index. all my files except login include() a file called header.php which if login is not registered redirects to login. Except login is never registered when it hits header. The code I use to initialize the session is below. Also, no data is saved in /tmp as it should be. I missed something. I just can't figure out what. :( Any help would be appreciated. Thanks in advance. ---Matt if ($success) { //set the session name to the login, start the session, register the login in the session //destroy any old data @session_destroy(); session_name($login); session_start(); session_register("login"); header ("Location: index.php"); exit; } -- 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] how display msg(5 secs) and then redirect?
How do you display a "you are being redirected to xyz page" page for some period of time(5 seconds?) and then redirect to another page without the user having to click on a link or a button? TIA. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [newbie]subtracting date
For PHP's data and time functions, see this page: http://www.php.net/manual/en/html/ref.datetime.html You didn't mention a database - are you going to be selecting records in a database based on a date? I haven't seen this anywhere in the documentation, but my favorite way of doing date math, and the way I've seen other people do it also, is to convert your dates to unix timestamps - that is, convert each date to the number of seconds since 1970, then subtract or add, then convert the result back into a date. $today_seconds = time(); // get current unix timestamp $num_days = 5; $num_days_seconds = (60*60*24*$num_days); $date_before_seconds = $today_seconds - $num_days_seconds; // now convert new date seconds back into a date $date_before = date("m-d-Y", $date_before_seconds); Or use this that I found in the "date" documentation: $five_days_ago_seconds = mktime (0,0,0,date("m"),date("d")-5,date("Y")); $date_5_days_ago = date("m-d-Y", $five_days_ago_seconds); HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Matthew Ley [[EMAIL PROTECTED]] wrote: I am working on a project where I need a function that will take the current date and subtract however many days off of it a client specifies. Would anybody know a way I can set this up? I pretty new at this so my vocabulary is very basic. -- 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]
Re: [PHP] date question
Which database? Fang Li [[EMAIL PROTECTED]] wrote: There is a LiveDate (-MM-DD) field in my table. 1. I want data from last 5 days up to now, and its order should be from latest; 2. I want data for next month. Any help would be appreciated. -- 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]
Re: [PHP] Date/Time from Unix timestamp
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? iewhat 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sessions
Fortunately I've recently done some research into this - here are a few links to get you going: http://www.phpwizard.net/resources/tutorials/session_intro.html http://www.zend.com/zend/tut/session.php and here are more links if you are interested in storing your session info in a database - these are specific to MySQL, but the concepts are the same no matter what db: http://www.phpbuilder.com/columns/ying2602.php3 http://www.phpbuilder.com/tips/item.php?id=177 http://phpweblogs.com/adodb http://phpweblogs.com/adodb-sessions http://www.phpbuilder.com/columns/chad19990414.php3 HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Brandon Orther [[EMAIL PROTECTED]] wrote: Does anyone have a place with a little more user friendly tutorial or place to learn about sessions? The php manual is making me go mad. Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sessions
Randy Johnson [[EMAIL PROTECTED]] wrote: Hello, I was going to use sessions to save a logged in variable so if the user logged in with a username and password I checked for the session variable and if it existed then I could continue. Is there a way for the loggedin session variable to automatically be destroyed after 5 minutes for example? If not what would be another way I could implement the above. Look at your php.ini configuration - specifically session.gc_probability session.gc_maxlifetime they will help you manage sessions and give a lifetime to each session. You can also use a scheduled(cron on *nix) job to remove sessions older than ??? minutes. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com thanks, Randy -- 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]