Re: [PHP] Problem with PHP 4.0.5

2001-05-07 Thread Philip Olson
1. What file extension are you using for your test file? 2. Is this extension found around httpd.conf in a form similar to : AddType application/x-httpd-php .php .php3 .html .phtml .parsemephp When you stated "All works ok except ..." what works ok? Regards, Philip On Mon, 7 May 2001, Alva

Re: [PHP] Need help with Database and variables

2001-05-08 Thread Philip Olson
You need to fetch/get information out of the database using a function, since we want just one result (count) we can easily use mysql_result() Other functions that you're probably familiar with are mysql_fetch_row and mysql_fetch_array ... they'll work too but in this case, not as efficiently.

Re: [PHP] Safe mode upload

2001-05-08 Thread Philip Olson
Awhile ago there was some discussion on irc #php , this use was proposed (by onki) : $tmp_name = $HTTP_POST_FILES['userfile']['tmp_name']; move_uploaded_file ($tmp_name, '/home/httpd/html/upload/example.zip'); chmod('/home/httpd/html/upload/example.zip', 0644); And it works. move_upl

Re: [PHP] Little question

2001-05-09 Thread Philip Olson
this : if ... $myOra="" ... should be more like : if ... $myOra == "" ... essentially you're setting $myOra as blank everytime which evaluates to true, then it ends up printing the blank, which is not good. regarding typos, this is a common one and since it reveals no error ... it can be f

Re: [PHP] user authentication

2001-05-09 Thread Philip Olson
try : http://www.zend.com/zend/tut/authentication.php regards, philip On Wed, 9 May 2001, Jerry Lake wrote: > Does anyone know of a good user authentication/sessions > tutorial for php 4? I've looked through the ones at phpbuilder > and they are not quite as in-depth as I would like. > > J

Re: [PHP] PC MAG article

2001-05-09 Thread Philip Olson
for informational purposes, it can be seen here : http://www.zdnet.com/pcmag/stories/reviews/0,6755,2713481,00.html no comment. :) regards, philip On Wed, 9 May 2001, Mike wrote: > As a devoted php programmer I was surprised how bad PC MAG blasted php this > month.It sound as if it doesnt

Re: [PHP] Documentation

2001-05-11 Thread Philip Olson
http://uk.php.net/mirrors.php regards, philip On Fri, 11 May 2001, Don Pro wrote: > Does anyone know alternative sites for PHP documentation? > > www.php.net seems to be down. > > Thankls, > Don > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL

Re: [PHP] Site search engine suggestion.

2001-05-12 Thread Philip Olson
You may also find this interesting : http://php.net/manual/en/ref.mnogo.php >From php changelog 4.0.5 : Added mnoGoSearch extension - http://search.mnogo.ru. (Sergey K) regards, philip On Sat, 12 May 2001, Ethan Schroeder wrote: > Wow, thanks for the heads up =) > > Ethan Schroeder

Re: [PHP] check if a variable is in a number of states.

2001-05-12 Thread Philip Olson
Here's an appropriate example, one of a few ways you may do it : $state = 'Wa'; $state = trim(strtoupper($state)); $states = array('WA' => 'Washington', 'OR' => 'Oregon', 'ID' => 'Idaho'); if (in_array($state, array_keys($states))) { echo "you chose {$states[$state]}, a state in

[PHP] php propaganda request

2001-05-15 Thread Philip Olson
Greetings PHP friends, I'm compiling a list of PHP related propaganda, please send any that you know of. Positive, Negative, Neutral ... all is welcome! ;-) Thus far : Stats : ---

Re: [PHP] free php/mysql hosting

2001-05-15 Thread Philip Olson
See the following : Where can I find some free hosting space by an ISP offering PHP. http://www.faqts.com/knowledge-base/view.phtml/aid/4058/ regards, philip On Tue, 15 May 2001, Christian Dechery wrote: > Does anyone knows any good free php/mysql hosting other than www.f2s.com?? >

Re: [PHP] Re: Generate Alphabet

2001-12-27 Thread Philip Olson
> This will only work with PHP 4.1.0 or later. Consider this example: $letter = 'a'; $i = 0; while ($i++ < 26) { print "Letter: ". $letter++ ."\n"; } regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAI

