php-general Digest 17 Nov 2009 17:40:21 -0000 Issue 6447
Topics (messages 299879 through 299895):
Ask about printer_open()
299879 by: agus priy
299882 by: agus priy
When will we get the official x64 php binaries?
299880 by: Buddy Hu
299881 by: Buddy Hu
Re: Shoutbox suggestion needed
299883 by: Michael Kubler
Re: [php] & [mysql] select and subselect
299884 by: David Robley
299887 by: Nisse Engström
How to call DLL in Javascript
299885 by: Peter
299886 by: Ashley Sheridan
299888 by: Phpster
299890 by: Nathan Rixham
Re: How to make the PHP know the real SCRIPT_FILENAME?
299889 by: Nathan Rixham
299894 by: Dong Wang
Re: PHP httpd debug question
299891 by: Devendra Jadhav
299892 by: John Beaulaurier -X (jbeaulau - Advanced Network Info at
Cisco)
299893 by: Nathan Rixham
Pear include path problem
299895 by: Al
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Dear,
I want to ask about function printer_open(). I have error Call to
undefined function printer_open(), but php_printer.dll was copied in
windows-system32 and php.ini has been setting. can you help me to
solving this problem.
Please reply soon. thank you.
Regards,
Priyagus
--- End Message ---
--- Begin Message ---
in phpinfo(), information about fields php_printer is nothing.
how to use get_loaded_extensions? do you explain it more?
thanks.
On Tue, Nov 17, 2009 at 2:08 PM, 惠新宸 <huixinc...@baidu.com> wrote:
> Hi:
> is there any fields about php_printer in phpinfo()'s output ?
> or you can use get_loaded_extensions too.
>
> if not , that means your did not loading the extension into php.
> you should check the php startup error_log .
>
> thanks
>
> agus priy wrote:
>
> Dear,
>
> I want to ask about function printer_open(). I have error Call to
> undefined function printer_open(), but php_printer.dll was copied in
> windows-system32 and php.ini has been setting. can you help me to
> solving this problem.
>
> Please reply soon. thank you.
>
> Regards,
> Priyagus
>
> On 11/17/09, agus priy <priya...@gmail.com> <priya...@gmail.com> wrote:
>
>
> Dear,
>
> I want to ask about function printer_open(). I have error Call to
> undefined function printer_open(), but php_printer.dll was copied in
> windows-system32 and php.ini has been setting. can you help me to
> solving this problem.
>
> Please reply soon. thank you.
>
> Regards,
> Priyagus
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> .
>
>
>
>
> --
> [image: Baidu] 惠新宸 Xinchen.Hui *|* Engineer @ ECOM *|* (+8610)59926238 *|
> * [image: Hi] laruence
>
--- End Message ---
--- Begin Message ---
Hi All,
I noticed that in the snapshot page<http://windows.php.net/snapshots/>, we have
a VC9 x64 Thread Safe binaries. However it's not intended for production use.
So my question is, when can we get the official x64 PHP binaries? What's your
schedule?
Thanks very much!
-Buddy Hu
--- End Message ---
--- Begin Message ---
In case this mail is not sent out. Send again!
From: Buddy Hu
Sent: Tuesday, November 17, 2009 3:00 PM
To: 'php-gene...@lists.php.net'
Subject: When will we get the official x64 php binaries?
Hi All,
I noticed that in the snapshot page<http://windows.php.net/snapshots/>, we have
a VC9 x64 Thread Safe binaries. However it's not intended for production use.
So my question is, when can we get the official x64 PHP binaries? What's your
schedule?
Thanks very much!
-Buddy Hu
--- End Message ---
--- Begin Message ---
The main issue with these systems is updating the client on a regular
enough basis.
If the content is time critical, like with Facebook chat, then you need
to do long polling.
However for a Shoutbox, because it's more like an IRC channel with
people 'shouting' to a channel, you can probably just set the client to
automatically update on a regular basis. Or even more advanced, would be
to get it to check in increasing intervals. Firstly it checks 0.5s
later, then 1s later, then 2s, 4s, 8s, 16s, with a limit of 60s (i.e it
checks at least once a minute for an update), upon new content being
received the time is reset back to the 0.5s
If you need to do long polling <http://ajaxpatterns.org/HTTP_Streaming>
then look into the Tornado Webserver <http://www.tornadoweb.org/> which
Friendfeed <http://friendfeed.com/>, and more recently, Facebook use
(for their LiveFeed system).
For a PHP based implementation check this out
<http://www.zeitoun.net/articles/comet_and_php/start>.
Michael Kubler
*G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>
Mobile : 0433483008
I believe in a better world. I support the Zeitgeist Movement
<http://www.zeitgeistsa.com>.
Ashley Sheridan wrote:
On Mon, 2009-11-16 at 12:06 -0500, Paul M Foster wrote:
On Mon, Nov 16, 2009 at 02:46:45PM +0000, Ashley Sheridan wrote:
I don't know of anything you can use like this, especially that runs
purely on Ajax. Just take a look at Facebook chat. That's Ajax, and
fails and falls over on a constant basis to the point where it is almost
useless. Imho, Java seems to be pretty good at this sort of thing, and
there are plenty of free options out there that you could use.
It's often been argued back and forth whether people have Javascript
turned off. I suspect the vast majority of people have Javascript turned
on. However, Java is another story. You may find that many more have it
turned off.
Paul
--
Paul M. Foster
Yeah, but then, generally, you can tell the people visiting this site
what they need enabled, as it looks like the visitors are going to be a
select few. Java is available on all the main browsers, and generally
only needs one to accept the applet. For a chat application to be
written using only Ajax technology, well, like I said before, if
Facebook tried it and still can't get it right with all the financial
backing they have, what hope for someone to release this sort of thing
open source and Facebook not be aware of it?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Allen McCabe wrote:
> I have a page on my site where I can optionaly filter by certain fields
> (order by filesize or file category), but I am implementing a shopping
> cart type of idea where users can submit an order.
>
> As administrators, my coworkers and I need to be able to filter orders by
> their contents. For example:
>
> View all orders for "Jack and the Beanstalk," where an order may have Jack
> and the Beanstalk and other items.
>
> I have an order table that keeps track of the order_id, the date, the
> status, etc. I also have an order_lineitem table that is the contents of
> the order. This has a one-to-many structure (without foreign keys because
> it is mysql).
>
> I was baffled as to how to filter the orders by the item_id that appears
> in the order_lineitem table.
>
> I just came up with this, but I'm not sure how the mysql_queries will
> handle an array. Do I have to do some extensive regular expression
> management here to get this to work, or will it accept an array?
>
> <?php
>
> if (isset($_POST['showid']))
> $showid = $_POST['showid'];
> $subSQL = "SELECT order_id FROM afy_show_lineitem WHERE show_id =
> {$_POST['showid']};";
> $subResult = mysql_query($subSQL);
> $where = "WHERE";
> $extQuery = 'order_id = {$subResult}';
> }
>
> $resultOrders = mysql_query("SELECT * FROM afy_order {$where}
> {$extQuery};") or die(mysql_error("Could not query the database!"));
>
> ?>
If $_POST['showid'] is likely to be an array, use implode to create a comma
separated string of values, then use IN to build the query.
$ids = implode(',', $_POST['showid'];
$subSQL = "SELECT order_id FROM afy_show_lineitem WHERE show_id IN ($ids)"
But you need also to check your logic - your query above will have two WHERE
in it and will fail miserably :-) And your call to mysql_error will
probably not help you either, as the (optional) argument should be a link
identifier, not a string of your choosing.
Cheers
--
David Robley
MS-DOS: celebrating ten years of obsolescence
Today is Sweetmorn, the 29th day of The Aftermath in the YOLD 3175.
--- End Message ---
--- Begin Message ---
On Mon, 16 Nov 2009 14:21:41 -0800, Allen McCabe wrote:
> I have an order table that keeps track of the order_id, the date, the
> status, etc. I also have an order_lineitem table that is the contents of the
> order. This has a one-to-many structure (without foreign keys because it is
> mysql).
<http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html>
"InnoDB supports foreign key constraints. ..."
> I was baffled as to how to filter the orders by the item_id that appears in
> the order_lineitem table.
>
> I just came up with this, but I'm not sure how the mysql_queries will handle
> an array. Do I have to do some extensive regular expression management here
> to get this to work, or will it accept an array?
>
> <?php
>
> if (isset($_POST['showid']))
> $showid = $_POST['showid'];
> $subSQL = "SELECT order_id FROM afy_show_lineitem WHERE show_id =
> {$_POST['showid']};";
> $subResult = mysql_query($subSQL);
> $where = "WHERE";
> $extQuery = 'order_id = {$subResult}';
> }
>
> $resultOrders = mysql_query("SELECT * FROM afy_order {$where} {$extQuery};")
> or die(mysql_error("Could not query the database!"));
[[ Note: You should probably have posted to the php-db list
(or the php.db newsgroup) to increase the chance of
getting responses from people who actually know what
they're talking about. I'm a MySQL newbie... ]]
$subResult is a resource. You need to fetch the results
before you can use them like this. Maybe something like:
--------------------
/* UNTESTED */
/* Don't forget to escape! Some will argue that
you are better off using prepared statements. */
$showid = mysql_real_escape_string ($_POST['showid']);
$q = <<<_
SELECT `order_id` FROM `afy_show_lineitem`
WHERE `show_id` = '$showid';
_;
$res = mysql_query ($q);
if ($res) {
while ($row = mysql_fetch_row ($res)) {
$ids[] = $row[0]; /* Assuming numerical ids. */
}
$ids_spec = implode (',', $ids);
mysql_free_result ($res);
} else {
/* Handle error */
}
if (isset ($ids_spec)) {
$q = <<<_
SELECT * FROM `afy_order`
WHERE `order_id` IN ($ids_spec)
_;
$res = mysql_query ($q);
if ($res) {
/* Do stuff */
} else {
/* Handle error */
}
}
--------------------
But you could also do it in one query (*untested*):
/* UNTESTED */
SELECT `ao`.* FROM `afy_order` AS `ao`,
`afy_show_lineitem` AS `asl`
WHERE `ao`.`show_id` = $show_id
AND `asl`.`order_id` = `ao`.`show_id`
Or maybe there are better ways, such as using INNER JOIN,
but those sometimes end up using a temporary table...
(Hint: php-db, php.db, php-db, ...)
/Nisse
--- End Message ---
--- Begin Message ---
Hi All,
I want to call dll in javascript
I tried the following script, but i got the error message 'ActiveXObject
is undefined'
(Note : i have the feedback.dll in the same path only)
<HTML>
<HEAD>
<script type='text/javascript' language='javascript'>
function comEventOccured()
{
try{
var myobject;
myobject = new ActiveXObject("feedback.dll");
}catch(e){
alert(e.description);
return false;
}
}
</script></head>
<body>
<input type=button value="Call the DLL" onClick="comEventOccured()">
</body>
</html>
Regards
Peter.
--- End Message ---
--- Begin Message ---
On Tue, 2009-11-17 at 17:58 +0530, Peter wrote:
> Hi All,
>
> I want to call dll in javascript
>
> I tried the following script, but i got the error message 'ActiveXObject
> is undefined'
> (Note : i have the feedback.dll in the same path only)
>
>
> <HTML>
> <HEAD>
> <script type='text/javascript' language='javascript'>
> function comEventOccured()
> {
>
> try{
> var myobject;
> myobject = new ActiveXObject("feedback.dll");
> }catch(e){
> alert(e.description);
> return false;
> }
>
> }
> </script></head>
> <body>
> <input type=button value="Call the DLL" onClick="comEventOccured()">
> </body>
> </html>
>
>
>
> Regards
> Peter.
>
I'm not even sure this is possible, and if it is, you know it would only
work on Internet Explorer yeah?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
I don't think you can di this with client side js. It would have to
run outside the security sandbox and that is a bug no-no.
If the dll is in the server, you could potentially call the server via
Ajax to instantiate the dll and have it's output sent to the browser
Bastien
Sent from my iPod
On Nov 17, 2009, at 7:28 AM, Peter <pet...@egrabber.com> wrote:
Hi All,
I want to call dll in javascript
I tried the following script, but i got the error message
'ActiveXObject is undefined'
(Note : i have the feedback.dll in the same path only)
<HTML>
<HEAD>
<script type='text/javascript' language='javascript'>
function comEventOccured()
{
try{
var myobject;
myobject = new ActiveXObject("feedback.dll");
}catch(e){
alert(e.description);
return false;
}
}
</script></head>
<body>
<input type=button value="Call the DLL" onClick="comEventOccured()">
</body>
</html>
Regards
Peter.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Peter wrote:
> Hi All,
>
> I want to call dll in javascript
>
> I tried the following script, but i got the error message 'ActiveXObject
> is undefined'
> (Note : i have the feedback.dll in the same path only)
>
>
> <HTML>
> <HEAD>
> <script type='text/javascript' language='javascript'>
> function comEventOccured()
> {
>
> try{
> var myobject;
> myobject = new ActiveXObject("feedback.dll");
> }catch(e){
> alert(e.description);
> return false;
> }
>
> }
> </script></head>
> <body>
> <input type=button value="Call the DLL" onClick="comEventOccured()">
> </body>
> </html>
>
>
>
> Regards
> Peter.
usually .dll should be running client side not server side
jscript and javascript are two different beasts based on ecmascript;
you'll be wanting to get some JScript (microsofts own version) help for
this.. http://msdn.microsoft.com/en-us/library/7sw4ddf8%28VS.85%29.aspx
but as somebody else mentioned, you won't get it working on all browsers
AFAIK.. so running DLL on server side and calling wrapper functions via
ajax is more appropriate.
an asp.net forum or suchlike will probably yield a more useful response
regards
--- End Message ---
--- Begin Message ---
Dong Wang wrote:
> I am trying to use PHP as backend, which communicate with apache-2.3's
> mod_proxy_fcgi
>
> But I have noticed that the SCRIPT_FILENAME has been changed to
> "proxy:balancer://xxxxxx", it cann't be recognized by the remote PHP
> backend. So the request failed.
> In my opinion, the remote PHP backend use the SCRIPT_FILENAME to find the
> script file. But the PHP and the Apache may be in different computer, so the
> Document Root may be different. is that means the PHP shouldn't rely on the
> SCRIPT_FILENAME?
>
> how can I configure the PHP to know the real script file to execute?
>
> Thank you
>
$real_script_file = __FILE__;
--- End Message ---
--- Begin Message ---
ur... you mean use this in the php script?
but the php-cgi still doesn't know which scriptfile to execute, isn't it?
php-cgi tries to find the aimed script using SCRIPT_FILENAME, but this
variable is changed by the mod_proxy_fcgi, so php-cgi can not find the real
scriptfile, that's the point, I think.
Or maybe there is something I misunderstand?
On Tue, Nov 17, 2009 at 9:19 PM, Nathan Rixham <nrix...@gmail.com> wrote:
> Dong Wang wrote:
> > I am trying to use PHP as backend, which communicate with apache-2.3's
> > mod_proxy_fcgi
> >
> > But I have noticed that the SCRIPT_FILENAME has been changed to
> > "proxy:balancer://xxxxxx", it cann't be recognized by the remote PHP
> > backend. So the request failed.
> > In my opinion, the remote PHP backend use the SCRIPT_FILENAME to find the
> > script file. But the PHP and the Apache may be in different computer, so
> the
> > Document Root may be different. is that means the PHP shouldn't rely on
> the
> > SCRIPT_FILENAME?
> >
> > how can I configure the PHP to know the real script file to execute?
> >
> > Thank you
> >
>
>
> $real_script_file = __FILE__;
>
--- End Message ---
--- Begin Message ---
Hi,
I am not getting what are you asking but if you want to run two httpd then
you have to run those on different ports.
For this you can change "Listen 80" to "Listen 2020" from httpd.conf file.
So that one server will run on 80 and other will run on 2020.
you can change 2020 to whatever port you want .. but check if that port is
not already assigned to some other application.
On Tue, Nov 17, 2009 at 5:35 AM, John Beaulaurier -X (jbeaulau - Advanced
Network Info at Cisco) <jbeau...@cisco.com> wrote:
> Hello,
>
>
>
> phpMyAdmin crashes when access is attempted each time, and I need to run
> an httpd backtrace. I have a question though.
>
>
>
> There is another httpd instance running on the same host. If I run httpd
> -X will it interfere with the other httpd process running, or will
>
> it be a separate process?
>
>
>
> Thanks
>
> -John
>
>
--
Devendra Jadhav
देवेंद्र जाधव
--- End Message ---
--- Begin Message ---
Hi Devendra
That’s sounds like what I’m looking for. I don’t want to interfere with the
current httpd process serving content while running the debug.
Thanks
-John
From: Devendra Jadhav [mailto:devendra...@gmail.com]
Sent: Tuesday, November 17, 2009 5:57 AM
To: John Beaulaurier -X (jbeaulau - Advanced Network Info at Cisco)
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP httpd debug question
Hi,
I am not getting what are you asking but if you want to run two httpd then you
have to run those on different ports.
For this you can change "Listen 80" to "Listen 2020" from httpd.conf file.
So that one server will run on 80 and other will run on 2020.
you can change 2020 to whatever port you want .. but check if that port is not
already assigned to some other application.
On Tue, Nov 17, 2009 at 5:35 AM, John Beaulaurier -X (jbeaulau - Advanced
Network Info at Cisco) <jbeau...@cisco.com> wrote:
Hello,
phpMyAdmin crashes when access is attempted each time, and I need to run
an httpd backtrace. I have a question though.
There is another httpd instance running on the same host. If I run httpd
-X will it interfere with the other httpd process running, or will
it be a separate process?
Thanks
-John
--
Devendra Jadhav
देवेंद्र जाधव
--- End Message ---
--- Begin Message ---
John Beaulaurier -X (jbeaulau - Advanced Network Info at Cisco) wrote:
> That’s sounds like what I’m looking for. I don’t want to interfere with the
> current httpd process serving content while running the debug.
>
http://www.google.com/search?q=multiple+apache+instances
note: setting only the same instance to listen on port 2020 or suchlike
as well won't help you here, you need 2 instances
also see: http://httpd.apache.org/dev/debugging.html#crashes
--- End Message ---
--- Begin Message ---
I've got script that uses the pear Mail class and have had problems on some
shared hosts with the include path to Mail. E.g., Blue Host insists the site
owner must change the php.ini file. I'd rather not expect them to do that.
Can you folks critique this approach for me.
if(EMAIL_MODE=='smtp'){
$basePath = str_ireplace('public_html', '', $_SERVER['DOCUMENT_ROOT']);
set_include_path(get_include_path() . PATH_SEPARATOR . basePath);
require_once "$basePath/php" . '/Mail.php';
$smtpStatus=(class_exists('Mail'))?true:false;
}
Thanks....
--- End Message ---