Re: [PHP] New Server advice

2002-10-31 Thread John Nichel
Production Server -> Apache 1.3.x

Apache2 is not even to be considered.

Apache2 and PHP are not "bedfellows" yet.

David Russell wrote:

Hi all,

I am setting up a new production server. Assuming that I do not need
register globals, what does everyone suggest for setting it up:

Linux machine
Apache 
PHP 4.2.3

My real question is whether I should install with Apache 1.3.27 or
Apache 2.0.43 This implies 3 questions:
1. Does PHP 4.2.3 work properly with Apache 2.0.43? In a production
server?
2. Are there features in Apache 2.0 that would be beneficial?
3. What is the learning curve line from moving to installing,
configuring and running Apache 1.3 to 2.0?

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com



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




[PHP] Require_once problem

2002-10-31 Thread Kerry Kobashi
Whats the difference between require_once and include_once?

I been running into a problem, perhaps someone can help.

I require_once in a Pear database extension. Inside that pear database
extension
is a require_once("pear.php") and a require_once("db.php")

This file, Thomas Voxs' DbPage.php file, gets require_once inside yet
another
file (my file).

The problem is, my file brings in many require_once file's, some of which
require_once(db.php) inside of it. All I get redefinition problems all over
the place.

It appears to me that require_once doesn't work as advertised? For if it
did,
there should never be redefinition problems.

Why didn't all PHP code do like we do in C/C++ with
#define BLAH
if !defined(BLAH)
{
   your code here.
}

I realize the #define trick works as I used it in my own PHP code... but
when
the basic PHP core files don't have this in them, it sort of  makes
require_once
and include_once hacks! (that don't work)

Any ideas suggestions?




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




[PHP] New Server advice

2002-10-31 Thread David Russell
Hi all,

I am setting up a new production server. Assuming that I do not need
register globals, what does everyone suggest for setting it up:

Linux machine
Apache 
PHP 4.2.3

My real question is whether I should install with Apache 1.3.27 or
Apache 2.0.43 This implies 3 questions:
1. Does PHP 4.2.3 work properly with Apache 2.0.43? In a production
server?
2. Are there features in Apache 2.0 that would be beneficial?
3. What is the learning curve line from moving to installing,
configuring and running Apache 1.3 to 2.0?

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com



smime.p7s
Description: application/pkcs7-signature


Re: [PHP] Re: counting clicks on a flash ad

2002-10-31 Thread James Redfern
On Fri, 01 Nov 2002 12:45:45 +1000, [EMAIL PROTECTED] (Justin
French) wrote in <[EMAIL PROTECTED]>:

¦ Looks to me like you've named your directory:
¦ /phpadsnew/ 
¦ 
¦ And looks to me like it's look for:
¦ /phpAdsNew/
¦ 
¦ Perhaps try that simple change and see what happens?

Oh god, I wish that were it, but it isn't.  That was just me being
careless when I wrote the message.  Sorry.  And thanks for trying, but
that isn't it.

JR.


-- 
James Redfern [The Redfern Organization]
PGP Auto-responder 
Fingerprint: 6809 FE89 4CEF E76F C6DF  04BF 46DC 58B9 CB81 E8E8

...You always suppress momentary anger at something you deeply and permanently 
hate"--Robert M. Persig

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




[PHP] client-side zip of POST or GET data, auto unzip on server.

2002-10-31 Thread Petre Agenbag
Hi
I'm wondering if something like this will be possible.

I am correct in thinking that POST and GET data are sent as plain text?
And, that being plain text, they should probably be highly compactable
by zip utils?

The reason I'm thinking this route is that I have a couple of forms for
some client websites that are particularly large, some of the POST data
sent are more than 2 MB, but obviously it can vary depending on the
amount of data entered by the user ( I cannot limit this, as these forms
are assessment forms, and they need to contain all relevant info,
regardless of size ).
All fields are text fields.

So, what happens now is that for some users on slow connections, these
forms can either take years or they simply time out every time.

Being a specific application with controlled number of users, I wouldn't
think it bad practise to force the user to install a "zip" package on
his pc; that's to say if it would be possible to write some client side
script (JS?) that will receive the form data, zip it, then send the
zipped packet via POST or GET as per usual to the server, where, upon
receipt, the POST package is "unzipped" and the handled as per usual.

Would something like this be possible or feasible at all? Are there
other better ways to accomplish this?

Thanks




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




[PHP] php development environment

2002-10-31 Thread Simon Taylor
Hi All,
Does anyone know if there is a good php development environment around, you
know something that will hold a list of functions/classes so you don't have
to scroll through thousands of line of code looking for a few lines of
spurious code...and all the other goodies that come with that sort of
thing.. At the moment I use homesite which is pretty cool and makes all me
lines come out in pretty colours, but I am getting frustrated as things are
growing..
Thanks..
_
Simon Taylor
AfriTol (Pty) Ltd.

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




Re: [PHP] Displaying Data of a MySQL Table in PHP

2002-10-31 Thread Jason Wong
On Friday 01 November 2002 14:14, Ben C. wrote:
> I want to create a table in PHP with data from a MySQL database table.  Can
> someone please help with a sample script.  I know this is probably easy but
> I need quick help.  I searched the archives and couldn't find something
> this simple.

google -> "mysql php tutorial"

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Mother told me to be good but she's been wrong before.
*/


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




[PHP] PHP-GTK 0.5.2 released

2002-10-31 Thread Andrei Zmievski
To all crazy users of PHP-GTK,

Version 0.5.2 has been released (after a half a year hiatus). This
release has some bug fixes and also some minor feature enhancements,
mostly in the graphics area.

Download the releaes from;

http://gtk.php.net/download.php

Version 0.5.2 "Bass does a body good" 01-Nov-2002
~
- simplified GdkPixbuf constructor parameters. (Andrei)
- fixed setting of tile/stipple/clip_mask/bg_pixmap properties of
  GdkGC. (Andrei)
- implemented GdkPixbuf::fill(). (Andrei)
- changed failure to allocate color to output only a notice instead
  of a warning. (Andrei)
- made depth parameter of GdkPixmap constructor optional. (Andrei)
- added copy_area() method for drawables. (Andrei)
- added group() and set_group() methods for
  GtkRadioButton/GtkRadioMenuItem. (Andrei)
- added GDK functions pointer_grab(), pointer_ungrab(),
  keyboard_grab(), keyboard_ungrab(). (Andrei)
- added utf8 support to GtkRadioButton, GtkToggleButton,
  GtkCheckMenuItem, and GtkCheckButton. (Frank)
- fixed a crash bug when using non-string variables to access
  overloaded object's properties. (Andrei)
- fixed a crash bug in GtkCheckButton constructor. (Andrei)

Enjoy,

-Andrei   http://www.gravitonic.com/
* Reality isn't all it's cracked up to be. *

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




Re: [PHP] Displaying Data of a MySQL Table in PHP

2002-10-31 Thread John Nichel
http://www.php.net/manual/en/ref.mysql.php

It doesn't get any simpler than that.

Ben C. wrote:

I want to create a table in PHP with data from a MySQL database table.  Can
someone please help with a sample script.  I know this is probably easy but
I need quick help.  I searched the archives and couldn't find something this
simple.

Please help.

--
The content of this email message and any attachments are confidential and
may be legally privileged, intended solely for the addressee.  If you are
not the intended recipient, be advised that any use, dissemination,
distribution, or copying of this e-mail is strictly prohibited.  If you
receive this message in error, please notify the sender immediately by reply
email and destroy the message and its attachments.






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




[PHP] Displaying Data of a MySQL Table in PHP

2002-10-31 Thread Ben C.
I want to create a table in PHP with data from a MySQL database table.  Can
someone please help with a sample script.  I know this is probably easy but
I need quick help.  I searched the archives and couldn't find something this
simple.

Please help.

--
The content of this email message and any attachments are confidential and
may be legally privileged, intended solely for the addressee.  If you are
not the intended recipient, be advised that any use, dissemination,
distribution, or copying of this e-mail is strictly prohibited.  If you
receive this message in error, please notify the sender immediately by reply
email and destroy the message and its attachments.


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




Re: [PHP] why does eregi match for whitespace when there is none?

2002-10-31 Thread rija
I don't think that eregi or ereg consider "\s" as whitespace-
Instead, use " " or "\040"-

- Original Message - 
From: "Peter J. Schoenster" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 4:44 PM
Subject: [PHP] why does eregi match for whitespace when there is none?


> Here is the example:
> 
>  
> $string = 'asfddsaz';
> 
> if (eregi('\s', $string)) {
> echo "Whitespace present";
> }else {
> echo "NO Whitespace present";
> }
> ?>
> 
> Why does the above return true? There is no whitespace in the string. 
> What am I missing?
> 
> Peter
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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




[PHP] why does eregi match for whitespace when there is none?

2002-10-31 Thread Peter J. Schoenster
Here is the example:



Why does the above return true? There is no whitespace in the string. 
What am I missing?

Peter


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




RE: [PHP] number_format question

2002-10-31 Thread John W. Holmes
>  Tried it. It works but crops everything after the first "," in the
number
> if you enter a number with commas. Works great if you don't enter any
> commas.

How many integers can you name that have commas in them??? In other
words, you have a string, so PHP converts it to an integer to pass to
number format. Thus you only get the integer part up to the first comma.

---John Holmes...



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




[PHP] Re: How to prevent failure email from being sent?

2002-10-31 Thread Manuel Lemos
Hello,

On 10/27/2002 02:24 PM, Noah Spitzer-Williams wrote:

Hey guys,

My service sends out emails every few days to members who wish to have
stats sent to them. The problem is once an email becomes inactive, I the
webmaster gets a failure email sent to me. This is starting to add up and I
can get upwards of 20 of these a day. It just seems likea  waste of space
and bandwidth... is there anyway I can prevent this?

If i delete the webmaster email key in php.ini will my emails not have a
reply address?


If you set the return-path address to different address then the 
Reply-to:  you can sort most of real responses from the bounces. 
However, keep in mind that some broken e-mail systems will not honour 
the return-path address and instead use address in From: and even the 
Reply-to: address.


--

Regards,
Manuel Lemos


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



[PHP] Re: Good form class?

2002-10-31 Thread Manuel Lemos
Hello,

On 10/31/2002 06:28 PM, Leif K-Brooks wrote:

I'm looking for a good class to manage forms.  It doesn't need to do 
anything with the form itself, I'm looking for something that does form 
validation on the processing side.  I've looked on phpclasses, but 
everything I found was either insecure (passing data about the form 
through hidden form fields) or just not what I needed.  Any ideas?

If you tried this class, have you found anything insecure on it?

http://www.phpclasses.org/formsgeneration

--

Regards,
Manuel Lemos


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




[PHP] Re: Help with using phpmailer

2002-10-31 Thread Manuel Lemos
Hello,

On 10/31/2002 05:58 PM, Pushpinder Singh Garcha wrote:

I am new in the php development world. I have made a simple mail 
application using the phph mail() function.
I needed to use an attachment facility ith the mailing program...so I 
have tried to use this solution called phpmailer()
from http://sourceforge.net/projects/phpmailer

I am not able to find any installation info on the site...Has anyoneused 
this before?

I never used phpmailer, so I can't help you on its specifics. Anyway, if 
you want to try this other class for composing and sending e-mail 
messages, I can help you:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos


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



RE: [PHP] number_format question

2002-10-31 Thread Martin Towell
what about str_replace(",", "", $str) before you pass the value to
number_format()?

-Original Message-
From: [EMAIL PROTECTED] [mailto:ed@;home.homes2see.com]
Sent: Friday, November 01, 2002 9:37 AM
To: Jay Blanchard
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] number_format question



 Tried it. It works but crops everything after the first "," in the number