Re: [PHP] Re: Generate Alphabet

2001-12-27 Thread Philip Olson
> I seriously doubt your code works -- have you tested it? I think the code > you submitted will most probably output "1 2 3 4...24 25 26" (spaces are > actually \n's). I never tested it though, so I may be mistaken. Yes, it works. Test it before posting such doubts :

Re: [PHP] printing php variable into html > print $result; ?

2002-01-03 Thread Philip Olson
here: http://www.php.net/manual/en/language.types.resource.php Regards, Philip Olson On Fri, 4 Jan 2002, louie miranda wrote: > Hi, is it possible to print the sql query? i mean > i want to print the output of the command "SELECT * FROM members;" > and output it into html, i

RE: [PHP] quick question

2002-01-11 Thread Philip Olson
a]"; // an apple As are: print "an {$arr['a']}"; // an apple print "an ". $arr['a']; // an apple Anyway, maybe that helps explain a few things :) Regards, Philip Olson -- 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] PHP question regarding Cold Fusion

2002-01-11 Thread Philip Olson
iation being sendtohost() http://dodds.net/~cardinal/sendtohost.txt regards, Philip Olson -- 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] strtok bug

2002-01-13 Thread Philip Olson
Are you referring to the change with 4.1.0 that's documented in the manual? Have another look, it gives examples of new/old behavior: http://www.php.net/strtok Regards, Philip Olson On Sun, 13 Jan 2002, Robert Mena wrote: > Hi, does anybody know when the strtok bug introduced &g

Re: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Philip Olson
This is documented now which is as best we can do at this point. That and clearly document all BC breaks in the future. I vow to help on the documentation end. Regards, Philip Olson On Mon, 14 Jan 2002, Manuel Lemos wrote: > Hello, > > I don't disagree, but the fact is that d

Re: [PHP] Writing Array to File w/o blank lines

2002-01-13 Thread Philip Olson
:) And, use fclose(). Also for good measure, you may want to check if $file is_writable() first. Regards, Philip Olson p.s. Please keep questions to one thread. On Sun, 13 Jan 2002, Andrew V. Romero wrote: > I have been working on a script that manipulates arrays and now I am > working

Re: [PHP] Variable Problem

2002-01-18 Thread Philip Olson
es which include while/list alternatives: http://www.php.net/manual/en/control-structures.foreach.php Your question was answered below but I couldn't resist throwing in a little array propaganda, jic :) Arrays work great in forms too! http://www.php.net/manual/en/faq.html.php#AEN73718 Re

RE: [PHP] Variable Problem

2002-01-19 Thread Philip Olson
.variables.predefined.php That page is in Japanese, hope it makes sense to you as it sure doesn't to me :) Regards, Philip Olson On Sat, 19 Jan 2002, Steven Maroney wrote: > > I hope im on the right track Cause im jumping in on this post. > > $MYCHK isn't an array cau

Re: [PHP] I'm not sure how to do some simple code...

2002-01-26 Thread Philip Olson
Have a look around: http://www.php.net/strip_tags Regarding simple matches, consider: http://uk.php.net/stristr And who knows, maybe you want: http://us.php.net/htmlspecialchars Learn about if/else: http://au.php.net/else Regards, Philip Olson On Fri, 25 Jan 2002, Leif K-Brooks

Re: [PHP] MySQL Fetch_Array VS. Fetch_Object

2002-01-30 Thread Philip Olson
, MYSQL_ASSOC); Or just use mysql_fetch_assoc(). Regarding extract(), if this is the desired affect (as proposed in the original question), then: SELECT foo FROM bar extract($row); print $foo; Now, mysql_fetch_row is _slightly_ faster then both of these but who's counting. Regards, Philip

Re: [PHP] unset a function?

2002-01-30 Thread Philip Olson
This sounds like a job for include_once www.php.net/include_once regards, Philip Olson On Wed, 30 Jan 2002, Bas Jobsen wrote: > Hello, > > I have this: > include("file1"); > function_somename(); > include("file2"); > function_somename(); > ?&g

RE: [PHP] unset a function?

