php-general Digest 21 Jun 2004 14:03:41 -0000 Issue 2834

Topics (messages 188721 through 188741):

Re: Printing invoices
        188721 by: Justin French
        188724 by: Lester Caine
        188735 by: bskolb

Re: plz help!compiled php but iam still getting old version ???
        188722 by: Joel Kitching

Re: Auth_User
        188723 by: Gabor Niederl�nder
        188725 by: Marcel Tschopp

Testing for cookie?
        188726 by: Martin Schneider

Testing if cookies are enabled
        188727 by: Martin Schneider
        188730 by: Aidan Lister
        188736 by: Martin Schneider
        188737 by: Ford, Mike               [LSS]
        188741 by: Michael Sims

email autoresponder
        188728 by: Syed Ghouse
        188729 by: Aidan Lister

Check if cookies are enabled on one page
        188731 by: Martin Schneider

file locking question
        188732 by: Brent Clark
        188738 by: Marek Kilimajer
        188740 by: Daniel Clark

Re: is there any application ,
        188733 by: Mr. Bogomil Shopov

PHP Contest (rev2)
        188734 by: Mr. Bogomil Shopov

Re: hi all can you read me ?
        188739 by: Daniel Clark

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On 21/06/2004, at 9:30 AM, bskolb wrote:

Could someone direct me to a printing solution from a static document that
would render variable data elements to be sent to a printer queue? I was
thing perhaps of an RTF for the static page, but can't seem to locate any
way of inserting the variable data, then spit out each occurrance to a
printer.

You could read the contents of an RTF file straight into a PHP variable, then perform some regular expressions on it. You'd have to set-up some naming conventions, but replacing something like {FIRSTNAME} with the contents of $myInvoiceData['FIRSTNAME'] would be pretty basic stuff. I'd probably use preg_replace_callback() with a callback to a function which:


a) attempts to match {THIS_BIT} with $myInvoiceData['THIS_BIT']
b) if no match, either
- return nothing (it replaces {THIS_BIT} with nothing), or
- return {THIS_BIT} (no replacing done -- probably safer for debugging and the mysteries of RTF.
c) if there's a match return the value of $myInvoiceData['THIS_BIT'], replacing {THIS_BIT}



Let me know if you need more help, but http://php.net/preg_replace_callback should give you enough pointers.



--- Justin French http://indent.com.au

--- End Message ---
--- Begin Message ---
Bskolb wrote:

Could someone direct me to a printing solution from a static document that
would render variable data elements to be sent to a printer queue?  I was
thing perhaps of an RTF for the static page, but can't seem to locate any
way of inserting the variable data, then spit out each occurrance to a
printer.

Have a look at http://www.interaktonline.com/products/PDFreportsLite/

I had a couple of false starts, but now have it working off Firebird and producing .pdf files which I can display in the browser, or save to file.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message ---
Thanks, I had something similar in mind.  The reason I was hoping to use RTF
is so the customer can easily create new documents and be able to fill in
the variable data themselves. 

Example.  First Name: $fname 

So they would actually type the PHP variable and I could easily read in the
RTF file from database.  

As much as I appreciate everones suggestions thus far, nobody has yet to
address the issue of actually printing the data.  I have no need to save
and/or display the form, I only need to send it to the server side printer
(optionally client side as well, if possible).  It's looking as if I will
have to parse through the RTF and convert it to the built in PHP printer
functions, but I feel this is ineffecient and therefore not necessarily the
best solution.


Thanks to everyone so far!!

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 20, 2004 10:04 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Printing invoices

On 21/06/2004, at 9:30 AM, bskolb wrote:

> Could someone direct me to a printing solution from a static document 
> that would render variable data elements to be sent to a printer 
> queue?  I was thing perhaps of an RTF for the static page, but can't 
> seem to locate any way of inserting the variable data, then spit out 
> each occurrance to a printer.

You could read the contents of an RTF file straight into a PHP variable,
then perform some regular expressions on it.  You'd have to set-up some
naming conventions, but replacing something like {FIRSTNAME} with the
contents of $myInvoiceData['FIRSTNAME'] would be pretty basic stuff.  I'd
probably use preg_replace_callback() with a callback to a function which:

a) attempts to match {THIS_BIT} with $myInvoiceData['THIS_BIT']
b) if no match, either
        - return nothing (it replaces {THIS_BIT} with nothing), or
        - return {THIS_BIT} (no replacing done -- probably safer for
debugging and the mysteries of RTF.
c) if there's a match return the value of $myInvoiceData['THIS_BIT'],
replacing {THIS_BIT}


Let me know if you need more help, but
http://php.net/preg_replace_callback should give you enough pointers.


---
Justin French
http://indent.com.au

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


--- End Message ---
--- Begin Message ---
Try looking in your apache configuration files for a reference to a
PHP library file or something...  Though I don't see the logic in
installing an older version either.

On Sun, 20 Jun 2004 21:53:37 -0400, Michael Lauzon <[EMAIL PROTECTED]> wrote:
> 
> Why do you want to install 4.3.3, when the latest version is 4.3.7?
> 
> 
> 
> On Mon, 21 Jun 2004 19:07:32 -0400 (EDT), Ravi <[EMAIL PROTECTED]> wrote:
> >
> > HI,
> >
> > existing configuration :
> > PHP Version 4.3.4 ( default rpm with fedora fc2 install)
> > Server version: Apache/2.0.49 (default with fedora fc2 install)
> > Server built:   May  6 2004 07:15:13
> >
> > NOw i want to install 4.3.3 , so i compiled and install ( with no errors )
> > if i type " php -v " at shell iam getting correct version *BUT if tried
> > phpinfo() in browser iam getting still OLD version :( restarted apache but
> > no use.
> >
> > please help
> >
> > - thanks for your time.
> >
> > --- knowledge is power share it - ravi.us ---
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> --
> Michael Lauzon, Founder
> The Quill Society
> http://www.quillsociety.org/
> [EMAIL PROTECTED]
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
If you are using IIS with PHP as an ISAPI-module, it is possible to find out
the NT-User through $_SERVER['AUTH_USER'].
Apparently it is not so easy on Apache.
Does anyone know a solution?

Gabor


"Gerben" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> This var means something else
> when you write the following code:
>     Header("WWW-Authenticate: Basic realm=\"Enter username and
password\"");
>     Header("HTTP/1.0 401 Unauthorized");
> Your browser will produce a popup requesting a username an password
>
> This it what you get returned when using $_SERVER['AUTH_USER']
>
>
>
>
> "Gabor Niederl�Nder" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi!
> >
> > I have installed a Apache Server (+php) in a Windows NT network. I
> > would like to identify the Windows NT user visiting my php pages.
> > When I was using IIS, I think it was quite easy to find it out through
> > the $_SERVER['AUTH_USER'] variable. But it doesn't seem to work with
> > apache. Is there another way?
> >
> > Cheers,
> > Gabor

--- End Message ---
--- Begin Message ---
Eventually the apache module mod_ntlm (http://modntlm.sourceforge.net/)
could help... don't know if it really works but it looks very
interesting.

cheers
Marcel

> If you are using IIS with PHP as an ISAPI-module, it is possible to find out
> the NT-User through $_SERVER['AUTH_USER'].
> Apparently it is not so easy on Apache.
> Does anyone know a solution?
> 
> Gabor
> 
> 
> "Gerben" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> > This var means something else
> > when you write the following code:
> >     Header("WWW-Authenticate: Basic realm=\"Enter username and
> password\"");
> >     Header("HTTP/1.0 401 Unauthorized");
> > Your browser will produce a popup requesting a username an password
> >
> > This it what you get returned when using $_SERVER['AUTH_USER']
> >
> >
> >
> >
> > "Gabor Niederl�Nder" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi!
> > >
> > > I have installed a Apache Server (+php) in a Windows NT network. I
> > > would like to identify the Windows NT user visiting my php pages.
> > > When I was using IIS, I think it was quite easy to find it out through
> > > the $_SERVER['AUTH_USER'] variable. But it doesn't seem to work with
> > > apache. Is there another way?
> > >
> > > Cheers,
> > > Gabor
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hello!

Okay, I saw pages doing this and I want exactly the same:

- On a page the user can login. Before, no cookie is set.

- On the next page, the cookie is set. It shows either the user data (is the login was correct and cookies where enabled) or a page which tells that cookies are disabled.

So how is it done? I was not able to set and test a cookie on the same page.

Martin
--- End Message ---
--- Begin Message ---
Hello!

I saw this on some pages and want to do the same:

- On one page the user can login. Before that no cookie is set!

- On the next page they set the cookie and show either the user data or a warning that the user has disabled cookies and should enable them.

I wasn't able to set and text a cookie on the same page! How is it done?

Martin
--- End Message ---
--- Begin Message ---
Think about it.

Step 1) Analyse the problem.
a) Set a cookie.
b) Test if the cookie has been set.
c) Display data from cookie

