OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 9 Nov 2005 23:51:57 -0000 Issue 3785

php-general-digest-helplists.php.net
Date: Wed Nov 09 2005 - 17:51:57 CST


php-general Digest 9 Nov 2005 23:51:57 -0000 Issue 3785

Topics (messages 225426 through 225476):

Re: comment more than a question
        225426 by: James Benson
        225440 by: Jake Gardner

PHP 5 && OO && performance && exceptions
        225427 by: cron.odi.com.br

Re: Session's across Domains...
        225428 by: Ben Ramsey
        225438 by: Ben Ramsey
        225444 by: Tony Di Croce
        225445 by: M
        225446 by: Ben Ramsey

Re: to the freelancers!!
        225429 by: bruce
        225454 by: Richard Lynch

Re: security code
        225430 by: Gustavo Narea
        225464 by: lonewolf.nc.rr.com

Re: Using the echo tag...
        225431 by: Paul Williams
        225432 by: Ben Ramsey
        225433 by: Paul Williams
        225435 by: Ben Ramsey
        225437 by: Ben Ramsey

R: [PHP] Using the echo tag...
        225434 by: Alan D'angelo - Media Beat Information Technology

Re: PEAR on PHP 5+?
        225436 by: Minuk Choi

java .vs php
        225439 by: bruce
        225441 by: Richard Heyes
        225442 by: Chris Shiflett
        225447 by: Armando Afá
        225448 by: Rosty Kerei
        225450 by: Ben Ramsey
        225451 by: Jay Blanchard
        225452 by: Richard Lynch
        225474 by: Esteamedpw.aol.com

Re: Type of form element
        225443 by: Jake Gardner

Re: phpmyadmin problems with quoting exported text
        225449 by: Chris W
        225453 by: Richard Lynch

Unable to send variables to MySQL table
        225455 by: Stewart Priest
        225456 by: Jay Blanchard
        225457 by: Ben Ramsey
        225458 by: Richard Davey
        225459 by: Dan McCullough
        225460 by: Jim Moseby
        225461 by: Stewart Priest
        225462 by: Dan McCullough
        225463 by: lonewolf.nc.rr.com
        225467 by: Stewart Priest
        225475 by: M

Re: Creating PDF from a Image
        225465 by: Jens Schulze

T_PAAMAYIM_NEKUDOTAYIM
        225466 by: Unknown Unknown
        225468 by: Jay Blanchard
        225469 by: Curt Zirzow
        225470 by: Dan McCullough
        225471 by: Unknown Unknown
        225472 by: tg-php.gryffyndevelopment.com
        225473 by: Jim Moseby

Select and $_POST
        225476 by: Ross

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


It takes some getting used to I admit but PHP errors turned up full is
far than enough to fix any script, in my experience

matt VanDeWalle wrote:
> I don't really have a question, I just have noticed in working with php
> for about a year off and on, so you could probably say i'm a bit new
> still, what an error says it is, or what line it is on, is hardly ever
> the case, e.g, several different times until i figured out what this
> meant, i would get the "unexpected $ on line <two lines past the end of
> the script> error, I've figured out that actually means you are missing
> a closing } or a few
> also tonight, I was working on a script, I figured this out about an
> hour later but i was getting an error about "unexpected '\' ascii 92 in
> <line#>, something to that effect; I infact did not have a stray \, but
> the script i was calling in this particular function apparently didn't
> sit well with the code, so, i just read the code into the function
> instead of include'ing the script and everything is happy again
> so I guess just letting new or somewhat new, users know not to take the
> php's errors for what they say always, sometimes it works that way, not
> much, or, in my experience anyway

attached mail follows:


Yeah I never really look at what the error message actually says, it
usually turns out to be unhelpful because of those line numbers. I
just look, for example, to see if it says the error happened past the
last line of the script, and I know im missing a } somewhere. The
errors PHP returns are more about reading inbetween the lines than
reading the actual error lines.

On 11/9/05, James Benson <jbjamesbenson.co.uk> wrote:
> It takes some getting used to I admit but PHP errors turned up full is
> far than enough to fix any script, in my experience
>
>
>
>
>
> matt VanDeWalle wrote:
> > I don't really have a question, I just have noticed in working with php
> > for about a year off and on, so you could probably say i'm a bit new
> > still, what an error says it is, or what line it is on, is hardly ever
> > the case, e.g, several different times until i figured out what this
> > meant, i would get the "unexpected $ on line <two lines past the end of
> > the script> error, I've figured out that actually means you are missing
> > a closing } or a few
> > also tonight, I was working on a script, I figured this out about an
> > hour later but i was getting an error about "unexpected '\' ascii 92 in
> > <line#>, something to that effect; I infact did not have a stray \, but
> > the script i was calling in this particular function apparently didn't
> > sit well with the code, so, i just read the code into the function
> > instead of include'ing the script and everything is happy again
> > so I guess just letting new or somewhat new, users know not to take the
> > php's errors for what they say always, sometimes it works that way, not
> > much, or, in my experience anyway
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hello,

 

Currently I'm make some utilities classes and I took the idea from java to make some wrappers class like String, Integer and so on. This allows me to use the type hint for basic types in php. Anyone have a clue if replacing the all in one type in php for objects types will degrade the performance?

 

Also for every controller class that I'm making I'm also making exceptions class of every error that it can generate. Same questions: It will degrade performance to throw an exception instead of lest say a pear error or return false?

 

Just for know, I'm doing this because I believe that it will eliminate some o problems o development and will eliminate some basic validations.

Any tips appreciate

Angelo

attached mail follows:


On 11/8/05 11:52 PM, Chris Shiflett wrote:
> When I've provided this feature in the past, I've always taken advantage
> of launch and landing pages - e.g., users could only get to the other
> domain and still be logged in if they clicked a link from my
> application, and those links all go through a launch page. This page
> takes care of generating whatever data I plan to send to the remote
> domain (including the URL that the user wants to visit) and redirecting
> the user to the landing page at that domain. With servers synchronized
> with ntpd, this lets you close the window of opportunity down to just a
> few seconds, strengthening the technique.

I spoke to Chris a little further about this last night (so I'm
crediting him with this), and I've noticed he hasn't responded, so I'm
doing so.

He said that, since the domains are on the same machine, it's relatively
easy for them to share the same session id (something I wasn't
disputing), and he offered a solution to mitigate exposure of the
session id: a temporary token.

Instead of passing the session id, create a randomly generated session
token that is only valid for, say, 2 to 5 minutes. On the server, you
can specify to which session the token corresponds, but you never reveal
this to the client. You only reveal the token. Since it's only valid for
a very small window of time, then, even if it is sniffed or appended to
a URL (like in the linking examples I was giving), it won't allow others
to use it to log in because it will have already expired.

