php-general Digest 19 Jun 2006 15:16:58 -0000 Issue 4194

Topics (messages 238258 through 238287):

Re: Mail in Spam Box - my code
        238258 by: kartikay malhotra

Re: Ok next php problem
        238259 by: Chris

Re: Want some PHP e-book
        238260 by: Ligaya Turmelle

Compare data between 2 array
        238261 by: weetat
        238262 by: Chris

Re: Mail in Spam Box
        238263 by: eqla3.com eqla3.com
        238264 by: eqla3.com eqla3.com

A way to stop spam on this list
        238265 by: Denis Gerasimov
        238266 by: Pham Huu Le Quoc Phuc
        238267 by: Robert Cummings
        238268 by: Denis Gerasimov
        238269 by: Rory Browne
        238286 by: Jochem Maas
        238287 by: Dan Parry

Re: How to run one php app from another? RECAP
        238270 by: Manuel Amador (Rudd-O)
        238271 by: Manuel Amador (Rudd-O)

PHP Session
        238272 by: James Nunnerley
        238274 by: David Tulloh

Slow loading (was Re: [PHP] Re: How to run one php app from another? RECAP)
        238273 by: Manuel Amador (Rudd-O)

php calendar
        238275 by: weetat
        238276 by: Ryan A

ldap_connect allways returns true even if logically it shouldn't?
        238277 by: Steve Turnbull
        238280 by: Joe Wollard

PHP Automation
        238278 by: Jef Sullivan
        238279 by: Brad Bonkoski

trouble getting PDO going on ubuntu 6.06 installation
        238281 by: Richard Harding
        238282 by: Richard Harding
        238283 by: Jochem Maas
        238284 by: Richard Harding
        238285 by: Jochem Maas

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:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Oops, sent this previous mail to Manuel instead of the group... :)

Hi All!

Sure, here is what I've:


<?php

 $uploaddir='/tmp/';
 $account_file = "account.txt"; //Substitute with a valid file on ur system
 $account_file = $uploaddir.basename($account_file);

 $file = fopen($account_file,'rb');
 $data = fread($file,filesize($account_file));
 fclose($file);

//  echo $data;

 $to = " [EMAIL PROTECTED]";
 $from = "[EMAIL PROTECTED]";
 $message = "Hi! Where are you these days?";

 $headers = "From: $from";


// Generate a boundary string
 $semi_rand = md5(time());
 $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

// Add the headers for a file attachment
 $headers .= "\nMIME-Version: 1.0\n" .
            "Content-Type: multipart/mixed;\n" .
            " boundary=\"{$mime_boundary}\"";



// Add a multipart boundary above the plain message
 $message = "This is a multi-part message in MIME format.\n\n" .
           "--{$mime_boundary}\n" .
           "Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
           "Content-Transfer-Encoding: 7bit\n\n" .
            $message . "\n\n";

// Base64 encode the file data
 $data = chunk_split(base64_encode($data));


$fileatt_type="text/plain";
$fileatt_name="Hola";

// Add file attachment to the message
 $message .= "--{$mime_boundary}\n" .
            "Content-Type: {$fileatt_type};\n" .
            " name=\"{$fileatt_name}\"\n" .
            "Content-Disposition: attachment;\n" .
            " filename=\"{$fileatt_name}\"\n" .
            "Content-Transfer-Encoding: base64\n\n" .
            $data . "\n\n" .
            "--{$mime_boundary}--\n";

// echo $message;

// Send the message

$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
echo "<p>Mail sent Successfully</p>";
} else {
echo "<p>Mail send failed</p>";
}



?>

Thanks & Regards
KM

On 6/19/06, Manuel Lemos <[EMAIL PROTECTED]> wrote:

on 06/18/2006 12:29 PM kartikay malhotra said the following:
> I've use PHP mail to send mail to my Gmail ID. But it gets delivered to
my
> Spam box and not the Inbox :(
>
> Am I missing a header, signature, certificate?

Maybe if you show how you are composing the message you are sending we
can advise.

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



--- End Message ---
--- Begin Message ---
Rob W. wrote:
Ok but my problem is is that in the process of doing that, numbers can be released so they pretty much haft to be dynamic. Any idea how I do it with that.

IE:

1
2
3
6
9
10
...

So if them numbers change, which they can, because they are assigned port numbers for servers, How do I make it so they are not scripted statically.

That was an example only.

See my next reply for an example of how to get the port from the db and go from there.

Since we don't know your db structure, table names, field names I made it "generic" and you'll have to modify to suit your needs.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
prolibertine wrote:
i am a newbie of php .i want get some php ebook to read.
who can send me some
thx
http://www.hudzilla.org/phpbook/

--

life is a game... so have fun.

--- End Message ---
--- Begin Message ---
Hi all,

  I would like to say good job to this newsgroup , they are the best.

Ok. My dilemma is that i have to compare values between 2 table which are exactly the same structure and fields.
  Below is rough example .

   The table are tbl_chassis and tbl_chassis_temp. Below are the fields.

   `id` int(11) NOT NULL auto_increment,
  `serial_no` varchar(100) NOT NULL default '',
  `host_name` varchar(100) NOT NULL default '',
  `chasis_model` varchar(100) NOT NULL default '',
  `chasis_flash_size` varchar(100) NOT NULL default '',
  `chasis_dram_size` varchar(100) NOT NULL default '',
  `chasis_sw_version` varchar(100) NOT NULL default '',
  `chasis_eos` date NOT NULL default '0000-00-00',
  `chasis_eol` date NOT NULL default '0000-00-00',
  `chasis_user_field_1` varchar(100) NOT NULL default '',
  `chasis_user_field_2` varchar(100) NOT NULL default '',
  `chasis_user_field_3` varchar(100) NOT NULL default '',
   `status` varchar(100) NOT NULL default '',

What i need to figure out are when the records are deleted , updated and insert ,i need to update status in tbl_chassis table. What i am plan to do is to select query in the tbl_chassis_temp table and compare the value from each records to the records in the tbl_chassis table.Any others ways to do it?

There are about 1000 records in each table.
What is the better alternative to do this ? Thanks

 - weetat

--- End Message ---
--- Begin Message ---
weetat wrote:
Hi all,

  I would like to say good job to this newsgroup , they are the best.

Ok. My dilemma is that i have to compare values between 2 table which are exactly the same structure and fields.
  Below is rough example .

   The table are tbl_chassis and tbl_chassis_temp. Below are the fields.

   `id` int(11) NOT NULL auto_increment,
  `serial_no` varchar(100) NOT NULL default '',
  `host_name` varchar(100) NOT NULL default '',
  `chasis_model` varchar(100) NOT NULL default '',
  `chasis_flash_size` varchar(100) NOT NULL default '',
  `chasis_dram_size` varchar(100) NOT NULL default '',
  `chasis_sw_version` varchar(100) NOT NULL default '',
  `chasis_eos` date NOT NULL default '0000-00-00',
  `chasis_eol` date NOT NULL default '0000-00-00',
  `chasis_user_field_1` varchar(100) NOT NULL default '',
  `chasis_user_field_2` varchar(100) NOT NULL default '',
  `chasis_user_field_3` varchar(100) NOT NULL default '',
   `status` varchar(100) NOT NULL default '',

What i need to figure out are when the records are deleted , updated and insert ,i need to update status in tbl_chassis table. What i am plan to do is to select query in the tbl_chassis_temp table and compare the value from each records to the records in the tbl_chassis table.Any others ways to do it?

If you're changing the status, why not do it in both tables at the same time?

$query = "update table1 set status=newstatus where ...";
mysql_query($query);

$query = "update table2 set status=newstatus where ...";
mysql_query($query);


Another option is to change to use the INNODB engine in mysql and use foreign keys (note they only work "properly" with InnoDB tables, MyISAM tables don't have this capability).

See

http://dev.mysql.com/doc/refman/5.1/en/innodb.html
http://dev.mysql.com/doc/refman/5.1/en/example-foreign-keys.html
http://dev.mysql.com/doc/refman/5.1/en/ansi-diff-foreign-keys.html

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
is there an example of the correct code?

--- End Message ---
--- Begin Message ---
On 6/19/06, eqla3.com eqla3.com <[EMAIL PROTECTED]> wrote:

is there an example of the correct code?


is my messege get in the right place?


===========
web archive
<a href="http://7b99.com/";>.</a>

--- End Message ---
--- Begin Message ---
Hello List Members,

 

I am very tired of deleting spam messages received from PHP mailing lists
and I think we all are.

 

As I can see most of the spam messages are in Chinese / Japanese.  Since
this is an English-only mailing list I would like to suggest blocking all
messages containing such Chinese / Japanese characters in body, or at least
marking all of them with the word [SPAM] in subject (so mail clients will be
able to deliver it to the Spam folder). AFAIK PHP lists use some home-grown
moderator so doing this should be an easy task.

 

Of course that may affect some legal users that have such characters in
their signatures, but in this case it sounds reasonable just to reply with
an email explaining blocking policy so any legal user will know what to do
to get his message go through the moderator.

 

What do you think?

 

Have a great day,

 

Denis S Gerasimov 
Web Developer
Team Force LLC

Web:    <http://www.team-force.org/> www.team-force.org

RU & Int'l:   +7 8362-213555

email:    [EMAIL PROTECTED]

 


--- End Message ---
--- Begin Message ---
I'm too! :( 

-----Original Message-----
From: Denis Gerasimov [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 19, 2006 1:23 PM
To: php-general@lists.php.net
Subject: [PHP] A way to stop spam on this list

Hello List Members,

 

I am very tired of deleting spam messages received from PHP mailing
lists
and I think we all are.

 

As I can see most of the spam messages are in Chinese / Japanese.  Since
this is an English-only mailing list I would like to suggest blocking
all
messages containing such Chinese / Japanese characters in body, or at
least
marking all of them with the word [SPAM] in subject (so mail clients
will be
able to deliver it to the Spam folder). AFAIK PHP lists use some
home-grown
moderator so doing this should be an easy task.

 

Of course that may affect some legal users that have such characters in
their signatures, but in this case it sounds reasonable just to reply
with
an email explaining blocking policy so any legal user will know what to
do
to get his message go through the moderator.

 

What do you think?

 

Have a great day,

 

Denis S Gerasimov 
Web Developer
Team Force LLC

Web:    <http://www.team-force.org/> www.team-force.org

RU & Int'l:   +7 8362-213555

email:    [EMAIL PROTECTED]

 

--- End Message ---
--- Begin Message ---
On Mon, 2006-06-19 at 02:23, Denis Gerasimov wrote:
> Hello List Members,
> 
>  
> 
> I am very tired of deleting spam messages received from PHP mailing lists
> and I think we all are.
> 
>  
> 
> As I can see most of the spam messages are in Chinese / Japanese.  Since
> this is an English-only mailing list I would like to suggest blocking all
> messages containing such Chinese / Japanese characters in body, or at least
> marking all of them with the word [SPAM] in subject (so mail clients will be
> able to deliver it to the Spam folder). AFAIK PHP lists use some home-grown
> moderator so doing this should be an easy task.
> 
>  
> 
> Of course that may affect some legal users that have such characters in
> their signatures, but in this case it sounds reasonable just to reply with
> an email explaining blocking policy so any legal user will know what to do
> to get his message go through the moderator.
> 
>  
> 
> What do you think?

I think you should quit whining like a spoilt brat *lol*. I get
something like 3 a day. Big fricking whoop.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hello Robert,

> I think you should quit whining like a spoilt brat *lol*. I get
> something like 3 a day. Big fricking whoop.

I am subscribed to most of the PHP mailing lists, not only to PHP general.
There is the same problem too. So receive something more than just "3 a
day".

Also I remember that spam traffic was much less in the past and I really
expect it grow in the future since spammers can see they are not blocked in
any way.

Do you want to fight against hundreds of spam messages in the future?
I don't.

Have a great day,
 
Denis S Gerasimov 
Web Developer
Team Force LLC

Web:   www.team-force.org
RU & Int'l:   +7 8362-213555
email:    [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
Do you know who the list admin is?

php-general has been traditionally "admined" by users flaming people posting
"bad content".

This doesn't work for spam.

Having that said, feel free to set up procmail or something like that, to
block message with chinese/japanese characters.

--- End Message ---
--- Begin Message ---
Rory Browne wrote:
> Do you know who the list admin is?
> 
> php-general has been traditionally "admined" by users flaming people
> posting
> "bad content".
> 
> This doesn't work for spam.

just wait till we have spambots with AI and emotion subroutines ;-)

> 
> Having that said, feel free to set up procmail or something like that, to
> block message with chinese/japanese characters.
> 

--- End Message ---
--- Begin Message ---
<snip>
just wait till we have spambots with AI and emotion subroutines ;-)
</snip>

It'll be worse if we get spammers with actual intelligence...

-- 
Dan Parry
Senior Developer
Virtua Webtech Ltd
http://www.virtuawebtech.co.uk 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 16/06/2006
 

--- End Message ---
--- Begin Message ---
Excuse me... in which scenarios isn't fork() available?  As far as I
know, it even works on Windows (albeit slower... not that you'll be
gaining any performance by curl'ing your URL - that's actually slower
than fork()).

El vie, 16-06-2006 a las 11:25 -0300, Martin Alterisio escribió:
> 
> 

--- End Message ---
--- Begin Message ---
El vie, 16-06-2006 a las 15:54 -0500, Richard Lynch escribió:
> On Fri, June 16, 2006 9:25 am, Martin Alterisio wrote:
> > You can fork a new process a run the other script in the child
> > process. But
> > forking is not always available so I also use another approach:
> > emulate a
> > web page request through sockets or curl to the script I want to run.
> 
> Forking in a web environment is a Bad Idea, as documented in the manual.

This is true.  Basically you need to ensure that the child process
exits() always, or you'll have a ton of apache processes running left
behind.  Not to mention that you should not attempt to access any of the
shared resources (yes, that includes print and echo since they share the
standard output file descriptor, and obviously database connections are
included) because you're not going to get consistent results.

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

--- End Message ---
--- Begin Message ---
Hi Folks,

 

Bit of an unusual question here, which is basically as a result of my lack
of understanding as to how Sessions work.

 

I've created a Captcha image solution for an application I look after, and
when we came to look into something that required debugging, I realized I'm
using sessions without understanding how they work.

 

Basically, the login includes an image, and textbox for the captcha text.
The image then generates a session with a variable name of x, and a value of
the characters from the captcha image.  The user then logs in, including the
text on the graphic.

 

## IMAGE CODE:

session_start();

$_SESSION['captcha_text'] = $randomly_generated_text;

 

 

The login check page obviously checks the username and password, and also
does the following:

 

## CHECK LOGIN CODE

session_start();

if ($_SESSION['captcha_text']!=$_POST["captcha_text"]) {

            #FAIL LOGIN TEXT

}

session_destroy();

 

It works a treat, however what I want to understand is how the session is
kept relevant to that particular user's session - mainly because my boss
wants to check there's no security implication.

 

We've thought this through and believe that in other applications, there is
also a cookie or post/get variable set in the form, which includes a
reference to the session name.

 

Are we missing something, or is it really magic?

 

Cheers

Nunners


--- End Message ---
--- Begin Message ---
James Nunnerley wrote:
> ...
> 
> It works a treat, however what I want to understand is how the session is
> kept relevant to that particular user's session - mainly because my boss
> wants to check there's no security implication.
> 
>  ...
> 

The session is stored on the server, typically in a file in /tmp.
This gives the additional security needed for your type of application
because the data is never directly seen by the user.

The link to the user is provided by a variable, typically stored as a
cookie though it can be passed via GET if cookies are disabled.  The
variable contains a random string which links to the temporary session
file.  All the handling of the session, retrieving the data etc. is done
by PHP for you.


An example of this in practice:

The first page starts a session, setting $_SESSION['foo'] = 'bar';
A cookie is created in the header, setting the variable PHPSESSION =
'232323';
At the end of the request a file /tmp/sess_232323 is created, this
contains a slight variant of serialize($_SESSION);

The second page starts a session, php grabs $_COOKIE['PHPSESSION'] and
looks up the file /tmp/sess_232323, reading in the data.
You can now access $_SESSION['foo'].


The above is slightly simplified but it gives you a good idea of what
happens and some of the security risks that remain.  Most of the fixed
strings I used above are configurable including the variable used in the
cookie, the timeout for the cookie, the location of the session files,
the starting bit of the session file and how quickly the server side
session files are deleted.


David

--- End Message ---
--- Begin Message ---
PHP tends to send output in content transfer encoding "chunked" (I think
this is true when output buffering is on).  <?php ?> blocks usually have
their output sent in one chunk.  The browser renders the chunks as they
come, but oftentimes they delay rendering until a sensible number of
HTML closing tags have arrived.

Now, on to the real answer to your question.  No, under normal
conditions you can't have your users' browsers interact with a live PHP
script.  Web programming is Web REQUEST->PHP RESPONSE, and you must use
support technology (like sessions, cookies or manual carryover of form
data) to make session state persistence possible.

In other words: no, if the user clicks a button, it doesn't "call a
function or branch in an if/then control statement" immediately.
Rather, an entirely new PHP process, totally unaware of the former one,
is called upon to service that request.

Now, while in the PHP realm, there *is* one way to have your web client
follow the pattern "REQUEST->RESPONSE,RESPONSE,RESPONSE" ad infinitum. 

This is called slow loading (or Comet), and basically involves:

- having the web client load a PHP script through a hidden IFRAME
- having the PHP script *never* finish execution (unless, of course, the
user hits Stop in his browser window), and continually send data through
the connection (plus one ob_flush() after each chunk just to be
politically correct).  Usually, data payloads ("page updates") are to be
carried on via JavaScript snippets, because that's about the only
technology that allows for browser state manipulation "in vivo", I mean,
live as the connection goes and never finishes.

Given a properly architected solution, this kind of technology can
outperform the famous AJAX, both in response times and in server load.
Given a poorly done solution, this kind of technology can be as bad or
dramatically worse than AJAX.

Plus, you gotta remember that PHP usually has a maximum duration on
scripts, so you need to architect around that (which isn't hard to do,
namely you have a counter and as the counter approaches the maximum load
time, just a few seconds earlier you send a <script>location.href
= ...</script> to have the browser reload the IFRAME, and exit() your
PHP script.



El vie, 16-06-2006 a las 17:04 -0400, tedd escribió:
> At 3:52 PM -0500 6/16/06, Richard Lynch wrote:
> >On Fri, June 16, 2006 8:26 am, tedd wrote:
> >> At 2:35 PM +0200 6/16/06, Barry wrote:
> >>>But once output is made. You can't remove it.
> >>>
> >>>That isn't possible with PHP.
> >>
> >> I think I get it now.
> >>
> >> PHP does everything before the user see's anything.
> >
> >This is not quite 100% correct...
> >
> >PHP output is buffered, possibly by PHP with ob_start and friends, and
> >then possibly by Apache, and then possibly by TCP packets and their
> >ordered arrival (or not) and then by the browser, but...
> >
> >It is entirely possible to construct a trivial example proving that
> >PHP can still be runing and finishing output while the browser has
> >rendered the beginning of the page.
> >
> >You can mostly THINK of it as PHP finishing before user sees anything,
> >as that will get you in a lot less trouble than thinking the other way
> >around, but to be pedantic, you should be aware it's not quite that
> >simple.
> 
> Good explanation and point.
> 
> How's this for the obvious -- the user doesn't see anything until php is done 
> with it. That doesn't mean that the entire operation must be finished, but 
> rather anything that the user see's (while and after loading) php has already 
> finished with.
> 
> That about right?
> 
> tedd
> -- 
> ------------------------------------------------------------------------------------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 

--- End Message ---
--- Begin Message ---
Hi all ,

Any php calendar out there, search google , most of them are javascript calendar ?

Thanks

--- End Message ---
--- Begin Message ---
Strange... all I wrote was "php calender" on google
and i got a whole bunch of results... 

guess i am using special version of google...

-Ryan

--- weetat <[EMAIL PROTECTED]> wrote:

> Hi all ,
> 
>   Any php calendar out there, search google , most
> of them are 
> javascript calendar ?
> 
> Thanks
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- End Message ---
--- Begin Message ---
Hi

I have this code (PHP5) as part of a class to do some LDAP stuff...

public function connect()
    {
        $this->ds = @ldap_connect( $this->server, $this->port ); ###
This seems to return true no matter waht????
        if ( $this->ds ) {
            // A successful connection was made
            $this->message .= 'A successful connection was made to the
LDAP server: <b>' . $this->server . "</b><br /><br /> \n";
        } else {
            // The connection was not successful
            $this->message .= 'It was not possible to connect to the
LDAP server: <b>' . $this->server . "</b><br /> \n";
            $this->message .= 'LDAP Error Message: ' .
ldap_error( $this->ds ) . "<br /> \n";
            $this->message .= 'LDAP Error Number: ' .
ldap_errno( $this->ds ) . "<br /> \n";
        }
    }


As you can see, I am expecting a return value of true only if the
ldap_connect makes a successful connection. However, even if I pass
values which should make a false, it gives a true.

What am I missing out on here - could any one tell me why true is always
returned?

Cheers
Steve

-- 
Steve Turnbull

Digital Content Developer
YHGfL Foundation

e [EMAIL PROTECTED]
t 01724 275030

The YHGfL Foundation Disclaimer can be found at:
http://www.yhgfl.net/foundation-services/yhgfl-email-disclaimer/

--- End Message ---
--- Begin Message --- I believe the manual says that ldap_connect doesn't actually make the connection but rather it just simply sets up the connection parameters. The actual connection doesn't happen until ldap_bind is executed.

 - or so I recall reading some where ;-)



On Jun 19, 2006, at 9:06 AM, Steve Turnbull wrote:

Hi

I have this code (PHP5) as part of a class to do some LDAP stuff...

public function connect()
    {
        $this->ds = @ldap_connect( $this->server, $this->port ); ###
This seems to return true no matter waht????
        if ( $this->ds ) {
            // A successful connection was made
            $this->message .= 'A successful connection was made to the
LDAP server: <b>' . $this->server . "</b><br /><br /> \n";
        } else {
            // The connection was not successful
            $this->message .= 'It was not possible to connect to the
LDAP server: <b>' . $this->server . "</b><br /> \n";
            $this->message .= 'LDAP Error Message: ' .
ldap_error( $this->ds ) . "<br /> \n";
            $this->message .= 'LDAP Error Number: ' .
ldap_errno( $this->ds ) . "<br /> \n";
        }
    }


As you can see, I am expecting a return value of true only if the
ldap_connect makes a successful connection. However, even if I pass
values which should make a false, it gives a true.

What am I missing out on here - could any one tell me why true is always
returned?

Cheers
Steve

--
Steve Turnbull

Digital Content Developer
YHGfL Foundation

e [EMAIL PROTECTED]
t 01724 275030

The YHGfL Foundation Disclaimer can be found at:
http://www.yhgfl.net/foundation-services/yhgfl-email-disclaimer/

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


--- End Message ---
--- Begin Message ---
Greetings all,

 

I have a situation that I'm not sure how it can be done with PHP. I have
written a web-application that produces 

a monthly statement for our customers. Now, I need to automate the
printing of these monthly statements.

The way I was thinking of doing this was through Perl. However, I have
discovered that a Perl script will not 

work. 

 

I know I can build the URL to the monthly statement. What I don't know
how to do is automate this process

and get it to print to a specific printer. Any help would be greatly
appreciated.

 

 

 

 

Jef 

 

 


--- End Message ---
--- Begin Message --- If you cron job the script file and perhaps convert it to something like PDF then you could feed it to the printer through the shell script...
I'm sure there are other ways, just one suggestion from the top of my head..

-brad

Jef Sullivan wrote:

Greetings all,



I have a situation that I'm not sure how it can be done with PHP. I have
written a web-application that produces
a monthly statement for our customers. Now, I need to automate the
printing of these monthly statements.

The way I was thinking of doing this was through Perl. However, I have
discovered that a Perl script will not work.


I know I can build the URL to the monthly statement. What I don't know
how to do is automate this process

and get it to print to a specific printer. Any help would be greatly
appreciated.









Jef






--- End Message ---
--- Begin Message --- I am trying to get PDO going on a new desktop with Ubuntu 6.06. I have installed php5, php5-dev, etc and have php5 working with no problems. I then did a pecl install pdo and that installed ok. When I run phpinfo() I get that PDO is activated and the drivers has no value.

I am now trying to install pdo_mysql and getting the following:
checking for PDO includes... checking for PDO includes... /usr/include/php/ext
configure: error:
You've configured extension pdo_mysql, which depends on extension pdo,
but you've either not enabled pdo, or have disabled it.

ERROR: `/tmp/tmptDnQ5L/PDO_MYSQL-1.0.2/configure' failed

When I list the contents of /usr/include/php/ext I get:
ls /usr/include/php/ext/pdo
php_pdo_driver.h  php_pdo.h

Any ideas as to where i need to go from here?

Thanks for the help.

Rick

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Richard Harding wrote:
I am trying to get PDO going on a new desktop with Ubuntu 6.06. I have
installed php5, php5-dev, etc and have php5 working with no problems. I
then did a pecl install pdo and that installed ok. When I run phpinfo()
I get that PDO is activated and the drivers has no value.

I am now trying to install pdo_mysql and getting the following:
checking for PDO includes... checking for PDO includes...
/usr/include/php/ext
configure: error:
You've configured extension pdo_mysql, which depends on extension pdo,
but you've either not enabled pdo, or have disabled it.

you need to have '--with-pdo_mysql' and '--with-pdo' in your configure line
'--with-pdo' may need to be something like '--with-pdo=shared'

does that help?
I was trying to look at that, but since I'm installing via pecl and not building from source how do you get those option in there? I see that pecl downloads the file to /var/tmp/pear-build-root but there are no files in there once the pecl install dies.

Thanks
Rick

--- End Message ---
--- Begin Message ---
Richard Harding wrote:
> I am trying to get PDO going on a new desktop with Ubuntu 6.06. I have
> installed php5, php5-dev, etc and have php5 working with no problems. I
> then did a pecl install pdo and that installed ok. When I run phpinfo()
> I get that PDO is activated and the drivers has no value.
> 
> I am now trying to install pdo_mysql and getting the following:
> checking for PDO includes... checking for PDO includes...
> /usr/include/php/ext
> configure: error:
> You've configured extension pdo_mysql, which depends on extension pdo,
> but you've either not enabled pdo, or have disabled it.

you need to have '--with-pdo_mysql' and '--with-pdo' in your configure line
'--with-pdo' may need to be something like '--with-pdo=shared'

does that help?

> 
> ERROR: `/tmp/tmptDnQ5L/PDO_MYSQL-1.0.2/configure' failed
> 
> When I list the contents of /usr/include/php/ext I get:
> ls /usr/include/php/ext/pdo
> php_pdo_driver.h  php_pdo.h
> 
> Any ideas as to where i need to go from here?
> 
> Thanks for the help.
> 
> Rick
> 

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Richard Harding wrote:
Jochem Maas wrote:
Richard Harding wrote:
I am trying to get PDO going on a new desktop with Ubuntu 6.06. I have
installed php5, php5-dev, etc and have php5 working with no problems. I
then did a pecl install pdo and that installed ok. When I run phpinfo()
I get that PDO is activated and the drivers has no value.

I am now trying to install pdo_mysql and getting the following:
checking for PDO includes... checking for PDO includes...
/usr/include/php/ext
configure: error:
You've configured extension pdo_mysql, which depends on extension pdo,
but you've either not enabled pdo, or have disabled it.
you need to have '--with-pdo_mysql' and '--with-pdo' in your configure
line
'--with-pdo' may need to be something like '--with-pdo=shared'

does that help?
I was trying to look at that, but since I'm installing via pecl and not
building from source how do you get those option in there? I see that
pecl downloads the file to /var/tmp/pear-build-root but there are no
files in there once the pecl install dies.

this bug report may also describe the problem you are having:
http://pecl.php.net/bugs/bug.php?id=5010

what is your configure line for php5? (see phpinfo())

also what version of php5 do you have? I suggest you grab 5.1

also given that it is a development/personal machine your running on
why not build php from source? - it's actually quite easy - heck I can do it,
and I know Jack Shit - just ask Jasper Byrant-Greene)
Version 5.1.2
Configure: There is no configure command field in the phpinfo output.
I don't build it from source because I like to use packages that I run on the server. Actually I run backports on the server, but it looks like I'm going to run into the same issues on the server that I am having here. If I had just compiled the source I would never have realized that the server will have the same issues. I figure that if I can install on this machine the same process should then apply to the server when I try to update it.

The bug you pointed to is close, but not quite. The bug appears fixed in 5.1 and the problem I am having is not the lack of finding the .h file. It just seems that it is not picking up PDO is enabled even though it is for some reason.

Thanks for the help.

Rick

--- End Message ---
--- Begin Message ---
Richard Harding wrote:
> Jochem Maas wrote:
>> Richard Harding wrote:
>>  
>>> I am trying to get PDO going on a new desktop with Ubuntu 6.06. I have
>>> installed php5, php5-dev, etc and have php5 working with no problems. I
>>> then did a pecl install pdo and that installed ok. When I run phpinfo()
>>> I get that PDO is activated and the drivers has no value.
>>>
>>> I am now trying to install pdo_mysql and getting the following:
>>> checking for PDO includes... checking for PDO includes...
>>> /usr/include/php/ext
>>> configure: error:
>>> You've configured extension pdo_mysql, which depends on extension pdo,
>>> but you've either not enabled pdo, or have disabled it.
>>>     
>>
>> you need to have '--with-pdo_mysql' and '--with-pdo' in your configure
>> line
>> '--with-pdo' may need to be something like '--with-pdo=shared'
>>
>> does that help?
>>   
> I was trying to look at that, but since I'm installing via pecl and not
> building from source how do you get those option in there? I see that
> pecl downloads the file to /var/tmp/pear-build-root but there are no
> files in there once the pecl install dies.

this bug report may also describe the problem you are having:
http://pecl.php.net/bugs/bug.php?id=5010

what is your configure line for php5? (see phpinfo())

also what version of php5 do you have? I suggest you grab 5.1

also given that it is a development/personal machine your running on
why not build php from source? - it's actually quite easy - heck I can do it,
and I know Jack Shit - just ask Jasper Byrant-Greene)

> 
> Thanks
> Rick
> 

--- End Message ---

Reply via email to