2002-01-30 Thread Philip Olson
> include_once() won't help. In fact, he is including each file only once. > He wants to have a function with the same name in each file. That's the > kicker... oh well that's silly, don't do that. also consider function_exists() regards, Philip Olson -- P

Re: [PHP] Number checker

2002-04-18 Thread Philip Olson
use is_numeric() http://uk.php.net/is_numeric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] replacing first occurence

2002-04-24 Thread Philip Olson
($pos = strpos($str, ',')) !== false) { $str{$pos} = '!'; } print $str;// Hello! I love you!'; print $pos; // 5 print $str{0}; // H print $str{5}; // ! Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] passing array as hidden field

2002-04-24 Thread Philip Olson
ment. Then upon use, either explode or unserialize it. Also consider using urlencode() in addition to one of the above methods. Anyway: $arr1 = explode('|', $vars1); $arr2 = unserialize($vars2); Ah yes, our arrays are back :) Regards, Philip Olson On Wed, 24 Apr 2002, Pushkar Pra

Re: [PHP] how to make array_search start from 0?

2002-04-25 Thread Philip Olson
d from value $findme"; } else { print "Sorry, $findme was not found in array \$fruit"; } Again, remember, 0 == false. == !=, === !==. So, 0 !== false. Wow that sounds confusing. :) Also consider the sexy array_keys() function. Regards, Philip Olson p.s. http://uk.

RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Philip Olson
> To stop receiving the messages from undefined variables add this at top > of your files: > > error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Regards, Philip Olson -- PHP General Mailing List (h

Re: [PHP] Form validation

2002-04-25 Thread Philip Olson
Here are a couple resources to help your cause: http://uk.php.net/strip_tags And to get ideas on how to validate forms intelligently: http://www.zend.com/zend/spotlight/form-pro-php4.php Regards, Philip Olson On Thu, 25 Apr 2002, Tarjei Huse wrote: > Hi, > > I need a fu

Re: [PHP] Opening manual - .bz2

2002-04-26 Thread Philip Olson
Hmm, I swore this was changed back to .tar.gz :) Anyway, read this faq: http://www.php.net/manual/en/faq.misc.php#faq.misc.bz2 Regards, Philip Olson On Sat, 27 Apr 2002, r wrote: > Greetings all, > Special greetings to: > one brainy dude -> Steve, and a REALLLY persistive d

RE: [PHP] Variables not working

2002-04-26 Thread Philip Olson
/language.variables.predefined.php Also consider extract and import_request_variables, I posted a bit about them awhile back here: http://marc.theaimsgroup.com/?l=php-general&m=101803683730027 And when in doubt, send your script to a call of phpinfo() and it'll provide a ton of useful information. Regard

RE: [PHP] Apache: SERVER_NAME gone?

2002-04-27 Thread Philip Olson
because $SERVER_NAME is created IF the php directive register_globals = on. this setting is off by default as of PHP 4.2.0. all server predefined variables behave this way, such as $PHP_SELF, etc. regards, philip On Sat, 27 Apr 2002, John Holmes wrote: > Use $_SERVER["SERVER_NAME"] > >

RE: [PHP] POST/GET is not working for PHP 4.2.0 on W2K AdvancedServer

2002-04-27 Thread Philip Olson
also consider extract or import_request_variables as they can be useful too. regards, philip olson On Sat, 27 Apr 2002, John Holmes wrote: > Register_globals is off by default and you have to use the $_GET and > $_POST arrays for your data. > > ---John Holmes... > > >

RE: [PHP] simplify if/then statement

2002-04-27 Thread Philip Olson
xists, if so, include it else houston we have a problem Regards, Philip Olson On Sat, 27 Apr 2002, Stuart Dallas wrote: > $incfilename = "Calc".$state.".class.inc"; > if (file_exists($incfilename)) > include($incfilename); > else > echo "Pl

Re: [PHP] Apache: SERVER_NAME gone?

2002-04-27 Thread Philip Olson
array of all web server predefined variables. As is $HTTP_SERVER_VARS. At least one of these will always be available (nobody uses 4.0.2- anymore right? Phew, no need to bring up track_vars then :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] apps that need register globals 'on' and others require'off' on same server