Step 2) Read the fucking manual
a) http://php.net/setcookie
b) http://php.net/setcookie
c) http://php.net/setcookie

If you can't work it out, and have actually done some reading, feel free to
ask for some more help.



"Martin Schneider" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello!
>
> I saw this on some pages and want to do the same:
>
> - On one page the user can login. Before that no cookie is set!
>
> - On the next page they set the cookie and show either the user data or
> a warning that the user has disabled cookies and should enable them.
>
> I wasn't able to set and text a cookie on the same page! How is it done?
>
> Martin

--- End Message ---
--- Begin Message ---
Hi Aidan,

> Think about it.
>
> Step 1) Analyse the problem.
> a) Set a cookie.
> b) Test if the cookie has been set.
> c) Display data from cookie
>
> Step 2) Read the fucking manual
> a) http://php.net/setcookie
> b) http://php.net/setcookie
> c) http://php.net/setcookie

thanks for your reply, I think you missunderstood, please read more carefully. I know how to set and read a cookie, but as I wrote I wasn't able to set and text a cookie ON THE SAME PAGE.

The manual says: http://php.net/setcookie
"Once the cookies have been set, they can be accessed ON THE NEXT PAGE."

But I have seen pages on which it seems they set und check if the cookie has been set ON THE SAME PAGE. So I want to know how they do that (perhaps with a 302-header or something like that?).

Martin

Aidan Lister schrieb:


If you can't work it out, and have actually done some reading, feel free to ask for some more help.



"Martin Schneider" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Hello!

I saw this on some pages and want to do the same:

- On one page the user can login. Before that no cookie is set!

- On the next page they set the cookie and show either the user data or
a warning that the user has disabled cookies and should enable them.

I wasn't able to set and text a cookie on the same page! How is it done?

Martin

--- End Message ---
--- Begin Message ---
On 21 June 2004 12:11, Martin Schneider wrote:

> thanks for your reply, I think you missunderstood, please read more
> carefully. I know how to set and read a cookie, but as I
> wrote I wasn't
> able to set and text a cookie ON THE SAME PAGE.
> 
> The manual says: http://php.net/setcookie
> "Once the cookies have been set, they can be accessed ON THE
> NEXT PAGE."
> 
> But I have seen pages on which it seems they set und check if
> the cookie
> has been set ON THE SAME PAGE. So I want to know how they do that
> (perhaps with a 302-header or something like that?).

Yes, that's one possibility, but there'd still have to be at least one page
load involved before you'd see the cookie.  What you describe makes it more
likely that there's actually some client-side technology involved, such as
JavaScript.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message ---
Martin Schneider wrote:
> I saw this on some pages and want to do the same:
>
> - On one page the user can login. Before that no cookie is set!
>
> - On the next page they set the cookie and show either the user data
> or a warning that the user has disabled cookies and should enable
> them.
>
> I wasn't able to set and text a cookie on the same page! How is it
> done?

Probably wasn't done on the same page.  Here's my guess at how these sites do that:

(1) User visits login page, no cookie is set.
(2) User enters username and password in the login page form, clicks the submit
button, and the login page form posts back to itself.
(3) The login page has logic at the top to check and see if the form has been
posted...if so it verifies the user's credentials, sets a cookie, and then redirects
to the first page of the application.
(4) The first page of the application (main menu or whatever) checks to see if a
cookie has been provided.  If not, it displays the warning that the user has
disabled cookies.

So, the app sets the cookie and then immediately redirects to the page that checks
the cookie.  To the end user it would appear that the cookie was set and checked in
the same page.  HTH...

--- End Message ---
--- Begin Message ---
Hi All
(B
(Bwill anybody explain me what is email autoresponder?.
(Band how to create in php?
(B
(BRegards
(BSyed

--- End Message ---
--- Begin Message ---
If you don't know what it is, why do you want to make one?

There's a lot more to this than simple PHP, I suggest you start on
google.com


"Syed Ghouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi All

will anybody explain me what is email autoresponder?.
and how to create in php?

Regards
Syed

--- End Message ---
--- Begin Message ---
Hello!

I don't want to alyways set a cookie when a user enters my page. I want to set it when the users logs on, not earlier.

The way is:
- "Login-Page": The user enters the page where he can enter his name/password in a form and then submits this form. Before this, no cookie should be set.


- "After Login-Page":
    Here the cookie is set for the first time.
    - If the user has enabled cookies, I want to show him his data.
    - If the user has disabled cookies, I want to show him a page
      saying that he should enable cookies.

I saw pages doing so, but how is it done? I seem not to be able to set and check a cookie on the same page (or am I wrong?)

Martin
--- End Message ---
--- Begin Message ---
Hi all

I have this script whereby I use the php function file().
Just a quick question, do I need to implement file locking.

if so, can I just use something like
        flock( file("/path/file.ext") );

Kind Regards
Brent Clark

MSN: [EMAIL PROTECTED]
eMail: [EMAIL PROTECTED]
Cell: +27 82 701 7827
Work No: +27 21 683 0069
Fax No: +27 21 683 6137

--- End Message ---
--- Begin Message --- Brent Clark wrote --- nap�sal::
Hi all

I have this script whereby I use the php function file().
Just a quick question, do I need to implement file locking.

if so, can I just use something like
        flock( file("/path/file.ext") );

No, you need file locking only for writing.

--- End Message ---
--- Begin Message ---
If you're just going to read only, no.

>>Hi all
>>
>>I have this script whereby I use the php function file().
>>Just a quick question, do I need to implement file locking.
>>
>>if so, can I just use something like
>>      flock( file("/path/file.ext") );
>>
>>Kind Regards
>>Brent Clark

--- End Message ---
--- Begin Message ---
hello , yes there is a phpBlender application.Please look at
http://phpblender.com

All the Best
Bogomil

--- End Message ---
--- Begin Message --- The Spisanie.com Magazine together with its enlisted partners is the organizers of the Balkan PHP programming/developing competition. The first stage had already been started and will reach completion on the 15th of July 2004 with the following task:


Development of an encryption algorithm for communication.


- To be structured in two methods – name_encode and name_decode (see example);
- The possibility for the input of more than one parameter;
- The completed solutions are to be tested on versions from 4.2.x to 4.3.6. (or the latest version of PHP4 available when the evaluation is to be performed);
- If your script is for a specific version – please let us know by writing it on the attached file as well as any other stuff you’d like us to take into consideration;



There are no limitations for the algorithm type, encryption level and what is to be encrypted. Which means it is up to your creativity.


Prizes are:

- Zend Studio 3.5
- Maguma Workbench (more info?)
- NuSphere Editor (PHPEd)
- TemplateTamer (Developer edition)
- ionCube Cerberus Encoder
- ionCube Standalone PHP Encoder.
- Activestate Comodo IDE

and a lot of Beer ;))


More info at: http://php.spisanie.com/

Bogomil
--- End Message ---
--- Begin Message ---
Can read you now().

>>Hi all just wanna check if you can read me
>>
>>Thx

--- End Message ---

Reply via email to