This alleviates the exposure issues I was discussing.

Hope this helps.

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


I'm posting this back to the list to keep the conversation there. I hope
you don't mind. My comments are at the bottom . . .

On 11/9/05 10:10 AM, Tony Di Croce wrote:
> The reason I even wanted to do this had more to do with sharing some
> data between two sites, and less with really maintaining a login.
>
> It occured to me that I need not "share sessions" at all. Instead, all
> of the data B needs could simply be encrypted by A and sent in a post field.
>
> Now, this does bring up the problem that someone could sniff this
> packet, capture this encrypted packet, and use it to authenticate
> themselves on B. They never had to decrypt it, just capture from A, and
> send to B at their leisure...
>
> Let me give some background here on exactly what I'm doing, as it may
> clear things up a bit.
>
> B is a secure page, with a CC info form that when submitted will process
> their card, charging the amount of money passed in the encrypted packet,
> and if the charge succeeds, redirecting back to A. A would probably need
> to send an order number to B, and B could pass that back to A upon
> success or failure.
>
> All of this is to get around the Apache limitation of allowing only one
> virtual host to use SSL.
>
> Anyhow, B could keep track of all of the order numbers it was sent by A,
> and if it was re-sent a duplicate could simply deny the whole
> transaction. Thus, if someone sniffed my encrypted "data burrito", and
> attempted to re-use it to gain access to B, they would fail, since B
> will only allow that burrito ONCE. Perhaps these order numbers could be
> GUID's.
>
> How does this sound?

I think someone else here could probably offer some better advice, but
here's what I would do.

I would definitely use SSL when dealing with CC data, but I don't think
there's an Apache limitation that restricts the use of SSL to one host.
There is a limitation that restricts the use of an SSL certificate to
one host, so, if you had two certificates, both hosts could use SSL
sockets, but I don't think that's what you need here. (You could still
use the same certificate across multiple hosts, but then the user is
going to be prompted in the browser whether or no to allow the
certificate to be used, and this is generally not a good idea.)

What you need to do is ensure that your FORM action on domain A (the
unsecured domain) is POSTing to https://domain-b.org. Note the usage of
HTTPS. This will ensure that the data is sent along the secure channel
and not in clear text. You don't need to perform any encryption, since
SSL takes care of that for you.

Then, B could simply redirect back to A after processing the order and
pass the order number through the query string (since it's probably not
very sensitive).

Does this answer your question?

And, yeah, denying used order numbers would be a good idea.

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


Hmm.. Almost.

If the shopping cart on site A submits to the secure CC processing page on
site B, then the contextual data that describes the order (price, order
number) was actually communicated from A to B via a hop at the users browser
(likely via a hidden form field on site A). Thus it would need to be
encrypted and urlencoded (otherwise anyone could hit "View Source" and see
it all in plain text).

Now, I suppose the shopping cart on site A could submit to itself, and then
in that case, build up this encrypted data packet and then re-direct to the
secure CC processing page (passing the encrypted data as a GET parameter. Is
their any way to POST with a re-direct?).

Ok. I think I have this all in my head now.

On 11/9/05, Ben Ramsey <ramseyphp.net> wrote:
>
> I'm posting this back to the list to keep the conversation there. I hope
> you don't mind. My comments are at the bottom . . .
>
>
> On 11/9/05 10:10 AM, Tony Di Croce wrote:
> > The reason I even wanted to do this had more to do with sharing some
> > data between two sites, and less with really maintaining a login.
> >
> > It occured to me that I need not "share sessions" at all. Instead, all
> > of the data B needs could simply be encrypted by A and sent in a post
> field.
> >
> > Now, this does bring up the problem that someone could sniff this
> > packet, capture this encrypted packet, and use it to authenticate
> > themselves on B. They never had to decrypt it, just capture from A, and
> > send to B at their leisure...
> >
> > Let me give some background here on exactly what I'm doing, as it may
> > clear things up a bit.
> >
> > B is a secure page, with a CC info form that when submitted will process
> > their card, charging the amount of money passed in the encrypted packet,
> > and if the charge succeeds, redirecting back to A. A would probably need
> > to send an order number to B, and B could pass that back to A upon
> > success or failure.
> >
> > All of this is to get around the Apache limitation of allowing only one
> > virtual host to use SSL.
> >
> > Anyhow, B could keep track of all of the order numbers it was sent by A,
> > and if it was re-sent a duplicate could simply deny the whole
> > transaction. Thus, if someone sniffed my encrypted "data burrito", and
> > attempted to re-use it to gain access to B, they would fail, since B
> > will only allow that burrito ONCE. Perhaps these order numbers could be
> > GUID's.
> >
> > How does this sound?
>
> I think someone else here could probably offer some better advice, but
> here's what I would do.
>
> I would definitely use SSL when dealing with CC data, but I don't think
> there's an Apache limitation that restricts the use of SSL to one host.
> There is a limitation that restricts the use of an SSL certificate to
> one host, so, if you had two certificates, both hosts could use SSL
> sockets, but I don't think that's what you need here. (You could still
> use the same certificate across multiple hosts, but then the user is
> going to be prompted in the browser whether or no to allow the
> certificate to be used, and this is generally not a good idea.)
>
> What you need to do is ensure that your FORM action on domain A (the
> unsecured domain) is POSTing to https://domain-b.org. Note the usage of
> HTTPS. This will ensure that the data is sent along the secure channel
> and not in clear text. You don't need to perform any encryption, since
> SSL takes care of that for you.
>
> Then, B could simply redirect back to A after processing the order and
> pass the order number through the query string (since it's probably not
> very sensitive).
>
> Does this answer your question?
>
> And, yeah, denying used order numbers would be a good idea.
>
> --
> Ben Ramsey
> http://benramsey.com/
>

--
for only the most hard core geekstas...
http://geekstasparadise.blogspot.com

attached mail follows:


Ben Ramsey wrote:
>> B is a secure page, with a CC info form that when submitted will
>> process their card, charging the amount of money passed in the
>> encrypted packet, and if the charge succeeds, redirecting back to A. A
>> would probably need to send an order number to B, and B could pass
>> that back to A upon success or failure.
>>
>> All of this is to get around the Apache limitation of allowing only
>> one virtual host to use SSL.

apache does not have this limit. this is limit of https protocol,
because encryption takes place before any request is made, so the only
way to know what SSL certificate to use is the IP address. You can get
apache to listen on more than one IP and use as many certificates as you
like.