if you enter a number with commas. Works great if you don't enter any
commas.

What I need to be able to do:

IN   OUT
123456789 > 123,456,789
123456789.00 > 123,456,789
123,456,789.00 > 123,456,789

Ed


On Thu, 31 Oct 2002, Jay Blanchard wrote:

> [snip]
>  If I try that I get a wrong parameter count error.
> 
> [/snip]
> 
> number_format ( float number [, int decimals [, string dec_point [, string
> thousands_sep]]])
> 
> number_format($number, 0, '', ',');
> 
> Try that ...
> 
> Jay
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

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




RE: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?

2002-10-31 Thread Daevid Vincent
I have it. You can download it from my website here:
http://www.siia.net/piracy/

idiot.

> -Original Message-
> From: jianking [mailto:liaus@;10mail.net] 
> Sent: Thursday, October 31, 2002 7:00 AM
> 
> 
> Who can tell me where I can get the cracked Zend Encoder 3.0 ?


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




RE: [PHP] number_format question

2002-10-31 Thread ed

 Tried it. It works but crops everything after the first "," in the number
if you enter a number with commas. Works great if you don't enter any
commas.

What I need to be able to do:

IN   OUT
123456789 > 123,456,789
123456789.00 > 123,456,789
123,456,789.00 > 123,456,789

Ed


On Thu, 31 Oct 2002, Jay Blanchard wrote:

> [snip]
>  If I try that I get a wrong parameter count error.
> 
> [/snip]
> 
> number_format ( float number [, int decimals [, string dec_point [, string
> thousands_sep]]])
> 
> number_format($number, 0, '', ',');
> 
> Try that ...
> 
> Jay
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




RE: [PHP] rename()

2002-10-31 Thread John W. Holmes
> I am trying to allow the user to upload pictures.  What is the best
way to
> rename them?  If I use the rename function, I have to upload the
pictures
> to
> the same place as the script and then move it.  ALso, if I am not sure
of
> the extension, how can I simply rename it?  Can I do multiple files at
> once?

You can use uniqid() to help make a unique name for the file when you
copy it. You can get the extension of the file from the $_FILE array,
just parse the element that holds the name of the file on the client
computer. You can do this with multiple files or just one. 

---John Holmes...



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




RE: [PHP] PHP - Internal linking in a page

2002-10-31 Thread John W. Holmes
You need to come up with a completely different method of doing this.
Your site, if using this method, is horribly unsecure. How are you
checking $page to make sure it's something that should be included??

---John Holmes...

> -Original Message-
> From: Paul Ottar Tornes [mailto:critical@;tiscali.no]
> Sent: Thursday, October 31, 2002 5:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP - Internal linking in a page
> 
> Hi!
> 
> I started to learn PHP yesterday, and I have just entered a little
> problem.
> In my index.php file. I have this line:
> 
>  ($page); ?>
> 
> wich controles the main page locaton, just like frames. It makes the
files
> appear in the middle of the site.
> 
> Now over to the problem:
> 
> I am making a newsscript with PHP and PostgreSQL. I have now gotten
PHP to
> extract the news from the database.
> I am using numbers as ID for each post. 1, 2 ,3, 4, 5, 6 and so on.
> I use them to make a READ MORE link on the news posts.
> I am calling my "READ MORE"-page for main2.php, this contains PHP code
> that finds the story thats connected to the given number. and I use
this
> to make it appear: http://maloyportalen.no/~critical/maloy/main2.php?id=7
> 
> But that makes it go on a seperate page.
> And this link does not work at all:
> http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
> It returns this error:
> 
> Warning: Failed opening 'main2.php?id=7' for inclusion
> (include_path='.:/usr/share/pear') in
> /home/critical/public_html/maloy/index.php on line 21
> 
> 
> Line 21 is the following:
>  ($page); ?>
> 
> How can I write it so I can use:
> http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
> 
> Regards
> Paul Ottar Tornes.
> 




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




RE: [PHP] Rearranging Order of Photos

2002-10-31 Thread @ Darwin
Monty, maybe you can try using a database and PHP together to organize these
photos. A suggestion would be to store only the path to the photos in a
MySQL database, for example, and store the actual photos in the file system.
If you would like to have these photos in a specific order then just create
a field that will number the placement of these photos from 1 to some
number. There are many possibilities on how you can arrange something like
this with a database back-end. You just have to be a little creative while
keeping your needs in mind. Hope that helps.

-- Navid

> -Original Message-
> From: Monty [mailto:monty3@;hotmail.com]
> Sent: Thursday, October 31, 2002 7:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Rearranging Order of Photos
>
>
> Hi, I need to write a script that re-organizes the order of photos that
> appear in an online photo gallery. I'm not sure if I can do this
> completely
> with PHP or if I need to incorporate Javascript as well, but, I was hoping
> someone here might have or know of a site that has some sample
> scripts that
> allow someone to re-order photos displayed in a thumbnail gallery. I'm
> having a hard to figuring out the best fool-proof way to accomplish this
> with PHP alone.
>
> Thanks!
>
> Monty
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] XML to MS Word

2002-10-31 Thread Charles Wiltgen
Manuel Lemos wrote...

>>> I'd say RTF is a format you're going to be able to come to grips with
>>> quicker than .doc -- just take a look at the source of a word doc -- it's
>>> pretty obscure!!!
>> 
>> And proprietary, and soon to be obsolete.  But Office 11 files will be XML
>> files.
> 
> RTF is not a closed format.