2002-04-30 Thread Philip Olson
also: import_request_variables() and extract(). Regards, Philip Olson On 30 Apr 2002, Jeff Bearer wrote: > I have a server where I'm running some third party apps. > > until now I've had register globals 'on', now I have a new app that > requires register globals

Re: [PHP] Help need (Urgent)

2002-05-01 Thread Philip Olson
ou should run des through urlencode() before sending it through the url, or any string for that matter. See: http://www.php.net/urlencode Regards, Philip Olson On Wed, 1 May 2002, Luiz Rafael Culik Guimaraes wrote: > Dear Friends > I have an form that get the user info , and i need to

Re: [PHP] New to PHP - Undefined variable: ??????

2002-05-01 Thread Philip Olson
#x27;; } It's worth mentioning that one can control error levels both at runtime (error_reporting()) as well as in php.ini (.htaccess, etc). Regards, Philip Olson On Tue, 30 Apr 2002, TGL wrote: > I'm new to PHP and can't get through my first script. I want to create a > form

Re: Tr: [PHP] New to PHP - Undefined variable: ??????

2002-05-01 Thread Philip Olson
Some things to consider: a) please read my first post :) (re: isset/empty/error_reporting) b) $FILE != $File != $file (case sensitive) regards, Philip Olson On Thu, 2 May 2002, nico_free wrote: > > - Original Message - > From: nico_free <[EMAIL PROTECTED]> &g

Re: [PHP] Re: getting a function name of the calling function

2002-05-01 Thread Philip Olson
with their older siblings __LINE__ and __FILE__. These are special PHP core reserved/predefined constants. Regards, Philip Olson p.s. Controversy surrounds these magic constants, are they *really* constants? Inquiring minds want to know. :) http://www.php.net/constants --

Re: [PHP] Re: file() and macintosh line break

2002-05-01 Thread Philip Olson
Here's a bug report: file() - incorrect behavior (line endings ignored) on files with Mac EOLN (CR) http://bugs.php.net/bug.php?id=16521 Maybe some kind soul will fix this before PHP 4.3.0 :) http://cvs.php.net Regards, Philip Olson On Thu, 2 May 2002, eat

Re: [PHP] Hashes in strings

2002-05-02 Thread Philip Olson
t work in PHP3 (iirc) $str = "Hello {$there['friend']}, how are you?"; // Concatenation is always a possability $str = 'Hello ' . $there['friend'] . ', how are you?'; Related resources: http://www.php.net/en/language.types.string.php

Re: [PHP] Re: tutorial on global variables

2002-05-02 Thread Philip Olson
tract($HTTP_SERVER_VARS); print 'we just created $REMOTE_ADDR because register_globals is off'; print "\nREMOTE_ADDR: $REMOTE_ADDR"; } else { print 'register_globals is on so $DOCUMENT_ROOT et al already exists'; print "\nDOCUMENT_ROOT: $DOCUMENT

Re: [PHP] Re: tutorial on global variables

2002-05-02 Thread Philip Olson
use .htaccess (or equivalent) with something like: php_flag register_globals on Yes there are a lot of options, variety is the spice of life. Regards, Philip Olson > --- Philip Olson <[EMAIL PROTECTED]> wrote: > > An issue/confusion of register_globals, global, and > >

Re: [PHP] Re: case-insensitive str_replace

2002-05-02 Thread Philip Olson
This is a feature request, see: stri_replace() to compliment str_replace() : http://bugs.php.net/bug.php?id=5919 Regards, Philip Olson On Thu, 2 May 2002, CC Zona wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTE

Re: [PHP] PHP 4.2.0 and $argc/$argv

2002-05-02 Thread Philip Olson
See the register_globals directive. If it is on, $argv will be created. Otherwise it will not. And as we all now know, PHP 4.2.0 defaults register_globals = off. Consider using $_SERVER['argv'] instead. regards, Philip Olson On Fri, 3 May 2002, Andre wrote: > > Is

Re: [PHP] date(), strtotime(), Wed, Dec 31, 1969 ??

2002-05-03 Thread Philip Olson
, in later versions of PHP it does try to do something but not sure exactly what ... yet. I'm assuming it returns -1 for you, in PHP3. Regards, Philip Olson On Fri, 3 May 2002, ROBERT MCPEAK wrote: > Running PHP3 on a Linux box and I've got trouble with date(). > > Here'

Re: [PHP] Register Globals workarounds

2002-05-05 Thread Philip Olson
register_globals, it may or may not be what you want so adjust accordingly. I've posted a few related replies to this topic, see: Re: Using the new AUTOGLOBALS http://marc.theaimsgroup.com/?l=php-general&m=101803683730027 Re: tutorial on global variables http://marc.theaimsgroup.com/?l=php-general&m=102036870428992 Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Grabbing ALL $_POST var at once.

2002-05-06 Thread Philip Olson
x27;bar'); print "I say $bar_name and $bar_doh"; extract() is a pretty cool function with many options, read about extract here: http://www.php.net/extract And as already stated by others, import_request_variables() and $_REQUEST exist too. Regards, Philip Olson On Mon

RE: [PHP] Alternating table rows...

2002-05-10 Thread Philip Olson
= mysql_fetch_assoc($result)) { $bgcolor = $colors[$i++ % 4]; } The first used &, which is a bitwise operator. See also the following faqt: How can I show rows from a database in a table with alternating colors? http://www.faqts.com/knowledge_base/view.phtml/aid/783 Rega

