php-general Digest 7 Mar 2007 06:39:14 -0000 Issue 4663
Topics (messages 249932 through 249957):
Re: [PHP-DB] array field type
249932 by: Micah Stevens
249940 by: Mark
List all files in directory
249933 by: Helder Lopes
249934 by: Jay Blanchard
249935 by: Jochem Maas
249943 by: Tom Chubb
249944 by: Jim Moseby
249945 by: Børge Holen
249950 by: Jay Blanchard
249951 by: Børge Holen
Re: Opinion on on-line payment and banking gateway
249936 by: Seak, Teng-Fong
249938 by: Seak, Teng-Fong
249939 by: Eric Butera
249942 by: Jim Moseby
Re: RE:[[PHP] Error in Script!!!
249937 by: Tijnema !
Re: Problem with spam
249941 by: Børge Holen
Launch a seperate process
249946 by: Brad Fuller
249947 by: fedt
249948 by: Brad Fuller
249949 by: Jon Anderson
249954 by: Richard Lynch
zipArchive - corrupting files?
249952 by: KMiller
Live Sound experience?
249953 by: Richard Lynch
Re: Combining sound files
249955 by: Richard Lynch
Re: advise on consulting fees
249956 by: Richard Lynch
change Style Sheet by programming
249957 by: Alain Roger
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 ---
Wrong! Take a look at the SET datatype
http://dev.mysql.com/doc/refman/4.1/en/set.html. This allows you to have an
array of values in a single field, and the user can select any number of
them.
Sort of, but not really: This is a really specialized keyword, and
depends on binary mapping of enum-ish sets. As a results you have a
maximum of 64 possible values, and only 1 dimension. Large or
multdimensional arrays wouldn't work with this.
-Micah
--- End Message ---
--- Begin Message ---
Sancar Saran wrote:
> Thanks for all those replies. It seems there was no easy solution (and or
> serializing was better solution) for us.
>
> Our arrays contains lots of things.. XML may not fit because content of
> array may broke xml structure.
>
Before you give up, take a look at the XMLDBX PHP extension at
http://www.mohawksoft.org
It uses XML and works really well.
--- End Message ---
--- Begin Message ---
Hi people
How to php give to me a list of all files in one directory to make an
editor???
--- End Message ---
--- Begin Message ---
[snip]
How to php give to me a list of all files in one directory to make an
editor???
[/snip]
RTFM, seriously. http://www.php.net/readdir
--- End Message ---
--- Begin Message ---
Helder Lopes wrote:
> Hi people
>
> How to php give to me a list of all files in one directory to make an
> editor???
if you can't figure out how to get a list of files from a directory
using php then how do you expect to write a fully fledged 'editor'?
RTFM ... there are examples that show you how to do exactly what your asking.
>
--- End Message ---
--- Begin Message ---
On 06/03/07, Helder Lopes <[EMAIL PROTECTED]> wrote:
Hi people
How to php give to me a list of all files in one directory to make an
editor???
http://php.net/readdir
--- End Message ---
--- Begin Message ---
>
> Helder Lopes wrote:
> > Hi people
> >
> > How to php give to me a list of all files in one directory
> to make an
> > editor???
>
> if you can't figure out how to get a list of files from a directory
> using php then how do you expect to write a fully fledged 'editor'?
>
> RTFM ... there are examples that show you how to do exactly
> what your asking.
>
Who wants to bet the next question is how to list all the files on the
client's machine?
JM
--- End Message ---
--- Begin Message ---
On Tuesday 06 March 2007 22:34, Jim Moseby wrote:
> > Helder Lopes wrote:
> > > Hi people
> > >
> > > How to php give to me a list of all files in one directory
> >
> > to make an
> >
> > > editor???
> >
> > if you can't figure out how to get a list of files from a directory
> > using php then how do you expect to write a fully fledged 'editor'?
> >
> > RTFM ... there are examples that show you how to do exactly
> > what your asking.
>
> Who wants to bet the next question is how to list all the files on the
> client's machine?
Oh, yes, about that, how do you _really_ use PHP to do some reading on the
client machine... like say. listing files... ;D
>
> JM
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
[snip]
Oh, yes, about that, how do you _really_ use PHP to do some reading on
the
client machine... like say. listing files... ;D
[/snip]
You're kidding, right? Here's how, set up a PHP enabled.....nah, never
mind. Just repeat to yourself Dorothy, "PHP is server-side, not
client-side......"
--- End Message ---
--- Begin Message ---
On Tuesday 06 March 2007 23:36, Jay Blanchard wrote:
> [snip]
> Oh, yes, about that, how do you _really_ use PHP to do some reading on
> the
> client machine... like say. listing files... ;D
> [/snip]
>
> You're kidding, right? Here's how, set up a PHP enabled.....nah, never
> mind. Just repeat to yourself Dorothy, "PHP is server-side, not
> client-side......"
you think...
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
Mark wrote:
> Seak, Teng-Fong wrote:
>
>> I'm not a PHP programmer. I ask this question for a friend of
>> mine. So I'm not sure if I'm using the correct terms. He's making an
>> e-commerce website and he doesn't know much about how to validate credit
>> card, or how to make transactions. What he needs is called "banking
>> gateway", right?
>>
> a couple years ago I did some research and while I'm not Sure who the
> players are right now, I concluded it was not worth the effort. We
> concluded it was better to subscribe to a credit card clearing service.
>
> They provide a basic API that allows you to pass a billing amount to the
> clearing service who, for a fee or percentage, process the credit card. You
> never Have to deal with it, they just credit your account and you ship
> goods.
>
That sounds good. Could I know more about this clearing service? I
mean, to whom should my friend contact? Some bank? His company is in
Chicago. So, is there any central banking organization in United-States
that he should contact? Or some bank in Chicago?
Thanks in advance
----------
* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised!
www.zoner.com/zps
You can download your free version.
--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
> tell him this: "never ever ever ever so much as accept a creditcard number
> as input to any of his scripts let alone store it somewhere - leave that to
> the payment provider who has the expertise, secure (hopefully) system and
> massive
> liability fund to be able to deal with such things professionally."
>
OK, jotted down.
> payment provider is probably a more used term. but yes her needs one
> of those.
> one example is paypal - there are plenty of others.
>
He's not selling any physical product. He's selling services and
on-line videos. So I don't know if PayPal suits his needs.
> google/yahoo knows more than me :-)
>
Yes, there are quite a lot, but how do we know if such and such site
is a real one? Or an honest one? Just like phishing sites are
proliferating, I think we'd be careful with anything found in the Net.
Don't you agree?
----------
* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised!
www.zoner.com/zps
You can download your free version.
--- End Message ---
--- Begin Message ---
On 3/6/07, Seak, Teng-Fong <[EMAIL PROTECTED]> wrote:
Jochem Maas wrote:
> tell him this: "never ever ever ever so much as accept a creditcard number
> as input to any of his scripts let alone store it somewhere - leave that to
> the payment provider who has the expertise, secure (hopefully) system and
massive
> liability fund to be able to deal with such things professionally."
>
OK, jotted down.
> payment provider is probably a more used term. but yes her needs one
> of those.
> one example is paypal - there are plenty of others.
>
He's not selling any physical product. He's selling services and
on-line videos. So I don't know if PayPal suits his needs.
> google/yahoo knows more than me :-)
>
Yes, there are quite a lot, but how do we know if such and such site
is a real one? Or an honest one? Just like phishing sites are
proliferating, I think we'd be careful with anything found in the Net.
Don't you agree?
----------
* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised!
www.zoner.com/zps
You can download your free version.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
When the company I work for sets up a payment gateway for a client we
always have the client set up the account through their bank. Each
bank has different payment gateway companies they are willing to work
with. Usually we are able to get a few choices from the bank and keep
it within the 3 or so gateways we support with our current e-commerce
solution.
Hope that helps!
--- End Message ---
--- Begin Message ---
> >
> He's not selling any physical product. He's selling services and
> on-line videos. So I don't know if PayPal suits his needs.
> > google/yahoo knows more than me :-)
> >
Paypal is perfect for his needs. They provide an API for use with PHP and
are easy to set up and use.
JM
--- End Message ---
--- Begin Message ---
On 3/5/07, Helder Lopes <[EMAIL PROTECTED]> wrote:
Helder Lopes wrote:
<?php
// Conexão com o banco de dados
include "mysql.php";
// Inicia sessões
session_start();
// Recupera o login
$login = $_POST["username"];
// Recupera a senha
$senha = $_POST["password"];
// Usuário não forneceu a senha ou o login
if($login==" " && $senha=" ")
{
echo "Você deve digitar sua senha e login!";
exit;
}
/*
* Executa a consulta no banco de dados.
* Caso o número de linhas retornadas seja 1 o login é válido,
* caso 0, inválido.
*/
echo $nome;
$sql = "SELECT username,realname,gid FROM utilizador WHERE
username='$login'";
$result_id = mysql_query($sql,$con) or die("<br>Erro no banco de
dados!");//line 23
Where is $con defined???
-B
$total = mysql_num_rows($result_id);
// Caso o usuário tenha digitado um login válido o número de linhas será
1..
if($total)
{
// Obtém os dados do usuário, para poder verificar a senha e passar os
demais dados para a sessão
$dados = mysql_fetch_array($result_id);
// Agora verifica a senha
if(!strcmp($senha, $dados["password"]))
{
// TUDO OK! Agora, passa os dados para a sessão e redireciona o
usuário
$_SESSION["username"] = $dados["username"];
$_SESSION["realname"] = $dados["realname"];
$_SESSION["gid"] = $dados["gid"];
require_once ('../utilizadores/listar.php');
exit;
}
// Senha inválida
else
{
echo "Senha inválida!";
exit;
}
}
// Login inválido
else
{
echo "Error";
exit;
}
?>
Why this script give me a error:
**Warning**: mysql_query(): supplied argument is not a valid MySQL-Link
resource in **ver.php** on line *23*
in a file with a name mysql.php
the $con is correct
with the other that results
I don't know , but if you have only 1 mysql connection, there's no need to
use a MySQL link, you can just leave that out, and it will use the last
opened connection by mysql_connect.
Tijnema
--- End Message ---
--- Begin Message ---
On Monday 05 March 2007 12:15, Bc. Radek Krejca wrote:
> Hi,
>
> I have problem with spam over function mail. My clients have badly
> written functions and I cannot find where. Is there in php simple
> way to detect which script generate mail? I mean like header (in
> case of returning mail) or log every using mail function etc.
Probably is, but what about using someting real easy like grep or rgrep. Those
two helps me find witch files generates quirks whenever someones in need of
some cleanup.
>
> Thank you
>
> --
> Regards
> Bc. Radek Krejca
> ICQ: 65895541
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
Is there a way in a php script to launch another script but output something
and exit (terminating the original request) before that script finishes?
I have a script that accepts data, does some stuff, returns a response and
exits.
I want that page to accept data, return a response and exit. Then the stuff
happens.
Make sense?
I am STFW right now, but nothing yet.
Any advice is much appreciated.
Thx,
B
--- End Message ---
--- Begin Message ---
pcntl_ fork() and pcntl_ wait(), yo
On 3/6/07, Brad Fuller <[EMAIL PROTECTED]> wrote:
Is there a way in a php script to launch another script but output
something
and exit (terminating the original request) before that script finishes?
I have a script that accepts data, does some stuff, returns a response and
exits.
I want that page to accept data, return a response and exit. Then the
stuff
happens.
Make sense?
I am STFW right now, but nothing yet.
Any advice is much appreciated.
Thx,
B
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
tyvm, I will check it out right away!
B
> -----Original Message-----
> From: fedt [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 06, 2007 5:17 PM
> To: Brad Fuller
> Cc: [email protected]
> Subject: Re: [PHP] Launch a seperate process
>
> pcntl_ fork() and pcntl_ wait(), yo
>
> On 3/6/07, Brad Fuller <[EMAIL PROTECTED]> wrote:
> >
> >
> > Is there a way in a php script to launch another script but output
> > something
> > and exit (terminating the original request) before that script finishes?
> >
> > I have a script that accepts data, does some stuff, returns a response
> and
> > exits.
> >
> > I want that page to accept data, return a response and exit. Then the
> > stuff
> > happens.
> >
> > Make sense?
> >
> > I am STFW right now, but nothing yet.
> >
> > Any advice is much appreciated.
> >
> > Thx,
> >
> > B
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--- End Message ---
--- Begin Message ---
fedt wrote:
pcntl_ fork() and pcntl_ wait(), yo
If you're using PHP as an apache DSO, you may find that those functions
aren't available. If you don't have the pcntl_* functions available,
there a less attractive options...I've done a request with curl with a
short timeout to "spawn" the second request from PHP. You could likely
also do it with JavaScript/AJAX. There are probably lots of other ways,
in fact there may have been a discussion here some time ago about it
though I don't remember the outcome.
jon
--- End Message ---
--- Begin Message ---
On Tue, March 6, 2007 4:06 pm, Brad Fuller wrote:
> Is there a way in a php script to launch another script but output
> something
> and exit (terminating the original request) before that script
> finishes?
>
> I have a script that accepts data, does some stuff, returns a response
> and
> exits.
>
> I want that page to accept data, return a response and exit. Then the
> stuff
> happens.
>
> Make sense?
>
> I am STFW right now, but nothing yet.
>
> Any advice is much appreciated.
http://php.net/pcntl
What you describe is called "fork" for a more general Google
experience about it.
To take a previous post a bit further:
Unless you are 100% sure that all your OTHER extensions are
thread-safe, you should not add pcntl to your web-server installation,
unless you actually LIKE random server crashes as your forked threads
stomp all over each other...
And, from hard-won recent personal experience, in Gentoo, you have to
edit /etc/make.conf or whatever it is and NOT the /etc/packages
thingie, and definitely not just USE in the ports system, because
otherwise you will find yourself a victim of Gentoo assuming one of
the following:
Oh, you said you wanted pcntl, but this is an Apache build, and that's
bad, so I'll take it out.
Oh, you said you wanted PHP CLI with pctnl, but you had Apache module
before, so I'll uninstall Apache module to give you PHP CLI.
Oh, you said you wanted Apache Module without pcntl, but you had PHP
CLI before, so I'll uninstall PHP CLI to give you Apache module.
I'm not quite sure why Gentoo package making people thought all that
was a "good idea", but it did at least give me LOTS of practice in
installing PHP under Gentoo...
Tossing pcntl and Apache into the /etc/make.conf, for some reason
beyond my ken, convinced Gentoo that I actually wanted pcntl in CLI
where it makes sense, and not in Apache module where it doesn't.
This was PHP 4 and Apache 1.3, in case that matters.
YMMV
NAIAA
PS I do not claim to actually understand the Gentoo adminstration of
software installation system. In fact, I can categorically state that
I just do NOT "get" this system... Oh well. It's just my laptop, and
the REAL systems are managed by the expert.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
Been playing with this for a few hours and it seems that anything but a plain
text file (doc,xls,pdf,etc.) is being trashed by ZipArchive.
Has anyone had similar experiences or am I just doing something stupid and
can't see it?
Whatever the problem is, it certainly is silent about it. I thought it may
be a permissions thing but that doesn't seem to be it. The one file it
doesn't mess up is a plain text file. Anything else gets trashed.
-km
public function zipAction() {
$params = SiteControllers::getParams();
if(!isset($params['file'])) {
echo "zip: file param expected - not found";
return false;
}
$file = $params['file'];
if(!file_exists("uploads/{$file}")) {
echo "file to zip: {$file} not found";
return false;
}
$zip = new ZipArchive;
$res = $zip->open("uploads/{$file}.zip", ZipArchive::OVERWRITE);
if ($res === TRUE) {
$zip->addFile("uploads/{$file}","{$file}");
$zip->close();
unlink("uploads/{$file}");
echo "{$file} - was zipped";
return true;
} else {
echo "{$file} - zip failed";
return false;
}
}
public function unzipAction() {
$params = SiteControllers::getParams();
$file = $params['file'];
if(!isset($params['file'])) {
echo "unzip: file param expected - not found";
return false;
}
$zfn = "uploads/{$file}.zip";
if(!file_exists($zfn)) {
echo "zip file: {$zfn} not found";
return false;
}
if(file_exists("uploads/{$file}")) {
echo "file to unzip: {$file} exists";
return false;
}
$zip = new ZipArchive;
$res = $zip->open($zfn);
if ($res === TRUE) {
$zip->extractTo("uploads/");
$zip->close();
echo "{$file}: unzipped";
unlink($zfn);
return true;
} else {
echo "unzip for: {$file} failed";
return false;
}
}
--
View this message in context:
http://www.nabble.com/zipArchive---corrupting-files--tf3359654.html#a9345356
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
If you are (or even might be) attending the php|tek conference in
Chicago in May, and if you have experience running a live sound board
(e.g., Mackie 1604 VLZ Pro or similar) please contact me OFF-LIST.
Experience in rudimentary command line skills (like using * as a
wildcard) is a big plus.
While technically "on" topic, I'm pretty sure the minutae of this
would not be of interest to the general population here, and will not
post anything more about this here.
THANKS!
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
I may be replying to an outdated URL or even all out of order as I
play catchup on the list...
Your JS "play" function checks for precisely two possible browser
"appName" values:
Microsoft Internet Explorer
Netscape
Maybe Mozilla Firefox has "Netscape" in its appName, but I wouldn't
expect that...
I'm told I need a plugin still, so I guess maybe that part IS working...
On Fri, March 2, 2007 12:37 pm, tedd wrote:
> At 5:28 PM -0600 2/27/07, Richard Lynch wrote:
>>You may find it easier/faster to just locate a .wav splicer command
>>line tool and run exec with it. Though perhaps not nearly as fun,
>>depending on your definition of fun.
>
> Richard:
>
> Nah, it's easier to bit twiddle the sound files and I found an easy
> way to combine them. It's funny what a few bytes of data can do. :-)
>
> What's ya think of this -- does it work for you?
>
> http://sperling.com/examples/captcha/
>
> Cheers,
>
> tedd
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
On Fri, March 2, 2007 12:33 pm, John wrote:
> This may be deviating a bit from the intent of the list, and someone
> feel
> free to say so if the list shouldn't be used for this. My apologies in
> advance if that is the case. This is NOT a self-advertisement!
>
> My question is regarding the "going rate" for software development
> consulting -
Way too open-ended a question...
In what region?
For what specialties?
How experienced is the developer?
You can hear numbers from $15/hour in off-shored out-sourced quotes to
$X00/hour for experts in a particular areas.
X could even be a 2-digit number, for that matter.
Somebody somewhere probably even uses a 3-digit number for X.
Might as well ask us how much you should pay for a house without
saying where, how big, and in what condition...
That said:
If somebody is giving you solid steady ongoing work, you'd maybe want
to give them a "discount" from your usual rate, possibly in the 10%
neighborhood, since you'll be getting enough hours from them to make
it worth it.
Perhaps even invoice them at full price, but with the discount as a
line-item at the end, so they know what they are saving.
It can also be difficult to track time on such an open-ended deal at
first. I *highly* recommend you have a process in-place for that
client to open up new "tickets" with you, and to track the progress of
whatever needs doing and what got done.
This is also crucial to prioritize the zillion things that will get
thrown at you with (probably) little organization on their side of
things -- Or, at least, it will be organized to their convenience and
not necessarily in the best order to get your work done efficiently
and with their true best interests.
If you have a dozen 5-minute tickets, you can lump them together and
charge for an hour. If you have no tickets and just do a dozen
5-minute tasks spread out and don't account for them, it's like being
nibbled to death by ducks.
NOTE:
One reason I got back into a full-time position is that I sucked at
this kind of administrivia, and it just plain wasn't any fun (to me)
to change myself to be better at it.
YMMV
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
Hi,
I'm creating a Class which should allow user to setup the default theme CSS
file he would like to use to render a class object.
therefore i have a simple function :
public function SetTheme(string $ThemeName)
{
$this->m_ThemeUsed = $ThemeName;
}
which set the theme (CSS file) to use to render my object.
However, how can i tell to my class to render or update his render with new
CSS file theme ?
can it be possible to provoke something like a refresh ?
Or it is only a CSS or JS topic ?
thanks a lot,
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5
--- End Message ---