(I was talking about Office's native .doc format, not the .rtf file format.)

-- Charles


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




Re: [PHP] Re: counting clicks on a flash ad

2002-10-31 Thread Justin French
Hi

Looks to me like you've named your directory:
/phpadsnew/ 

And looks to me like it's look for:
/phpAdsNew/

Perhaps try that simple change and see what happens?


Justin


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




[PHP] Re: counting clicks on a flash ad

2002-10-31 Thread James Redfern
On Tue, 29 Oct 2002 09:35:27 -0500 (EST), [EMAIL PROTECTED]
(Joel Boonstra) wrote in
<[EMAIL PROTECTED]>:

¦ You might try using software like phpAdsNew:
¦ 
¦   http://www.phpadsnew.com/
¦ 
¦ It has a fantastic admin interface for you and for the advertiser, it
¦ supports Flash banners, as well as everything else you want to throw at
¦ it, it's free, and it's free.  Installation is remarkably easy.

Joel,

Having got an earlier version of phpAdsNew working effortlessly once
before, when it was pre-configured into an auction package, I now find
myself struggling to get the latest version running on an e-smith
virtual domain web site. Can you or anyone else give me some pointers
on how to do it on e-smith? Having set it up according to the book (in
/ibays/southern/html/phpadsnew/, the code it wants me to use in 'local
mode' is as follows, for php: 

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Rearranging Order of Photos

2002-10-31 Thread Monty
Hi, I need to write a script that re-organizes the order of photos that
appear in an online photo gallery. I'm not sure if I can do this completely
with PHP or if I need to incorporate Javascript as well, but, I was hoping
someone here might have or know of a site that has some sample scripts that
allow someone to re-order photos displayed in a thumbnail gallery. I'm
having a hard to figuring out the best fool-proof way to accomplish this
with PHP alone.

Thanks!

Monty



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




[PHP] Hashing in PHP

2002-10-31 Thread Greg
Hi, is there an easy way to get the lanman and md4 hash of a string in PHP?
I know there's a md5() function, but can't find anything else.  Thanks!!
-Greg
--



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




[PHP] Invitation

2002-10-31 Thread Stephen
Hello,

I know this is completely off topic but why not take a break from all your PHP work 
for a minute? Could some of you please come to a chat I have running as a halloween 
party. Very few people are showing up. It's here: http://www.melchior.us/chat 

Thanks!

Thanks,
Stephen Craton
http://www.melchior.us

"Life is a gift from God. Wasting it is like destroying your favorite item you 
received from the person you love most." -- www.melchior.us


[PHP] storing inc.php outside doc root/security/includes

2002-10-31 Thread rolf vreijdenberger
this is how it is done:

include ($_SERVER['DOCUMENT_ROOT'].'/../sensitivedata.inc.php');

explanation:
suppose i have a file:
www.mydomain.com/file.php
on the server it could be :
 /home/sites/site168/web/file.php
this file wants to include a file with sensitive data, (or just download
some other files ) that should not be in the root (accessible via the web)
so I store this files in this directory, one higher than the doc root
/home/sites/site168/
like this
/home/sites/site168/sensitivedata.inc.php
it is now inaccesible via the web in a direct way, but not indirectly,
through other php scripts.

you include it in the way described above:
include ($_SERVER['DOCUMENT_ROOT'].'/../sensitivedata.inc.php');
$_SERVER['DOCUMENT_ROOT']
quote php manual "The document root directory under which the current script
is executing, as defined in the server's configuration file."

hope to have helped you all



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




Re: [PHP] str_replace

2002-10-31 Thread Rasmus Lerdorf
Folks, read the docs please.  You can simply pass an array directly to
str_replace() and do this in a single str_replace() call.

-Rasmus

On Thu, 31 Oct 2002, Jonathan Sharp wrote:

> $del = array(' ', "'", '\\', '/'...etc);
> foreach ( $del AS $d )
> {
>$file = str_replace($d, '', $file);
> }
>
> -js
>
>
> rick wrote:
> > How could this be written better? Is there a way to do it all in 1 line?
> >
> > $file = str_replace(" ", "", "$file");
> > $file = str_replace("'", "", "$file");
> > $file = str_replace("\\", "", "$file");
> > $file = str_replace("/", "", "$file");
> > $file = str_replace(":", "", "$file");
> > $file = str_replace("+", "", "$file");
> > $file = str_replace("&", "", "$file");
> > $file = str_replace("=", "", "$file");
> > $file = str_replace("@", "", "$file");
> > $file = str_replace("%", "", "$file");
> > $file = str_replace("^", "", "$file");
> > $file = str_replace("*", "", "$file");
> > $file = str_replace("~", "", "$file");
> > $file = str_replace("`", "", "$file");
> > $file = str_replace(";", "", "$file");
> > $file = str_replace("|", "", "$file");
> > $file = str_replace("{", "", "$file");
> > $file = str_replace("}", "", "$file");
> > $file = str_replace("[", "", "$file");
> > $file = str_replace("]", "", "$file");
> > $file = str_replace("%", "", "$file");
> > $file = str_replace("?", "", "$file");
> > $file = str_replace("(", "", "$file");
> > $file = str_replace(")", "", "$file");
> > $file = str_replace("#", "", "$file");
> >
> > Thanks!  :)
> >
> > ...rick
> >
> >
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] rename()

2002-10-31 Thread rija
$_FILES['userfile']['name']
$_FILES['userfile']['type']
$_FILES['userfile']['size']
$_FILES['userfile']['tmp_name']

First once you upload file from browser using , the filename is automatically renamed by another one and put
down to the upload_tmp_dir and after you move or copy it into your
destination directory.

move_uploaded_file($_FILES['userfile'], string destination) or Copy(string
filename, string destination) rename automatically the picture name to
string destination, and you can set the destination's file extension using
$_FILES['userfile']['type'] or $_FILES['userfile']['name'] using php
function like eregi() for example-


- Original Message -
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 9:25 AM
Subject: [PHP] rename()


> I am trying to allow the user to upload pictures.  What is the best way to
> rename them?  If I use the rename function, I have to upload the pictures
to
> the same place as the script and then move it.  ALso, if I am not sure of
> the extension, how can I simply rename it?  Can I do multiple files at
once?
>
> Thanks,
> Eddie
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] How printing the name and value of a variable ?

2002-10-31 Thread PHP List
Why?
echo "THE VARIABLE ".(please help me right here)." EQUALS ".$tigidizougou;

Obviously the variables name is tigidizougou, so just do this:

echo "THE VARIABLE  tigidizougou EQUALS ".$tigidizougou;

Or am I missing something here?


> Theoriquement it is not possible, because you cannot use any variable
since
> you don't know its name-
>
> But you can cope something with get_defined_vars() in which you set every
> variable without distinction into an array- and after you select the
> variable you need using some criterias.
>
> like this
> $array = get_defined_vars() ;
> foreach ($array as $key=>$value)
> if (ereg("EREG_CRITERIA",$key))  echo "La variable $KEY est egale a
$value"
> ;
>
> Elsewhere if you know the name of the variable you would like to use
> do simply like this:
>
> $tigidizougou = 12;
> echo "THE VARIABLE tigidizougou EQUALS ".$tigidizougou;
>
>
> - Original Message -
> From: "franck raynal" <[EMAIL PROTECTED]>
> To: "php-general" <[EMAIL PROTECTED]>
> Sent: Friday, November 01, 2002 9:09 AM
> Subject: [PHP] How printing the name and value of a variable ?
>
>
> Hello,
> I'd like to print the name of a variable, in order to get something like
> this  :
>
> THE VARIABLE tigidizougou EQUALS 12 !
>
> from the original code below :
>
> $tigidizougou = 12;
> echo "THE VARIABLE ".(please help me right here)." EQUALS ".$tigidizougou;
>
> Any idea ? Thanks you.
>
> Franck
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Form Question

2002-10-31 Thread PHP List
Thanks, but same problem.
alert() will give me the correct values, but it is still not unchecking the
boxes.

Strange, it obviously sees them as the statement
if (document.LevelListForm.elements['rgItems[]'][i].checked == true)
is correctly found for every checked box, but it just can't seem to find
them to uncheck them.
And I don't get any javascript errors.



> Try this
>
> 
> 
> 
>
> PHP List wrote:
> > Hi,
> > I am hopeing someone can help me with this.
> > This is more of a javascript problem I suppose.
> > I have a bunch of check boxes on a from that I have given a name of
rgItems[] so I can access them as an array in php.
> > But I can't find a way to clear all the checkboxes on the form at once.
a reset button only resets the form to the original values, but I need to be
able to clear all the check boxes.
> >
> > 
> > 
> > 
> > I do get the correct alerts from the above script corresponding to the
number of checked boxes, however, the second line does not seem to be
unchecking the boxes. I am not sure if this has something to do with the
fact that all the boxes have the same name rgItems[] and the browser doesn't
know which one to uncheck.
> > Has anybody else come accross this?
> > Thanks,
> > And I apologize for asking this question on the PHP List, but I am
hoping someone here may have had the same problem when name mutliple form
elements using the array style:   blah[]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] How printing the name and value of a variable ?

2002-10-31 Thread rija
Theoriquement it is not possible, because you cannot use any variable since
you don't know its name-

But you can cope something with get_defined_vars() in which you set every
variable without distinction into an array- and after you select the
variable you need using some criterias.

like this
$array = get_defined_vars() ;
foreach ($array as $key=>$value)
if (ereg("EREG_CRITERIA",$key))  echo "La variable $KEY est egale a $value"
;

Elsewhere if you know the name of the variable you would like to use
do simply like this:

$tigidizougou = 12;
echo "THE VARIABLE tigidizougou EQUALS ".$tigidizougou;


- Original Message -
From: "franck raynal" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 9:09 AM
Subject: [PHP] How printing the name and value of a variable ?


Hello,
I'd like to print the name of a variable, in order to get something like
this  :

THE VARIABLE tigidizougou EQUALS 12 !

from the original code below :

$tigidizougou = 12;
echo "THE VARIABLE ".(please help me right here)." EQUALS ".$tigidizougou;

Any idea ? Thanks you.

Franck


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



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




Re: [PHP] str_replace

2002-10-31 Thread Jonathan Sharp
$del = array(' ', "'", '\\', '/'...etc);
foreach ( $del AS $d )
{
   $file = str_replace($d, '', $file);
}

-js


rick wrote:
> How could this be written better? Is there a way to do it all in 1 line?
> 
> $file = str_replace(" ", "", "$file");
> $file = str_replace("'", "", "$file");
> $file = str_replace("\\", "", "$file");
> $file = str_replace("/", "", "$file");
> $file = str_replace(":", "", "$file");
> $file = str_replace("+", "", "$file");
> $file = str_replace("&", "", "$file");
> $file = str_replace("=", "", "$file");
> $file = str_replace("@", "", "$file");
> $file = str_replace("%", "", "$file");
> $file = str_replace("^", "", "$file");
> $file = str_replace("*", "", "$file");
> $file = str_replace("~", "", "$file");
> $file = str_replace("`", "", "$file");
> $file = str_replace(";", "", "$file");
> $file = str_replace("|", "", "$file");
> $file = str_replace("{", "", "$file");
> $file = str_replace("}", "", "$file");
> $file = str_replace("[", "", "$file");
> $file = str_replace("]", "", "$file");
> $file = str_replace("%", "", "$file");
> $file = str_replace("?", "", "$file");
> $file = str_replace("(", "", "$file");
> $file = str_replace(")", "", "$file");
> $file = str_replace("#", "", "$file");
> 
> Thanks!  :)
> 
> ...rick
> 
> 




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