>>
>> Anyhow, B could keep track of all of the order numbers it was sent by
>> A, and if it was re-sent a duplicate could simply deny the whole
>> transaction. Thus, if someone sniffed my encrypted "data burrito", and
>> attempted to re-use it to gain access to B, they would fail, since B
>> will only allow that burrito ONCE. Perhaps these order numbers could
>> be GUID's.

You can look at how payment gateways do this. There are basicly 2 ways:

1. postback - when user is redirected from B to A with the result status
and order id, A asks B (rpc, simple get method, anything...) if the
result is really what it got from the user. Check every important
information - order id, amount

2. signing - site B computes a sign from important information of the
transaction (at least order id and amount) and a secret key, and adds
this sign to the redirect url that leads to site A. Site A can then
compute the sign from the same values and check it against sign received
from the server.

In both cases you should also incorporate site id, so site A is not the
only one that can use the interface of site B.

attached mail follows:


On 11/9/05 11:05 AM, Tony Di Croce wrote:
> If the shopping cart on site A submits to the secure CC processing page on
> site B, then the contextual data that describes the order (price, order
> number) was actually communicated from A to B via a hop at the users browser
> (likely via a hidden form field on site A). Thus it would need to be
> encrypted and urlencoded (otherwise anyone could hit "View Source" and see
> it all in plain text).

Is the price and order number sensitive enough to encrypt? Like we've
already discussed, the order number will be considered invalid once it's
been processed, so any subsequent attempts to use the order number will
result in a failed transaction. If the order number includes sensitive
information, however (such as the full credit card number or something),
then you should rethink how you create your order numbers.

You also don't need to urlencode anything in a form field. When you
submit the form, the browser handles the urlencoding for you. (If you
were POSTing from a script, then, yes, you might need to urlencode it.)

As for the other question about POSTing on a redirect, it is possible
through several different means, and if this is a route you want to
take, I would suggest looking at PEAR::HTTP_Request, since it provides
an easy to use API for this. I, however, don't think you'll need to do
this (at least it doesn't sound like something that's necessary given
what I know about your form).

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


richard...

you miss a key nuance/point to the msg. her idea/thought was twofold. 1)
whether companies would have ideas/projects that they would be interested in
partially funding, and 2) if there would be a 'talented' pool of developers
who would be interested in working on the initial apps.

there are a lot of ideas within companies that don't ever make it to full
blown products. the basic idea would be to setup a structure and to find
companies that have these projects. the project could be a possible add on
to round out the biz offerings, it might be a test for a new
direction/product, it might be a project that you fund for competitive
reasons, etc...

the intent would not be to secure complete funding to fully
create/market/sell the product/project code (that's what the vc is for!!)
rather, the goal of the structure would be to 'jump start'/test apps in a
relatively fast/efficient manner.

the structure would be set up to get the projects, manage the projects,
distribute the initial funding, based on the project goals...

the question was whether there are talented developers who'd want to
participate in this kind of function/structure.

there are already a great deal of conusulting companies who look to
businesses for consulting/development/design work. this kind of model would
simply be an offshoot of that kind of approach.

-bruce

-----Original Message-----
From: Richard Lynch [mailto:ceol-i-e.com]
Sent: Tuesday, November 08, 2005 7:29 PM
To: bedouglasearthlink.net
Cc: php-generallists.php.net
Subject: Re: [PHP] to the freelancers!!

On Thu, November 3, 2005 7:15 pm, bruce wrote:
> Just a quick question. Had a conversation with a person who works for
> a
> non-profit, and she was describing some of her dealings with obtaining
> grants for the development of 'open source' apps.Got me to thinking.
> If a
> company sponsored the initial development of an 'open source' kind of
> app
> (the exact licensing would need to be fleshed out) what do yout think
> would
> be the response of people to work on the apps..
>
> I started to wnoder if there would be a pool of talented people who
> would be
> interested in working on projects that are initially funded. The
> funding
> would go to pay the resources, set up the project, do initial grass
> roots
> marketing, etc... The idea would be to focus in on the
> projects/technologies/apps that a given business would agree to
> initially
> support/fund.
>
> Thoughts/comments/etc...
>
> -bruce
> bedouglasearthlink.net
>
> ps. I'm not talking about a freshmeat.net/sourceforge kind of
> environment.
> The obvious goal of this kind of process would be to turn small
> applications/projects into profitable applications. My curiousity is
> whether
> you could then create applications/services that could be built along
> the
> same model as nagios/mysql/etc.. where you have a free/open version,
> as well
> as a fee based application/service.

I think there was a Penguin MasterCard/Visa company set up for
something very much like this... Though that was to just fund the
projects, not to build companies around them. LinuxCard, was it?

Also, in a loose sort of way, your description matches something
commonly referred to as the "dot boom"... and the "dot bomb" for that
mattter. :-)

There were a ZILLION start-ups with cool ideas, no friggin' idea
whatsoever of how to make revenue from it, and zillions of dollars
blown on pinball machines and beanbag chairs for the developers.

Ah, the glory days. :-)

I think the trick would be to find the right project, sponsors, and
people, rather than to just express the general idea as you have
above...

Sort of like this post:
http://www.oreillynet.com/pub/wlg/7614

--
Like Music?
http://l-i-e.com/artists.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


On Wed, November 9, 2005 7:59 am, bruce wrote:
> you miss a key nuance/point to the msg. her idea/thought was twofold.
> 1)
> whether companies would have ideas/projects that they would be
> interested in
> partially funding, and 2) if there would be a 'talented' pool of
> developers
> who would be interested in working on the initial apps.

Hmmmm. My answer must have confused rather than clarified.

The answer to both of these questions is "Yes"

The issue is, who is willing and has the skills to take this idea and
to execute the actions needed to make it work?

http://www.oreillynet.com/pub/wlg/7614

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Hello, Clive.

Depending on the target of your website, you shall need to keep in mind
the (in)accessibility of this kind of tests:
http://www.w3.org/TR/2003/WD-turingtest-20031105/

By the way, AFAIK they are also known as "turing numbers".

Regards.

Clive wrote:
> Hi
> does any one have a class/function to generate those security code images.
>
> Yhe ones that you see on website that you must enter to submit a form
>
> thanks
>
> clive

--
Best regards,

Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

attached mail follows:


www.phpclasses.org -> There was just one pushed out recently in fact. I
am not sitting in front of my archive or I could give you a direct URL
to it, but they have them there.

If you can't find it there, email me back directly and I'll send the
link when I get back from my conference.

Robert

----- Original Message -----
From: Clive <clivezlogic.co.za>
Date: Wednesday, November 9, 2005 0:53 am
Subject: [PHP] security code

