[PHP] mktime() and the format of the day number entry

2003-01-02 Thread Johnson, Kirk
OK, I am mktime() challenged. Can someone please explain these results to me? I have some test dates in October of 1998. For the days numbered 1-7, mktime() does not care whether I have a leading zero on the day or not, I get the same timestamp regardless, e.g., both a '7' and a '07' for the day

RE: [PHP] mktime() and the format of the day number entry

2003-01-02 Thread Johnson, Kirk
The month behaves the same: both '08' and '09' are treated as zero by mktime(). Kirk > -Original Message- > From: Paul Roberts [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 4:24 PM > To: Johnson, Kirk > Cc: [EMAIL PROTECTED] > Subject

RE: [PHP] dreading OOP

2003-01-21 Thread Johnson, Kirk
> -Original Message- > >However, my mind apparently works different and I keep trying to relate the OOP structure to > what I already know which equates an object to a function. I am resolving > to purchase a book dedicated to instruction in the inns and outs of OOP. > Specifically

RE: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Johnson, Kirk
> -Original Message- > From: Scott Fletcher [mailto:[EMAIL PROTECTED]] > > Found a PHP bug, I'm using PHP version 4.2.3. I have been > struggling with > why PHP code failed to work with the month is August or > September I stumbled into this one a short while ago myself. It is not a b

RE: [PHP] Problem with Date (2003-03-30)

2003-01-29 Thread Johnson, Kirk
> -Original Message- > From: Gareth Mulholland [mailto:[EMAIL PROTECTED]] > > I'm having problems with mktime and Midnight on 30th March 2003. > > The code I'm using is: > > echo mktime(0,0,1,'03','29','2003'); > echo mktime(0,0,1,'03','30','2003'); > echo mktime(0,0,1,'03',

RE: [PHP] Re: recursion?????

2003-02-18 Thread Johnson, Kirk
> % The benefit of checking in javascript(which I suspect is > enabled in most > > Not me! Not me! Not me! > > It is by no means ubiquitous. Anyone who even moderately considers > security will have it turned off. The latest survey I've seen indicates that about 11% of browsers have JS d

RE: [PHP] register_globals On

2003-02-18 Thread Johnson, Kirk
> I'm thinking of running a shopping cart package (osCommerce) > that requires > register_globals to be enabled. With all the warnings about > security with > register_globals enabled I'm worried. > > How dangerous is it? The key defensive step is to initialize all of your session variables at

RE: [PHP] Redirect without header or javascipt

2003-02-18 Thread Johnson, Kirk
> Is there any to redirect in php with using header() > and without the use of javascript? You can use an html meta tag with http-equiv="refresh". Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Re: register_globals On

2003-02-20 Thread Johnson, Kirk
> -Original Message- > An alternative... > > 1. register_globals off > > use the command > import_request_variables("PC","_p"); > now you can get the variables like user as $p_user. > The get variables will be ignored! > > Still, If a user developes a special browser, exclusively to >

RE: [PHP] missing simple php functionality

2003-02-20 Thread Johnson, Kirk
The field name in the is "user_name", and the echo is for "name". Are you copying the value from $user_name to $name at some point? Kirk > -Original Message- > From: ML [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 2:04 PM > To: [EMAIL PROTECTED] > Subject: [PHP] missing

RE: [PHP] array question

2003-02-24 Thread Johnson, Kirk
http://www.php.net/manual/en/language.variables.variable.php Kirk > -Original Message- > From: Bob Irwin [mailto:[EMAIL PROTECTED] > Sent: Monday, February 24, 2003 3:28 PM > To: php-general > Subject: Re: [PHP] array question > > > Hi Guys, > > This might be a bit of a newbie questio

[PHP] When is garbage collection initiated?

2003-02-27 Thread Johnson, Kirk
I need a better understanding of when garbage collection is initiated under PHP's default session handling. It is not clear to me if the gc_probability is based on: - each *request* to the server, or, - each time a *new session file is created*, or, - each time a request causes a *session file to

RE: [PHP] How can I detetct if session cookies are enabled?

2003-02-28 Thread Johnson, Kirk
> Is there a way (PHP code if possible please) to verify > if session > cookies are enabled in the user's browser? On the *second* request, check if $_COOKIES['PHPSESSID'] is set. On the initial request, PHP sends the 'PHPSESSID' cookie as part of the response. The browser then returns that co

RE: [PHP] Session variable under PHP 4.0.6

2003-03-03 Thread Johnson, Kirk
In the first file, replace this line: $HTTP_SESSION_VARS['variable']="the variables value"; with these two lines: $variable = "the variables value"; session_register('variable'); This is because 'register_globals' is enabled in the php.ini file. Kirk > -Original Message- > From: Henry

RE: [PHP] Session variable under PHP 4.0.6

2003-03-03 Thread Johnson, Kirk
That Caution message is not the full story, read some more on "register_globals". If register_globals is "On" in php.ini, then do the following: - use session_register() to create your session variables; - use the global variable to access the variable, not the $HTTP_SESSION_VARS array. Example:

RE: [PHP] delete from array

2003-03-10 Thread Johnson, Kirk
>How do I delete a specific time out of the array or > how do I delete > a range of times out of the array? I would like to be able to delete > 12:05:00 but if I want, delete a range like 12:05:00 to > 12:10:00. Here's some code. Kirk function remove_array_values($valuesToRemove, $array) {

RE: [PHP] OT Inactivity Timeout

2003-03-14 Thread Johnson, Kirk
> But how can I > set up an inactivity timeout that will logout a person after > let's say 20 > minutes of inactivity? You could put a refresh on the page, that redirects to an "inactivity" page. Set the refresh time to the timeout value. Put some logout code on the "inactivity" page. Otherwi

RE: [PHP] IF statement madness

2003-03-14 Thread Johnson, Kirk
Comparing a float with an integer can have problems. You could try something like: if(abs($i - $target) < .1) { //then they are essentially equal } Kirk > -Original Message- > From: James E Hicks III [mailto:[EMAIL PROTECTED] > Sent: Friday, March 14, 2003 11:22 AM > To: [EMAIL PRO

RE: [PHP] Sessions

2003-07-08 Thread Johnson, Kirk
> This works fine on my development PC, (PHP v 4.3.1) and on > my primary test > site (PHP v4.2.2). > However when I try it on the target site (PHP v4.1.2) then I find that > immediately after starting the session everything works fine, > however when I > move to any other page the session infor

RE: [PHP] session data missing

2003-07-09 Thread Johnson, Kirk
> After creating a new session with session_start() and > inserting a few values > e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file > /tmp/sess_{session_id} is > created. > The problem is that this file is empty! 0 bytes. no data is stored. > I'm using php 4.0.6 on linux with apache 1.3 something.

RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Johnson, Kirk
> I'm moving an application that I'm in the trying to move to a new > platform. It was running fine on an older Linux platform with PHP > 4.0.3 and Apache 1.3.14. The new platform is also Linux, > with PHP 4.2.2 > and Apache 1.2.26 -- with register_globals on. (I just > upgraded it from >

RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Johnson, Kirk
Your original code works for me, so it is a config issue somewhere. Add this code to each file, to verify that the session ID is being correctly passed: echo "session id is " . session_id() . ""; Also, is your php.ini in /usr/local/lib? If PHP can't find it, it will use its built-in defaults, wh

RE: [PHP] Debugging a Session Problem

2003-07-25 Thread Johnson, Kirk
Sorry, I am stumped. I don't see any problems in the .ini file. Have you tried some simple code in "register_globals off" style? "; ?> Kirk > -Original Message- > From: Lee Stewart [mailto:[EMAIL PROTECTED] > Sent: Friday, July 25, 2003 4:27 PM > To: [EMAIL PROTECTED] > Subject: RE: [

RE: [PHP] Debugging a Session Problem

2003-07-28 Thread Johnson, Kirk
Anything in the Apache or PHP error logs? Permissions are OK, there is space on the drive? Kirk > -Original Message- > From: Lee Stewart [mailto:[EMAIL PROTECTED] > Sent: Friday, July 25, 2003 6:00 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] Debugging a Session Problem > > > Using t

RE: [PHP] Debugging a Session Problem

2003-07-31 Thread Johnson, Kirk
df shows the file > system only > 70% full... > > At 08:38 AM 7/28/2003, Johnson, Kirk wrote: > >Anything in the Apache or PHP error logs? Permissions are > OK, there is space > >on the drive? > > > >Kirk > > > -- > Lee Stewart, Senior

RE: [PHP] session bug or feature

2003-08-14 Thread Johnson, Kirk
Under 4.3.2, and register_globals on, $foo and $_SESSION["foo"] both contain a reference that points to the same memory location. So, assigning to either one effectively causes the same assignment in the other. If you can't turn register_globals off, consider making a copy of $_SESSION at the top

RE: [PHP] session bug or feature

2003-08-14 Thread Johnson, Kirk
> > session_start(); > > // lets say this equals "bar" and it was set on a previous page > $_SESSION["foo"]; > > $foo = "rab"; > > > echo $_SESSION["foo"]; > > ?> > > The problem is, when I set the global variable $foo="rab", > when I echo the > session variable $_SESSION["foo"], it output

RE: [PHP] Removing empty array values.

2003-08-18 Thread Johnson, Kirk
> On Mon, 18 Aug 2003 08:03:25 -0400, you wrote: > > >How do I remove empty array values? This will remove the empty values and re-index the array so there are no "holes". $new_array = array_values($old_array); Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

RE: [PHP] How to detect if a cookie is set?

2003-03-21 Thread Johnson, Kirk
> Hi I'm trying to make a script that first figures out if a > cookie is set, if > not,do this, if so, do that. > > Can I use: > > Isset($HTTP_COOKIE_VARS['nick'] or what should I use? Yes. If you have PHP 4.1.0 or higher, you can also use the recommended $_COOKIES['nick']. Kirk -- PHP Gener

RE: [PHP] What am I not understanding about $GLOBALS['myvar'] vs global $myvar?

2003-03-26 Thread Johnson, Kirk
I think you either want to use no quotes or double quotes, but not single quotes. Double quotes will interpolate the variable, single quotes will not, i.e. $key becomes a string literal rather than a variable. No quotes will work, although the docs seem to indicate it is deprecated syntax. Not ever

RE: [PHP] Checking a string for # of charactors.

2003-03-28 Thread Johnson, Kirk
http://www.php.net/manual/en/function.strlen.php Kirk > I would like to check that a string as more than 20 > charactors in it. Can > someone point me in the right direction. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] str_replace() problem

2003-03-31 Thread Johnson, Kirk
You could replace the longer one, "Blueberry", first. Then, the only remaining occurrences of "Blue" will be ones that you really want. Kirk > I am performing a str_replace() on a large string, and > everything works > fine, except that two of the elements I'm searching for (and > replacing)

RE: [PHP] Session Question

2003-05-29 Thread Johnson, Kirk
> SInce register_globals() is ON on my server, I need to be able to > figure out a way to ensure session security. The single most important thing to do is initialize all your variables. The way to ensure that you have done that is to set the error reporting level to "E_ALL" (which is max). The

RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Johnson, Kirk
> One thing I'd like to abundantly point out is that NOT > EVERYTHING BELONGS IN > OOP! For instance, if you're building classes that output > HTML - you've > skipped a few chapters in your OOP design books. Joe, I am curious about this opinion, could you elaborate a bit, please? I am not an OO

RE: [PHP] php session not persisting

2003-06-04 Thread Johnson, Kirk
> Thanks. I'm using PHP-4.3.1. > > The problem is not with $_SESSION. I used > session_is_registered("sess_var"); > to check from the second script and cannot see the > variable("sess_var"). Can > anyone tell me why? Your code should work for register_globals "on". Check that: - php.ini is whe

RE: [PHP] php session not persisting

2003-06-04 Thread Johnson, Kirk
Set your error reporting to E_ALL, to see if anything else is going on. Add this line right after session_start() in both files, to make sure the session ID is getting passed correctly. The same ID should be displayed in both files: echo "ID = " . session_id() . ""; > -Original Message-

RE: [PHP] Re: Using register_globals [ note on multi-developer env ]

2003-06-05 Thread Johnson, Kirk
> -Original Message- > From: Jay Blanchard [mailto:[EMAIL PROTECTED] > In the corporate environment with multiple developers we have to > initialize every variable (it's a rule). We even scan code once a day > for variables that have not been declared. It's part of our > documentation. J

[PHP] Migrating pre-4.1 code to a post-4.1 server with register_globals on

2003-06-19 Thread Johnson, Kirk
A heads-up to those who are moving old code with register_globals "on" to a server with a newer PHP version and register_globals still "on": In the old days, the rule was simple. For a session variable, whatever value was in the global variable at the end of the script was what was saved to the se

RE: [PHP] Migrating pre-4.1 code to a post-4.1 server with regist er_globals on

2003-06-20 Thread Johnson, Kirk
> -Original Message- > From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] > Sent: Friday, June 20, 2003 2:57 AM > To: Johnson, Kirk; [EMAIL PROTECTED] > Subject: RE: [PHP] Migrating pre-4.1 code to a post-4.1 server with > regist er_globals on > > > > -

RE: [PHP] SQL injection

2003-06-23 Thread Johnson, Kirk
> Hi, > Is there any way, doc, article, example, idea, suggestion to how to > prevent sql injection on php sites... http://www.nextgenss.com/papers/advanced_sql_injection.pdf http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf Kirk -- PHP General Mailing List (http://www.php.net/)

RE: [PHP] Re: correct session format?

2003-06-23 Thread Johnson, Kirk
> So what is the diffirent between : > session_start (); > $_SESSION['eventid'] = 'arma2'; > and > session_start (); > session_register('arama2'); Use the first method to create session variables when register_globals is "off" in the php.ini file. Use the second method when it is "On". http://

RE: [PHP] Problem with GET variables

2003-06-23 Thread Johnson, Kirk
Set register_globals to "On" in php.ini. Kirk > -Original Message- > From: Sid [mailto:[EMAIL PROTECTED] > Sent: Monday, June 23, 2003 3:52 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Problem with GET variables > > > Hello, > > I just updated PHP on my local computer from PHP 4.0.2 to

RE: [PHP] New way to make select boxes auto select

2002-07-25 Thread Johnson, Kirk
Nathan, this is a new idea to me and very interesting. Do you know what happens here if the error reporting is set to max? Are a bunch of "unitialized variables" warnings issued? Thanks for contributing this to the list. Kirk > -Original Message- > From: Nathan Cook [mailto:[EMAIL PROTE

RE: [PHP] Re: Dynamically check radio buttons

2002-08-01 Thread Johnson, Kirk
If you made an array for your buttons, then you could use PHP's looping constructs to process the array. Write the input tag like this: Chicago The processing code will then have access to the array $Game indexed by the game number, e.g., $Game[1]. Good luck! Kirk > -Original Message

RE: [PHP] Php lib?

2002-08-12 Thread Johnson, Kirk
> Anyone got any handy hints on how to convert scripts running > on PHP3 and > PHPlib? 1. Roughly speaking, page_open() goes to session_start(): Old: page_open(array("sess" => "my_web_Session")); New: session_start(); 2. page_close() goes away; if you don't have time to remove all those calls

RE: [PHP] Re: Sessions...

2002-08-15 Thread Johnson, Kirk
> Kondwani Spike Mkandawire wrote: > > Am I mistaken to assume that a Session is automatically > > destroyed if a Window Browser is closed? *Eventually* it is destroyed, but not at the instant the browser is closed. See the session.gc_maxlifetime and session.gc_probability settings in php.ini. If

RE: [PHP] Project Suggestions

2002-09-04 Thread Johnson, Kirk
> Things I want to do: > > - convert this site into a dynamic one, where I can very easily > change the layout of things whenever it comes time to revamp > the site into a new design. I have not worked with any of the templating systems, but here is a home-grown one. Separate

RE: [PHP] Re: unless something...

2002-09-12 Thread Johnson, Kirk
There is no 'unless' in PHP, so you just have to grind it out. If you are searching for known strings, rather than string *patterns*, use the strstr() function here: http://www.php.net/manual/en/function.strstr.php. So, something like: if(!strstr($c,$a) && !strstr($c,$b)) { bla; exit; } Com

RE: [PHP] Re: unless something...

2002-09-12 Thread Johnson, Kirk
Indeed, it is a negated something or other. > -Original Message- > From: David Buerer [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 11:23 AM > To: '[EMAIL PROTECTED]' > Subject: RE: [PHP] Re: unless something... > > > True, but isn't unless just a negated while? -- P

RE: [PHP] "global" AND Register Globals with PHP 4.0.6 ??

2002-10-14 Thread Johnson, Kirk
register_globals() adds a variable to the *session*. The global statement brings a global variable into the *scope* of a function. Kirk > What is the difference? > > > variable. I read that "register globals" has some security > > issues. Are > > > these the same, or is setting a variable as

RE: [PHP] pass globals to functions???

2002-10-24 Thread Johnson, Kirk
"; } function test2() { echo "foo is {$GLOBALS['foo']}"; } ?> Kirk > Some have eluded to this but I haven't seen a working > example. I would like > to declare globals in my main script and then inside > functions that need > these globals just somehow use the $GLOBALS or something to >

RE: [PHP] extract($_POST)

2002-10-25 Thread Johnson, Kirk
> And what should these precautions be? If a malicious user can submit > his own form and you are looking for a POST variable, how can you > ensure that $admin came from your form and not that user's? The problem is when a cracker uses form variables in an attempt to set the values of "flag" v

[PHP] Apache 2 and PHP

2002-11-07 Thread Johnson, Kirk
Last I heard, PHP and Apache 2 were not yet ready for production environments. Are there any further updates? What is the best way to keep up on the status of this? Any good sites in particular? TIA Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

RE: [PHP] Apache 2 and PHP

2002-11-07 Thread Johnson, Kirk
Thanks for your reply, Davy. We are running *nix boxes, so I don't have any thoughts on XP and Apache. Kirk > -Original Message- > From: Davy Obdam [mailto:info@;davyobdam.com] > Sent: Thursday, November 07, 2002 3:29 PM > To: Johnson, Kirk; [EMAIL PROTECTED] > Subje

RE: [PHP] the ?PHPSESSID=spoofme 'bug'

2002-06-11 Thread Johnson, Kirk
OK, I have questions. A session *file* is created, but it is empty. I know of only one way to get data into it, that is through a session variable. Session variables are controlled by the programmer, so unless the programmer is careless with their validation or register_globals setting, I don't s

RE: [PHP] sessions trouble

2002-06-18 Thread Johnson, Kirk
Check the register_globals setting in php.ini. It looks like it is "on" on the problem server. If so, then you have two choices: 1. Turn it "off" 2. Change your code to this style: session_start(); $node = 10.2; session_register('node'); echo $node; Kirk > -Original Message- > From: Les

RE: [PHP] sessions trouble

2002-06-18 Thread Johnson, Kirk
Is your version of PHP new enough to support the new $_SESSION[] array? If it is not, use $HTTP_SESSION_VARS[]. > -Original Message- > From: Leston Drake [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 18, 2002 12:29 PM > To: Johnson, Kirk > Cc: [EMAIL PROTECTED] >

RE: [PHP] sessions trouble

2002-06-18 Thread Johnson, Kirk
[EMAIL PROTECTED]] > Sent: Tuesday, June 18, 2002 3:30 PM > To: Johnson, Kirk > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] sessions trouble > > > > I am using PHP 4.1.2, which I assume supports the $_SESSION > global array. > I've tried ...sigh... using

RE: [PHP] Netiquette

2002-06-20 Thread Johnson, Kirk
Foul! Top-post ;) *gives Ed a noogie* > Concise is also good ;) > > *gives Erik a noogie* > > Erik wrote: > > I was going to stay out of the thread, because people have > > ways of doing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] tracing include

2002-06-21 Thread Johnson, Kirk
You could look at $HTTP_SERVER_VARS['SCRIPT_NAME'] in the included file, for one. Kirk > Hi, is there any way to know in the included file the filename of the > parent file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] function definition causing problems?

2002-06-24 Thread Johnson, Kirk
> Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\inetpub\wwwroot\PHP\cat_proto3.php on line 46 > Line 46 corresponds to the form tag, as follows: > > When you echo out an array element, the name needs to be enclosed in c

RE: [PHP] function definition causing problems?

2002-06-24 Thread Johnson, Kirk
I thought this syntax, an unquoted key name, was deprecated ;) >From the manual at http://www.php.net/manual/en/language.types.array.php: "You should always use quotes around an associative array index." Kirk > Nope, use: > > echo "This script is called $_SERVER[PHP_SELF]"; -- PHP General M

RE: [PHP] How to use Session Variables

2002-07-01 Thread Johnson, Kirk
With register_globals on: 1. Put session_start() at the top of each page. 2. Initialize the variable, then call session_register(): $foo = 'bar'; session_register('foo'); 3. Do all assignments to $foo, not $HTTP_SESSION_VAR['foo'], since $foo gets written to $HTTP_SESSION_VAR['foo

[PHP] gc_probability: requests tallied per server or domain?

2002-07-02 Thread Johnson, Kirk
Is the number of requests (used for garbage collection), tallied on a per server basis, or on a per domain basis? What about in a load-balanced environment? TIA Kirk "0, as a number, is just as important as any other number." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

RE: [PHP] Need Help with $_SESSION.

2002-07-03 Thread Johnson, Kirk
> Now, I still can not understand why the 2nd page show the $_SESSION as > blank. It is suppose to contain datas. The php.net stated > that $_SESSION > is global. Any comments? register_globals on --- Page 1 Page 2: register_globals off Page 1: Pag

RE: [PHP] gc_probability: requests tallied per server or domain?

2002-07-05 Thread Johnson, Kirk
> On Tue, 2 Jul 2002, Johnson, Kirk wrote: > > Is the number of requests (used for garbage collection), tallied on a per > > server basis, or on a per domain basis? > Pretty fair bet it's a per-server basis. > > miguel Thanks, miguel. That would be my guess, t

RE: [PHP] Sessions / logins / cookies / security

2002-07-16 Thread Johnson, Kirk
> What I'm looking to do is when a user logs in, I start up the > session.. I > then have the registered session var to verify they are > authenticated as > they move throughout the site. > > Now, when they close the browser and come back, I want them > to still be authenticated. I don't thi

RE: [PHP] Do not use Apache 2.0 and PHP in a production environme nt neither on Unix nor on Windows.

2003-10-02 Thread Johnson, Kirk
> -Original Message- > From: Dave Restall - System Administrator [mailto:[EMAIL PROTECTED] > how long it will be before PHP/Apache 2 is considered stable > enough to be > used in a production environment ?. Below is how Rasmus answered this question back on 7/4/03. Kirk >> Apache2 has

RE: [PHP] LiteSpeed Web Server 1.1

2003-10-08 Thread Johnson, Kirk
> > No doubt, Apache is a good web server, everyone use it. ;-) > > What the heck? Is this thread headed somewhere? Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] magic_quotes_gpc and \

2003-10-10 Thread Johnson, Kirk
> If I have a form that POSTS a textarea that contains PHP > code. Say some > code that contains legitimate escapes \ like: > > echo "http://somewhere.com\";>Click"; > > When the data is posted and received in the destination > script, additional > escapes \ are added. So how do I get to the

RE: [PHP] References and memory efficiency

2003-11-03 Thread Johnson, Kirk
> I've been working on a database wrapper class for a while > now, MySQL to > be specific. Until now, I've simply had a fetch function > that returned > an array of all the rows that the database returned, only > because I have > gotten so tired of always writing the same while loop to > it

RE: [PHP] session variables scope problem. HELP!

2003-11-13 Thread Johnson, Kirk
> It seems that once a session is started and variables set, I > can access the > variables on the page on which they are set, but on > subsequent pages via > link or Header redirect the session variables are not set and > cannot be > accesses. Be sure you have session_start() at the top of *al

RE: [PHP] upload file size

2003-11-14 Thread Johnson, Kirk
> this could really kill my bandwidth. is there a way to check > the file size > without fully uploading the file? Although it has been called an "urban legend" :), you could try the old MAX_FILE_SIZE trick. For this, add a hidden tag before the tag: This is an instruction to the browser to r

RE: [PHP] what ever happened to http referrer

2003-11-18 Thread Johnson, Kirk
> I'm running php 4.3.4 and do not see any mention of HTTP_REFERRER. I > tried $_SERVER['HTTP_REFERRER'] which is what I thought it > was but to no > avail. > > Any comments on the location/status of this? You spell too well, try "HTTP_REFERER", without the double "R" ;) Kirk -- PHP General

RE: [PHP] echo or print

2003-11-20 Thread Johnson, Kirk
> when should i use echo ' '; vs. print ' '; Here's a link listed in the manual at http://www.php.net/manual/en/function.print.php http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.

RE: [PHP] Intuitive Interfaces

2003-11-25 Thread Johnson, Kirk
Cesar Cordovez wrote: > Chris Shiflett wrote: >> Some Web sites I have visited think it is helpful to use some >> client-side scripting to move the focus from the first text field to >> the second after three numbers have been entered. > > I think this is the worst thing to do. If they are going

[PHP] Problem using META tag refresh for page re-directs

2001-02-22 Thread Johnson, Kirk
I have been using the code below to do my page redirects for a year and a half with good results. Recently, some users have reported to me that the actual code is being partially displayed to the screen, and the re-direct is not occurring. It is as if the server stops serving the page before it is

RE: [PHP] Problem using META tag refresh for page re-directs

2001-02-22 Thread Johnson, Kirk
x.php"); exit(); ?> and youve got a great cobination, zero html will be sent to the browser, just the header, the browser will refresh for you. try it, works better then meta tags. ""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">ne

RE: [PHP] isset()

2001-02-26 Thread Johnson, Kirk
Wow, I hope you all will forgive me for one last go around on this thread :) Technically, what does "set" mean? It is not the same as "is registered" or "has a value", right? What is "is set"? Is it "introduced to the global namespace"? TIA Kirk >Except that it will throw a warning in PHP4 if

RE: [PHP] Table looking odd as a result of while loop?

2001-02-26 Thread Johnson, Kirk
Is it because 1 % 3 is 0 with a remainder of 2? Looks like the code is doing just what it is written to do. The "if" evaluates to true on the second picture. Kirk -Original Message- From: James, Yz [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 2:55 PM To: [EMAIL PROTECTED] S

RE: [PHP] exchange data between javascript & php!

2001-02-28 Thread Johnson, Kirk
I know of two ways to pass data from PHP to JavaScript. 1. Do an "echo" in the JS function definition: function myJavascriptFunction() { var foo = ; } 2. Assign the PHP variable to a HIDDEN element, then access this from JS: function myJavascriptFunction () { document.forms[0].som

RE: [PHP] Rounding to strange results

2001-03-06 Thread Johnson, Kirk
Is there a comma in one thousand, e.g., 1,000.00? round() will truncate everything to the right of a comma. Kirk -Original Message- From: Martin E. Koss [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 7:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Rounding to strange results Hi,

RE: [PHP] Netscape problems with PHP

2001-03-06 Thread Johnson, Kirk
Robert, can you (or anyone else) describe further the problem with Netscape and $PHP_SELF? This sounds a little worrisome to me! TIA Kirk -Original Message- From: Robert Fischler, Ph.D. ABD [mailto:[EMAIL PROTECTED]] Sent: Friday, March 02, 2001 5:00 PM To: [EMAIL PROTECTED] Subject: [P

RE: [PHP] RE: Value of if(isset(X)) problem

2001-03-07 Thread Johnson, Kirk
Tim, I just tried this in IE 5.0, and the submit button name-value pair was posted along with the other form variables, even though I submitted the form by hitting return on another field. Is the behavior you described specific to a certain browser version? Kirk -Original Message- From:

[PHP] over riding magic_quotes_sybase with ini_set()

2001-03-12 Thread Johnson, Kirk
Does anyone know if it is possible to override the php.ini setting for magic_quotes_sybase, using the ini_set() function? I have tried both of the following without success: ini_set("magic_quotes_sybase",1); and ini_set("magic_quotes_sybase","On"); I am trying to enable it for a particular app

RE: [PHP] Getting name of the main file from external included script..

2001-03-13 Thread Johnson, Kirk
Aviv, I'm not quite sure what you are asking. If you are just doing an include() or a require() on a chunk of code, then I think the usual server variables will give you the path of the main file, e.g. $PHP_SELF. If you are doing a *redirect* to a *different page*, then you could look at $HTTP_REF

RE: [PHP] Using php to get javascript varibles

2001-03-14 Thread Johnson, Kirk
1. Do an "echo" in the JS function definition: function myJavascriptFunction() { var foo = ; } 2. Assign the PHP variable to a HIDDEN element, then access this from JS: function myJavascriptFunction () { var foo = document.forms[0].somePhpVariable.value; } Kirk -Original Mess

RE: [PHP] [Q] session variables wouldn't keep contents.

2001-03-14 Thread Johnson, Kirk
> -Original Message- > From: Chung Ha-Nyung [mailto:[EMAIL PROTECTED]] > > My second example program. > a.php > session_start(); > session_register("name"); > $HTTP_SESSION_VARS["name"] = "test"; > > echo session_encode(); > ?> > a.php > result is as following. >

RE: [PHP] Sessions, no cookies, enable-trans-sids, no success

2001-03-14 Thread Johnson, Kirk
Eric, I gotta ask the obvious question: did you have cookies disabled in your browser when you were checking this out? PHPSESSID only gets appended when cookies are disabled. If that is not the problem, I have no suggestions. Works for me as advertised. Kirk > -Original Message- > From:

RE: [PHP] Will my script run after redirect?

2001-03-15 Thread Johnson, Kirk
This will work fine. The script will continue to run after the meta refresh unless the exit is there. > -Original Message- > From: Carfield Yim [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 3:24 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Will my script run after redirect?

RE: [PHP] separate php.ini files

2001-03-15 Thread Johnson, Kirk
We just started doing this using Apache's virtual hosting and .htaccess files to alter php.ini's configuration settings on a per application basis. Haven't played with it much yet, tho. Looks good so far. > -Original Message- > From: Kevin Porter [mailto:[EMAIL PROTECTED]] > Subject: [PHP

RE: [PHP] Variable value doesn't stay "Null"

2001-03-15 Thread Johnson, Kirk
You may want to check the field definitions in the database table. If I recall correctly, some MySQL numeric field types default to "0" when an empty string gets written to them. The problem (and solution) may not be in the PHP script at all. Kirk > -Original Message- > From: Michael Con

RE: [PHP] Help! Can't redeclare already declared function in

2001-03-15 Thread Johnson, Kirk
Are the functions declared in an include()'d file? Is this file being include()'d more than once? That's how I usually provoke this error :) Kirk > -Original Message- > From: Jack Sasportas [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 1:25 PM > To: php > Subject: [PHP] Hel

RE: [PHP] How do you keep your scripts secure?

2001-03-15 Thread Johnson, Kirk
If the include file has an extension that is not recognized by the server as being a "PHP" file, the server will simply serve it up as text. So, your file index.php is recognized as being a PHP file, it gets passed to PHP which parses and compiles it and returns it to the server, which passes the

[PHP] Can CONSTANT's be made persistent?

2001-03-16 Thread Johnson, Kirk
Can a defined()'d CONSTANT be made persistent between pages? According to my experiments, the answer is "no". Am I missing something? TIA Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To conta

RE: [PHP] how do i get a variable type? - not that simple

2001-03-18 Thread Johnson, Kirk
How about a regex check for numeric characters with and without a decimal point (and no leading zeros), versus alphanumerics? Just an "off the top of my head suggestion", back to work... Kirk > -Original Message- > > ""phpman"" <[EMAIL PROTECTED]> wrote in message > 99132e$ol8$[EMAIL PR

RE: [PHP] first three characters

2001-03-19 Thread Johnson, Kirk
substr() http://www.php.net/manual/en/function.substr.php Kirk > -Original Message- > From: Rahul Bhide [mailto:[EMAIL PROTECTED]] > Sent: Sunday, March 18, 2001 11:02 PM > To: [EMAIL PROTECTED] > Subject: [PHP] first three characters > > > Gurus, > How do I extract the first n ch

RE: [PHP] use strict alternative

2001-03-19 Thread Johnson, Kirk
I think there is an error_level you can set that will warn about using *undefined* variables before they have been assigned a value. Don't recall the details offhand. Kirk > -Original Message- > From: Christian Reiniger [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 5:37 AM >

RE: [PHP] how do i get a variable type? - not that simple

2001-03-19 Thread Johnson, Kirk
Jim, Thanks for sharing all your hard work. Have you seen checkdate()? http://www.php.net/manual/en/function.checkdate.php Kirk > -Original Message- > From: Ide, Jim [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 6:38 AM > To: 'phpman'; [EMAIL PROTECTED] > Subject: RE: [PHP]

RE: [PHP] math query

2001-03-19 Thread Johnson, Kirk
do an ereg_replace("[^0-9]","",$var) before the calculation, to remove all non-numeric characters. kirk > -Original Message- > From: Peter Houchin [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 4:13 AM > To: Php-General@Lists. Php. Net > Subject: [PHP] math query > > > hiya,

  1   2   3   4   >