Re: [PHP] Problem with new variable system in 4.2

2002-05-12 Thread Philip Olson
you exactly what is available to the script. And print_r() will also be helpful for various activities too. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] How can obtain referer's name?

2002-05-12 Thread Philip Olson
REFERER even if register_globals = off as it will then be created. See also: http://www.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson > -Original Message- > From: Alex Shi [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 13, 2002 10:48 AM > To: [EM

Re: [PHP] Problem with the double quotes

2002-05-13 Thread Philip Olson
Please read the following: Using Strings in PHP http://www.zend.com/zend/tut/using-strings.php Strings http://www.php.net/manual/en/language.types.string.php Notice stripslashes(), addslashes(), the PHP directive magic_quotes_gpc and the use of ' vs ". Regards, Philip

Re: [PHP] help with undefined variables, please

2002-05-14 Thread Philip Olson
nd variables. See: http://www.php.net/manual/language.operators.errorcontrol.php What is done of course depends on the situation and the person. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] variable for $_GET or $_POST

2002-05-14 Thread Philip Olson
see also: $_REQUEST, extract() and/or import_request_variables() Regards, Philip Olson On 14 May 2002, Jeff Bearer wrote: > Quick question if I'm programming with register globals off, and want to > get a variable that is allowed to be set with either a GET or POST > meth

Re: [PHP] Accessing Variables by Name

2002-05-14 Thread Philip Olson
These are called variable variables, and can be read about here: http://uk.php.net/manual/en/language.variables.variable.php Replace your [ ] with { } and you'll be good to go. Regards, Philip Olson On Tue, 14 May 2002, Steven Walker wrote: > Hi, > > I couldn'

Re: [PHP] PHP 4.2x changes

2002-05-14 Thread Philip Olson
On Tue, 14 May 2002, Rasmus Lerdorf wrote: > Turn on register_globals in your php.ini file and things should start > working again. That reply was way too short and easy ;) > On Tue, 14 May 2002, Weston Houghton wrote: > > > > > All, > > > > I've recently upgraded from 4.1.2 to 4.2.0. And of c

Re: [PHP] mysql_fetch_array errors

2002-05-20 Thread Philip Olson
A key to understanding your mysql errors is by using the mysql_error() function. It's wonderful! Here's a simple example with a little error checking: Regards, Philip Olson On Sun, 19 May 2002, Justin Latham wrote: > I am trying to clone my webserver because I am switch

Re: [PHP] Problem : track_vars stopped working.

2002-05-22 Thread Philip Olson
_globals in the PHP manual. http://www.php.net/manual/ Regards, Philip Olson On Wed, 22 May 2002, [Windows-1252] Johan Ekström wrote: > Okay, mystery to me, when I installed PHP 4.2.1 on Apache 2.0.35, the track_vars >function, stopped working. > > a simple command like, example

RE: [PHP] Problem : track_vars stopped working.