> Hi
> does any one have a class/function to generate those security code
> images.
> Yhe ones that you see on website that you must enter to submit a form
>
> thanks
>
> clive
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


<?php

print <<<EOF

<HTML>
$_SERVER['PHP_SELF']
</HTML>
EOF;

?>

Here's the coding and the error for it was this:

> > Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> > expecting
> > T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web
> > Server\htdocs\document1.php on line 6
> > "

Thank you.
Sincerely,

Paul Lee Williams III

>From: "Richard Lynch" <ceol-i-e.com>
>Reply-To: ceol-i-e.com
>To: "Paul Williams" <retchedhotmail.com>
>CC: php-generallists.php.net
>Subject: Re: [PHP] Using the echo tag...
>Date: Tue, 8 Nov 2005 19:25:12 -0600 (CST)
>MIME-Version: 1.0
>Received: from o2.hostbaby.com ([67.139.134.202]) by mc5-f37.hotmail.com
>with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Nov 2005 17:25:08 -0800
>Received: (qmail 79084 invoked by uid 98); 9 Nov 2005 01:25:13 -0000
>Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from <ceol-i-e.com>,
>uid 1013) with qmail-scanner-1.25 (clamdscan: 0.70-rc.
>Clear:RC:1(127.0.0.1):. Processed in 0.157818 secs); 09 Nov 2005 01:25:13
>-0000
>Received: from unknown (HELO l-i-e.com) (127.0.0.1) by localhost with
>SMTP; 9 Nov 2005 01:25:12 -0000
>Received: from 67.108.68.36 (SquirrelMail authenticated user
>ceol-i-e.com) by www.l-i-e.com with HTTP; Tue, 8 Nov 2005
>19:25:12 -0600 (CST)
>X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
>X-Qmail-Scanner-Mail-From: ceol-i-e.com via o2.hostbaby.com
>X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.157818 secs)
>References: <5066.67.108.68.36.1131491998.squirrelwww.l-i-e.com>
><BAY103-F26B626DEB0C3C542DF29E5A6640phx.gbl>
>User-Agent: Hostbaby Webmail
>Return-Path: ceol-i-e.com
>X-OriginalArrivalTime: 09 Nov 2005 01:25:09.0224 (UTC)
>FILETIME=[6C5A3680:01C5E4CC]
>
>On Tue, November 8, 2005 5:32 pm, Paul Williams wrote:
> > Nope sorry. It says this error "
> > Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> > expecting
> > T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web
> > Server\htdocs\document1.php on line 6
> > "
>
>Show us EXACTLY what you have in lines 1 through 6.
>
>Not just sorta.
>
>Copy-n-paste it.
>
>Or put it up on the web as TEXT output.
>
>Odds are pretty good your real mistake is in line 5 or even before that.
>
>--
>Like Music?
>http://l-i-e.com/artists.htm
>
>

attached mail follows:


On 11/9/05 9:45 AM, Paul Williams wrote:
> <?php
>
> print <<<EOF
>
> <HTML>
> $_SERVER['PHP_SELF']
> </HTML>
> EOF;
>
> ?>

Try it with curly braces:

<?php

print <<<EOF

<HTML>
{$_SERVER['PHP_SELF']}
</HTML>
EOF;

?>

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


Alright cool that one worked. Do I have to include the curly braces in all
calls to variables or just the superglobals?

Thank you.
Sincerely,

Paul Lee Williams III

>From: Ben Ramsey <ramseyphp.net>
>To: php-generallists.php.net,Paul Williams <retchedhotmail.com>
>CC: ceol-i-e.com
>Subject: Re: [PHP] Using the echo tag...
>Date: Wed, 09 Nov 2005 09:48:52 -0500
>MIME-Version: 1.0
>Received: from lists.php.net ([216.92.131.4]) by mc10-f41.hotmail.com with
>Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Nov 2005 06:48:57 -0800
>Received: from ([69.164.218.60:21029] helo=localhost.localdomain)by
>pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTPid 16/ED-28724-75C02734
>for <retchedhotmail.com>; Wed, 09 Nov 2005 09:48:55 -0500
>X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
>Return-Path: <ramseyphp.net>
>X-Host-Fingerprint: 69.164.218.60
>eycb01-00-cntnga-69-164-218-60.atlaga.adelphia.net User-Agent: Mozilla
>Thunderbird 1.0.6 (Macintosh/20050716)
>X-Accept-Language: en-us, en
>References: <21404.67.108.68.36.1131499512.squirrelwww.l-i-e.com>
><BAY103-F259A00E2EAE61BF697BE25A6670phx.gbl>
>X-Posted-By: 69.164.218.60
>X-OriginalArrivalTime: 09 Nov 2005 14:48:57.0698 (UTC)
>FILETIME=[B6C35420:01C5E53C]
>
>On 11/9/05 9:45 AM, Paul Williams wrote:
>><?php
>>
>>print <<<EOF
>>
>><HTML>
>>$_SERVER['PHP_SELF']
>></HTML>
>>EOF;
>>
>>?>
>
>Try it with curly braces:
>
><?php
>
>print <<<EOF
>
><HTML>
>{$_SERVER['PHP_SELF']}
></HTML>
>EOF;
>
>?>
>
>--
>Ben Ramsey
>http://benramsey.com/

attached mail follows:


On 11/9/05 9:51 AM, Paul Williams wrote:
> Alright cool that one worked. Do I have to include the curly braces in
> all calls to variables or just the superglobals?

It's not a superglobal issue; it's an array issue -- or, rather, it's an
issue with using quotation marks. You could have also done it this way:

<?php

print <<<EOF

<HTML>
$_SERVER[PHP_SELF]
</HTML>
EOF;

?>

Personally, I put curly braces around all interpolated variables because
it makes it easier for me to read and see the variables, but this is
really up to user preference.

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


On 11/9/05 10:03 AM, Paul Williams wrote:
> So would it be acceptable if I used curly braces on all variables
> (whether superglobals or not) in a here document?

Yes.

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


Use:

 
<?php

print <<<EOF

<HTML>
{$_SERVER['PHP_SELF']}
</HTML>
EOF;

?>

Best Regards,
Alan

-----Messaggio originale-----
Da: Paul Williams [mailto:retchedhotmail.com]
Inviato: mercoledì 9 novembre 2005 15.45
A: ceol-i-e.com
Cc: php-generallists.php.net
Oggetto: Re: [PHP] Using the echo tag...

<?php

print <<<EOF

<HTML>
$_SERVER['PHP_SELF']
</HTML>
EOF;

?>

Here's the coding and the error for it was this:

> > Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> > expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program
> > Files\Abyss Web Server\htdocs\document1.php on line 6 "

Thank you.
Sincerely,