Re: [PHP] Form Question

2002-10-31 Thread John Nichel
Try this





PHP List wrote:

Hi,
I am hopeing someone can help me with this.
This is more of a javascript problem I suppose.
I have a bunch of check boxes on a from that I have given a name of rgItems[] so I can access them as an array in php.
But I can't find a way to clear all the checkboxes on the form at once. a reset button only resets the form to the original values, but I need to be able to clear all the check boxes.



I do get the correct alerts from the above script corresponding to the number of checked boxes, however, the second line does not seem to be unchecking the boxes. I am not sure if this has something to do with the fact that all the boxes have the same name rgItems[] and the browser doesn't know which one to uncheck. Has anybody else come accross this? Thanks, And I apologize for asking this question on the PHP List, but I am hoping someone here may have had the same problem when name mutliple form elements using the array style: blah[] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] str_replace

2002-10-31 Thread Thoenen, Peter Mr. EPS
try $file = preg_replace("/[[:punct:][:space:]]/",'',$file);

PEter

> -Original Message-
> From: rick [mailto:rick@;somers.net]
> Sent: Friday, November 01, 2002 00:22
> To: [EMAIL PROTECTED]
> Subject: [PHP] str_replace
> 
> 
> How could this be written better? Is there a way to do it all 
> in 1 line?
> 
> $file = str_replace(" ", "", "$file");
> $file = str_replace("'", "", "$file");
> $file = str_replace("\\", "", "$file");
> $file = str_replace("/", "", "$file");
> $file = str_replace(":", "", "$file");
> $file = str_replace("+", "", "$file");
> $file = str_replace("&", "", "$file");
> $file = str_replace("=", "", "$file");
> $file = str_replace("@", "", "$file");
> $file = str_replace("%", "", "$file");
> $file = str_replace("^", "", "$file");
> $file = str_replace("*", "", "$file");
> $file = str_replace("~", "", "$file");
> $file = str_replace("`", "", "$file");
> $file = str_replace(";", "", "$file");
> $file = str_replace("|", "", "$file");
> $file = str_replace("{", "", "$file");
> $file = str_replace("}", "", "$file");
> $file = str_replace("[", "", "$file");
> $file = str_replace("]", "", "$file");
> $file = str_replace("%", "", "$file");
> $file = str_replace("?", "", "$file");
> $file = str_replace("(", "", "$file");
> $file = str_replace(")", "", "$file");
> $file = str_replace("#", "", "$file");
> 
> Thanks!  :)
> 
> ..rick
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




[PHP] str_replace

2002-10-31 Thread rick
How could this be written better? Is there a way to do it all in 1 line?

$file = str_replace(" ", "", "$file");
$file = str_replace("'", "", "$file");
$file = str_replace("\\", "", "$file");
$file = str_replace("/", "", "$file");
$file = str_replace(":", "", "$file");
$file = str_replace("+", "", "$file");
$file = str_replace("&", "", "$file");
$file = str_replace("=", "", "$file");
$file = str_replace("@", "", "$file");
$file = str_replace("%", "", "$file");
$file = str_replace("^", "", "$file");
$file = str_replace("*", "", "$file");
$file = str_replace("~", "", "$file");
$file = str_replace("`", "", "$file");
$file = str_replace(";", "", "$file");
$file = str_replace("|", "", "$file");
$file = str_replace("{", "", "$file");
$file = str_replace("}", "", "$file");
$file = str_replace("[", "", "$file");
$file = str_replace("]", "", "$file");
$file = str_replace("%", "", "$file");
$file = str_replace("?", "", "$file");
$file = str_replace("(", "", "$file");
$file = str_replace(")", "", "$file");
$file = str_replace("#", "", "$file");

Thanks!  :)

..rick


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




Re: [PHP] explode didn't work well

2002-10-31 Thread Keith Vance
And that too.

Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399

Try U.M.A. at http://uma.sourceforge.net/


On Thu, 31 Oct 2002, Rasmus Lerdorf wrote:

> Because you can't spell pizza, I bet.
>
> On Thu, 31 Oct 2002, ppf wrote:
>
> >
> > Hi all:
> > I had tried to split the string into an array of
> > string using explode but the result isn't displaying
> > anything
> > I tried the example from document its its not showing
> > anything, pls point out where i went wrong
> > **
> > $pizaa="piece1 piece2 piece3 piece4 piece5 piece6";
> > $pieces = explode(' ', $pizza);
> > echo $pizaa;
> > echo ($pieces [2]);
> > 
> >  Thanks in advance
> >   Prad
> >
> > __
> > Do you Yahoo!?
> > HotJobs - Search new jobs daily now
> > http://hotjobs.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] explode didn't work well

2002-10-31 Thread Keith Vance
echo ($pieces[2]);
instead of
echo ($pieces [2]);



Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399

Try U.M.A. at http://uma.sourceforge.net/


On Thu, 31 Oct 2002, ppf wrote:

>
> Hi all:
> I had tried to split the string into an array of
> string using explode but the result isn't displaying
> anything
> I tried the example from document its its not showing
> anything, pls point out where i went wrong
> **
> $pizaa="piece1 piece2 piece3 piece4 piece5 piece6";
> $pieces = explode(' ', $pizza);
> echo $pizaa;
> echo ($pieces [2]);
> 
>  Thanks in advance
>   Prad
>
> __
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] help needed with phpmailer

2002-10-31 Thread Jonathan Sharp
SEE: http://phpmailer.sourceforge.net/extending.html

(click Home Page then examples)

-js


Pushpinder Singh Garcha wrote:
> Hi All
> 
> I am new in the php development world. I have made a simple mail
> application using the phph mail() function.
> I needed to use an attachment facility ith the mailing program...so I
> have tried to use this solution called phpmailer()
> from http://sourceforge.net/projects/phpmailer
> 
> I am not able to find any installation info on the site...Has anyoneused
> this before?
> 
> Please help ..
> 
> Thanks
> --Pushpinder
> 
> 
> Pushpinder Singh Garcha
> _
> Web Developer
> T. Falcon Napier and Associates, Inc.
> Off : 704 987 6500
> Cell  :  704 236 2939
> Fax   :  704 987 5002
> _
> 
> 




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




Re: [PHP] explode didn't work well

2002-10-31 Thread Rasmus Lerdorf
Because you can't spell pizza, I bet.

On Thu, 31 Oct 2002, ppf wrote:

>
> Hi all:
> I had tried to split the string into an array of
> string using explode but the result isn't displaying
> anything
> I tried the example from document its its not showing
> anything, pls point out where i went wrong
> **
> $pizaa="piece1 piece2 piece3 piece4 piece5 piece6";
> $pieces = explode(' ', $pizza);
> echo $pizaa;
> echo ($pieces [2]);
> 
>  Thanks in advance
>   Prad
>
> __
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] explode didn't work well

2002-10-31 Thread ppf

Hi all:
I had tried to split the string into an array of
string using explode but the result isn't displaying
anything
I tried the example from document its its not showing
anything, pls point out where i went wrong 
**
$pizaa="piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(' ', $pizza);
echo $pizaa;
echo ($pieces [2]);

 Thanks in advance
  Prad

__
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

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




Re: [PHP] PHP - Internal linking in a page

2002-10-31 Thread PHP List
Your get statement is wrong:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
use
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php&id=7

You only get 1 question mark, any after will be treated as part of the
variable page.



Hi!

I started to learn PHP yesterday, and I have just entered a little problem.
In my index.php file. I have this line:



wich controles the main page locaton, just like frames. It makes the files
appear in the middle of the site.

Now over to the problem:

I am making a newsscript with PHP and PostgreSQL. I have now gotten PHP to
extract the news from the database.
I am using numbers as ID for each post. 1, 2 ,3, 4, 5, 6 and so on.
I use them to make a READ MORE link on the news posts.
I am calling my "READ MORE"-page for main2.php, this contains PHP code that
finds the story thats connected to the given number. and I use this to make
it appear: http://maloyportalen.no/~critical/maloy/main2.php?id=7

But that makes it go on a seperate page.
And this link does not work at all:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
It returns this error:

Warning: Failed opening 'main2.php?id=7' for inclusion
(include_path='.:/usr/share/pear') in
/home/critical/public_html/maloy/index.php on line 21


Line 21 is the following:


How can I write it so I can use:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7

Regards
Paul Ottar Tornes.




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




[PHP] problem with postgres integration

2002-10-31 Thread suman
Hi all
i'm having a strange problem while compiling php 4.2.3
i compiled php with these options

Configure Command './configure' '--with-mysql=/usr/local/mysql/' 
'--with-apxs=/usr/local/apache/bin/apxs' '--with-openssl=/usr/local/ssl/' 
'--with-pear' '--with-gd' '--with-pqsql=/usr/local/pgsql/' '--with-png' 
'--with-jpeg-dir=/usr/' '--with-ttf'