2002-05-22 Thread Philip Olson
_globals one might use $foo, but if the cookie does not exist a user could pass a get variable $foo through the url ... Just a simple example :) The following post might help clear things up regarding superglobals, variable scope, and register_globals: http://marc.theaimsgroup.com/?l=php-ge

Re: [PHP] How to get contents of symbol table?

2002-05-22 Thread Philip Olson
See: http://www.php.net/get_defined_vars Regards, Philip Olson On Thu, 23 May 2002, William_dw -- Sqlcoders wrote: > Hi there!, > I'm looking for a way to loop through the symbol table. > > In other words I want to be able to loop through every variable defined in

Re: [PHP] Can I delete / update line inside the file ?

2002-05-22 Thread Philip Olson
where you'll implode by "\n". Regards, Philip Olson > > > manisha > > At 04:59 AM 5/23/02 +0300, you wrote: > >Get a database working! That's definitely worth investing some time in - > >apart from the obvious speed avdantages, you'd learn a lot.

Re: [PHP] ini-options

2002-05-23 Thread Philip Olson
> if only there were, 'get_magic_quotes_sysbase();' happy birthday ;) function get_magic_quotes_sybase() { if (!ini_get('magic_quotes_sybase')) { return 0; } else { return 1; } } feature requests can be submitted at: http://bugs.php.net/

Re: [PHP] dynamically named variables?

2002-05-23 Thread Philip Olson
> extract($_POST, EXTR_PREFIX_ALL, 'file_'); A little typo, extract() automatically attaches a '_' so the third parameter here would be just 'file'. This behavior is unlike import_request_variables() and I assume the behavior remains for historical reas

Re: [PHP] the new variables

2002-05-23 Thread Philip Olson
rint $r_var; But it depends, going through predefined variables everytime can be fun too. Regards, Philip Olson On Thu, 23 May 2002, Tyler Longren wrote: > Hi, > > Just to prevent a bunch of non-helpful e-mails, I've already RTMF! > > Now, to the point. When using the

RE: [PHP] listing the files in the directory

2002-05-24 Thread Philip Olson
make $dir a local directory, try for example: $dir = '.'; regards, Philip Olson On Fri, 24 May 2002, _michael wrote: > well do you think you can point me in the right direction to listing the > files on my site? - is it possible (as i said i am very new to t

Re: [PHP] HELP!!! QUOTES!

2002-05-24 Thread Philip Olson
Read a tutorial about using strings here: http://www.zend.com/zend/tut/using-strings.php The manual also talks about them: http://www.php.net/manual/en/language.types.string.php Regards, Philip Olson On Fri, 24 May 2002, Shane wrote: > Question Please. > > What is the s

Re: [PHP] 4.2.1 Vars

2002-05-26 Thread Philip Olson
, such as $HTTP_GET_VARS. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] arrays

2002-05-26 Thread Philip Olson
hidden, text, textarea ... doesn't matter. d) a way to test if what _should_ be an array is really an array is with print_r() and/or is_array(). print_r($arr); e) we don't need urldecode() because that'll happen automatically when going through the form. f) you coul

Re: [PHP] php3 / php4 vars - Submitted form doesn't work

2002-05-29 Thread Philip Olson
ugs.php.net/bug.php?id=17428 It might help too. Also read: http://www.php.net/manual/language.variables.predefined.php Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Variable Variables