Paul Lee Williams III

>From: "Richard Lynch" <ceol-i-e.com>
>Reply-To: ceol-i-e.com
>To: "Paul Williams" <retchedhotmail.com>
>CC: php-generallists.php.net
>Subject: Re: [PHP] Using the echo tag...
>Date: Tue, 8 Nov 2005 19:25:12 -0600 (CST)
>MIME-Version: 1.0
>Received: from o2.hostbaby.com ([67.139.134.202]) by
>mc5-f37.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Nov
>2005 17:25:08 -0800
>Received: (qmail 79084 invoked by uid 98); 9 Nov 2005 01:25:13 -0000
>Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from <ceol-i-e.com>,
>uid 1013) with qmail-scanner-1.25 (clamdscan: 0.70-rc.
>Clear:RC:1(127.0.0.1):. Processed in 0.157818 secs); 09 Nov 2005
>01:25:13 -0000
>Received: from unknown (HELO l-i-e.com) (127.0.0.1) by localhost with
>SMTP; 9 Nov 2005 01:25:12 -0000
>Received: from 67.108.68.36 (SquirrelMail authenticated user
>ceol-i-e.com) by www.l-i-e.com with HTTP; Tue, 8 Nov 2005
>19:25:12 -0600 (CST)
>X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
>X-Qmail-Scanner-Mail-From: ceol-i-e.com via o2.hostbaby.com
>X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.157818 secs)
>References: <5066.67.108.68.36.1131491998.squirrelwww.l-i-e.com>
><BAY103-F26B626DEB0C3C542DF29E5A6640phx.gbl>
>User-Agent: Hostbaby Webmail
>Return-Path: ceol-i-e.com
>X-OriginalArrivalTime: 09 Nov 2005 01:25:09.0224 (UTC)
>FILETIME=[6C5A3680:01C5E4CC]
>
>On Tue, November 8, 2005 5:32 pm, Paul Williams wrote:
> > Nope sorry. It says this error "
> > Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> > expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program
> > Files\Abyss Web Server\htdocs\document1.php on line 6 "
>
>Show us EXACTLY what you have in lines 1 through 6.
>
>Not just sorta.
>
>Copy-n-paste it.
>
>Or put it up on the web as TEXT output.
>
>Odds are pretty good your real mistake is in line 5 or even before that.
>
>--
>Like Music?
>http://l-i-e.com/artists.htm
>
>

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Thanks! It turns out there was an rpm installed php-4.2.3 which was
clobbering with my PHP-5.0.5 installation.

I removed it with

apt-get remove php

and reinstalled PHP-5.0.5 and pear works fine!

Thanks again!

-Minuk

M wrote:

> Minuk Choi wrote:
>
>> I can't seem to get pear to work correctly.
>>
>> if I type
>>
>> [/]# pear install DB
>>
>> I get the usage printed out back(no error message, no action)
>>
>> and if I go to the PHP-5.0.4/lib/php directory, I get
>> [PHP-5.0.4/lib/php]# pear install DB
>>
>> <br />
>> <b>Fatal error</b>: Call to undefined function: getoptions() in
>> <b>/usr/bin/pear</b> on line<b>34</b><br />
>>
>> I tried with PHP-5.0.3 and PHP-5.0.2 with the same result. With some
>> google-assisted digging, I found that PEAR/Command.php doesn't have a
>> getOptions function defined... but instead of me trying to overwrite
>> a file or two, I'd like to ask this question
>>
>> Is PEAR broken with PHP5?
>>
>> I mean, I tried re-installing it... (only PHP-5.0.2 - PHP-5.0.4) and
>> pear or pearcmd.php doesn't work. It worked fine for PHP 4, so I'm a
>> little surprised. Any insight?
>
>
> do you have only php5 version installed? If you execute
> $ php -v
> what version do you get?
>

attached mail follows:


hi...

php appears to be fine/good for prototyping. my question; does anybody have
testing experience regarding scalability of php .vs java. ie, can php scale
to handle 1000s of simultaneous connections/users, as well as deal with the
various security issues...

articles dealing with actual live test data would be helpful. i'd also be
interested in hearing from your experience if you've actually had to look
into this issue.

haven't really seen a lot of hard data on this via google.. lots of mine is
better than yours.. but i'm trying to really get a feel as to whether php
can really drive serious commercial sites...

thanks

-bruce
bedouglasearthlink.net

attached mail follows:


bruce wrote:
> hi...
>
> php appears to be fine/good for prototyping. my question; does anybody have
> testing experience regarding scalability of php .vs java. ie, can php scale
> to handle 1000s of simultaneous connections/users, as well as deal with the
> various security issues...
>
> articles dealing with actual live test data would be helpful. i'd also be
> interested in hearing from your experience if you've actually had to look
> into this issue.
>
> haven't really seen a lot of hard data on this via google.. lots of mine is
> better than yours.. but i'm trying to really get a feel as to whether php
> can really drive serious commercial sites...

Put simply, it's down to the quality of the programmer. Good programmer
= good code; scalable and performant. Bad programmer = bad code. It
doesn't get any simpler than that really.

--
Richard Heyes
http://www.phpguru.org

attached mail follows:


bruce wrote:
> i'm trying to really get a feel as to whether php can really drive
> serious commercial sites.

Yahoo gets 3.4 billion page views per day. That serious enough for you?

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

attached mail follows:


Hi bruce,

Programming can be as good as the programer can be. If you look at the
google site, how it works, how many concurrent processes that code can
do, you realize that tools available for this purposes (Phyton, Perl,
PHP java) do what you want them to do.

Just try to take a look to them and then pick up your tool.

In 5 words. It is Up to you

bruce wrote:

>hi...
>
>php appears to be fine/good for prototyping. my question; does anybody have
>testing experience regarding scalability of php .vs java. ie, can php scale
>to handle 1000s of simultaneous connections/users, as well as deal with the
>various security issues...
>
>articles dealing with actual live test data would be helpful. i'd also be
>interested in hearing from your experience if you've actually had to look
>into this issue.
>
>haven't really seen a lot of hard data on this via google.. lots of mine is
>better than yours.. but i'm trying to really get a feel as to whether php
>can really drive serious commercial sites...
>
>thanks
>
>-bruce
>bedouglasearthlink.net
>
>
>

attached mail follows:


> Yahoo gets 3.4 billion page views per day. That serious enough for you?
>

I can't believe that Yahoo! works on PHP. Any proofs?
As I know they use their own-written engine, if I'm correct it's called
"yScript". Am I right?

attached mail follows:


On 11/9/05 11:58 AM, Rosty Kerei wrote:
>>Yahoo gets 3.4 billion page views per day. That serious enough for you?
>
> I can't believe that Yahoo! works on PHP. Any proofs?
> As I know they use their own-written engine, if I'm correct it's called
> "yScript". Am I right?

Try here for your "proof":
http://public.yahoo.com/~radwin/talks/php-at-yahoo-zend2005.pdf

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


[snip]
> Yahoo gets 3.4 billion page views per day. That serious enough for you?
>

I can't believe that Yahoo! works on PHP. Any proofs?
As I know they use their own-written engine, if I'm correct it's called
"yScript". Am I right?
[/snip]

You 'were' right...up until 2002

http://news.com.com/2100-1023-963937.html?tag=lh

attached mail follows:


On Wed, November 9, 2005 9:40 am, bruce wrote:
> php appears to be fine/good for prototyping. my question; does anybody
> have
> testing experience regarding scalability of php .vs java. ie, can php
> scale
> to handle 1000s of simultaneous connections/users, as well as deal
> with the
> various security issues...

PHP and Java scale up in a rather different manner.

PHP itself is generally based on a "shared nothing" architecture.

Need more web bandwidth ; buy more cheap hardware.

At the backend of the web, you probably have some kind of other
services, usually a database, and frequently some other processes that
must share data of some sort.

Java tends to throw that into its Framework, and that Framework
provides a nexus through which resource allocation/utilization is
managed.

In PHP, you are expected to choose your own preferred resource
management plan.

Both can scale as large as you can afford to buy hardware, and as much
as your skill allows you to maximize your hardware ROI.

> articles dealing with actual live test data would be helpful. i'd also
> be
> interested in hearing from your experience if you've actually had to
> look
> into this issue.
>
> haven't really seen a lot of hard data on this via google.. lots of
> mine is
> better than yours.. but i'm trying to really get a feel as to whether
> php
> can really drive serious commercial sites...

Obviously it can because it does.

You've already been given an example, and refuse to believe it. There
would seem to be little point to giving more examples.

You can choose PHP or Java or both and provide whatever services you want

#30#

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Look at the Thousand and Thousands of vBulletin boards, PHPBB's and other
PHP/MySQL based BB Systems out there with several thousand Members on at once,
not including guests. I know Yahoo! uses PHP and I've heard Google does as
well?

attached mail follows:


Uh.... isset will work in this particular instance because $_POST is
an array whose values are of one type and one type only: STRINGS.

Yes, it is true that:
$myArray['a'] = NULL;
isSet($myArray['a']); //Will return FALSE.

However, because $_POST contains STRINGS AND STRINGS ONLY, isSet works:

$myArray['a'] = '';
$myArray['b'] = "NULL";
isSet($myArray['a']); //Will return TRUE
isSet($myArray['b']); //Will return TRUE
isSet($myArray['c']); //Will return FALSE

$_POST will *NOT* contain a value of NULL type. It's not possible.
It's unheard of. It's heresey.

On a side not, before parsing my arrays in code I always go through
and remove null values because they foul up iteration. The point is
you will not have NULL in this situation, nor will you ever care about
NULL values in an array.
On 11/8/05, Ben Ramsey <ramseyphp.net> wrote:
> On 11/8/05 11:52 PM, Ben Ramsey wrote:
> > I know this is off-topic for this thread, but just as I see isset()
> > misused (as in this case), I often see empty() misused. For example,
> > when using empty(), the following all return TRUE:
>
> On second thought, "misused" is the wrong word. I mean "misunderstood."
>
> --
> Ben Ramsey
> http://benramsey.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Richard Lynch wrote:

>On Sun, November 6, 2005 2:17 am, Chris W wrote:
>
>
>>I just tried to use the output of the export function on phpmyadmin
>>and
>>got a million errors. After looking at the file I found that certain
>>columns that are strings were not quoted at all. I can't find any
>>reason why some are and some are not quoted. Anyone have any idea why
>>this is happening?
>>
>>
>
>Because unless a field contains a ',' or '"' character, it doesn't
>NEED quotes to delineate it:
>
>1,test,3
>1,"I said,""It's not the same""",3
>
>is the same thing as:
>1,"test",3
>1,"I said,""It's not the same""",3
>
>Your import function is BROKEN in a major way, by requiring quotes
>where they are not strictly necessary to conform to the CSV
>specification.
>
>That said, it's probably easier to get phpMyAdmin to always quote the
>output than it is to fix whatever broken import tool you are using.
>
>
>
The program I am using to import the data is the MySQL tools. They
don't like the output of phpMyAdmin 2.6.1-rc1. And I don't have any
control over the server so I can't upgrade the version either. Unless I
find a work around, I'm SOL

--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com

attached mail follows:


On Wed, November 9, 2005 11:05 am, Chris W wrote:
> Richard Lynch wrote:
>
>>On Sun, November 6, 2005 2:17 am, Chris W wrote:
>>
>>
>>>I just tried to use the output of the export function on phpmyadmin
>>>and
>>>got a million errors. After looking at the file I found that
>>> certain
>>>columns that are strings were not quoted at all. I can't find any
>>>reason why some are and some are not quoted. Anyone have any idea
>>> why
>>>this is happening?
>>>
>>>
>>
>>Because unless a field contains a ',' or '"' character, it doesn't
>>NEED quotes to delineate it:
>>
>>1,test,3
>>1,"I said,""It's not the same""",3
>>
>>is the same thing as:
>>1,"test",3
>>1,"I said,""It's not the same""",3
>>
>>Your import function is BROKEN in a major way, by requiring quotes
>>where they are not strictly necessary to conform to the CSV
>>specification.
>>
>>That said, it's probably easier to get phpMyAdmin to always quote the
>>output than it is to fix whatever broken import tool you are using.
>>
>>
>>
> The program I am using to import the data is the MySQL tools. They
> don't like the output of phpMyAdmin 2.6.1-rc1. And I don't have any
> control over the server so I can't upgrade the version either. Unless
> I
> find a work around, I'm SOL

You could probably import into something smart enough to handle the
missing quotes, then export with a setting that always quotes.

I believe Excel (gak!) would do this correctly.

PHP's http://php.net/fgetcsv might do the right thing, and you could
write out the CSV any which way you want... Or, at that point, just
write an INSERT query.

Which route to take depends how big the file is, and how often you
have to do this and what tools you are familiar with.

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Hi folks... a bit of a newbie question I'm afraid...

I've written this script shown below. It gets its variables from a form, and then it (supposedly!) writes these values into a MySQL table ('invoices').

The script executes with no errors, but when I check the table, the table is still empty. I can manually insert the data directly into the table, and when I echo the variables in the script, the values are displayed whe I run it, but for reasons unknown, the values are not written to the table.

