|
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 25 Mar 2005 01:31:09 -0000 Issue 3357
php-general-digest-help
lists.php.net
Date: Thu Mar 24 2005 - 19:31:09 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 25 Mar 2005 01:31:09 -0000 Issue 3357
Topics (messages 211455 through 211535):
Q: static method working in PHP4 and PHP5
211455 by: Piotr Klaban
211457 by: M. Sokolewicz
Re: SQL statement - please help
211456 by: Tom Rogers
Re: NetFlix Drag and Drop Row Ordering
211458 by: Martin.C.Austin.supervalu.com
211471 by: Nathan Tobik
211499 by: Graham Anderson
211514 by: Nathan Tobik
checkbox value
211459 by: William Stokes
211461 by: Ken
211469 by: afan.afan.net
Re: Listing directory, return none if only one file
211460 by: Tom Rogers
Re: convert date format
211462 by: Ken
if statement probable bug
211463 by: TheI2eptile
211464 by: TheI2eptile
211466 by: Richard Davey
211470 by: Jochem Maas
delete file
211465 by: William Stokes
211467 by: Jay Blanchard
211468 by: Richard Davey
Re: count with match probelm
211472 by: Jochem Maas
How can I destroy parameters by page
211473 by: Toms Rodriguez Orta
211476 by: Jay Blanchard
211477 by: Toms Rodriguez Orta
211480 by: Chris W. Parker
211481 by: M. Sokolewicz
211529 by: pavel
Meed a multiple merchant shopping cart please
211474 by: Denis L. Menezes
211475 by: afan.afan.net
XHTML to pdf converter
211478 by: symbulos partners
Re: Preorder Modified Tree Traversal
211479 by: Chris W. Parker
211493 by: Matt Babineau
211496 by: Chris W. Parker
image problem
211482 by: William Stokes
211535 by: Tom Rogers
Remove rows from a MySQL table?
211483 by: Phil Neeb
211484 by: Chris W. Parker
211486 by: John Nichel
211494 by: Phil Neeb
Re: Converting to a string
211485 by: Tyler Replogle
collapse SELECT from multiple tables
211487 by: David Christensen
211489 by: John Nichel
211492 by: Jay Blanchard
211495 by: John Nichel
211497 by: David Christensen
211500 by: Chris W. Parker
211501 by: Jay Blanchard
211502 by: David Christensen
211503 by: David Christensen
211504 by: Jay Blanchard
211506 by: Chris W. Parker
211515 by: David Christensen
211520 by: Chris W. Parker
211522 by: David Christensen
PHP 5.0.4RC2 rolled
211488 by: Zeev Suraski
html image
211490 by: delos
211491 by: Stephen Johnson
211511 by: Leif Gregory
PhpUnit2 - Unit test framework
211498 by: Dipesh Khakhkhar
Storing Arrays in a database
211505 by: Joe Harman
211507 by: Chris W. Parker
211508 by: afan.afan.net
211509 by: John Nichel
211510 by: Joe Harman
Problem with header in an if
211512 by: Jay Blanchard
211516 by: Chris W. Parker
211518 by: dpgirago.mdanderson.org
211519 by: Jay Blanchard
211524 by: Chris W. Parker
211534 by: Jochem Maas
Re: Full-text searches sucks?
211513 by: Raj Shekhar
PHP MYSQL table locking
211517 by: james tu
fopen problems
211521 by: AJ Lemke
211527 by: Jason Barnett
Storing data structires in DB
211523 by: GamblerZG
211525 by: Chris W. Parker
211528 by: John Nichel
211531 by: Joshua Beall
Re: Pagination
211526 by: pavel
Getting the process ID
211530 by: Joshua Beall
211532 by: Rasmus Lerdorf
211533 by: Joshua Beall
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
An example script:
<?php
error_reporting(4095);
class Foo {
function test() {
}
}
Foo::test();
?>
would produce in PHP5 error:
PHP Strict Standards: Non-static method Foo::test() should not be called statically in ... line 8
I have two questions:
1. Could it be possible that under specific circumstances such a call
can produce fatal error "Non-static method Foo::test() cannot be called statically"?
2. Is there a proper way to write such a class that would work properly in both
PHP4 and PHP5, without Strict errors?
Best regards,
--
Piotr Klaban
attached mail follows:
Piotr Klaban wrote:
> Hi,
>
> An example script:
>
> <?php
> error_reporting(4095);
> class Foo {
> function test() {
> }
> }
> Foo::test();
> ?>
>
> would produce in PHP5 error:
> PHP Strict Standards: Non-static method Foo::test() should not be called statically in ... line 8
>
> I have two questions:
>
> 1. Could it be possible that under specific circumstances such a call
> can produce fatal error "Non-static method Foo::test() cannot be called statically"?
>
no
> 2. Is there a proper way to write such a class that would work properly in both
> PHP4 and PHP5, without Strict errors?
no, unless you keep this code and turn off E_STRICT error_reporting
>
> Best regards,
>
attached mail follows:
Hi,
Thursday, March 24, 2005, 6:50:38 PM, you wrote:
J> Dear all
J> Please, I realy need your help. I am trying to extract only those records
J> that were entered during the past hour from my MySQL database. The
J> following SQL statement extracts all the records. As soon as I change the
J> INTERVAL to 1 HOUR I see all the records in my database. When I change
J> CURDATE() to CURTIME() no records are extracted from the database. The
J> cgtimeposted field is a time data type.
J> Please advise me as to how I can formulate my SQL statement so that only
J> those records entered within the past hour displays on my page.
J> Here is my current SQL statement - this statement displays all the records:
J> $sql = "Select tblchatglobal.cgid, tblchatglobal.cgdateposted,
J> tblchatglobal.cgtimeposted, tblchatglobal.uid, tblchatglobal.cgmsg,
J> tblusers.uid, tblusers.uusername from tblchatglobal, tblusers where
J> (tblchatglobal.uid = tblusers.uid) and
J> (DATE_SUB(CURDATE(),INTERVAL 1 HOUR)
J> <= tblchatglobal.cgtimeposted) order by
J> tblchatglobal.cgtimeposted desc";
J> Jacques
You cannot do this with just a time field as what happens at midnight
and now() becomes 00:00:00, you will need to work with a full date_time
field.
The other problem is CURDATE has no time component, it is just a date
so subtracting 1 hour will always return 23:00:00.
So change the time field to a timestamp and try
... AND tblchatglobal.cgtimeposted > (DATE_SUB(NOW(),INTERVAL 1 HOUR))
--
regards,
Tom
attached mail follows:
I don't see anything special about my Netflix queue. Am I missing
something there? And I have no idea what "Flex" is referring to, so I'll
check that out if anyone lets me know where. :o)
Martin Austin
Burhan Khalid <phplist
meidomus.com>
03/24/2005 12:27 AM
To: Graham Anderson <grahama
siren.cc>
cc: php-general
lists.php.net
Subject: Re: [PHP] NetFlix Drag and Drop Row Ordering
Graham Anderson wrote:
> For those who have netflix, does anyone know how you would recreate
> their 'drag and drop' queue widget?
> basically, you can drag and drop movies in the order you choose
>
> is this a combination of javascript and php ?
> how would you go about creating something like this to order rows in
> your own CMS ?
I don't have an account with Netflix, but Flex has a great drag and drop
widget.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I've used drag and drop row ordering before. The only PHP I used was to
read a record set and write it out for the different items. The piece
of code I used worked with JavaScript and html. Basically there was a
large div, and each element inside of the main div was a div. It
grabbed the onclick event, grabbed the coordinates of where you're
moving the piece, and when you dropped it, the JavaScript bumped
everything down, or up depending on what you did. I put each item into
a form, then submitted that when the page was finished.
It's pretty simple code if you're good at JavaScript, if not search the
internet for a while you'll find some examples. Best of luck.
Nate Tobik
(412)661-5700 x206
VigilantMinds
-----Original Message-----
From: Graham Anderson [mailto:grahama
siren.cc]
Sent: Wednesday, March 23, 2005 10:45 PM
To: php-general
lists.php.net
Subject: [PHP] NetFlix Drag and Drop Row Ordering
For those who have netflix, does anyone know how you would recreate
their 'drag and drop' queue widget?
basically, you can drag and drop movies in the order you choose
is this a combination of javascript and php ?
how would you go about creating something like this to order rows in
your own CMS ?
extremely cool
g
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
thanks for the tip
I am pretty unfamilar with javascript..
But for my purposes, I guess I better learn it
I am fairly conversant in a couple of languages so hopefully it won't
be too bad
recommend a good book ?
Essentially, I want CMS users to be order their own playlist of
multimedia tracks.
Is there any reason not to take a javascript approach ?
because this would be for a CMS only the javascript does not have to
work for EVERY browser....
Out of curiosity, are you still using this approach? Or, was it too
problematic ?
g
On Mar 24, 2005, at 7:01 AM, Nathan Tobik wrote:
> I've used drag and drop row ordering before. The only PHP I used was
> to
> read a record set and write it out for the different items. The piece
> of code I used worked with JavaScript and html. Basically there was a
> large div, and each element inside of the main div was a div. It
> grabbed the onclick event, grabbed the coordinates of where you're
> moving the piece, and when you dropped it, the JavaScript bumped
> everything down, or up depending on what you did. I put each item into
> a form, then submitted that when the page was finished.
>
> It's pretty simple code if you're good at JavaScript, if not search the
> internet for a while you'll find some examples. Best of luck.
>
> Nate Tobik
> (412)661-5700 x206
> VigilantMinds
>
> -----Original Message-----
> From: Graham Anderson [mailto:grahama
siren.cc]
> Sent: Wednesday, March 23, 2005 10:45 PM
> To: php-general
lists.php.net
> Subject: [PHP] NetFlix Drag and Drop Row Ordering
>
> For those who have netflix, does anyone know how you would recreate
> their 'drag and drop' queue widget?
> basically, you can drag and drop movies in the order you choose
>
> is this a combination of javascript and php ?
> how would you go about creating something like this to order rows in
> your own CMS ?
>
> extremely cool
> g
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Here is the code we used at the time:
http://dhtmlkitchen.com/scripts/draglib/index.jsp
I modified it a bit to meet our needs, if you're doing an open-source
project it's free to use. In my experience if you take your time
JavaScript can be made to work in any browser.
We actually don't use the code anymore, the needs of the application
changed, so we went from the drag and drop ordering to a sorting method
using arrows to indicate up and down. It is still driven by JavaScript.
I never read any books on JavaScript, it's similar syntactically to PHP
or any language like that, the big thing is to learn the JavaScript DOM.
I just found some good reference pages and learned from there. I have
the most useful ones memorized, anything else I'll Google for it. If
you can code in PHP JavaScript will be a piece of cake.
The advantage of JavaScript over PHP is that it's client side. This
means you don't have to do a page reload for each action a user takes.
You can sort tracks in your application with PHP but each time a user
selects an item to move up you have to submit the page, then re-present
the page. With JavaScript the user can reorder all they want, then
submit the page once. I then take the list of items in the new order
and submit them to the DB.
Best of luck...
Nate Tobik
(412)661-5700 x206
VigilantMinds
-----Original Message-----
From: Graham Anderson [mailto:grahama
siren.cc]
Sent: Thursday, March 24, 2005 2:29 PM
To: php-general
lists.php.net; Nathan Tobik
Subject: Re: [PHP] NetFlix Drag and Drop Row Ordering
thanks for the tip
I am pretty unfamilar with javascript..
But for my purposes, I guess I better learn it
I am fairly conversant in a couple of languages so hopefully it won't
be too bad
recommend a good book ?
Essentially, I want CMS users to be order their own playlist of
multimedia tracks.
Is there any reason not to take a javascript approach ?
because this would be for a CMS only the javascript does not have to
work for EVERY browser....
Out of curiosity, are you still using this approach? Or, was it too
problematic ?
g
attached mail follows:
Hello,
I have a checkbox in a form. How can I determine if the user has set the
checkbox on or not?
Thanks
-Will
attached mail follows:
isset($_POST['checkboxname']) or isset($_GET['checkboxname'])
depending on the method of your form.
a good thing to do is to do var_dump($_POST) or var_dump($_GET) to see
all the values posted from the form...
hth
ken
On Thu, 24 Mar 2005 15:42:10 +0200, William Stokes <kalles
operamail.com> wrote:
> Hello,
>
> I have a checkbox in a form. How can I determine if the user has set the
> checkbox on or not?
>
> Thanks
> -Will
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
# index.php
<form method=post action=index.php>
<?php
$checked = ($_POST['CheckThis'] == 'Yes') ? 'checked' : '' ;
<input type=checkbox name=CheckThis value=Yes <?= $checked ?>>
<input type=Submit value=Submit>
</form>
-afan
William Stokes wrote:
>Hello,
>
>I have a checkbox in a form. How can I determine if the user has set the
>checkbox on or not?
>
>Thanks
>-Will
>
>
>
attached mail follows:
Hi,
Thursday, March 24, 2005, 8:15:11 PM, you wrote:
AM> I have a script that lists the files in a directory, but when i have
AM> only ONE file , it won't display it ( here is the code :
AM> http://www.pastebin.com/262050 )
After you sort the $filename array its index changes from 1 to 0 so
your $i is 1 ahead of the array.
--
regards,
Tom
attached mail follows:
try
preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}))#', $row['date'], $matches);
$month = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
$converted_date = $matches[3]." ".$month[$matches[2]]. " ".$matches[1];
untested...
On Thu, 24 Mar 2005 12:52:04 +0200, Angelo Zanetti <angelo
zlogic.co.za> wrote:
> hi guys,
>
> I need to convert a date from this format: 2005-03-25 to 25 mar 2005.
> I have tried the mktime, strftime and the date functions but they all
> take a time stamp but I only have the dates in the format of 2005-03-25.
>
> These are what i tried where $row['date'] is 2005-02-24 but they all
> return 01 Jan 1970???
>
> echo(mktime(0,0,0, date("j", $row['date']), date("M", $row['date']),
> date("Y", $row['date'])));
> echo(strftime("%d", $row['date']) . " " . strftime("%b", $row['date']).
> " " . strftime("%Y", $row['date']));
> echo(date("d",$row['date'] ) . " " . date("M", $row['date']) . " " .
> date("Y",$row['date'] ));
>
> thanks in advance
> angelo
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Probably this is the wrong place to put this but I couldn't search for
the bug and what I saw in the bugs newsgroup was a bit strange and seem
to be a log for the bugs forms.
So here is what I would call a bug, but maybe it's thought to be so:
<?php
$var1 = 0;
$var2 = "AS";
if($var1 == "AS"){
echo "<br>Why is this printed";
}
if(0 == "AS"){
echo "<br>At least this should not be printed";
}
if($var2 == "AS"){
echo "<br>Only this should";
}
?>
I didn't expect it. I use php 5.02 and have the zend debugger installed.
Does anybody see every echo and finds this strange in a typeless language?
attached mail follows:
Probably this is the wrong place to put this but I couldn't search for
the bug and what I saw in the bugs newsgroup was a bit strange and seem
to be a log for the bugs forms.
So here is what I would call a bug, but maybe it's thought to be so:
<?php
$var1 = 0;
$var2 = "AS";
if($var1 == "AS"){
echo "<br>Why is this printed";
}
if(0 == "AS"){
echo "<br>At least this should not be printed";
}
if($var2 == "AS"){
echo "<br>Only this should";
}
?>
I didn't expect it. I use php 5.02 and have the zend debugger installed.
Does anybody see every echo and finds this strange in a typeless language?
Sebastian
attached mail follows:
Hello TheI2eptile,
Thursday, March 24, 2005, 2:05:14 PM, you wrote:
T> So here is what I would call a bug, but maybe it's thought to be so:
Try it with strict (data-type) comparisons, i.e.:
if ($var === "AS")
Then you won't get the "bug".
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov
attached mail follows:
TheI2eptile wrote:
> Probably this is the wrong place to put this but I couldn't search for
not at all the wrong place, having said that the only thing probable with regard
to you/your post is that you are not fully aware of the nature of data types in
php and the way auto-typecasting works (in terms of precedence and conversion)...
which is not surprising, most people get bitten by this at some time :-) because
often when looking at the behaviour from the point of view of other
langs (or as a complete beginner) the logic behind it may not seem at all logical...
I recommend searching for some more info on (auto)typecasting in php,
by the sounds of things you're capable of grokking the whys and wherefores without
much trouble :-)
> the bug and what I saw in the bugs newsgroup was a bit strange and seem
> to be a log for the bugs forms.
>
> So here is what I would call a bug, but maybe it's thought to be so:
> <?php
> $var1 = 0;
> $var2 = "AS";
>
> if($var1 == "AS"){
> echo "<br>Why is this printed";
> }
int has higher precendence... therefore "AS" is converted to an int
... "AS" when converted to an int is zero... the order of the operands does not
matter in this case, try the following one liner:
<?php var_dump( (0 == "AS"), ("AS" == 0) ); ?>
>
> if(0 == "AS"){
> echo "<br>At least this should not be printed";
> }
same rules applies here.
>
> if($var2 == "AS"){
> echo "<br>Only this should";
> }
> ?>
> I didn't expect it. I use php 5.02 and have the zend debugger installed.
> Does anybody see every echo and finds this strange in a typeless language?
php is not typeless! its dynamically typed.
I wonder if there are typeless langs at all :-)
btw: yes I see every echo, no I don't find it strange (anymore!)
as someone else already mentioned: use the strict equality operator (===) to
tell php not to do auto-typecasting on the vars you want to check for equality.
rgds,
Jochem
>
attached mail follows:
Hello,
How can I let user delete a uploaded image file in the server's directory?
Thanks
-Will
attached mail follows:
[snip]
How can I let user delete a uploaded image file in the server's
directory?
[/snip]
http://www.php.net/unlink
attached mail follows:
Hello William,
Thursday, March 24, 2005, 2:08:13 PM, you wrote:
WS> How can I let user delete a uploaded image file in the server's
WS> directory?
unlink()
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov
attached mail follows:
Richard Lynch wrote:
...
>>$how_many = mysql_result(mysql_query("SELECT COUNT(*), MATCH(ad_sub,
>>ad_text) AGAINST('$words') AS score from ".$tcname."ads WHERE
>>MATCH(ad_sub,
>>ad_text) AGAINST('$words') FROM ".$tcname."ads where is_confirmed=1"),0);
>
>
> Hmmmm. Actually, I *can* tell you that you shouldn't have FROM in there
> twice. You've messed up your query something awful with that.
>
also he just wants the count with this statement so:
'MATCH(ad_sub,ad_text) AGAINST('$words') AS score'
shouldn't be part of this query, instead:
"SELECT COUNT(*) FROM ".$tcname."ads where is_confirmed=1 WHERE MATCH(ad_sub,ad_text) AGAINST('$words')"
attached mail follows:
Hello friends.
IHow Can I destroy some variable that I pass by url, exmple:
http://webadmin/paginas/personalidades.php?ac2=delete&item=18#
then when i get the varibale ac2 and item, I want to delete the value of
this variable.
how can I do?
regards TOMAS
-------------------------------------------------------------------------
Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
en el dominio de correo angerona.cult.cu y no se encontro ninguna coincidencia.
attached mail follows:
[snip]
IHow Can I destroy some variable that I pass by url, exmple:
http://webadmin/paginas/personalidades.php?ac2=delete&item=18#
then when i get the varibale ac2 and item, I want to delete the value of
this variable.
how can I do?
[/snip]
http://www.php.net/unset
attached mail follows:
I sorry I can't destroy of value variable by pass url
I try this.
unset($_SERVER['QUERY_STRING']);
but the url have the same value. don't delete this value.
what can i do?
somebody can help me.
regards TOMAS
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard
niicommunications.com>
To: "Toms Rodriguez Orta" <admin
angerona.cult.cu>; "[php] PHP General
List" <php-general
lists.php.net>
Sent: Thursday, March 24, 2005 8:23 AM
Subject: RE: [PHP] How can I destroy parameters by page
[snip]
IHow Can I destroy some variable that I pass by url, exmple:
http://webadmin/paginas/personalidades.php?ac2=delete&item=18#
then when i get the varibale ac2 and item, I want to delete the value of
this variable.
how can I do?
[/snip]
http://www.php.net/unset
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-------------------------------------------------------------------------
Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
en el dominio de correo angerona.cult.cu y no se encontro ninguna
coincidencia.
-------------------------------------------------------------------------
Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
en el dominio de correo angerona.cult.cu y no se encontro ninguna coincidencia.
attached mail follows:
Toms Rodriguez Orta <mailto:admin
angerona.cult.cu>
on Thursday, March 24, 2005 12:19 PM said:
> IHow Can I destroy some variable that I pass by url, exmple:
> http://webadmin/paginas/personalidades.php?ac2=delete&item=18#
> then when i get the varibale ac2 and item, I want to delete the value
> of this variable.
> how can I do?
http://www.php.net/unset
attached mail follows:
how about... just leave it? Why do you need to destroy it anyway? :S
Toms Rodriguez Orta wrote:
> I sorry I can't destroy of value variable by pass url
> I try this.
>
> unset($_SERVER['QUERY_STRING']);
> but the url have the same value. don't delete this value.
> what can i do?
> somebody can help me.
>
> regards TOMAS
> ----- Original Message -----
> From: "Jay Blanchard" <jay.blanchard
niicommunications.com>
> To: "Toms Rodriguez Orta" <admin
angerona.cult.cu>; "[php] PHP General
> List" <php-general
lists.php.net>
> Sent: Thursday, March 24, 2005 8:23 AM
> Subject: RE: [PHP] How can I destroy parameters by page
>
>
> [snip]
> IHow Can I destroy some variable that I pass by url, exmple:
> http://webadmin/paginas/personalidades.php?ac2=delete&item=18#
> then when i get the varibale ac2 and item, I want to delete the value of
> this variable.
> how can I do?
> [/snip]
>
> http://www.php.net/unset
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> -------------------------------------------------------------------------
> Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
> en el dominio de correo angerona.cult.cu y no se encontro ninguna
> coincidencia.
>
>
>
> -------------------------------------------------------------------------
> Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
> en el dominio de correo angerona.cult.cu y no se encontro ninguna coincidencia.
attached mail follows:
> IHow Can I destroy some variable that I pass by url, exmple:
> http://webadmin/paginas/personalidades.php?ac2=delete&item=18#
> then when i get the varibale ac2 and item, I want to delete the value of
> this variable.
unset($_GET['item']) ?
http://www.php.net/manual/en/function.unset.php
--
Pavel Vrany
http://ogi.cz/
attached mail follows:
Hi.
I am looking for a shopping cart where we can have teh following :
1. Multiple vendors on our site,
2. Have accounts for all these vendors on how much sales, profits etc for
each seller.
3. Have a delivery module
4. Warehouse inventory
5. Customer complaints
Can anyone suggest a good PHP software for this please?
Thanks in advance.
DM
attached mail follows:
freshmeat.net and search "shopping carts"
check X-Cart (x-cart.com) - shopping mall version (I think it's xcart
pro ili something like that)
-afan
Denis L. Menezes wrote:
>Hi.
>
>I am looking for a shopping cart where we can have teh following :
>1. Multiple vendors on our site,
>2. Have accounts for all these vendors on how much sales, profits etc for
>each seller.
>3. Have a delivery module
>4. Warehouse inventory
>5. Customer complaints
>
>Can anyone suggest a good PHP software for this please?
>
>Thanks in advance.
>
>DM
>
>
>
attached mail follows:
Dear friends,
after an research on the subject, I have not been able to find an open
source converter from XHTML to pdf, with full suport for CSS, with full
support for tables.
Is there anything like that out there that yu know about?
--
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com
attached mail follows:
Burhan Khalid <mailto:phplist
meidomus.com>
on Wednesday, March 23, 2005 10:25 PM said:
> Sitepoint has a great article that has PHP snippets on both pmtt and
> the "flat" drill-down method.
>
> http://www.sitepoint.com/article/hierarchical-data-database
I would like to add that this is the article where I found out about
pmtt. It's also the article where I got the functions for
traversing/adjusting pmtt. In other words, the building blocks for
whatever you need regarding pmtt are probably in that article. (At least
that was the case for me.)
Chris.
attached mail follows:
Yeah, I read this article, and it works, but it doesn't set you up for a
drill down scenario...
Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: matt
criticalcode.com
-----Original Message-----
From: Chris W. Parker [mailto:cparker
swatgear.com]
Sent: Thursday, March 24, 2005 8:55 AM
To: Burhan Khalid; Matt Babineau
Cc: php-general
lists.php.net
Subject: RE: [PHP] Preorder Modified Tree Traversal
Burhan Khalid <mailto:phplist
meidomus.com>
on Wednesday, March 23, 2005 10:25 PM said:
> Sitepoint has a great article that has PHP snippets on both pmtt and
> the "flat" drill-down method.
>
> http://www.sitepoint.com/article/hierarchical-data-database
I would like to add that this is the article where I found out about pmtt.
It's also the article where I got the functions for traversing/adjusting
pmtt. In other words, the building blocks for whatever you need regarding
pmtt are probably in that article. (At least that was the case for me.)
Chris.
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
Matt Babineau <mailto:matt
criticalcode.com>
on Thursday, March 24, 2005 10:49 AM said:
> Yeah, I read this article, and it works, but it doesn't set you up
> for a drill down scenario...
I guess I don't understand what you mean then. I can display a tree just
fine...
Chris.
attached mail follows:
Hello,
I really can't figure this out. Can someone help please. I've wasted hours
already with this one.
I'm trying to print image to a web page using fpassthru. Here's the code:
$name = path/to/the/image/folder/img1.jpeg;
$fp = fopen($name, 'rb');
// send the right headers
header("Content-Type: image/jpeg"); //also tested with type pjpeg
header("Content-Length: " . filesize($name));
// dump the picture
fpassthru($fp);
Help Appeciated. Thanks.
-Will
This code is basically straight from manual. I have verified that the images
path is correct. When I test this I get a browserfull of junk like this:
"Q$pv{:Sd䱧'AסfngqZ;jixY3:f-,mfc>N-ԭn?IU`r6-Ky<
Zۭ-?խ^w1A&doV?ν_ZYb$Ay?9>moKT[/sYU^
ɐK$^[` 'DfY {{>qұ{z4AzXZ}PX]\'\[~~¨>TYm\-asj>qYKǿ?'_Gw;MzI>f>"T
n)<ha.fs'xU4(>Jo>~Ys8P_s1uZ`9EhNR{d
*\Ҭȧ?p,XƼs=Z5edPhy:'?0h?ѩS.}{
\XO+
Y:e"o`VO"wѢε>uU^,ĪEr><Y~C.g-v=Yaq{sO-7"'?w-ud)iJ\ݤ"<OxOo$nY""0'M,nSv>5Ϳ/wvYU.OOL<1ku7-Tis?F*`V8}gTF
l{{H"btKr;L'n\|ioeT̢ͬ
zUߺ Y?u8,B-'?=2s-?W[so7AS#oH,rlka6Ӱzof7~`7z?io,~sn%Y]Tsh
;)}:-f84
/?_V?'üf-?z#\K<|'?<}$B'~~h^BQ<"Wu-
C/z\:<y?uT Zw{.zy"Yjg_v>V5}oK-'eO͍j27cFTNүz*Vzz.[kg䱹M,,-[{:)*{T[$4z'o
YI'kG.G"pFUtM"rYWoXagX6ZvXpkɾ'{[Qo>cmc$W*OO>?g
0^E[}6r.T8pNYN4aG?Y,XsqHkP_-G/0Z
h|?Ho媺1oʱsG?<&a]Qٍ~KfiIH<[F'?"";OC"OZ/
[~%"ZA[eSNS{4~T ˱>'~8Z:>W
~Yu,-`8ҭQ~p?sSf.9|Ak"r>s`W;v[Ozoǰ,]:nQ?jv]kw>dSL?:-}>>cxolF?Z.,vE'?<a-9c{QsXnp{磻?-
O(ؤOP$9Kc >?> YO`ö<9Vl]?*;~'"~RxZM6??<<mv.=4W3WK\zߤBf
̳ST\9?i'zi4Ay>ho?[1..ʱ=?mOc=
Yhϴ>zZzk7oc2<MpU?js'53K]`YLfS%8?h>qOR&ckuCk7,>N
<#wzSPzf0vKskl\wRN'a,r#GܻMz$|INJ"ޯ^deFnfù(cc:OI-}
Y*a?~YDU}p6c䵿2zy,wg
~A6F+?6p .J.ZZ|,z?mM5IN OVg "15DBZ
attached mail follows:
Hi,
Friday, March 25, 2005, 3:27:41 AM, you wrote:
WS> Hello,
WS> I really can't figure this out. Can someone help please. I've wasted hours
WS> already with this one.
WS> I'm trying to print image to a web page using fpassthru. Here's the code:
WS> $name = path/to/the/image/folder/img1.jpeg;
WS> $fp = fopen($name, 'rb');
WS> // send the right headers
WS> header("Content-Type: image/jpeg"); //also tested with type pjpeg
WS> header("Content-Length: " . filesize($name));
WS> // dump the picture
WS> fpassthru($fp);
WS> Help Appeciated. Thanks.
WS> -Will
Make sure you don't have any whitespace after the trailing ?> if there
is one, better still get rid of it.
Also I use readfile($name); ... can't remember why
Here is a bit of code I use for passing PDF files which also handles
caching control you can adapt easily for images.
<?php
$cache_time = false;
$requested_time = false;
$filename = $_REQUEST{'filename'];
if(file_exists($filename)){
$len = filesize[$filename);
$mtime = filemtime($filename);
$cache_time = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
header('Last-Modified: '.$cache_time);
$rt = false;
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])){
$rt = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
}
if($rt) $requested_time = strtotime($rt);
if($requested_time && $cache_time){
if($requested_time == $cache_time){
Header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
exit;
}
}
header("Accept-Ranges: bytes");
header('Cache-Control: no-cache, must-revalidate');
header("Content-type: application/pdf");
header("Content-Length: $len");
readfile($filename);
}
--
regards,
Tom
attached mail follows:
Is it possible to remove a row(s) from a MySQL table? I looked through
the PHP manual and didn't see anything about it.
Phil Neeb
attached mail follows:
Phil Neeb <mailto:06prneeb
alma.edu>
on Thursday, March 24, 2005 9:35 AM said:
> Is it possible to remove a row(s) from a MySQL table? I looked through
> the PHP manual and didn't see anything about it.
Use the word "delete" instead of remove.
In any case you have to tell MySQL which records you want to delete.
DELETE FROM `table`
WHERE `columnA` = 'valueA';
HTH,
Chris.
attached mail follows:
Phil Neeb wrote:
> Is it possible to remove a row(s) from a MySQL table? I looked through
> the PHP manual and didn't see anything about it.
Call me crazy, but the MySQL manual _might_ have something about it.
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
John Nichel wrote:
> Phil Neeb wrote:
>
>> Is it possible to remove a row(s) from a MySQL table? I looked through
>> the PHP manual and didn't see anything about it.
>
>
> Call me crazy, but the MySQL manual _might_ have something about it.
>
Oh c'mon, you expect me to go look at a second website? That'd require
effort! Thanks though.
attached mail follows:
you could just use the time() or numbers of the date function
>From: "PartyPosters" <sales
partyposters.co.uk>
>To: <php-general
lists.php.net>
>Subject: [PHP] Converting to a string
>Date: Wed, 23 Mar 2005 20:43:30 -0000
>MIME-Version: 1.0
>Received: from lists.php.net ([216.92.131.4]) by mc10-f11.hotmail.com with
>Microsoft SMTPSVC(6.0.3790.211); Wed, 23 Mar 2005 12:46:08 -0800
>Received: from ([216.92.131.4:3752] helo=lists.php.net)by pb1.pair.com
>(ecelerity HEAD r(5268)) with SMTPid 6E/E2-06694-265D1424 for
><dbnm
hotmail.com>; Wed, 23 Mar 2005 15:45:22 -0500
>Received: (qmail 40045 invoked by uid 1010); 23 Mar 2005 20:43:52 -0000
>Received: (qmail 39914 invoked by uid 1010); 23 Mar 2005 20:43:41 -0000
>X-Message-Info: JGTYoYF78jGnXCyUPttfpp6UKiZEgipk++L9rr4c6Ms=
>Return-Path: <php-general-return-211408-dbnm=hotmail.com
lists.php.net>
>X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact
>php-general-help
lists.php.net; run by ezmlm
>Precedence: bulk
>list-help: <mailto:php-general-help
lists.php.net>
>list-unsubscribe: <mailto:php-general-unsubscribe
lists.php.net>
>list-post: <mailto:php-general
lists.php.net>
>Delivered-To: mailing list php-general
lists.php.net
>Delivered-To: ezmlm-scan-php-general
lists.php.net
>Delivered-To: ezmlm-php-general
lists.php.net
>X-Host-Fingerprint: 62.241.163.7 blaster.systems.pipex.net Linux 2.4/2.6
>X-MSMail-Priority: Normal
>X-Mailer: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
>X-OriginalArrivalTime: 23 Mar 2005 20:46:08.0620 (UTC)
>FILETIME=[572A42C0:01C52FE9]
>
>Hello guys,
>i am using date("l dS of F Y h:i:s A") and want to put the value in a
>database as a string,
>How do I converting it to a string, this is what I have got so far:-
>$v_ship_date = date("l dS of F Y h:i:s A");
>
>
>Lots of thanks.
>
>
> ----- Original Message -----
> From: PartyPosters
> To: php-general
lists.php.net
> Sent: Tuesday, March 22, 2005 10:01 PM
> Subject: Passing Arrays between pages
>
>
> Hello,
> Please can someone tell me how you pass arrays between PHP pages.
> I have tried something like this and have tried many variations of this
>but
> nothing working yet ;
>
>
> Page 1
> $testArray[0] =Apple;
> $testArray[1] =Banana;
> $testArray[2] =Peach;
>
> echo "<INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
>VALUE=\"$testArray\">";
>
> Page2
> echo $testArray[1];
>
>
> On different variations of this I keep on getting 'Array' when I to
>return the variable on the second page
>
> Many Thanks.
> Kaan.
attached mail follows:
I'm trying to figure out the best way to handle a SELECT from multiple
tables where a single ID in tableA relates to multiple ID's in tableB:
"SELECT tableA.ID, tableB.data FROM tableA, tableB WHERE tableA.ID=3 AND
tableA.ID=tableB.tableAID"
What I'm trying to product is an array output similar to:
| ID | data |
| 3 | data1, data2, data3 |
if the table data is represented by this:
tableA
| ID | something |
| 1 | something1 |
| 2 | something2 |
| 3 | something3 |
tableB
| ID | tableAID | data |
| 1 | 3 | data1 |
| 2 | 3 | data2 |
| 3 | 3 | data2 |
attached mail follows:
David Christensen wrote:
<snip non php stuff>
Comeon guys, this is the PHP mailing list. The MySQL mailing list is
over on the next block.
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
[snip]
I'm trying to figure out the best way to handle a SELECT from multiple
tables where a single ID in tableA relates to multiple ID's in tableB:
"SELECT tableA.ID, tableB.data FROM tableA, tableB WHERE tableA.ID=3 AND
tableA.ID=tableB.tableAID"
What I'm trying to product is an array output similar to:
| ID | data |
| 3 | data1, data2, data3 |
[/snip]
SELECT a.foo, b.foobar
FROM tableA a LEFT OUTER JOIN tableB b
ON(a.id = b.id)
SELECT p.users
FROM php.list p LEFT OUTER JOIN mysql.list m
ON (p.phpuserid = m.mysqluserid)
GROUP BY p.users
HAVING clue > 0;
attached mail follows:
Jay Blanchard wrote:
<snip>
> SELECT p.users
> FROM php.list p LEFT OUTER JOIN mysql.list m
> ON (p.phpuserid = m.mysqluserid)
> GROUP BY p.users
> HAVING clue > 0;
</snip>
I got zero results returned. ;)
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Your example doesn't produce the desired the results!
The reason I posted to the PHP list was I thought I would have to apply
some ARRAY functions to produce the output I'm looking for. Your
example did nothing more than mine produced.
On Thu, 2005-03-24 at 12:48 -0600, Jay Blanchard wrote:
> [snip]
> I'm trying to figure out the best way to handle a SELECT from multiple
> tables where a single ID in tableA relates to multiple ID's in tableB:
>
> "SELECT tableA.ID, tableB.data FROM tableA, tableB WHERE tableA.ID=3 AND
> tableA.ID=tableB.tableAID"
>
> What I'm trying to product is an array output similar to:
>
> | ID | data |
> | 3 | data1, data2, data3 |
> [/snip]
>
> SELECT a.foo, b.foobar
> FROM tableA a LEFT OUTER JOIN tableB b
> ON(a.id = b.id)
>
> SELECT p.users
> FROM php.list p LEFT OUTER JOIN mysql.list m
> ON (p.phpuserid = m.mysqluserid)
> GROUP BY p.users
> HAVING clue > 0;
attached mail follows:
David Christensen <mailto:davidc
connect4less.com>
on Thursday, March 24, 2005 11:24 AM said:
> Your example doesn't produce the desired the results!
>
> The reason I posted to the PHP list was I thought I would have to
> apply some ARRAY functions to produce the output I'm looking for.
> Your example did nothing more than mine produced.
Yeah but did you try the second query?
attached mail follows:
[snip]
Your example doesn't produce the desired the results!
The reason I posted to the PHP list was I thought I would have to apply
some ARRAY functions to produce the output I'm looking for. Your
example did nothing more than mine produced.
[/snip]
It produces EXACTLY what you asked for in the OP. You didn't ask "how do
I make this look pretty with PHP?"
In order to do that, do this...
echo "<tr>";
echo "<td>".$id."</td>";
while($id){
echo "<td>".$data."</td>"
}
echo "</tr>";
Is that better Sparky?
attached mail follows:
YES!
All it does differently is truncate the output to one row per entry in
tableA.
On Thu, 2005-03-24 at 11:35 -0800, Chris W. Parker wrote:
> David Christensen <mailto:davidc
connect4less.com>
> on Thursday, March 24, 2005 11:24 AM said:
>
> > Your example doesn't produce the desired the results!
> >
> > The reason I posted to the PHP list was I thought I would have to
> > apply some ARRAY functions to produce the output I'm looking for.
> > Your example did nothing more than mine produced.
>
> Yeah but did you try the second query?
>
attached mail follows:
NO Spanky!
I figured it was implied that I was looking for a PHP solution since I
posted to a PHP list!
I also didn't ask for help with HTML output. I was asking for help with
PHP output!
Let me try to explain it a little better...
I need to produce an array of results from two tables. The first table
contains the unique records, let's call it 'customers'. The second
table, let's call it 'orders', contains records that are referenced to
'customers' via a 'customerID' field that correlates to the
'ID' ("primary_key") field in 'customers'.
What I'm after is a multidimensional array that contains a list of
information which includes 'ID' from customers, 'name' from customers
and 'order_info' from 'orders' which is collapsed into a field of the
new multidimensional array similar to the following:
OUTPUT equivalent to
$array[0] = array('ID' => 1, 'name' => 'joe', 'order_info' => 'part1,
part2, part3');
$array[1] = array('ID' => 2, 'name' => 'jim', 'order_info' => 'part1,
part5, part9');
$array[2] = array('ID' => 3, 'name' => 'moe', 'order_info' => 'part2,
part3, part7');
'customers'
| ID | name |
| 1 | joe |
| 2 | jim |
| 3 | moe |
'orders'
| ID | customerID | part |
| 1 | 1 | part1 |
| 2 | 1 | part2 |
| 3 | 1 | part3 |
| 4 | 2 | part1 |
| 5 | 2 | part5 |
| 6 | 2 | part9 |
| 7 | 3 | part2 |
| 8 | 3 | part3 |
| 9 | 3 | part7 |
Hope this clears it up a bit.
On Thu, 2005-03-24 at 13:46 -0600, Jay Blanchard wrote:
> [snip]
> Your example doesn't produce the desired the results!
>
> The reason I posted to the PHP list was I thought I would have to apply
> some ARRAY functions to produce the output I'm looking for. Your
> example did nothing more than mine produced.
> [/snip]
>
>
> It produces EXACTLY what you asked for in the OP. You didn't ask "how do
> I make this look pretty with PHP?"
>
> In order to do that, do this...
>
> echo "<tr>";
> echo "<td>".$id."</td>";
> while($id){
> echo "<td>".$data."</td>"
> }
> echo "</tr>";
>
> Is that better Sparky?
attached mail follows:
[snip]
I figured it was implied that I was looking for a PHP solution since I
posted to a PHP list!
[/snip]
Bad assumption.
[snip]
I also didn't ask for help with HTML output. I was asking for help with
PHP output!
[/snip]
I did it with PHP
[snip]
Let me try to explain it a little better...
[/snip]
Finally, a smarter question...
[snip]
blah, blah, blah about multidimensional arrays
[/snip]
Simply take the output that I performed for PHP->HTML and convert to
PHP->array...it works the same way.
attached mail follows:
David Christensen <mailto:davidc
connect4less.com>
on Thursday, March 24, 2005 12:07 PM said:
> NO Spanky!
>
> I figured it was implied that I was looking for a PHP solution since I
> posted to a PHP list!
>
> I also didn't ask for help with HTML output. I was asking for help
> with PHP output!
Yikes.
> Let me try to explain it a little better...
>
> I need to produce an array of results from two tables. The first
> table contains the unique records, let's call it 'customers'. The
> second table, let's call it 'orders', contains records that are
> referenced to 'customers' via a 'customerID' field that correlates to
> the 'ID' ("primary_key") field in 'customers'.
Yes, this is called a one-to-many relationship.
> What I'm after is a multidimensional array that contains a list of
> information which includes 'ID' from customers, 'name' from customers
> and 'order_info' from 'orders' which is collapsed into a field of the
> new multidimensional array similar to the following:
>
> OUTPUT equivalent to
> $array[0] = array('ID' => 1, 'name' => 'joe', 'order_info' => 'part1,
> part2, part3');
> $array[1] = array('ID' => 2, 'name' => 'jim', 'order_info' => 'part1,
> part5, part9');
> $array[2] = array('ID' => 3, 'name' => 'moe', 'order_info' => 'part2,
> part3, part7');
Did you read the manual? The PHP functions for MySQL already do this
automatically! In fact they organize the output even better!
Start here: http://us4.php.net/mysql. (HINT: mysql_fetch_array().)
Next time don't be hostile and post a more clearly worded question[1].
You'll save everyone a lot of time.
Chris.
[1] Read here: www.catb.org/~esr/faqs/smart-questions.html
attached mail follows:
My apologies! I thought I was giving what I was getting as far as the
angle of my post.
I still don't think everyone is understanding what I'm after here
though. I know how to use the mysql functions in PHP. That is not my
problem. I'm trying to avoid having to make multiple queries to the db
in order to combine two array results.
I understand this is a one-to-many relationship, but I'm not really
after the default output that produces. I want the 'many' to be a
single element in the customer line array (referencing my last post.)
So if the result is that customer '1' has ordered 3 items, and each item
is a separate line in the 'orders' table that get returned from the
query, I want an array of:
$array[0] = ('ID' => 1, 'name' => 'joe', 'items' => 'part1, part2,
part3');
I don't know how to say it any plainer than that.
The original post would have produced the following:
1, 'joe', 'part1'
1, 'joe', 'part2'
1, 'joe', 'part3'
but what I'd like to get is:
1, 'joe', 'part1, part2, part3'
Thanks for your help. I think I may have to redesign this thing to make
this easier or I maybe I just don't have the vocabulary to ask the
question correctly.
On Thu, 2005-03-24 at 12:17 -0800, Chris W. Parker wrote:
> David Christensen <mailto:davidc
connect4less.com>
> on Thursday, March 24, 2005 12:07 PM said:
>
> > NO Spanky!
> >
> > I figured it was implied that I was looking for a PHP solution since I
> > posted to a PHP list!
> >
> > I also didn't ask for help with HTML output. I was asking for help
> > with PHP output!
>
> Yikes.
>
> > Let me try to explain it a little better...
> >
> > I need to produce an array of results from two tables. The first
> > table contains the unique records, let's call it 'customers'. The
> > second table, let's call it 'orders', contains records that are
> > referenced to 'customers' via a 'customerID' field that correlates to
> > the 'ID' ("primary_key") field in 'customers'.
>
> Yes, this is called a one-to-many relationship.
>
> > What I'm after is a multidimensional array that contains a list of
> > information which includes 'ID' from customers, 'name' from customers
> > and 'order_info' from 'orders' which is collapsed into a field of the
> > new multidimensional array similar to the following:
> >
> > OUTPUT equivalent to
> > $array[0] = array('ID' => 1, 'name' => 'joe', 'order_info' => 'part1,
> > part2, part3');
> > $array[1] = array('ID' => 2, 'name' => 'jim', 'order_info' => 'part1,
> > part5, part9');
> > $array[2] = array('ID' => 3, 'name' => 'moe', 'order_info' => 'part2,
> > part3, part7');
>
> Did you read the manual? The PHP functions for MySQL already do this
> automatically! In fact they organize the output even better!
>
> Start here: http://us4.php.net/mysql. (HINT: mysql_fetch_array().)
>
> Next time don't be hostile and post a more clearly worded question[1].
> You'll save everyone a lot of time.
>
>
>
> Chris.
>
> [1] Read here: www.catb.org/~esr/faqs/smart-questions.html
>
attached mail follows:
David Christensen <mailto:davidc
connect4less.com>
on Thursday, March 24, 2005 12:34 PM said:
> I don't know how to say it any plainer than that.
>
> The original post would have produced the following:
>
> 1, 'joe', 'part1'
> 1, 'joe', 'part2'
> 1, 'joe', 'part3'
>
> but what I'd like to get is:
> 1, 'joe', 'part1, part2, part3'
I think this is the explanation we needed.
Serious question: Is it that you want someone to write the loop for your
do you just need some ideas?
> Thanks for your help. I think I may have to redesign this thing to
> make this easier or I maybe I just don't have the vocabulary to ask
> the question correctly.
A redesign sounds good. Maybe instead of trying to make an oddly
structured array you can instead adjust the code that receives the array
to receive the unmodified array?
Chris.
attached mail follows:
Thanks, I just use my original SQL and setup a foreach loop to compare
the 'ID' to see whether or not a record was returned with multiple row
results.
I was just hoping someone had all ready figured out some kool, neato,
voodoo-magic way to handle a one-to-many result like this.
On Thu, 2005-03-24 at 13:02 -0800, Chris W. Parker wrote:
> David Christensen <mailto:davidc
connect4less.com>
> on Thursday, March 24, 2005 12:34 PM said:
>
> > I don't know how to say it any plainer than that.
> >
> > The original post would have produced the following:
> >
> > 1, 'joe', 'part1'
> > 1, 'joe', 'part2'
> > 1, 'joe', 'part3'
> >
> > but what I'd like to get is:
> > 1, 'joe', 'part1, part2, part3'
>
> I think this is the explanation we needed.
>
> Serious question: Is it that you want someone to write the loop for your
> do you just need some ideas?
>
> > Thanks for your help. I think I may have to redesign this thing to
> > make this easier or I maybe I just don't have the vocabulary to ask
> > the question correctly.
>
> A redesign sounds good. Maybe instead of trying to make an oddly
> structured array you can instead adjust the code that receives the array
> to receive the unmodified array?
>
>
> Chris.
>
attached mail follows:
All,
There have been several fixes since RC1. If there are no show stoppers
found, we hope to release the final 5.0.4 early next week.
Source:
http://downloads.php.net/zeev/php-5.0.4RC2.tar.gz
http://downloads.php.net/zeev/php-5.0.4RC2.tar.bz2
Windows binaries:
http://downloads.php.net/edink/php-5.0.4RC2-Win32.zip
http://downloads.php.net/edink/php-debug-pack-5.0.4RC2-Win32.zip
http://downloads.php.net/edink/pecl-5.0.4RC2-Win32.zip
Test away!
Zeev
attached mail follows:
i would like to produce a script that can make an image ("screenshot")
based only on the site url. so that i enter an URL and php makes the
picture.
can such a thing be done by php? if not, maybe by some other language?
attached mail follows:
I have done this sort of thing with PDF's but I have never done it with
images.
It has also always been a web page that is on my site -- I get the
impression that you want to read in someone else's url and do this.
I would start off by looking at the ob_start and other related functions.
Once you have the url in a variable I would think you can do whatever you
want with it.
<?php
/*
Stephen Johnson c | eh
The Lone Coder
http://www.thelonecoder.com
stephen
thelonecoder.com
562.924.4454 (office)
562.924.4075 (fax)
continuing the struggle against bad code
*/
?>
> From: delos <liberache
hot.ee>
> Date: Thu, 24 Mar 2005 20:48:50 +0200
> To: php-general
lists.php.net
> Subject: [PHP] html image
>
> i would like to produce a script that can make an image ("screenshot")
> based only on the site url. so that i enter an URL and php makes the
> picture.
>
> can such a thing be done by php? if not, maybe by some other language?
attached mail follows:
Hello delos,
Thursday, March 24, 2005, 11:48:50 AM, you wrote:
d> i would like to produce a script that can make an image
d> ("screenshot") based only on the site url. so that i enter an URL
d> and php makes the picture.
Hmmm. It can be done. See http://www.whois.sc/www.php.net
But I'm just not sure quite how. I can think of a lot of scenarios,
but I don't know if I'm even in the right ballpark. You might be able
to e-mail those guys and ask how they do it. You might get lucky.
If you figure it out, let us know though. It's kinda neat.
--
Leif (TB lists moderator and fellow end user).
Using The Bat! 3.0.9.9 Return (pre-beta) under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB
attached mail follows:
Hi,
I am trying to use PHPUnit2 package under pear to run unit test for php scripts.
Finally after pulling lotta hairs from my head, I am able to run phpunit command line utilty to run test.
I am still not sure how to get the result of the test in xml (or text or html) format. phpUnit --help says by using it like this:
/*
Usage: phpunit [switches] UnitTest [UnitTest.php]
--testdox-html <file> Log test progress in TestDox/HTML format to file.
--testdox-text <file> Log test progress in TestDox/Text format to file.
--log-xml <file> Log test progress in XML format to file.
--loader <loader> TestSuiteLoader implementation to use.
--skeleton Generate skeleton UnitTest class for Unit in Unit.php.
--wait Waits for a keystroke after each test.
--help Prints this usage information.
--version Prints the version and exits.
*/
I tried using the following:
1) phpUnit Run.php
It gives the result of test and other things on system out. (monitor)
2) phpUnit --testdox-html myHtmlFile.html UnitTest Run.php
It still givest the result of the test on system output.
3) phpUnit --log-xml <mylog.xml> UnitTest Run.php
The system cannot find the file specified.
4) phpUnit --log-xml mylog.xml UnitTest Run.php
Still on system out.
5)phpUnit --log-xml "c:/../../mylog.xml" UnitTest Run.php
Still on system out.
Has anybody used this framework. I went to its site (http://www.phpunit.de/en/index.php) and still no detail documentation about its usage.
Any help in this would be highly appreciated.
Thanks!
Regards,
Dipesh
attached mail follows:
Hey,
I was curious if anyone here stores arrays in MySQL... and how r u
doing this... are you converting the values to a delimited string....
or is there another way?
Thanks
Joe
attached mail follows:
Joe Harman <mailto:cjharman
gmail.com>
on Thursday, March 24, 2005 12:15 PM said:
> I was curious if anyone here stores arrays in MySQL... and how r u
> doing this... are you converting the values to a delimited string....
> or is there another way?
http://php.net/serialize and http://php.net/unserialize are probably
what you want.
Chris.
attached mail follows:
check serialize() and unserialize() in manual.
implode() and explode() functions too.
-afan
Joe Harman wrote:
>Hey,
>
>I was curious if anyone here stores arrays in MySQL... and how r u
>doing this... are you converting the values to a delimited string....
>or is there another way?
>
>Thanks
>Joe
>
>
>
attached mail follows:
Joe Harman wrote:
> Hey,
>
> I was curious if anyone here stores arrays in MySQL... and how r u
> doing this... are you converting the values to a delimited string....
> or is there another way?
>
> Thanks
> Joe
>
http://us4.php.net/serialize
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
k.. in the past i have been using implode and explode... i have yet to
try serialize yet... but i will be giving it a whirled in about 5
minutes...
Thanks... just looking for a better way to do things
Cheers & thanks for the help!
Joe
On Thu, 24 Mar 2005 14:23:05 -0600, afan
afan.net <afan
afan.net> wrote:
> check serialize() and unserialize() in manual.
> implode() and explode() functions too.
>
> -afan
>
> Joe Harman wrote:
>
> >Hey,
> >
> >I was curious if anyone here stores arrays in MySQL... and how r u
> >doing this... are you converting the values to a delimited string....
> >or is there another way?
> >
> >Thanks
> >Joe
> >
> >
> >
>
attached mail follows:
/* send the errors to the interface and exit*/
if('' !== $errorsReported){
for($i = 0; $i < count($errorsReported); $i++){
echo $errorsReported[$i];
}
} else {
/* reload the empty interface */
header("Location: adminTicketMgmtCreationForm.php");
}
The above does not work on the else statement. If $errorsReported is
blank the header statement does not work, the script just exits. I have
had a long day and I may not be seeing something correctly, can anyone
see an error with this? If so, can you tell me where I am going wrong?
attached mail follows:
Jay Blanchard <mailto:jay.blanchard
niicommunications.com>
on Thursday, March 24, 2005 12:34 PM said:
I don't know if either of these two things will make a difference but
here they are anyway.
> /* send the errors to the interface and exit*/
> if('' !== $errorsReported){
Why not if(!empty($errorsReported))?
> } else {
> /* reload the empty interface */
> header("Location: adminTicketMgmtCreationForm.php");
> }
Also the Location header should(?) receive a FQDN (although I know it
works sans FQDN) and I think I read in the manual or somewhere that you
should put an exit; after it.
.02
Chris.
attached mail follows:
> /* send the errors to the interface and exit*/
> if('' !== $errorsReported){
> for($i = 0; $i < count($errorsReported);
$i++){
> echo $errorsReported[$i];
> }
> } else {
> /* reload the empty interface */
> header("Location:
adminTicketMgmtCreationForm.php");
> }
Jay,
Maybe try...
if(!empty($errorsReported)) {
instead of...
if('' !== $errorsReported){
David
attached mail follows:
[snip]
> /* send the errors to the interface and exit*/
> if('' !== $errorsReported){
> for($i = 0; $i <
count($errorsReported); $i++){
> echo
$errorsReported[$i];
> }
> } else {
> /* reload the empty interface */
> header("Location:
adminTicketMgmtCreationForm.php");
> }
[/snip]
I have tried ...
0 < count($errorsReported)
0 !=
0 !==
isset($errorReported)
!empty
'' !=
'' !==
I tried reversing the order in the statement itself, no go.
And Chris, thanks for the heads up, I put the exit() and the FQDN in
there.
I am headed out for the afternoon, perhaps a clearer head will prevail
in the morning!
attached mail follows:
Jay Blanchard <mailto:jay.blanchard
niicommunications.com>
on Thursday, March 24, 2005 1:00 PM said:
> I have tried ...
> 0 < count($errorsReported)
> 0 !=
> 0 !==
> isset($errorReported)
> !empty
> '' !=
> '' !==
Have you tried explicitly setting $errorsReported to "" to see where it
goes?
$errorsReported = "";
if(!empty($errorsReported))
{
// do loop
}
else
{
// do redirect
}
Also, are you sure your program is even GETTING that far? Maybe the
program is stopping before the point in question.
> And Chris, thanks for the heads up, I put the exit() and the FQDN in
> there.
In that case may I suggest the following function:
function redirect($location)
{
header("Location: ".FQDN_CONSTANT."$location");
exit;
}
Makes things easier down the road.
Chris.
attached mail follows:
Jay Blanchard wrote:
> /* send the errors to the interface and exit*/
> if('' !== $errorsReported){
> for($i = 0; $i < count($errorsReported); $i++){
> echo $errorsReported[$i];
> }
> } else {
> /* reload the empty interface */
a quick echo statement here to check that this block is running when
you expect it to might tell you something... but you have probably
already plastered your code with echo/print statements to determine the
flow :-)
> header("Location: adminTicketMgmtCreationForm.php");
> }
> The above does not work on the else statement. If $errorsReported is
> blank the header statement does not work, the script just exits. I have
> had a long day and I may not be seeing something correctly, can anyone
> see an error with this? If so, can you tell me where I am going wrong?
>
having read the other replies to this post I'm a little perplexed...
I was wondering if adminTicketMgmtCreationForm.php isn't crashing?
I sometimes get into a situation where an include file has a syntax
error that causes complete failure (blank screen, nothing in log), I have
had the same on occasion with require_once() statements that fail....
so maybe the redirect is working only the destination page is silently dying
on you....
I assume that you are not outputting anything before the call to header.
attached mail follows:
"Ryan A" <ryan
coinpass.com> writes:
> Hey,
>
> > > I dont want to do that as its only mysql 4.1+ compatable,
> >
> > IN BOOLEAN MODE was added in version 4.0.1 not 4.1, for what it's
> > worth.
>
> Oops, thats what i meant. The problem is a LOT of hosts are still on 3.23.xx
> so I dont want to do the BOOLEAN MODE thing.
Here is the workaround that I used.
- If the search term is smaller than 3 words, I did a LIKE.
- If the search term is greater than 3 words, do a fulltext search
i.e. MATCH AGAINST (no BOOLEAN MODE)
- If the fulltext search did not find any results, do the search
again, but this time use LIKE instead of MATCH AGAINST.
This gave me good enough results.
--
Raj Shekhar Y! : Operations Engineer
MySQL DBA, programmer and slacker Y!IM : lunatech3007
home : http://rajshekhar.net blog : http://rajshekhar.net/blog/
attached mail follows:
I understand table locking with MYSQL.
My concern is this. What happens if a php script issues a LOCK, and
then somehow crashes without issuing an UNLOCK?
All other scripts will not be able to access the LOCKed tables.
What is the solution for a situation like this? It will be pretty
unlikely, but I'm curious if there is anything I can do to mitigate
this situation.
--
-James Tu
-----------------------------------
ESI Design
111 Fifth Avenue 12th floor
New York, NY 10003
(212) 989-3993 ext. 357
(212) 673-4061 (fax)
-----------------------------------
attached mail follows:
Hello all,
I have an install of php on a Red Hat Ent. server that is giving me fits.
I have been trying to use the fopen command to retreive files from external
sites and have been getting this error:
Warning: fopen(http://us3.php.net/images/php.gif): failed to open stream:
HTTP request failed! in /home/test/public_html/declare.php on line 2
My code is as follows:
<?
if($handle=fopen("http://us3.php.net/images/php.gif","r")) {
echo "\n\nOPENED REMOTE FILE\n\n";
while (!feof($handle)) {
$buffer = fgets($handle,4096);
echo $buffer;
}
fclose($handle);
}
else
echo "\n\nFAILED TO OPEN REMOTE FILE\n\n";
?>
My Fopen section of my php.ini file.
;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On
; Define the anonymous ftp password (your email address)
;from="john
doe.com"
; Define the User-Agent string
; user_agent="PHP"
; Default timeout for socket based streams (seconds)
default_socket_timeout = 60
; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause PHP to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; auto_detect_line_endings = Off
As I stated before This is on a Red Hat Ent Server that is connected to the
internet behind a SonicWall (300 I believe) firewall appliance. I am able
to use the fget command to retrieve files from sites that are also behind
said firewall.
Any help anyone could give me would be greatly appreciated.
AJ Lemke
attached mail follows:
AJ Lemke wrote:
> Hello all,
>
> I have an install of php on a Red Hat Ent. server that is giving me fits.
> I have been trying to use the fopen command to retreive files from external
> sites and have been getting this error:
>
> Warning: fopen(http://us3.php.net/images/php.gif): failed to open stream:
> HTTP request failed! in /home/test/public_html/declare.php on line 2
>
Servers are occasionally down. I think the us3 mirror was down for
quite a while today (us4, us2 and www all worked when I tried them
earlier).
In my signature do you notice how I have the php.net site without
indicating which mirror I want? That's because making the request in
*that* way will let the php.net site determine which mirror to use for
your request. Perhaps you will have better luck in the future if you
try to;
<?php
fopen('http://php.net/images/php.gif', 'r');
?>
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
attached mail follows:
Output of serialize() is barely readable and definetely is not suited
for manual editing.
It is quite simple to create var_export() clone that does not add junk
to it's output. But then I would need to exec() the string to get a data
structure back, which is bad security practice.
Is there any good way to store/retrieve data structures (multidimetional
arrays) to/from database?
attached mail follows:
GamblerZG <mailto:gambler
highstream.net>
on Thursday, March 24, 2005 1:15 PM said:
> Output of serialize() is barely readable and definetely is not suited
> for manual editing.
[snip /]
> Is there any good way to store/retrieve data structures
> (multidimetional arrays) to/from database?
Maybe I missed something... So why is serialize not any good? Is it
because of the way it looks when it's printed?
Chris.
attached mail follows:
GamblerZG wrote:
> Output of serialize() is barely readable and definetely is not suited
> for manual editing.
>
> It is quite simple to create var_export() clone that does not add junk
> to it's output. But then I would need to exec() the string to get a data
> structure back, which is bad security practice.
>
> Is there any good way to store/retrieve data structures (multidimetional
> arrays) to/from database?
>
Huh?
Why would you _manually_ edit a serialized array??? One would think you
would UNSERIALIZE (http://us4.php.net/unserialize) the serialized array
*before* working with the data. But that's just me.
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
"GamblerZG" <gambler
highstream.net> wrote in message
news:20050324212125.21841.qmail
lists.php.net...
> Output of serialize() is barely readable and definetely is not suited for
> manual editing.
>
> It is quite simple to create var_export() clone that does not add junk to
> it's output. But then I would need to exec() the string to get a data
> structure back, which is bad security practice.
>
> Is there any good way to store/retrieve data structures (multidimetional
> arrays) to/from database?
You should look into the WDDX functions - http://php.net/wddx/ - they give
you an XML document that you can edit by hand much more easily than the
bytestream you get from serialize. However it is not as compact as
serialize, and not only that it suffers from what I consider a showstopped
bug.
This bug in the WDDX serialization causes you to run into trouble if you
have a numerically indexed array that does not start at 0. For instance:
//$data[0] = 'uncomment me and things will work';
$data[1] = "foo";
$data[2] = "bar";
$serialized = wddx_serialize_value($data);
$result = wddx_deserialize($serialized);
echo gettype($result[1]);
The output is "NULL" - it is now impossible directly access anything in the
$result array. It is still there - you can see this if you
var_dump($result) or iterate through it with foreach($result as $entry).
HTH,
-Josh
attached mail follows:
> I am wanting to paginate records from a MySQL Database.
> I want there to be 5 records on a page, on multiple pages.
example for selecting page of records from mysql table:
$sql=sprintf("
SELECT SQL_CALC_FOUND_ROWS * FROM table LIMIT %d, %d",
$position*$records,
$records
);
after get count of all records:
$sql='SELECT FOUND_ROWS()';
> (I would like there to be a "next" and "previous.")
you can use http://pear.php.net/package/Pager
--
Pavel Vrany
http://ogi.cz/
attached mail follows:
Hi All,
I am doing some work where I want to do locking, and prevent scripts from
running in parallel. I see that I could use the semaphore mechanism, but
I'd like for my code to be portable, and that extension is not enabled in
many places.
I need some way for a process to uniquely identify itself. It can then look
at the storage container (flat file, DB, whatever is appropriate in
context), check to see if the requested semaphore is available, and if it
is, acquire it and then mark itself as the owner. It can then check that it
did in fact get ownership (as opposed to another process which attempted to
acquire it at the exact same moment) before proceeding.
However I am stumped at the point where it needs to indicate ownership. How
does the PHP script identify itself? It can't use the script name,
obviously - lots of instances of the script may be running. It can't use
session ID - the user might submit duplicate requests, and they would both
have the same session ID. The best I have been able to think of is to use
the sha1(microtime()) to generate a unique key. But this isn't quite
foolproof, as it is theoretically possible, though unlikely, for two
requests to be at the exact same instant.
The answer that comes to my mind would be to use the process ID. This is
necessarily unique across the entire server, correct? It seems to be
exactly what I need. But I can't seem to figure out how to determine the
current process ID from within PHP. Is this even possible?
Apache 1.3.x/PHP5.0.3
Any ideas?
-Josh
p.s. Please forgive me if I have misused the term "semaphore" - I know it
only from the context I have seen/heard it used in, I don't know the
textbook definition.
attached mail follows:
Joshua Beall wrote:
> I am doing some work where I want to do locking, and prevent scripts from
> running in parallel. I see that I could use the semaphore mechanism, but
> I'd like for my code to be portable, and that extension is not enabled in
> many places.
Sort of defeats the whole concept of a web server, but to answer just
your process id question, use getmypid()
-Rasmus
attached mail follows:
"Rasmus Lerdorf" <rasmus
lerdorf.com> wrote in message
news:42435332.70807
lerdorf.com...
> Joshua Beall wrote:
>> I am doing some work where I want to do locking, and prevent scripts from
>> running in parallel. I see that I could use the semaphore mechanism, but
>> I'd like for my code to be portable, and that extension is not enabled in
>> many places.
>
> Sort of defeats the whole concept of a web server, but to answer just your
> process id question, use getmypid()
http://php.net/manual/en/function.getmypid.php
It says "Process IDs are not unique"
I really only need it to be unique at any given instant. I can do
sha1(microtime().getmypid()) to generate a unique ID. But of course it is
only guaranteed to be unique if indeed the process ID is not shared.
The problem I am having is that people are double-submitting certain
transactions. My first attempt to prevent this was to store a flag in the
session record indicating whether or not certain transactions had been
completed, but this turned out to be insufficient at times because users
could try and initiate a second transaction before the first transaction had
finished (and thus the system had not yet flagged the transaction completed
in the session record). They then both completed in parallel, and voila,
duplicate transactions again.
I realized that this sort of problem would always exist unless I had some
sort of semaphore mechanism. Once a user has *started* a transaction, they
need to be prevented from initiating a second transaction until the first
transaction has been completed.
I am open to suggestions on how to do this. What is the best way?
-Josh
- application/pgp-signature attachment: OpenPGP digital signature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]