2002-05-29 Thread Philip Olson
efined variables, and then some. Note that error_reporting is both a function (runtime) and a php directive. Most PHP users feel that developing with E_ALL is good. Regards, Philip Olson > > CYA, Dave > > > -- > PHP General Mailing List (http://www.php.net/) > To u

Re: [PHP] POST Format

2002-05-29 Thread Philip Olson
ea. For example: $words = "Cheese is good"; echo 'hi'; Which essentially makes: yep.php?motto=Cheese+is+good More information on what urlencode exactly does and related information (like for htmlentities), see the manual entry: http://www.php.net/urlencode Regards, Phil

Re: [PHP] Undefined variables

2002-05-31 Thread Philip Olson
ay or may not be appropriate here: http://au.phpz.net/manual/language.variables.predefined.php On a sidenote (picky), consider making variables all lowercase. Also when printing a single var, no need to surround it with quotes. print $foo. Regards, Philip Olson On Fri, 31 May 2002, Christopher J. Crane wrote: > I lik

Re: [PHP] diplaying the path

2002-05-31 Thread Philip Olson
FERER']; // Works since PHP 4.1.0 print $_SERVER['HTTP_REFERER']; Btw, $GLOBALS['HTTP_REFERER'] === $HTTP_REFERER. And lastly, since PHP 4.2.0 the register_globals directive defaults to off, which is what Jim was indirectly referring to. See also extract(). Regards, Phil

Re: [PHP] diplaying the path

2002-05-31 Thread Philip Olson
ds contained no specifics, I felt it was important enough to mention some. Regards, Philip Olson > > Jim lucas > - Original Message - > From: "Philip Olson" <[EMAIL PROTECTED]> > To: "Jim lucas" <[EMAIL PROTECTED]> > Cc: "Kris Vos

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Philip Olson
re this, it was on. So, many books, articles, tutorials, etc. rely on it on, which makes life interesting in the PHP world today. http://www.php.net/manual/en/security.registerglobals.php There are many predefined variables, such as $_GET, too. http://www.php.net/manual/en/language.va

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Philip Olson
t "a " . $arr['key'] . " string"; Be sure to always surround keys with quotes outside of strings otherwise PHP looks for a CONSTANT named key first, instead. define ('a','b'); $arr = array('a' => 'apple', 'b

Re: [PHP] Baffled, line producing error

2002-06-01 Thread Philip Olson
d/tut/using-strings.php http://www.php.net/manual/en/language.types.string.php One thing you can do is escape it: \' regards, Philip Olson On Sun, 2 Jun 2002, Craig Vincent wrote: > > If the "error" is a warning about undefined variable, then set a default > >

Re: [PHP] Global vars

2002-06-01 Thread Philip Olson
global $var; does nothing outside of a function. You do not need to use global for this. $foo = 'bar'; include 'something_that_uses_foo.inc'; http://www.php.net/manual/en/language.variables.scope.php regards, Philip Olson On Sun, 2 Jun 2002, Anzak Wolf wrote: >

Re: [PHP] Smart URLs

2002-06-02 Thread Philip Olson
For tips on doing these things, read this faqt: http://www.faqts.com/knowledge_base/view.phtml/aid/124 Regards, Philip Olson On Sun, 2 Jun 2002, Andrew Brampton wrote: > Hey try it, it works when are running the PHP Module in apache. > I have a server with proxy.php yet I access

Re: Re[2]: [PHP] A small question - Mysql_insert_id

2002-06-03 Thread Philip Olson
Jim- Please don't post such useless garbage to the lists. The thread was dead, mistakes were made, time to move on. We all make mistakes from time to time (frustration), and can only learn from them. Draft folders are good. Regards, Philip Olson > and you want people to actual

Re: [PHP] Re: stupid error, please kick me (and send me a solution)

2002-06-03 Thread Philip Olson
// not the value of $foo. bad. Read/study this tutorial on using strings: http://www.zend.com/zend/tut/using-strings.php Good luck, you'll get the hang of it soon :) Regards, Philip Olson On Mon, 3 Jun 2002, Jule Slootbeek wrote: > Jule Slootbeek wrote: > > G r e g L a w r

Re: [PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (andsend me a solution))

2002-06-03 Thread Philip Olson
Please post: a) the error b) if the error is line #5, just post related lines line 4-6. I did see this: $result = mysql_query('$query', '$link_glob'); Which should be: $result = mysql_query($query, $link_glob); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Re: [PHP] mysql_select_db problem

2002-06-03 Thread Philip Olson
In the above, we are checking if the function returns false and if it does we do stuff, like print mysql_error() and exit the script. Do as you wish. On a related note, if you removed the '@' from your code, odds are it'd shout an error too. '@' can be useful for

Re: [PHP] mysql_select_db problem

2002-06-03 Thread Philip Olson
oops, i forgot a @ for mysql_connect() but oh well, you get the point :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Not Quite: how to build an array

