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
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.
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
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
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
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
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
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
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
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 :
---
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??
>
> 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
> 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 :
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
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]
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]
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
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
:)
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
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
.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
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
, 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
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
> 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
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
($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
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
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.
> 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
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
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
/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
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"]
>
>
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...
>
> >
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
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
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
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
#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
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
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
--
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
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
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
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
> >
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
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
, 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'
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
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
= 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
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
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
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
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
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
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'
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
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
_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
_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
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
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.
> 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/
> 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
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
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
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
, 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
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
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
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
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
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
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
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 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
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
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
> >
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:
>
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
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
// 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
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
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
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
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
#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
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
>
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
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
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
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
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
> > 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
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
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
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
> 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
301 - 400 of 638 matches
Mail list logo