php-general Digest 29 Jul 2007 04:37:49 -0000 Issue 4930
Topics (messages 259744 through 259753):
Re: Comment modes behavior in HTML and PHP
259744 by: C.R.Vegelin
Re: PHP list as a blog
259745 by: Børge Holen
259749 by: Daniel Brown
Re: how to use imagestring() function with Chinese String
259746 by: brian
Re: Pirate PHP books online?
259747 by: Dotan Cohen
259748 by: Larry Garfield
Rules of Engagement
259750 by: Daniel Brown
259751 by: Tijnema
259753 by: Larry Garfield
PDO_SQLite Transactions
259752 by: M. Sokolewicz
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi Daniel, Paul, Robert, Rick,
Thanks for making it clear.
Have a nice weekend.
Cor
----- Original Message -----
From: "Daniel Brown" <[EMAIL PROTECTED]>
To: "Paul Novitski" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 28, 2007 4:29 PM
Subject: Re: [PHP] Comment modes behavior in HTML and PHP
On 7/28/07, Paul Novitski <[EMAIL PROTECTED]> wrote:
At 7/28/2007 07:40 AM, C.R.Vegelin wrote:
>I have a PHP script, as follows:
><!--
> <?php
> echo "should this be echoed ?";
> ?>
>-->
>
>As expected, the browser shows nothing,
>but when I view Source in the browser, I see:
><!-- start HTML comment
> should this be echoed ?-->
>
>Shouldn't it be just: <!-- -->, without the echo result ?
>I don't expect PHP to be active between <!-- -->.
<!-- ... --> is an HTML comment.
/* ... */ and //... are PHP comments.
The HTML comment syntax does not affect PHP, and PHP comment syntax
does not affect HTML.
http://www.php.net/manual/en/language.basic-syntax.comments.php
Regards,
Paul
__________________________
Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Taking a moment to explain the WHY of what's happening should help
you understand it a bit more, Cor. All HTML markup - including
comments - is parsed on the browser side, while PHP is done on the
server side. The server doesn't parse HTML at all, and PHP doesn't
have any knowledge of it's position within a script, or what else
exists outside of the <? ?> tags. Thus, PHP is parsed, compiled, and
executed prior to the web server serving the end-result as pure HTML,
which is then parsed by the browser upon receipt.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Thursday 14 June 2007 00:41, Philip Thompson wrote:
> On Jun 13, 2007, at 1:15 PM, Richard Lynch wrote:
> > On Wed, June 13, 2007 12:21 am, Crayon Shin Chan wrote:
> >> On Wednesday 13 June 2007 12:39, Paul Scott wrote:
> >>> Our interns and students specifically. They are all dead scared of
> >>> joining mailing lists in general, and find that using a web based
> >>> prettier interface is much easier and friendlier.
> >>
> >> Not to mention slower, clumsier and more bandwidth hungry than a
> >> mailing list. It's time you did them a favour and show them that
> >> mailing lists
> >> are nothing to be afraid of.
> >
> > Do students and interns still have quotas on their email accounts?...
>
> Yes. It does depend on the university though. For our students, the
> default is only 50 megs - they may request more. However, these text-
> only emails don't really take up that much space.
>
> > Cuz I *DO* remember the days when the email quotas a University would
> > have prohibited subscribing to PHP mailing list...
>
> This is not currently the case.....
>
> > Surely in this day and age, the quotas aren't *that* restrictive...
There seems to be some failure to comunicate (I believe the Prodigy said
that)... whatever, quotas on the universities will not keep you from
recieving mail... or download anything of the net. It just defines the space
available to the user. The temporary space available lets you pull way more,
and get a delete warning from either an automated system or an admin (at my
university, wasn't it 10 days or so before forced deletion on random objects
occured?... dunno).
Imagine an master or phD degree getting lost because someone set up an
university server with some weird download quota.
This could hardly be _A_ reason for makin' this blog... the amount of mail or
numbers should not be an issue. If it is so... how about them digest mails?
>
> True.
>
>
> ~Philip
--
---
Børge
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
I'll top-post for this announcement. I think we found the winner
of the "Revive An Old Topic" award.
Congrats.
On 7/28/07, Børge Holen <[EMAIL PROTECTED]> wrote:
> On Thursday 14 June 2007 00:41, Philip Thompson wrote:
> > On Jun 13, 2007, at 1:15 PM, Richard Lynch wrote:
> > > On Wed, June 13, 2007 12:21 am, Crayon Shin Chan wrote:
> > >> On Wednesday 13 June 2007 12:39, Paul Scott wrote:
> > >>> Our interns and students specifically. They are all dead scared of
> > >>> joining mailing lists in general, and find that using a web based
> > >>> prettier interface is much easier and friendlier.
> > >>
> > >> Not to mention slower, clumsier and more bandwidth hungry than a
> > >> mailing list. It's time you did them a favour and show them that
> > >> mailing lists
> > >> are nothing to be afraid of.
> > >
> > > Do students and interns still have quotas on their email accounts?...
> >
> > Yes. It does depend on the university though. For our students, the
> > default is only 50 megs - they may request more. However, these text-
> > only emails don't really take up that much space.
> >
> > > Cuz I *DO* remember the days when the email quotas a University would
> > > have prohibited subscribing to PHP mailing list...
> >
> > This is not currently the case.....
> >
> > > Surely in this day and age, the quotas aren't *that* restrictive...
>
> There seems to be some failure to comunicate (I believe the Prodigy said
> that)... whatever, quotas on the universities will not keep you from
> recieving mail... or download anything of the net. It just defines the space
> available to the user. The temporary space available lets you pull way more,
> and get a delete warning from either an automated system or an admin (at my
> university, wasn't it 10 days or so before forced deletion on random objects
> occured?... dunno).
> Imagine an master or phD degree getting lost because someone set up an
> university server with some weird download quota.
> This could hardly be _A_ reason for makin' this blog... the amount of mail or
> numbers should not be an issue. If it is so... how about them digest mails?
>
> >
> > True.
> >
> >
> > ~Philip
>
> --
> ---
> Børge
> http://www.arivene.net
> ---
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--- End Message ---
--- Begin Message ---
Davis Chan wrote:
brian wrote:
Does the font you're using support Chinese characters? Are the
Good point, I think I am just using the "default" and size 1. Are there
other fonts? Where can I find the font file for imageloadfont()?
You'll need to find a TrueType font that supports Chinese characters.
See the imageloadfont & imagettftext pages in the manual:
http://www.php.net/manual/en/function.imageloadfont.php
http://www.php.net/manual/en/function.imagettftext.php
characters coming through in $_GET ok?
echo $_GET[...]; is fine.
How *are* the characters coming through in $_GET?
May I ask what does this mean?
How is the string encoded (UTF-8, GB-2312, etc.)?
But i think you're problem lies with the font you're using. Once you
find a suitable font, you can point your script to it somewhere on the
server (it does not have to be under the DocumentRoot) to load it.
brian
--- End Message ---
--- Begin Message ---
On 28/07/07, tedd <[EMAIL PROTECTED]> wrote:
> >On 28/07/07, Larry Garfield <[EMAIL PROTECTED]> wrote:
> >> If "indirectly affecting the market so that prices change" counts
> >>as stealing,
> >> then Coke and Pepsi build their business models around stealing from each
> >> other.
> >>
> >> Apache/PHP/MySQL are then "stealing actual money" from Microsoft,
> >>because they
> >> reduces sales of Windows, IIS, Visual Studio, and MS SQL Server.
> >>
> >> Great, so that means we should shut down Pepsi to stop them from
> >>stealing from
> >> Coke, and shut down PHP to stop them from stealing from Microsoft!
> >>
> >> I would say that shows just what pathetically laughable bullshit
> >>that argument
> >> is, except that Microsoft has made it publicly before, albeit phrased
> >> as "defending capitalism". You see why I find it so offensive?
> >>
> >
> >Ah, so you are saying that by pirating software/books/music you are
> >creating market competition, which drives the producers to produce
> >higher quality content at affordable prices. I feel so stupid that I
> >didn't see it that way from the beginning.
> >
> >Dotan Cohen
>
>
> It' a lost cause trying to get him to admit that it's stealing.
>
> But, I did just hear that same argument from a movie called "The
> Fifth Element" where the bad guy was claiming his bad deeds did just
> that.
>
> Cheers,
>
> tedd
He's probably just trolling.
In any case I think that I remember the scene. Wasn't that just before
he double-timed his accomplices and gave them a booby-trapped weapon?
Lesson to be learned here, don't trust the immoral....
Dotan Cohen
http://lyricslist.com/
http://what-is-what.com/
--- End Message ---
--- Begin Message ---
On Saturday 28 July 2007, Dotan Cohen wrote:
> On 28/07/07, tedd <[EMAIL PROTECTED]> wrote:
> > >On 28/07/07, Larry Garfield <[EMAIL PROTECTED]> wrote:
> > >> If "indirectly affecting the market so that prices change" counts
> > >>as stealing,
> > >> then Coke and Pepsi build their business models around stealing from
> > >> each other.
> > >>
> > >> Apache/PHP/MySQL are then "stealing actual money" from Microsoft,
> > >>because they
> > >> reduces sales of Windows, IIS, Visual Studio, and MS SQL Server.
> > >>
> > >> Great, so that means we should shut down Pepsi to stop them from
> > >>stealing from
> > >> Coke, and shut down PHP to stop them from stealing from Microsoft!
> > >>
> > >> I would say that shows just what pathetically laughable bullshit
> > >>that argument
> > >> is, except that Microsoft has made it publicly before, albeit phrased
> > >> as "defending capitalism". You see why I find it so offensive?
> > >
> > >Ah, so you are saying that by pirating software/books/music you are
> > >creating market competition, which drives the producers to produce
> > >higher quality content at affordable prices. I feel so stupid that I
> > >didn't see it that way from the beginning.
> > >
> > >Dotan Cohen
> >
> > It' a lost cause trying to get him to admit that it's stealing.
> >
> > But, I did just hear that same argument from a movie called "The
> > Fifth Element" where the bad guy was claiming his bad deeds did just
> > that.
> >
> > Cheers,
> >
> > tedd
>
> He's probably just trolling.
>
> In any case I think that I remember the scene. Wasn't that just before
> he double-timed his accomplices and gave them a booby-trapped weapon?
> Lesson to be learned here, don't trust the immoral....
>
> Dotan Cohen
1) Something can be illegal without it being theft. The idea that "if it's
not theft then it must be OK" is the bullshit argument that I am pointing out
as bullshit.
2) No, I am not saying that copyright infringement is a good thing. Perhaps
you've heard of a concept called "hyperbole". Or one called "sarcasm". I
was pointing out that if copyright infringement counted as "theft" from
someone else who was paying for a licensed copy of X, then Pepsi having a
marketing campaign counted as "theft" from Coke because of lost sales. Both
are equally asinine statements. That's the point.
3) At no point in this conversation have I ever said that I engage in or
support copyright infringement, and I am insulted that you would accuse me of
such without any evidence or justification to back it up.
I am pointing out that you are saying things that are *factually inaccurate by
the laws of the United States*. And for that you accuse me of copyright
infringement and being immoral? That is without a doubt the most offensive
comment I've seen on this list so far. I would say I expect an apology, but
given that you fall back on insulting someone's ethics just because they
don't buy into the same lie that the media cartels have been spreading that
you do I won't hold my breath.
Really, I had expected more mature commentary from the adults on this list.
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
As a relatively-new contributor to this list (read: under 2
years), I realize that I have no business requesting a change, but
I'll breech etiquette and hope for the best.
Can we update the filters on the list to have the reply-to address
header marked to the php-general address? The reason I ask this is
because, when people are on vacation (such as Juan is now), we receive
responses to our personal addresses. Secondly, we have to continually
"Reply All" the messages, which - though it's not a problem - can
cause issues when attempting to respond to those "[URGENT]" replies.
Third, our addresses are included in gmane, et al, which is an
inherent risk --- I understand.
Maybe it's just the ramblings of someone attempting to read and
type on a limited-bandwidth mobile device while bored due to delays in
mass-transit facilities (here, read: I'm fucking exhausted, and yes, I
dropped the "F" bomb). In either case, it's not conducive to a new
contributor to have to weed through "vacation response" messages each
time he/she replies to the list.
</rant>
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--- End Message ---
--- Begin Message ---
On 7/29/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> As a relatively-new contributor to this list (read: under 2
> years), I realize that I have no business requesting a change, but
> I'll breech etiquette and hope for the best.
>
> Can we update the filters on the list to have the reply-to address
> header marked to the php-general address? The reason I ask this is
> because, when people are on vacation (such as Juan is now), we receive
> responses to our personal addresses. Secondly, we have to continually
> "Reply All" the messages, which - though it's not a problem - can
> cause issues when attempting to respond to those "[URGENT]" replies.
> Third, our addresses are included in gmane, et al, which is an
> inherent risk --- I understand.
>
> Maybe it's just the ramblings of someone attempting to read and
> type on a limited-bandwidth mobile device while bored due to delays in
> mass-transit facilities (here, read: I'm fucking exhausted, and yes, I
> dropped the "F" bomb). In either case, it's not conducive to a new
> contributor to have to weed through "vacation response" messages each
> time he/she replies to the list.
>
> </rant>
Uhm, about that vacation response, it will only make things worser, as
then email sent to a user with a vacation message, will send a message
back to the list, which will be addressed to everyone on the list :P
Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
--- End Message ---
--- Begin Message ---
On Saturday 28 July 2007, Daniel Brown wrote:
> As a relatively-new contributor to this list (read: under 2
> years), I realize that I have no business requesting a change, but
> I'll breech etiquette and hope for the best.
>
> Can we update the filters on the list to have the reply-to address
> header marked to the php-general address? The reason I ask this is
> because, when people are on vacation (such as Juan is now), we receive
> responses to our personal addresses. Secondly, we have to continually
> "Reply All" the messages, which - though it's not a problem - can
> cause issues when attempting to respond to those "[URGENT]" replies.
> Third, our addresses are included in gmane, et al, which is an
> inherent risk --- I understand.
>
> Maybe it's just the ramblings of someone attempting to read and
> type on a limited-bandwidth mobile device while bored due to delays in
> mass-transit facilities (here, read: I'm fucking exhausted, and yes, I
> dropped the "F" bomb). In either case, it's not conducive to a new
> contributor to have to weed through "vacation response" messages each
> time he/she replies to the list.
>
> </rant>
Amen! A public discussion list (such as this one) really should have Reply-To
set correctly. All of the arguments against Reply-To headers apply only to
the 1% of the population still using mail clients written in the early 90s.
I'd love to not get double copies of every bloody reply to every thread I'm
involved in. It's just a waste of electrons and of my time.
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
I've been having this problem for a while now,
when I use transactions in SQLite with PDO it stalls on me with an error
stating my statements are in progress.
I've tried closing all cursors to my statements, but that does not seem
to resolve this for me. This is my code,
(obviously shortened quite a bit)
I hope someone could help me figure out what's going wrong, could it be
that I can't run an update yet because
the transaction has not been commited yet?? (sounds a bit odd to me)
<?php
// setup an SQLite db connection via PDO, this is in $db
try {
// $fileName, $fileDesc and $fileType are all existing, cleaned,
checked values
$statement = $db->prepare('INSERT INTO Files (file_name, file_desc,
file_type, file_filename) VALUES (?, ?, ?, ?)');
$statement->execute(array($fileName, $fileDesc, $fileType, ''));
$id = $db->lastInsertId();
$statement->closeCursor();
$res = move_uploaded_file($tmp_file, $new_file);
if($res === false) {
$db->rollBack();
echo 'error';
exit;
} else {
$statement = $db->prepare('UPDATE Files SET file_filename=? WHERE
file_id=?');
$statement->execute(array($new_file, $id));
$statement->closeCursor();
OG::$db->commit();
}
} catch(Exception $e) {
var_dump($e);
}
And the Exception I recieve (there is only one commit in the file, due
to shortening for posting
the line listed here is incorrect):
object(PDOException)#7 (7) {
["message:protected"]=>
string(88) "SQLSTATE[HY000]: General error: 1 cannot commit
transaction - SQL statements in progress"
["string:private"]=>
string(0) ""
["code:protected"]=>
string(5) "HY000"
["file:protected"]=>
string(43) "/home/tularis/public_html/t/createFile.php"
["line:protected"]=>
int(95)
["trace:private"]=>
array(1) {
[0]=>
array(6) {
["file"]=>
string(43) "/home/tularis/public_html/t/createFile.php"
["line"]=>
int(95)
["function"]=>
string(6) "commit"
["class"]=>
string(3) "PDO"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
["errorInfo"]=>
array(3) {
[0]=>
string(5) "HY000"
[1]=>
int(1)
[2]=>
string(54) "cannot commit transaction - SQL statements in progress"
}
}
--- End Message ---