but i see no pgsql configuration
Also i see no libpng congiguration in gd table i see only jpeg configuration.I 
was trying to use jpgraph so i did all this there were no errors while 
compiling the code.so plz help me

am i missing something

thanks in advance

suman


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




[PHP] PHP - Internal linking in a page

2002-10-31 Thread Paul Ottar Tornes
Hi!

I started to learn PHP yesterday, and I have just entered a little problem.
In my index.php file. I have this line:



wich controles the main page locaton, just like frames. It makes the files appear in 
the middle of the site.

Now over to the problem:

I am making a newsscript with PHP and PostgreSQL. I have now gotten PHP to extract the 
news from the database.
I am using numbers as ID for each post. 1, 2 ,3, 4, 5, 6 and so on.
I use them to make a READ MORE link on the news posts.
I am calling my "READ MORE"-page for main2.php, this contains PHP code that finds the 
story thats connected to the given number. and I use this to make it appear: http://maloyportalen.no/~critical/maloy/main2.php?id=7

But that makes it go on a seperate page.
And this link does not work at all:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
It returns this error:

Warning: Failed opening 'main2.php?id=7' for inclusion 
(include_path='.:/usr/share/pear') in /home/critical/public_html/maloy/index.php on 
line 21


Line 21 is the following:


How can I write it so I can use:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7

Regards
Paul Ottar Tornes.





[PHP] How printing the name and value of a variable ?

2002-10-31 Thread franck raynal
Hello, 
I'd like to print the name of a variable, in order to get something like this  : 
 
THE VARIABLE tigidizougou EQUALS 12 !
 
from the original code below :
 
$tigidizougou = 12;
echo "THE VARIABLE ".(please help me right here)." EQUALS ".$tigidizougou;
 
Any idea ? Thanks you. 
 
Franck


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




[PHP] rename()

2002-10-31 Thread Edward Peloke
I am trying to allow the user to upload pictures.  What is the best way to
rename them?  If I use the rename function, I have to upload the pictures to
the same place as the script and then move it.  ALso, if I am not sure of
the extension, how can I simply rename it?  Can I do multiple files at once?

Thanks,
Eddie


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




RE: [PHP] SQL>Insert and recover the ID

2002-10-31 Thread Christian Ista
> use mysql_insert_id().  Much more reliable when and if you use the
system
> with more than one person inserting at the same time.

Sure it's for that I ask

Thanks for your help.


Christian,



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




RE: [PHP] SQL>Insert and recover the ID

2002-10-31 Thread John Meyer
use mysql_insert_id().  Much more reliable when and if you use the system
with more than one person inserting at the same time.

-Original Message-
From: Christian Ista [mailto:mailing-list@;istasofts.com]
Sent: Thursday, October 31, 2002 2:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] SQL>Insert and recover the ID


Hello,

In a table, I have some fields and the primary key is an autoincrement
field. I insert an row and I'd like to recover the ID used for the last
record I inserted.

For the moment, I do a select max(Id) just after the insert but there
is, my be a best way to do it.

Thanks for your help

Christian,



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


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




Re: [PHP] SQL>Insert and recover the ID

2002-10-31 Thread 1LT John W. Holmes
> In a table, I have some fields and the primary key is an autoincrement
> field. I insert an row and I'd like to recover the ID used for the last
> record I inserted.
> 
> For the moment, I do a select max(Id) just after the insert but there
> is, my be a best way to do it.

Stop.

Read this:

www.php.net/mysql_insert_id

---John Holmes...

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




Re: [PHP] Good form class?

2002-10-31 Thread Chris Boget
> I'm looking for a good class to manage forms.  It doesn't need to do 
> anything with the form itself, I'm looking for something that does form 
> validation on the processing side.  I've looked on phpclasses, but 
> everything I found was either insecure (passing data about the form 
> through hidden form fields) or just not what I needed.  Any ideas?

http://px.sklar.com/code.html?id=34

I've been using the above for the last 4+ years.  I've modified it a wee
bit to fit our specific needs but, IMO, it's the best and easiest I've come
across in that time.  That's not to say there aren't others out there you
might prefer but I definitely recommend that you at least check it out.

Chris



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




Re: [PHP] Dear all

2002-10-31 Thread R . Z .
http://www.php.net/mailing-lists.php

there is an option to subscribe/unsubscribe


>
>Please how can I unsubscribe from this mailing list ...
>Thanks
>
>
>Regards
>Saif Yousif 
>
>
> No God 
>except AllahMohammed is profit of Allah
>
>


___
Radoslaw Zajkowski
http://www.finalbanana.com


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




[PHP] Good form class?

2002-10-31 Thread Leif K-Brooks
I'm looking for a good class to manage forms.  It doesn't need to do 
anything with the form itself, I'm looking for something that does form 
validation on the processing side.  I've looked on phpclasses, but 
everything I found was either insecure (passing data about the form 
through hidden form fields) or just not what I needed.  Any ideas?

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



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



[PHP] help needed with phpmailer

2002-10-31 Thread Pushpinder Singh Garcha
Hi All

I am new in the php development world. I have made a simple mail 
application using the phph mail() function.
I needed to use an attachment facility ith the mailing program...so I 
have tried to use this solution called phpmailer()
from http://sourceforge.net/projects/phpmailer

I am not able to find any installation info on the site...Has 
anyoneused this before?

Please help ..

Thanks
--Pushpinder


Pushpinder Singh Garcha
_
Web Developer
T. Falcon Napier and Associates, Inc.
Off : 704 987 6500
Cell  :  704 236 2939
Fax   :  704 987 5002
_


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



Re: [PHP] Is there an ISP that supports GD Library 2.0?

2002-10-31 Thread R . Z .
Signature Hosting from Verio did last time I phpinfo them(today that is)

here is the dump:

gd
GD Support  enabled
GD Version  2.0 or higher
FreeType Supportenabled
FreeType Linkagewith freetype
T1Lib Support   enabled
JPG Support enabled
PNG Support enabled
WBMP Supportenabled



















>Hurrican Electric does... here's a php -m from them:
>
>Running PHP 4.1.2
>Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
>
>[PHP Modules]
>xml
>standard
>session
>posix
>pcre
>mysql
>imap
>gd
>ftp
>db
>zlib
>
>[Zend Modules]
>Not Implemented
>
>
>I had to use pdflib once, and after talking to them for a bit they
>configured
>it so i could use dl()... They have no problems with security audits (as
>long
>as you give them a heads-up), servers are quick and dependable, they
>implemented privsep in OpenSSH in just a few hours back when there was that
>remote-root hole (chrooted jail w/ privsep)... Basically, I highly reccomend.
>
>
>
>
>On Thursday 31 October 2002 08:10 am, René Fournier wrote:
>> I'm going to need it for a site I'm working on
>> Any suggestions are much appreciated.
>>
>>
>> ---
>> René Fournier,
>> [EMAIL PROTECTED]
>>
>> Toll-free +1.888.886.2754
>> Tel +1.403.291.3601
>> Fax +1.403.250.5228
>> www.smartslitters.com
>>
>> SmartSlitters International
>> #33, 1339 - 40th Ave NE
>> Calgary AB  T2E 8N6
>> Canada
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


___
Radoslaw Zajkowski
http://www.finalbanana.com


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




Re: [PHP] SQL>Insert and recover the ID

2002-10-31 Thread Chase Urich
Check out mysql_insert_id()

> For the moment, I do a select max(Id) just after the insert but there
> is, my be a best way to do it.
-- 
Linux: Because rebooting is for adding hardware.
Fingerprint = CE24 057D 1E88 A253 3196 89DB 9FF0 9EF0 2F70 8BE8 BE8



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: strange echo() effect

2002-10-31 Thread Mat Harris
DOH! 



think i'll keep myself to myself from now on



On Thu, Oct 31, 2002 at 09:32:41PM +0100, BAROILLER Pierre-Emmanuel wrote:
> You've forgotten the "" in your echo...
> html_header() and html_footer() put html in the right place in your page
> but, like you haven't close your  tag,
> the footer dans be everywhere in your page (depends on the web browser
> you're using)..
> 
> Regards,
> P.E. Baroiller
> 
> I have a small piece of code which does the following:
> 
> 1) call a function to print an html header,
> 2) query a database to list the users in the db,
> 3) print an html footer.
> 
> problem is it print out the footer before the table, even though it is
> called after. looking at the html source of the page in a browser, show that
> the table is first, why is this happening? here is the code:
> 
> html_header();
> echo " cellspacing=\"0\">\n";
> echo "\n";
> echo "uid\n";
> echo "username\n";
> echo "password\n";
> echo "session id\n";
> echo "email address\n";
> echo "\n";
> $query = "SELECT * FROM users LIMIT 0,30";
> $result = mysql_query($query);
> while ($query_data = mysql_fetch_row($result))
>  {
>  echo "\n";
>  foreach ($query_data As $column)
>   {
>   echo "\t$column\n";
>   }
>  echo "\n";
>  }
> echo "\n";
> html_footer();
> 
> -- 
> Mat Harris   OpenGPG Public Key ID: C37D57D9
> [EMAIL PROTECTED] matthewh.genestate.com
> 
> "Mat Harris" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Mat Harris  OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED]matthewh.genestate.com  



msg83657/pgp0.pgp
Description: PGP signature


Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread DonPro
These two ideas, I really like.  Saves me lots of coding