2002-02-23 Thread Philip Olson
27;, $row['something']); } print_r($authors); Rename your field to something other then AS, like perhaps "authors" or something ;) Also eventually learn about "Database Normalization". Regards, Philip Olson > OK. I use: > > while ($mydata = mysql

Re: [PHP] Warning: Undefined variable

2002-04-01 Thread Philip Olson
#ini.error-reporting A function also controls this behavior within scripts, it's appropriatly named error_reporting() http://www.php.net/error_reporting So, start programming your code with error_reporting(E_ALL) and have fun! Regards, Philip Olson p.s. Although it's fairly common

Re: [PHP] Need some help please

2002-04-01 Thread Philip Olson
t 'Success! Row added.'; } In short, mysql_error() is your friend. Regards, Philip Olson On Tue, 2 Apr 2002, menezesd wrote: > Hello Friends. > > I know I am asking for too much. But somehow, I am stuck > with three books I am refering and still not being able to >

Re: [PHP] Warning: Undefined variable

2002-04-02 Thread Philip Olson
d other things. If you're distributing code in cyberspace it's a good idea to make it error free too, E_NOTICE or otherwise. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Warning: Undefined variable

2002-04-02 Thread Philip Olson
liar has its purpose but usually an array will do (please!). When in doubt, put error_reporting(E_ALL) on top of your script and go to town. Regards, Philip Olson On Tue, 2 Apr 2002, Erik Price wrote: > > On Tuesday, April 2, 2002, at 03:27 PM, Philip Olson wrote: > > > If you&#

Re: [PHP] PHP FAQ (again)

2002-04-03 Thread Philip Olson
is a good idea too. The PHP manual and website are live entities always looking for ways to improve. Regards, Philip Olson p.s. http://www.google.com/ is your friend. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] suggestions on work-arounds to highlight_file() ?

2002-04-03 Thread Philip Olson
utput buffering, something like: function ob_highlight_file($filename) { ob_start(); highlight_string($filename); $source = ob_get_contents(); ob_end_clean(); return $source; } Be sure to pay attention to notes and warnings within the PHP manual. Regards, Philip Olson

Re: [PHP] suggestions on work-arounds to highlight_file() ?

2002-04-03 Thread Philip Olson
I meant to use highlight_file instead of highlight_string, doh! I'll go back in time and modify the source below :) Philip On Thu, 4 Apr 2002, Philip Olson wrote: > > A note exists at http://www.php.net/highlight_file that says: > > Note: The return parameter became

Re: [PHP] Emulation: $var = print_r($array)

2002-04-04 Thread Philip Olson
> > Is there a way to "emulate" var_dump(), print_r() so I can write it to a > > file and when I open this file the information are shown like if I really > > did a print_r();? > > ob_start(); > print_r($doo); > $dah = ob_get_contents(); > ob_end_clean(); > echo $d

Re: [PHP] checkbox doesn't pass?

2002-04-04 Thread Philip Olson
Unchecked checkboxes pass no values, that's how it works. It's either set or not. Default value for a checkbox is 'on' although you can change that. isset() will work fine. Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub

Re: [PHP] New to PHP Need Help

2002-04-04 Thread Philip Olson
umerated array (numerical) print $row[1]; Or use a function like mysql_fetch_assoc instead: $row = mysql_fetch_assoc($result); print $row['id']; // with id being a column name // selected via the query print $row['name']; And lastly, if you're

Re: [PHP] using new AUTOGLOBALS

2002-04-05 Thread Philip Olson
r use, so do as you will. extract() has many many options, read about them: http://ca.php.net/extract All of the above should give ideas, have fun! Regards, Philip Olson p.s. Use a mirror http://uk.php.net/mirrors.php On Fri, 5 Apr 2002, Miguel Cruz wrote: > On Fri, 5 Apr 2002, cybe

Re: [PHP] Re: globals in functions

2002-04-14 Thread Philip Olson
> Is there an easier way than having to manually place "global" > in each function...?? It's not that hard :) > Other than passing by parameter? > > Like is it possible to actually declare var's in PHP > as global? No. Consider arrays, constants, extract(), etc. Regards, Philip -- PHP

<    1   2   3   4   5   6   7   >