Any ideas? The code is below.

Many thanks.
Stewart

<?php

// this opens the connection to the db
include 'library/opendb.php';

// this adds detals to the invoice table
$item1_desc = $_REQUEST['item1_desc'];
$item2_desc = $_REQUEST['item2_desc'];
$item3_desc = $_REQUEST['item3_desc'];
$item4_desc = $_REQUEST['item4_desc'];
$item1_cost = $_REQUEST['item1_cost'];
$item2_cost = $_REQUEST['item2_cost'];
$item3_cost = $_REQUEST['item3_cost'];
$item4_cost = $_REQUEST['item4_cost'];
$delivery_cost = $_REQUEST['delivery_cost'];

$add_to_db = "insert into invoices (item1_desc, item1_cost, item2_desc, item2_cost, item3_desc, item3_cost, item4_desc, item4_cost, delivery_cost) values ('$item1_desc', '$item1_cost', '$item2_desc', '$item2_cost', '$item3_desc', '$item3_cost', '$item4_desc', '$item4_cost', '$delivery_cost')";
mysql_query($add_to_db);

?>

attached mail follows:


[snip]
Any ideas? The code is below.
[/snip]

Does your MySQL connection have permission to insert to the table?

attached mail follows:


On 11/9/05 2:15 PM, Stewart Priest wrote:
> <?php
>
> // this opens the connection to the db
> include 'library/opendb.php';
>
> // this adds detals to the invoice table
> $item1_desc = $_REQUEST['item1_desc'];
> $item2_desc = $_REQUEST['item2_desc'];
> $item3_desc = $_REQUEST['item3_desc'];
> $item4_desc = $_REQUEST['item4_desc'];
> $item1_cost = $_REQUEST['item1_cost'];
> $item2_cost = $_REQUEST['item2_cost'];
> $item3_cost = $_REQUEST['item3_cost'];
> $item4_cost = $_REQUEST['item4_cost'];
> $delivery_cost = $_REQUEST['delivery_cost'];
>
> $add_to_db = "insert into invoices (item1_desc, item1_cost, item2_desc, item2_cost, item3_desc, item3_cost, item4_desc, item4_cost, delivery_cost) values ('$item1_desc', '$item1_cost', '$item2_desc', '$item2_cost', '$item3_desc', '$item3_cost', '$item4_desc', '$item4_cost', '$delivery_cost')";
> mysql_query($add_to_db);
>
> ?>

Comment out the mysql_query() line and just echo $add_to_db. Then take
the echoed line and try to run it against the database. Does it still
work, then?

--
Ben Ramsey
http://benramsey.com/

attached mail follows:


Hi Stewart,

Wednesday, November 9, 2005, 7:15:39 PM, you wrote:

> The script executes with no errors, but when I check the table, the
> table is still empty. I can manually insert the data directly into
> the table, and when I echo the variables in the script, the values
> are displayed whe I run it, but for reasons unknown, the values are not written to the table.

> $add_to_db = "insert into invoices (item1_desc, item1_cost,
> item2_desc, item2_cost, item3_desc, item3_cost, item4_desc,
> item4_cost, delivery_cost) values ('$item1_desc', '$item1_cost',
> '$item2_desc', '$item2_cost', '$item3_desc', '$item3_cost',
> '$item4_desc', '$item4_cost', '$delivery_cost')";
> mysql_query($add_to_db);

?>>

On the surface it looks fine, so I would echo out your query and then
paste it into MySQL (phpmyamin, SQLyog, etc) and check it works!

Or you could capture the result of the query and check for an error.

If there isn't one, it's probably a table design issue.

Cheers,

Rich
--
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

attached mail follows:


print $add_to_db;

should print out the entire insert line and you can just double check
that your values are full, otherwise like Jay said I would check and
make sure the user you have in your connect string can write to the
db.

On 11/9/05, Stewart Priest <smileystewartpriest.com> wrote:
> Hi folks... a bit of a newbie question I'm afraid...
>
> I've written this script shown below. It gets its variables from a form, and then it (supposedly!) writes these values into a MySQL table ('invoices').
>
> The script executes with no errors, but when I check the table, the table is still empty. I can manually insert the data directly into the table, and when I echo the variables in the script, the values are displayed whe I run it, but for reasons unknown, the values are not written to the table.
>
> Any ideas? The code is below.
>
> Many thanks.
> Stewart
>
> <?php
>
> // this opens the connection to the db
> include 'library/opendb.php';
>
> // this adds detals to the invoice table
> $item1_desc = $_REQUEST['item1_desc'];
> $item2_desc = $_REQUEST['item2_desc'];
> $item3_desc = $_REQUEST['item3_desc'];
> $item4_desc = $_REQUEST['item4_desc'];
> $item1_cost = $_REQUEST['item1_cost'];
> $item2_cost = $_REQUEST['item2_cost'];
> $item3_cost = $_REQUEST['item3_cost'];
> $item4_cost = $_REQUEST['item4_cost'];
> $delivery_cost = $_REQUEST['delivery_cost'];
>
> $add_to_db = "insert into invoices (item1_desc, item1_cost, item2_desc, item2_cost, item3_desc, item3_cost, item4_desc, item4_cost, delivery_cost) values ('$item1_desc', '$item1_cost', '$item2_desc', '$item2_cost', '$item3_desc', '$item3_cost', '$item4_desc', '$item4_cost', '$delivery_cost')";
> mysql_query($add_to_db);
>
> ?>
>

attached mail follows:


<snippity snip>
>
> Any ideas? The code is below.
<snip snip>
> mysql_query($add_to_db);

Hi Stewart. Your query is failing for some reason (as others here have
mentioned). I would change the above line to read:

mysql_query($add_to_db) or die(mysql_error()."<br>$add_to_db");

This will make the script die, and will print the mysql error and the SQL
statement that caused it.

JM

attached mail follows:


<snip>
print $add_to_db;
</snip>

Thanks for all your replies! I didn't expect to get one so quick, so thanks!

After I did the above, I pasted the output into MySQL. Guess what? It didn't
work!

I was only sending values for $item1_desc and $item1_cost. Because I was not
sending values for the other columns, I was getting an error message saying
the data was truncated for the empty variables.

Now I need to figure out how to send empty values... would NULL do the job?

Thanks again!
Stewart

attached mail follows:


What is the structure of that table?