Thanks,
Don
  - Original Message - 
  From: PHP List 
  To: php ; DonPro 
  Sent: Thursday, October 31, 2002 4:09 PM
  Subject: Re: [PHP] Saving form input fields to MySQL br clicking on a button


  Why not use the Memorize button to set a hidden field? Or just use a check
  box.
  Since you are going to be submitting the data anyway, save the fields at
  that time depending on whether or not the check box/hidden filed is set?


  > Hi,
  >
  > I have a form where the user enters some information.  For a particular
  > section of the form, I'd like the user to be able to save what he/she
  > entered so that the next time they feel out the form, they can recall
  > without the need to retype.  This is not for the entire form but only for
  a
  > few input text fields.
  >
  > I created a button called "Memorize" but how do I have the page save the
  > values to my MySQL database when the user clicks on the button.  I
  > understand that I can only use JavaScript to trap the "OnClick()" function
  > and not PHP but I cannot use JavaScript to write to a MySQL table.  I do
  not
  > want to submit as that would reload the form and the user would lose other
  > changes to other fields.
  >
  > Any idea?
  >
  > Don
  >
  >
  >
  > --
  > PHP General Mailing List (http://www.php.net/)
  > To unsubscribe, visit: http://www.php.net/unsub.php
  >




[PHP] SQL>Insert and recover the ID

2002-10-31 Thread Christian Ista
Hello,

In a table, I have some fields and the primary key is an autoincrement
field. I insert an row and I'd like to recover the ID used for the last
record I inserted.

For the moment, I do a select max(Id) just after the insert but there
is, my be a best way to do it.

Thanks for your help

Christian,



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




Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread PHP List
Why not use the Memorize button to set a hidden field? Or just use a check
box.
Since you are going to be submitting the data anyway, save the fields at
that time depending on whether or not the check box/hidden filed is set?


> Hi,
>
> I have a form where the user enters some information.  For a particular
> section of the form, I'd like the user to be able to save what he/she
> entered so that the next time they feel out the form, they can recall
> without the need to retype.  This is not for the entire form but only for
a
> few input text fields.
>
> I created a button called "Memorize" but how do I have the page save the
> values to my MySQL database when the user clicks on the button.  I
> understand that I can only use JavaScript to trap the "OnClick()" function
> and not PHP but I cannot use JavaScript to write to a MySQL table.  I do
not
> want to submit as that would reload the form and the user would lose other
> changes to other fields.
>
> Any idea?
>
> Don
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] using mysql_field_type to disginguish between a blob and a text field.

2002-10-31 Thread John Meyer
I've recently found out that mysql returns blob for both blobs and text
fields.  Now, how do I distinguish between the two?


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




Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread Don
- Original Message -
From: Jay Blanchard
To: 'DonPro' ; 'php list'
Sent: Thursday, October 31, 2002 3:43 PM
Subject: RE: [PHP] Saving form input fields to MySQL br clicking on a button


[snip]
I created a button called "Memorize" but how do I have the page save the
values to my MySQL database when the user clicks on the button.  I
understand that I can only use JavaScript to trap the "OnClick()" function
and not PHP but I cannot use JavaScript to write to a MySQL table.  I do not
want to submit as that would reload the form and the user would lose other
changes to other fields.

Any idea?
[/snip]

Yep. Submit the form variables to a PHP script that either does a SQL UPDATE
or INSERT depending upon the condition of the form information. JavaScript
is not necessary for this.

HTH!

Jay



Thanks,

But how do I submit to a PHP script without moving off of the form?  The
user will be entering lots of information while only a particular section
pertains to the Memorize button.  If the user clicks on the button, wont it
move off of the page thereby causing the user to lose all their form input?



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




RE: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread Jay Blanchard
[snip]
But how do I submit to a PHP script without moving off of the form?  The
user will be entering lots of information while only a particular section
pertains to the Memorize button.  If the user clicks on the button, wont it
move off of the page thereby causing the user to lose all their form input?
[/snip]

Old Indian Rope Trick... have the variables posted (UPDATED or INSERTED) by
the processing page which returns (via header()) to the form page which
retrieves the variables from the DB. You would have to use a session or a
cookie to maintain the user so that the query would know which data to look
for, but when clicking 'Memorize' the user may see a brief flash of some
sort, but not likely.

Jay





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




[PHP] Help with using phpmailer

2002-10-31 Thread Pushpinder Singh Garcha
Hi All

I am new in the php development world. I have made a simple mail 
application using the phph mail() function.
I needed to use an attachment facility ith the mailing program...so I 
have tried to use this solution called phpmailer()
from http://sourceforge.net/projects/phpmailer

I am not able to find any installation info on the site...Has 
anyoneused this before?

Please help ..

Thanks
--Pushpinder




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



Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread Sascha Cunz
Hi,

> Hi,
>
> I have a form where the user enters some information.  For a particular
> section of the form, I'd like the user to be able to save what he/she
> entered so that the next time they feel out the form, they can recall
> without the need to retype.  This is not for the entire form but only for a
> few input text fields.
>
> I created a button called "Memorize" but how do I have the page save the
> values to my MySQL database when the user clicks on the button.  I
> understand that I can only use JavaScript to trap the "OnClick()" function
> and not PHP but I cannot use JavaScript to write to a MySQL table.  I do
> not want to submit as that would reload the form and the user would lose
> other changes to other fields.
>
> Any idea?
>
> Don

As you say it yourself, you can't use mySQL with JavaScript. Do a submit to a 
php-script, and "restore" the original page in that php-script.

-Sascha

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




[PHP] Re: Validating E-mail Accounts

2002-10-31 Thread DonPro
Most mail servers have the verify command disabled these days, so it makes
almost impossible to validate. Blame spammers for ruining everything.

But here's a class that will attempt to do what you wish:
http://www.phpclasses.org/browse.html/package/13.html

- Original Message -
From: "Robert Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 2:59 PM
Subject: [PHP] Validating E-mail Accounts


Is it possible, or (even better) do you have a sample script that can take a
user-submitted e-mail address, contact the host, and verify that the account
exists?

Thanks,

Rob



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




RE: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread Jay Blanchard
[snip]
I created a button called "Memorize" but how do I have the page save the
values to my MySQL database when the user clicks on the button.  I
understand that I can only use JavaScript to trap the "OnClick()" function
and not PHP but I cannot use JavaScript to write to a MySQL table.  I do not
want to submit as that would reload the form and the user would lose other
changes to other fields.

Any idea?
[/snip]

Yep. Submit the form variables to a PHP script that either does a SQL UPDATE
or INSERT depending upon the condition of the form information. JavaScript
is not necessary for this.

HTH!

Jay



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




Re: [PHP] Validating E-mail Accounts

2002-10-31 Thread 1LT John W. Holmes
Scripts that do this, if they work, usually take quite a while to process.
It's better to just send the user an email and have them respond back by
clicking on a link.

---John Holmes...

- Original Message -
From: "Robert Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 2:59 PM
Subject: [PHP] Validating E-mail Accounts


Is it possible, or (even better) do you have a sample script that can take a
user-submitted e-mail address, contact the host, and verify that the account
exists?

Thanks,

Rob


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




[PHP] Re: strange echo() effect

2002-10-31 Thread BAROILLER Pierre-Emmanuel
You've forgotten the "" in your echo...
html_header() and html_footer() put html in the right place in your page
but, like you haven't close your  tag,
the footer dans be everywhere in your page (depends on the web browser
you're using)..

Regards,
P.E. Baroiller

I have a small piece of code which does the following:

1) call a function to print an html header,
2) query a database to list the users in the db,
3) print an html footer.

problem is it print out the footer before the table, even though it is
called after. looking at the html source of the page in a browser, show that
the table is first, why is this happening? here is the code:

html_header();
echo "\n";
echo "\n";
echo "uid\n";
echo "username\n";
echo "password\n";
echo "session id\n";
echo "email address\n";
echo "\n";
$query = "SELECT * FROM users LIMIT 0,30";
$result = mysql_query($query);
while ($query_data = mysql_fetch_row($result))
 {
 echo "\n";
 foreach ($query_data As $column)
  {
  echo "\t$column\n";
  }
 echo "\n";
 }
echo "\n";
html_footer();

--
Mat Harris   OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED] matthewh.genestate.com

"Mat Harris" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]



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




[PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread DonPro
Hi,

I have a form where the user enters some information.  For a particular
section of the form, I'd like the user to be able to save what he/she
entered so that the next time they feel out the form, they can recall
without the need to retype.  This is not for the entire form but only for a
few input text fields.

I created a button called "Memorize" but how do I have the page save the
values to my MySQL database when the user clicks on the button.  I
understand that I can only use JavaScript to trap the "OnClick()" function
and not PHP but I cannot use JavaScript to write to a MySQL table.  I do not
want to submit as that would reload the form and the user would lose other
changes to other fields.

Any idea?

Don



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




[PHP] strange echo() effect

2002-10-31 Thread Mat Harris
I have a small piece of code which does the following:

1) call a function to print an html header,
2) query a database to list the users in the db,
3) print an html footer.

problem is it print out the footer before the table, even though it is
called after. looking at the html source of the page in a browser, show that
the table is first, why is this happening? here is the code:

html_header();
echo "\n";
echo "\n";
echo "uid\n";
echo "username\n";
echo "password\n";
echo "session id\n";
echo "email address\n";
echo "\n";
$query = "SELECT * FROM users LIMIT 0,30";
$result = mysql_query($query);
while ($query_data = mysql_fetch_row($result))
{
echo "\n";
foreach ($query_data As $column)
{
echo "\t$column\n";
}
echo "\n";
}
echo "\n";
html_footer();

