Mark Roedel wrote:
> Perhaps a quick re-read of the date_format() section of
> http://www.mysql.com/doc/D/a/Date_and_time_functions.html
> is in order? (Hint: the % characters mean something.)
Thank you very much! That's odd ... in previous scripts I've written
there wasn't a need for the % cha
Hello! :)
First off, please respond to me directly as I am not subscribed to the
list. Thanks! :)
Now then, I have a quick question I'm hoping someone can help me with.
I have this class method:
function query($sql, $type = 'obj')
{
if(!$result = @mysql_query($this->masl($sql))){
ec
You wrote:
> I have a simple question...
> How can a space inserted to a string after the 3rd char ??
>
> washington ->> was hington
$str = 'washington';
$str = ereg_replace('^(.{3})(.*)$', '\\1 \\2', $str);
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
--
PHP Gene
> Which is why you see spoofs like this one
> http://bbspot.com/News/2001/03/perl_test.html
The Perl code in that spoof isn't even valid. ;)
And besides, the fact that you can write Perl code that looks like that
and still functions is more of a feature than anything. Code that is
written like
You wrote:
> >Sure it is. Lists or list context. () is not that hard to
> determine
> >what it means. At least, not nearly as hard as you make it out to
> >be for any moderately-experienced programmer.
>
> So it's easy to look it up is if you already know what it does? I
> think the majority of
> > You wrote:
> > > ($var1, $var2) is magic. I hate magic.
> >
> > It's not magic. It's just simpler.
> >
> > > What do you look up in the Perl
> > > manual when you hit syntax like that?
> >
> > http://www.perldoc.com/perl5.6/pod/perldata.html
>
> I said "what" not "where". I still maintain t
You wrote:
> >I use list context a lot in PHP and Perl, and I prefer Perl's way of
> >doing it *because* it allows you to be as verbose or terse as you
> >like.
> >PHP, unfortunately, doesn't give you that freedom.
>
> Hmm... the freedom to write unreadable, unmaintainable code, yes this
> is a ve
You wrote:
> ($var1, $var2) is magic. I hate magic.
It's not magic. It's just simpler.
> What do you look up in the Perl
> manual when you hit syntax like that?
http://www.perldoc.com/perl5.6/pod/perldata.html
> In PHP the equivalent syntax is:
>
> list($var1, $var2) = ...
Which is longer,
You wrote:
> Is it possible to write this shorter:
>
> if ($Var != "No1" && $Var != "No2" && $Var != "No3") {
> code
> };
if(!ereg("^No[1-3]$", $Var)){
// code
}
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
--
PHP General Mailing List (http://www.php.net/)
To
You wrote:
> Note that the download font thing is Internet Exploder Specific.
Internet
> Exploder also has a few issues with different charsets.
> Also note that *all* html documents should have a specified charset -
even
> the plain english ones. Most of the html on the internet is coded
wrongly,
You wrote:
> hi guys,
>
> I'd like to get the query string the browser sends to the script. The
> problem is that since the $HTTP_POST_VARS (or $HTTP_GET_VARS ) is an
> associative array I can't use numbers to point to the elements of
> this array. This piece of code does not work:
>
> for ($a=1;
You wrote:
> very amusing indeed.
>
> Go learn php and when youll have answer send it or stfu.
>
> you might start with your own site: www.PHPBeginner.com
> and then go to
http://logos.uoregon.edu/explore/socioling/politeness.html to
> learn how to behave !
>
> Its amazing how many people are rude
You wrote:
> > You wrote:
> > > Can anybody tell me what the code to close the browser is?
> >
> > ALT+F4. ;)
> PHP cannot execute client side actions, afaik.
>
> - k
'Twas a joke. See the winky smilie? You may all laugh now. ;)
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboar
You wrote:
> Can anybody tell me what the code to close the browser is?
ALT+F4. ;)
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE
Hello! :)
I have a script that loads another script with require() and based on
the context, I'd like different things to happen. So, index.php is
calling the required file require.php. And when require.php is run, if
there's no HTTP_REFERER and the file is index.php, everything is OK.
But if
You wrote:
> additionally I also tend to always provide an alternative, especially
if dealing
> with nested ifs or loops, even if just a comment... call it habit
(from where I
> don't know).
>
> if($condition){
> do this
> }else{
> # oops, $condition didn't exist
> }
>
> saves a hell of alot of t
You wrote:
> > This always works for me...
> >
> > eval ("\$message = \"$message\";");
>
> RED ALERT! SECURITY TO THE BRIDGE!
>
> "Captain, there's Klingons off the starboard bow!"
>
> Oh, sorry. Did I type that aloud? Sorry.
>
> If $message is a free-form email typed in by a potentially malici
You wrote:
> > location.href='mail.php?message=' + message;
>
> You need to URLEncode that message data.
>
> Not sure how JavaScript does it...
>
> probably message.urlencode()
Actually, it's escape(message).
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
--
PHP G
You wrote:
> This always works for me...
>
> eval ("\$message = \"$message\";");
>
> I use it in the same type of scenario you've described, and also with
E-Mail
> bodies stored in a DB. Works like a charm.
Thanks, that worked great! :D
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigabo
Hello! :)
I have a form with a textarea that contains a template e-mail with
variables in it. I would like to be able to replace those variables
with values. The variables named in the template are actual variables
in my script. This doesn't seem to work:
$newmail = preg_replace("/\$(\w+)/e"
You wrote:
> I have a php book that says it stands for Personal Home Page, not sure
if
> that is correct or not...
It's not. PHP stands for "PHP: Hypertext Preprocessor." It's a
recursive acronym.
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
--
PHP General Mailing Lis
You wrote:
> What do you think a medium sized hosting company could do to give you
(the
> developer) better service and support?
Be willing to help their users in any way they can, as far as service
goes.
> Is access to professional PHP developers useful when an issue arises?
Depends on the iss
You wrote:
> It's generally a whole lot better to do your form value checking with
> Javascript. It'll be faster and alot less of a waste of your server
> resources. IMHO, of course. :)
This really isn't that true because if a user has JavaScript disabled,
or is using a browser that doesn't suppo
You wrote:
> I have a mySQL database holding baseball stats and I want to calculate
> rankings on these players. Now I'd obviously want this to be as fast
as
> possible since I go through about 600 players but where is it best to
make
> them? In the SQL command itself or in PHP?
>
> players need
You wrote:
> I was wondering what I would have to do in order to have index.php
load up
> automatcially when someone went to my domain. IE if they go to
> www.mydomain.com and I have index.html or index.htm there then those
pages
> get loaded first. How could I do it so index.php, index.php3,
in
You wrote:
> I am trying to receive file names but can't quite figure out the
proper > substr to do it:
>
> jeff.dat
> jeffrey.dat
> chris.dat
> tom.dat
>
> I want to receive the name to the left of the .dat
>
> Jeff
$file = array("jeff.dat", "jeffrey.dat", "chris.dat", "tom.dat");
for($i=0; $i\n
You wrote:
> While I do appreciate people's contributions, let me frame the
> discussion a little. The person I need to convince is an
> administrator of an organization within North America, and he's never
> heard of PHP. The response I'm hoping to provoke in him is something
> like this: "You
You wrote:
> I've been reading the "Profanity Filter" thread in the list archives
but
> haven't found anything real helpful. Here's my code so far, this of
course
> won't work.
> function filterWords($string, &$result) {
> $badwords="shit, fuck, ass, bitch";
> $word=explode(", ",
You wrote:
> So sprach »Ryan Fischer« am 2001-07-24 um 07:35:37 -0400 :
> > Usually, "the 3rd" is written as "John Doe, III," AFAIK, so that's
not
> > really an issue.
>
> Okay, III isn't an issue then. What about people with Dr. titles?
Like
You wrote:
> So sprach »PHP Junkie« am 2001-07-23 um 21:39:07 -0400 :
> > I'm taking in first name and last name data into a MySQL db through
a
> > form. Users sometimes don't capitalize their first and last names
when
> > entering the data. Is there a function to clean this up for
> > consistenc
You wrote:
"Ryan Fischer" <[EMAIL PROTECTED]> wrote in message
01d901c1101e$9cd43220$80c93fd0@ryan">news:01d901c1101e$9cd43220$80c93fd0@ryan...
> You wrote:
> > I have a table that looks like
> >
> > Name | Type | X | Y
> >
> > Foo| Sh
You wrote:
> Also, consider using print or echo as opposed to printf. And lastly,
you
> really don't need to use mysql_free_result, PHP does this
automagically
> after the script dies. Sorry for picking on you, you may have your
> reasons. ;-)
Really? Then why was it that, when I neglected to
You wrote:
> I have a table that looks like
>
> Name | Type | X | Y
>
> Foo| Ship | 9 | 29
> Bar| Base | 9 | 29
>
> Is there any way I can write a query that selects
> everything with Type = Base, and X and Y = Foo's X and Y?
>
> ie
>
> "Select * from table where type = Base and X = {Foo
> I'm pretty new to programming - besides JavaScript, PHP is really the
first
> language I've used.
> I'm just wondering, and I'm sure you all would know - should I learn
Perl?
> Is it considered a necessity for a web developer to know Perl, or is
it not
> a worthwhile endeavor, considering how ea
34 matches
Mail list logo