On 11/9/05, Stewart Priest <smileystewartpriest.com> wrote:
> <snip>
> print $add_to_db;
> </snip>
>
> Thanks for all your replies! I didn't expect to get one so quick, so thanks!
>
> After I did the above, I pasted the output into MySQL. Guess what? It didn't
> work!
>
> I was only sending values for $item1_desc and $item1_cost. Because I was not
> sending values for the other columns, I was getting an error message saying
> the data was truncated for the empty variables.
>
> Now I need to figure out how to send empty values... would NULL do the job?
>
> Thanks again!
> Stewart
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I code all my apps to look for an empty variable and dump and empty set
into it. That way when I code the rest of the information into the
database, the files are cleaner and I don't have to worry about users
and bad sets.

$var = '';

Robert

----- Original Message -----
From: Stewart Priest <smileystewartpriest.com>
Date: Wednesday, November 9, 2005 2:43 pm
Subject: Re: [PHP] Unable to send variables to MySQL table

> <snip>
> print $add_to_db;
> </snip>
>
> Thanks for all your replies! I didn't expect to get one so quick,
> so thanks!
>
> After I did the above, I pasted the output into MySQL. Guess what?
> It didn't
> work!
>
> I was only sending values for $item1_desc and $item1_cost. Because
> I was not
> sending values for the other columns, I was getting an error
> message saying
> the data was truncated for the empty variables.
>
> Now I need to figure out how to send empty values... would NULL do
> the job?
>
> Thanks again!
> Stewart
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


<snip>
What is the structure of that table?
</snip>

+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| invoice_no | int(10) | YES | | NULL | |
| item1_desc | varchar(255) | YES | | NULL | |
| item1_cost | float | YES | | NULL | |
| item2_desc | varchar(255) | YES | | NULL | |
| item2_cost | float | YES | | NULL | |
| item3_desc | varchar(255) | YES | | NULL | |
| item3_cost | float | YES | | NULL | |
| item4_desc | varchar(255) | YES | | NULL | |
| item4_cost | float | YES | | NULL | |
| delivery_cost | float | YES | | NULL | |
| customer_id | int(10) | YES | | NULL | |
| comments | varchar(255) | YES | | NULL | |
+---------------+--------------+------+-----+---------+-------+

attached mail follows:


Stewart Priest wrote:
> <snip>
> What is the structure of that table?
> </snip>
>
> +---------------+--------------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------------+--------------+------+-----+---------+-------+
> | invoice_no | int(10) | YES | | NULL | |
> | item1_desc | varchar(255) | YES | | NULL | |
> | item1_cost | float | YES | | NULL | |
> | item2_desc | varchar(255) | YES | | NULL | |
> | item2_cost | float | YES | | NULL | |
> | item3_desc | varchar(255) | YES | | NULL | |
> | item3_cost | float | YES | | NULL | |
> | item4_desc | varchar(255) | YES | | NULL | |
> | item4_cost | float | YES | | NULL | |
> | delivery_cost | float | YES | | NULL | |
> | customer_id | int(10) | YES | | NULL | |
> | comments | varchar(255) | YES | | NULL | |
> +---------------+--------------+------+-----+---------+-------+
>

This is not a good structure. Have you thought about taking item*
columns to a separate table?

Table invoices:
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| invoice_no | int(10) | YES | | NULL | |
| delivery_cost | float | YES | | NULL | |
| customer_id | int(10) | YES | | NULL | |
| comments | varchar(255) | YES | | NULL | |
+---------------+--------------+------+-----+---------+-------+

Table invoices_items:
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| item_no | int(10) | YES | | NULL | |
| invoice_no | int(10) | YES | | NULL | |
| item_desc | varchar(255) | YES | | NULL | |
| item_cost | float | YES | | NULL | |
+---------------+--------------+------+-----+---------+-------+

And columns should be able to hold NULL values only if they can be
empty. I'm sure you don't want invoice_no to be NULL ;)

attached mail follows:


Richard (ceol-i-e.com) wrote:

> http://php.net/gd
> This will let you imagecreatefromgif() and then imagejpeg()

I didn't find any mentioning, that the imagejpeg function supports
conversion to CMYK, so it is most liky that it will not help the
original poster. ImageMagick is the way to go... ;-)

Jens

--
This mail was scanned by AntiVir Milter.
This product is licensed for non-commercial use.
See www.antivir.de for details.

attached mail follows:


I was working with objects, and suddenly i got this error:
*Parse error*: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in *
D:\Apache\Apache(re)\Apache2\htdocs\Include.php* on line *11*
is this like a bug in PHP or is it a valid error?
thanks in advance

attached mail follows:


[snip]
I was working with objects, and suddenly i got this error:
*Parse error*: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in *
D:\Apache\Apache(re)\Apache2\htdocs\Include.php* on line *11*
is this like a bug in PHP or is it a valid error?
thanks in advance
[/snip]

It means that you have two colons not being used correctly
http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

attached mail follows:


On Wed, Nov 09, 2005 at 04:27:08PM -0500, Unknown Unknown wrote:
> I was working with objects, and suddenly i got this error:
> *Parse error*: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in *
> D:\Apache\Apache(re)\Apache2\htdocs\Include.php* on line *11*
> is this like a bug in PHP or is it a valid error?

It is a valid. The T_PAAMAYIM_NEKUDOTAYIM is refering to a the
double colon (::) token. You would get that error if you use it
wrong, like:

  'foo'::bar;

Btw, Paamayim Nekudotayim means double colon in hebrew.

Curt.
--

attached mail follows:


t_paamayim_nekudotayim is Hebrew for term twice colon
I believe that its saying that you need to use the :: operator.

On 11/9/05, Unknown Unknown <phpinfolistgmail.com> wrote:
> I was working with objects, and suddenly i got this error:
> *Parse error*: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in *
> D:\Apache\Apache(re)\Apache2\htdocs\Include.php* on line *11*
> is this like a bug in PHP or is it a valid error?
> thanks in advance
>
>

attached mail follows:


Ah yes that fixed it, thanks

attached mail follows:


Yay! Useless Trivia Time!

That big nasty word is apparently the name for "::". Here's a PHP manual page explaining how it's used. I'd recommend looking for a misuse of the "::" operator in your code.

http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

Enjoy!

-TG

= = = Original message = =
I was working with objects, and suddenly i got this error:
*Parse error*: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in *
D:\Apache\Apache(re)\Apache2\htdocs\Include.php* on line *11*
is this like a bug in PHP or is it a valid error?
thanks in advance

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


>
> Btw, Paamayim Nekudotayim means double colon in hebrew.
>

I suppose it would be an insult of the highest order to call a Hebrew man
and his brother "Paamayim Nekudotayim".

JM

attached mail follows:


What is the correct syntax for

$query = "SELECT * FROM login where username='$_POST['username']' AND pass
='$_POST['pass']'";

Thought this would work.

R.