-- 
Mat Harris  OpenGPG Public Key ID: C37D57D9
[EMAIL PROTECTED]matthewh.genestate.com  



msg83643/pgp0.pgp
Description: PGP signature


[PHP] Validating E-mail Accounts

2002-10-31 Thread Robert Miller
Is it possible, or (even better) do you have a sample script that can take a 
user-submitted e-mail address, contact the host, and verify that the account exists?

Thanks,

Rob



RE: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Brandon Orther
Hello,

For anyone else that had a problem with ^M use this function:

str_replace("\r", "", $result);

 
Brandon Orther 
WebIntellects Design/Development Manager
[EMAIL PROTECTED] 800-994-6364
www.webintellects.com




-Original Message-
From: 1LT John W. Holmes [mailto:holmes072000@;charter.net] 
Sent: Thursday, October 31, 2002 10:42 AM
To: Brandon Orther; PHP User Group
Subject: Re: [PHP] ^M at the end of each line when I use php to write
file


You're probably writing \r\n instead of just \n. 

---John Holmes...

- Original Message - 
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 12:44 PM
Subject: [PHP] ^M at the end of each line when I use php to write file


> Hello,
>  
> Does anyone know a way around all the ^M at the end of each line that 
> my php file writes to on a linux box?
>  
> 
> 
> 
> Brandon Orther
> 
> WebIntellects Design/Development Manager
> 
>   [EMAIL PROTECTED] 
> 800-994-6364
> 
>   www.webintellects.com
> 
> 
> 
>  
> 


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




RE: [PHP] number_format question

2002-10-31 Thread Jay Blanchard
[snip]
 If I try that I get a wrong parameter count error.

[/snip]

number_format ( float number [, int decimals [, string dec_point [, string
thousands_sep]]])

number_format($number, 0, '', ',');

Try that ...

Jay



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




RE: [PHP] number_format question

2002-10-31 Thread ed

 If I try that I get a wrong parameter count error.


Ed


On Thu, 31 Oct 2002, Jay Blanchard wrote:

> [snip]
> I using number_format where I need to turn a number say "123456789" into
> "123,456,789" and it works just fine. I also need it to strip the decimal
> out if someone enters it. I.E "123456.00" would become "123,456"
> 
> the command I'm using right now is:
> 
> number_format($number, ",");
> 
> If I enter "123456.00" it comes out as "123". Did I miss something?
> [/snip]
> 
> You're missing an attribute, try
> 
> number_format($number, '', ',');
> 
> HTH!
> 
> Jay
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




RE: [PHP] number_format question

2002-10-31 Thread Jay Blanchard
[snip]
I using number_format where I need to turn a number say "123456789" into
"123,456,789" and it works just fine. I also need it to strip the decimal
out if someone enters it. I.E "123456.00" would become "123,456"

the command I'm using right now is:

number_format($number, ",");

If I enter "123456.00" it comes out as "123". Did I miss something?
[/snip]

You're missing an attribute, try

number_format($number, '', ',');

HTH!

Jay



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




[PHP] number_format question

2002-10-31 Thread ed

I using number_format where I need to turn a number say "123456789" into
"123,456,789" and it works just fine. I also need it to strip the decimal
out if someone enters it. I.E "123456.00" would become "123,456"

the command I'm using right now is:

number_format($number, ",");

If I enter "123456.00" it comes out as "123". Did I miss something?

Thanks,

Ed



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




[PHP] Form Question

2002-10-31 Thread PHP List
Hi,
I am hopeing someone can help me with this.
This is more of a javascript problem I suppose.
I have a bunch of check boxes on a from that I have given a name of rgItems[] so I can 
access them as an array in php.
But I can't find a way to clear all the checkboxes on the form at once. a reset button 
only resets the form to the original values, but I need to be able to clear all the 
check boxes.




I do get the correct alerts from the above script corresponding to the number of 
checked boxes, however, the second line does not seem to be unchecking the boxes. I am 
not sure if this has something to do with the fact that all the boxes have the same 
name rgItems[] and the browser doesn't know which one to uncheck.
Has anybody else come accross this?
Thanks,
And I apologize for asking this question on the PHP List, but I am hoping someone here 
may have had the same problem when name mutliple form elements using the array style:  
 blah[]


Re: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Marek Kilimajer
Don't put it into the databese ;)


Brandon Orther wrote:


The lines that are having a ^M are pulling from a TEXT field of a mysql
database.  The \n I am saving come out great.  So I guess I found that
my issue is that text fields I am pulling.  Is there a way to make the
new line in a text field the same as a \n when pulling from a database?

 
Brandon Orther 
WebIntellects Design/Development Manager
[EMAIL PROTECTED] 800-994-6364
www.webintellects.com




-Original Message-
From: Evan Nemerson [mailto:evan@;coeus-group.com] 
Sent: Thursday, October 31, 2002 10:08 AM
To: Brandon Orther; [EMAIL PROTECTED]
Subject: Re: [PHP] ^M at the end of each line when I use php to write
file


a what does your code look like??? What happens when you

$fp = fopen("temp", a+);
for ( $x=0 ; $x<10 ; $x++ )
	fputs($fp, "$x\n");
fclose($fp);

???



On Thursday 31 October 2002 09:44 am, Brandon Orther wrote:
 

Hello,

Does anyone know a way around all the ^M at the end of each line that 
my php file writes to on a linux box?




Brandon Orther

WebIntellects Design/Development Manager

 [EMAIL PROTECTED] 
800-994-6364

 www.webintellects.com


   


 



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




Re: [PHP] stipslashes

2002-10-31 Thread Marco Tabini
But you could do this:

function f(&$value, $key)
{
$value = stripslashes ($value);
}

array_walk($_POST, 'f');

On Thu, 2002-10-31 at 13:41, 1LT John W. Holmes wrote:
> > Is 
> > 
> > stripslashes($_POST);
> > 
> > the same as 
> > 
> > stripslashes($_POST['var1']);
> > stripslashes($_POST['var2']);
> > stripslashes($_POST['var3']);
> 
> Nope. 
> 
> ---John Holmes...
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




Re: [PHP] stipslashes

2002-10-31 Thread 1LT John W. Holmes
> Is 
> 
> stripslashes($_POST);
> 
> the same as 
> 
> stripslashes($_POST['var1']);
> stripslashes($_POST['var2']);
> stripslashes($_POST['var3']);

Nope. 

---John Holmes...

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




Re: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread 1LT John W. Holmes
You're probably writing \r\n instead of just \n. 

---John Holmes...

- Original Message - 
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 12:44 PM
Subject: [PHP] ^M at the end of each line when I use php to write file


> Hello,
>  
> Does anyone know a way around all the ^M at the end of each line that my
> php file writes to on a linux box?
>  
> 
>  
> 
> Brandon Orther 
> 
> WebIntellects Design/Development Manager
> 
>   [EMAIL PROTECTED]
> 800-994-6364
> 
>   www.webintellects.com
> 
> 
> 
>  
> 

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




Re: [PHP] required field

2002-10-31 Thread 1LT John W. Holmes
> I know you can do it with javascript but is there a way in php or straight
> html to make a field in a form required?  I would like to validate it on
> submit.

No, you just have to write some PHP code to verify that something was
entered for the input and validate it based on whatever you think the data
should be.

---John Holmes...


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




RE: [PHP] command to determine the end of a page?

2002-10-31 Thread R B
When you use, FPDF class (i think others pdf class too), you can setup the 
paper size in the document (pdf), but the printer don't care this paper size 
configuration and prints with the default paper size, and my printer don't 
have a custom size setup.

Do you know who to print with custom size?

Thanks,

RB


From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "'Evan Nemerson'" <[EMAIL PROTECTED]>,   "'Jeff Bluemel'" 
<[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: RE: [PHP] command to determine the end of a page?
Date: Thu, 31 Oct 2002 12:16:24 -0600

[snip]
Might not be the best solution, but you _could_ create PDFs of your data,
then
print those...? Really clunky, but you could do nice formatting type
stuff...
[/snip]

You may want to try the FPDF class ... http://www.fpdf.org

@HTH!

Jay



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


_
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.microsoft.com/es


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



RE: [PHP] command to determine the end of a page?

2002-10-31 Thread Jay Blanchard
[snip]
only problem with that is I believe it is going to change depending on what
printer the user has.  what looks good on mine may not be quite right for
the next person.
[/snip]

The FPDF class (http://www.fpdf.org) has a SetAutoPageBreak() function which
sets the page break at a certain distance from the bottom of the page which
may work for you.

HTH

Jay



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




[PHP] mail()

2002-10-31 Thread Edward Peloke

I am attempting to use the mail function.  I have set the smtp in the
php.ini file to my smtp server but when I run the script, I get the error
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\lg\nuser2.php on line 50 where line 50 is where the mail
function is called.  Why is it still pointing to my localhost?  I am running
it through apache and Win98.

Thanks,
Eddie


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




Re: [PHP] command to determine the end of a page?

2002-10-31 Thread Jeff Bluemel
actually Jay - I think inadvertently you answered my question better then I
was really looking for.  I originally wanted to do this with PDF, but the
costs for pdflib were just too high, and I wouldn't find an open source/free
solution.  I will have to take a look at fpdf, and see if I can use it.

if not then I guess I'll turn to java script which would be acceptable too.

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:003d01c28109$9ff641c0$8102a8c0@;000347D72515...
> [snip]
> Might not be the best solution, but you _could_ create PDFs of your data,
> then
> print those...? Really clunky, but you could do nice formatting type
> stuff...
> [/snip]
>
> You may want to try the FPDF class ... http://www.fpdf.org
>
> @HTH!
>
> Jay
>
>



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




Re: [PHP] command to determine the end of a page?

2002-10-31 Thread Jeff Bluemel
only problem with that is I believe it is going to change depending on what
printer the user has.  what looks good on mine may not be quite right for
the next person.


"Carl Brandenburg" <[EMAIL PROTECTED]> wrote in message
news:ADEKJJAMOOACODPFNFAPAECLCDAA.tongo@;bossig.com...
> I am very unfamiliar with printing from PHP, but could you just guess how
> many lines per page you want to print and after that many lines issue a
page
> break then print your header for the next page? Once you have it working
you
> can tweak the line per page to where they fill a whole sheet of paper.
It's
> a quick and dirty way of printing reports that I use in our DOS based
> accounting system.
>
> Carl
>
> On Thursday 31 October 2002 10:08 am, Jeff Bluemel wrote:
> > is there a php command that could determine if the end of a page has
been
> > reached according to their print driver?  I'm need to print out a report
> > that could be multiple pages.  I need to be able to put column headings
&
> > page numbers.
> >
> > thanks,
> >
> > Jeff
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




RE: [PHP] command to determine the end of a page?

2002-10-31 Thread Carl Brandenburg
I am very unfamiliar with printing from PHP, but could you just guess how
many lines per page you want to print and after that many lines issue a page
break then print your header for the next page? Once you have it working you
can tweak the line per page to where they fill a whole sheet of paper. It's
a quick and dirty way of printing reports that I use in our DOS based
accounting system.

Carl

On Thursday 31 October 2002 10:08 am, Jeff Bluemel wrote:
> is there a php command that could determine if the end of a page has been
> reached according to their print driver?  I'm need to print out a report
> that could be multiple pages.  I need to be able to put column headings &
> page numbers.
>
> thanks,
>
> Jeff

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


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




RE: [PHP] required field

2002-10-31 Thread Jay Blanchard
[snip]
I know you can do it with javascript but is there a way in php or straight
html to make a field in a form required?  I would like to validate it on
submit.
[/snip]

If server side validation works for you then you can check to see if the
proper variable isset() and if not it can return to the page to require the
information. If you need client side validation you will have to use
JavaScript

HTH!

Jay



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




RE: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Brandon Orther
The lines that are having a ^M are pulling from a TEXT field of a mysql
database.  The \n I am saving come out great.  So I guess I found that
my issue is that text fields I am pulling.  Is there a way to make the
new line in a text field the same as a \n when pulling from a database?

 
Brandon Orther 
WebIntellects Design/Development Manager
[EMAIL PROTECTED] 800-994-6364
www.webintellects.com




-Original Message-
From: Evan Nemerson [mailto:evan@;coeus-group.com] 
Sent: Thursday, October 31, 2002 10:08 AM
To: Brandon Orther; [EMAIL PROTECTED]
Subject: Re: [PHP] ^M at the end of each line when I use php to write
file


a what does your code look like??? What happens when you

$fp = fopen("temp", a+);
for ( $x=0 ; $x<10 ; $x++ )
fputs($fp, "$x\n");
fclose($fp);

???



On Thursday 31 October 2002 09:44 am, Brandon Orther wrote:
> Hello,
>
> Does anyone know a way around all the ^M at the end of each line that 
> my php file writes to on a linux box?
>
>
> 
>
> Brandon Orther
>
> WebIntellects Design/Development Manager
>
>   [EMAIL PROTECTED] 
> 800-994-6364
>
>   www.webintellects.com
>
> 

-- 
I contend that we are both atheists. I just believe in one fewer god
than you 
do. When you understand why you dismiss all the other possible gods, you
will 
understand why I dismiss yours.

-Stephen Roberts


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




[PHP] required field

2002-10-31 Thread Edward Peloke
I know you can do it with javascript but is there a way in php or straight
html to make a field in a form required?  I would like to validate it on
submit.

Thanks,
Eddie


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




RE: [PHP] command to determine the end of a page?

2002-10-31 Thread Jay Blanchard
[snip]
Might not be the best solution, but you _could_ create PDFs of your data,
then
print those...? Really clunky, but you could do nice formatting type
stuff...
[/snip]

You may want to try the FPDF class ... http://www.fpdf.org

@HTH!

Jay



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




Re: [PHP] command to determine the end of a page?

2002-10-31 Thread Evan Nemerson
Might not be the best solution, but you _could_ create PDFs of your data, then 
print those...? Really clunky, but you could do nice formatting type stuff...


On Thursday 31 October 2002 10:08 am, Jeff Bluemel wrote:
> is there a php command that could determine if the end of a page has been
> reached according to their print driver?  I'm need to print out a report
> that could be multiple pages.  I need to be able to put column headings &
> page numbers.
>
> thanks,
>
> Jeff

-- 
Prisons are built with stones of Law, Brothels with bricks of Religion.

-William Blake


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




Re: [PHP] strtotime bug? end of the month.

2002-10-31 Thread Jeff Bearer
Actually I only needed date("Y-m") so my solution works fine, and I
didn't consider the problems with hard coding 1 into it.  But thanks for
the replies.





On Thu, 2002-10-31 at 11:33, Jeff Bearer wrote:
> date("Y-m-d",strtotime("+1 month"))
> 
> returns December 1st!  This happens when you add 1 month to any day that
> doesn't exist in the next month.  Quite annoying that you have to handle
> it like this:
> 
> date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1"
> 
> 
> -- 
> Jeff Bearer, RCHE
> Webmaster, PittsburghLIVE.com
> Winner 2002 Eppy Award, Best U.S. Newspaper Website
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
Jeff Bearer, RCHE
Webmaster, PittsburghLIVE.com
Winner 2002 Eppy Award, Best U.S. Newspaper Website


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




Re: [PHP] command to determine the end of a page?

2002-10-31 Thread Adam Voigt
I tried to do what your talking about, never found a way, other then
guessing where it would end with a lot of test runs. We ended up
switching to writing out PDF's which is much more scientific where you
can just check X,Y coordinates to see where you are on the page.

Adam Voigt
[EMAIL PROTECTED]

On Thu, 2002-10-31 at 13:08, Jeff Bluemel wrote:
> is there a php command that could determine if the end of a page has been
> reached according to their print driver?  I'm need to print out a report
> that could be multiple pages.  I need to be able to put column headings &
> page numbers.
> 
> thanks,
> 
> Jeff
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




Re: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Evan Nemerson
a what does your code look like??? What happens when you

$fp = fopen("temp", a+);
for ( $x=0 ; $x<10 ; $x++ )
fputs($fp, "$x\n");
fclose($fp);

???



On Thursday 31 October 2002 09:44 am, Brandon Orther wrote:
> Hello,
>
> Does anyone know a way around all the ^M at the end of each line that my
> php file writes to on a linux box?
>
>
> 
>
> Brandon Orther
>
> WebIntellects Design/Development Manager
>
>   [EMAIL PROTECTED]
> 800-994-6364
>
>   www.webintellects.com
>
> 

-- 
I contend that we are both atheists. I just believe in one fewer god than you 
do. When you understand why you dismiss all the other possible gods, you will 
understand why I dismiss yours.

-Stephen Roberts


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




[PHP] command to determine the end of a page?

2002-10-31 Thread Jeff Bluemel
is there a php command that could determine if the end of a page has been
reached according to their print driver?  I'm need to print out a report
that could be multiple pages.  I need to be able to put column headings &
page numbers.

thanks,

Jeff



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




Re: [PHP] unlink function

2002-10-31 Thread Evan Nemerson
It probably isn't supported in windows. Unlink is (in C) in the unistd.h file. 
It provides a way to remove a file based on the unlink syscall (which i 
sincerly doubt is available from Win32). Looking at php.net/unlink... yep 
fourth comment: "unlink() function dosen't work with windows98, but it dose 
work on NT with apache server".

If memory serves, there is an $OS variable... if not, check phpinfo(). You can 
do something like...

if ( stristr($OS, "Win") )
exec("echo 'y' | del $file");
else
unlink("$file");



On Thursday 31 October 2002 09:46 am, Andres, Cyrille wrote:
> Hello everyone,
>
> I upload some files on my server. If the number of lines of a file exceeds
> 159, I want to erase the file.
>
> Actually the unlink() function doesn't work, I have this error : Warning:
> Unlink failed (Permission denied) in D:\Data\WebSSL\tm\RFP\upload2.php on
> line 78.
>
> My code is :
>
>   $num = 0;
>   $fp = fopen ("temp/$i","r");
>   while ($data = fgetcsv ($fp, 1000, ","))
>   $num++;
>
>   echo "number of lines : $num";
>
>   if ($num>150){
>   echo "you have too many hotels";
>   unlink("temp/$i");
>
>   }
>   fclose ($fp);
>
>
> Do you have a clue ??
>
> Cyrille.

-- 
I pledge allegiance to the flag, of the United States of America, and to the 
republic for which it stands, one nation indivisible, with liberty, and 
justice for all.

-Pledge of Allegiance


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




  1   2   >