[PHP] PHP+MYSQL: unable to select database

2001-12-10 Thread josep

 I get:
 
 unable to select database
 
 when I visit my guestbook.php
 
 The user trying it is set in the mysql.user (without any perms) and in the
 mysql.db (with all perms).

Do I have to set all perms to this user in the mysql.user table?
 
Josep


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP 4.1.0 released

2001-12-10 Thread Zeev Suraski

After a lengthy QA process, PHP 4.1.0 is finally out.  Download at 
http://www.php.net/downloads.php !

PHP 4.1.0 includes several other key improvements:
- A new input interface for improved security (read below)
- Highly improved performance in general
- Revolutionary performance and stability improvements under Windows.  The 
multithreaded server modules under Windows (ISAPI, Apache, etc.) perform as 
much as 30 times faster under load!  We want to thank Brett Brewer and his 
team in Microsoft for working with us to improve PHP for Windows.
- Versioning support for extensions.  Right now it's barely being used, but 
the infrastructure was put in place to support separate version numbers for 
different extensions.  The negative side effect is that loading extensions 
that were built against old versions of PHP will now result in a crash, 
instead of in a nice clear message.  Make sure you only use extensions 
built with PHP 4.1.0.
- Turn-key output compression support
- *LOTS* of fixes and new functions

As some of you may notice, this version is quite historical, as it's the 
first time in history we actually incremented the middle digit!  :) The two 
key reasons for this unprecedented change were the new input interface, and 
the broken binary compatibility of modules due to the versioning support.

Following is a description of the new input mechanism.  For a full list of 
changes in PHP 4.1.0, scroll down to the end of this section.

---

SECURITY:  NEW INPUT MECHANISM

First and foremost, it's important to stress that regardless of anything 
you may read in the following lines, PHP 4.1.0 *supports* the old input 
mechanisms from older versions.  Old applications should go on working fine 
without modification!

Now that we have that behind us, let's move on :)

For various reasons, PHP setups which rely on register_globals being on 
(i.e., on form, server and environment variables becoming a part of the 
global namespace, automatically) are very often exploitable to various 
degrees.  For example, the piece of code:

?php
if (authenticate_user()) {
   $authenticated = true;
}
...
?

May be exploitable, as remote users can simply pass on 'authenticated' as a 
form variable, and then even if authenticate_user() returns false, 
$authenticated will actually be set to true.  While this looks like a 
simple example, in reality, quite a few PHP applications ended up being 
exploitable by things related to this misfeature.

While it is quite possible to write secure code in PHP, we felt that the 
fact that PHP makes it too easy to write insecure code was bad, and we've 
decided to attempt a far-reaching change, and deprecate 
register_globals.  Obviously, because the vast majority of the PHP code in 
the world relies on the existence of this feature, we have no plans to 
actually remove it from PHP anytime in the foreseeable future, but we've 
decided to encourage people to shut it off whenever possible.

To help users build PHP applications with register_globals being off, we've 
added several new special variables that can be used instead of the old 
global variables.  There are 7 new special arrays:

$_GET - contains form variables sent through GET
$_POST - contains form variables sent through POST
$_COOKIE - contains HTTP cookie variables
$_SERVER - contains server variables (e.g., REMOTE_ADDR)
$_ENV - contains the environment variables
$_REQUEST - a merge of the GET variables, POST variables and Cookie 
variables.  In other words - all the information that is coming from the 
user, and that from a security point of view, cannot be trusted.
$_SESSION - contains HTTP variables registered by the session module

Now, other than the fact that these variables contain this special 
information, they're also special in another way - they're automatically 
global in any scope.  This means that you can access them anywhere, without 
having to 'global' them first.  For example:

function example1()
{
print $_GET[name];   // works, 'global $_GET;' is not necessary!
}

would work fine!  We hope that this fact would ease the pain in migrating 
old code to new code a bit, and we're confident it's going to make writing 
new code easier.  Another neat trick is that creating new entries in the 
$_SESSION array will automatically register them as session variables, as 
if you called session_register().  This trick is limited to the session 
module only - for example, setting new entries in $_ENV will *not* perform 
an implicit putenv().

PHP 4.1.0 still defaults to have register_globals set to on.  It's a 
transitional version, and we encourage application authors, especially 
public ones which are used by a wide audience, to change their applications 
to work in an environment where register_globals is set to off.  Of course, 
they should take advantage of the new features supplied in PHP 4.1.0 that 
make this transition much easier.

As of the next semi-major version of PHP, 

[PHP] PHP 4.1.0 released

2001-12-10 Thread Zeev Suraski

After a lengthy QA process, PHP 4.1.0 is finally out.  Download at 
http://www.php.net/downloads.php !

PHP 4.1.0 includes several other key improvements:
- A new input interface for improved security (read below)
- Highly improved performance in general
- Revolutionary performance and stability improvements under Windows.  The 
multithreaded server modules under Windows (ISAPI, Apache, etc.) perform as 
much as 30 times faster under load!  We want to thank Brett Brewer and his 
team in Microsoft for working with us to improve PHP for Windows.
- Versioning support for extensions.  Right now it's barely being used, but 
the infrastructure was put in place to support separate version numbers for 
different extensions.  The negative side effect is that loading extensions 
that were built against old versions of PHP will now result in a crash, 
instead of in a nice clear message.  Make sure you only use extensions 
built with PHP 4.1.0.
- Turn-key output compression support
- *LOTS* of fixes and new functions

As some of you may notice, this version is quite historical, as it's the 
first time in history we actually incremented the middle digit!  :) The two 
key reasons for this unprecedented change were the new input interface, and 
the broken binary compatibility of modules due to the versioning support.

Following is a description of the new input mechanism.  For a full list of 
changes in PHP 4.1.0, scroll down to the end of this section.

---

SECURITY:  NEW INPUT MECHANISM

First and foremost, it's important to stress that regardless of anything 
you may read in the following lines, PHP 4.1.0 *supports* the old input 
mechanisms from older versions.  Old applications should go on working fine 
without modification!

Now that we have that behind us, let's move on :)

For various reasons, PHP setups which rely on register_globals being on 
(i.e., on form, server and environment variables becoming a part of the 
global namespace, automatically) are very often exploitable to various 
degrees.  For example, the piece of code:

?php
if (authenticate_user()) {
   $authenticated = true;
}
...
?

May be exploitable, as remote users can simply pass on 'authenticated' as a 
form variable, and then even if authenticate_user() returns false, 
$authenticated will actually be set to true.  While this looks like a 
simple example, in reality, quite a few PHP applications ended up being 
exploitable by things related to this misfeature.

While it is quite possible to write secure code in PHP, we felt that the 
fact that PHP makes it too easy to write insecure code was bad, and we've 
decided to attempt a far-reaching change, and deprecate 
register_globals.  Obviously, because the vast majority of the PHP code in 
the world relies on the existence of this feature, we have no plans to 
actually remove it from PHP anytime in the foreseeable future, but we've 
decided to encourage people to shut it off whenever possible.

To help users build PHP applications with register_globals being off, we've 
added several new special variables that can be used instead of the old 
global variables.  There are 7 new special arrays:

$_GET - contains form variables sent through GET
$_POST - contains form variables sent through POST
$_COOKIE - contains HTTP cookie variables
$_SERVER - contains server variables (e.g., REMOTE_ADDR)
$_ENV - contains the environment variables
$_REQUEST - a merge of the GET variables, POST variables and Cookie 
variables.  In other words - all the information that is coming from the 
user, and that from a security point of view, cannot be trusted.
$_SESSION - contains HTTP variables registered by the session module

Now, other than the fact that these variables contain this special 
information, they're also special in another way - they're automatically 
global in any scope.  This means that you can access them anywhere, without 
having to 'global' them first.  For example:

function example1()
{
print $_GET[name];   // works, 'global $_GET;' is not necessary!
}

would work fine!  We hope that this fact would ease the pain in migrating 
old code to new code a bit, and we're confident it's going to make writing 
new code easier.  Another neat trick is that creating new entries in the 
$_SESSION array will automatically register them as session variables, as 
if you called session_register().  This trick is limited to the session 
module only - for example, setting new entries in $_ENV will *not* perform 
an implicit putenv().

PHP 4.1.0 still defaults to have register_globals set to on.  It's a 
transitional version, and we encourage application authors, especially 
public ones which are used by a wide audience, to change their applications 
to work in an environment where register_globals is set to off.  Of course, 
they should take advantage of the new features supplied in PHP 4.1.0 that 
make this transition much easier.

As of the next semi-major version of PHP, 

[PHP] PHP+MYSQL unable to select database

2001-12-10 Thread josep

I can't select a database from a php script.

I've set privileges in both the user and the data base tables
and I've done FLUSH PRIVILEGES;

WHY?

JOSEP.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP+MYSQL unable to select database

2001-12-10 Thread Benjamin Pflugmann

Hi.

First, please avoid cross-posting.

Try to narrow down the problem by trying from the command line client
(i.e. try to rule out PHP as source of the problem). If that doesn't
work, try the PHP list.

If you are successful, it belongs to the MySQL list (as PHP is no
longer part of the problem).

And it doesn't sound like any particular debian problem at all.

On Mon, Dec 10, 2001 at 11:58:51AM +0100, [EMAIL PROTECTED] wrote:
 I can't select a database from a php script.

What means i can't select? Does it simply show no effect? Do you get
an error? Anything else?

 I've set privileges in both the user and the data base tables
 and I've done FLUSH PRIVILEGES;
 
 WHY?

I cannot say, because you did not provide enough information, mainly
which error message you get (provided you got one).

You may want to have a look at the following section from the fine
manual: http://www.mysql.com/doc/A/c/Access_denied.html

If that doesn't help, don't forget to mention, what you already have
tried. And please write only to one list at a time, the one which
seems most appropriate. Thanks.

Bye,

Benjamin.


PS: Reply-To set accordingly.

-- 
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Safe Mode control

2001-12-10 Thread Charles Williams

Hey all,

I just finished an article on Safe Mode control for PHP but it is based on
non-Win32 systems.  Can somebody with a bit more experience in Win32 servers
take a look at it and let me know what can be done to achieve, if not the
same level of control then close to it, on a Win32 platform?

The article is at:
http://www.acnsnet.com/~slydder/stories/op/storiesView/sid/53/

thanks,
chuck

Chuck's Top 10 Things to Remember and Think about!
===
10. Please return stewardess to original upright position.
9. Fighting for peace is like fucking for virginity.
8. Never date someone because you're too lazy to commit suicide.
7. It is not the fall that kills you.  it's the sudden stop at the end.
6. You can't have everything.  Where would you put it all?
5.  Real Windows Performance, on the next In Search Of.
4. 2 rules to success in life. 1. Don't tell people everything you know.
3. 24 hours in a day, 24 beers in a case.  Coincidence?
2. 9 out of 10 men who try Camels prefer women.
1. Always borrow money from a pesimist.  They never expect it back anyway.

That's it!  NO MORE! JEEZ! GET BACK TO WORK!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP+MYSQL: unable to select database

2001-12-10 Thread Jon Farmer

 I get:

  unable to select database

  when I visit my guestbook.php

  The user trying it is set in the mysql.user (without any perms) and in
the
  mysql.db (with all perms).

 Do I have to set all perms to this user in the mysql.user table?

Did you 'flush privileges' ?

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] variables

2001-12-10 Thread Lennart Johansen

Is it advisable to use the same names for variables both in a function and in 
its activator([?] I'm sorry I don't know the correct word) as follows?

?
function test($var1, $var2) {
...whatever;
return $result;
}

var $var1, $var2;
$result = test($var1, $var2); // this is what I called the activator ... :)
?

Lennart Johansen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP+MYSQL: unable to select database even FLUSH PRIVILEGES

2001-12-10 Thread josep

I've did:

FLUSH PRIVILEGES

but nothing changes.

Josep.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] variables

2001-12-10 Thread Andrew Brampton

I don't see any reason not to.
But you should allways try and make your varible names meaningful...

In some cases I do end up having the same, for example if I'm passing X,Y
coords around. But in othercases they have totally different names.

Also out of interest, activator=formal parameter, the other one is Actual
parameter (/me prays I got that the right way around :))

Andrew

- Original Message -
From: Lennart Johansen [EMAIL PROTECTED]
To: PHP MailingList [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 9:13 AM
Subject: [PHP] variables


 Is it advisable to use the same names for variables both in a function and
in
 its activator([?] I'm sorry I don't know the correct word) as follows?

 ?
 function test($var1, $var2) {
 ...whatever;
 return $result;
 }

 var $var1, $var2;
 $result = test($var1, $var2); // this is what I called the activator ...
:)
 ?

 Lennart Johansen


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Store locator / postcode proximity

2001-12-10 Thread Rich Buggy

 I'm wondering if anyone has any information about how to get the
 proximity data for postcodes in Australia? Or is it safe to assume
 that if a postcode is, say, 3107, that 3120 or 3110 (for example)
 are nearby as well as 3108 (so, perhaps, 10 above and 10 below could
 be safely assumed to be nearby?)

  Don't even bother trying that for Sydney. There's a border around Western
Sydney where the Eastern suburbs are 21xx and the Western ones are 27xx. For
example 2148 and 2767 are next to each other.

Rich




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP+MYSQL unable to select database

2001-12-10 Thread Miles Thompson

Have you checked the docs? Have you double-checked the username, password 
and permissions?
Have you added  or die(mysql_error()) to your database connection function?
If this site is remote, does your username/password have rights to access 
the database?

Good luck - Miles Thompson

At 11:58 AM 12/10/2001 +0100, josep wrote:
I can't select a database from a php script.

I've set privileges in both the user and the data base tables
and I've done FLUSH PRIVILEGES;

WHY?

JOSEP.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP and plugin detection

2001-12-10 Thread Daniel Reichenbach

Hy,

is there any way to detect the plugins a user has installed in his
browser with PHP? I want to write a page where users get a plugin
depending on their installation. If none of the required plugins
is available an error page should be viewed.

If it's not possible using PHP, can it be done with JavaScript?

Greetings,
Daniel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] WEB PAGE CALCI

2001-12-10 Thread Chamarty Prasanna Kumar



Hi All,
   
 Using PHP,is there any function for

calculating the size of a Web page, means the size of

everything the browser has to load to render the page.

That includes the HTML file, all the graphics, 

animations, CSS, php. And the input being URL of the

page.


Thanks in advance,


Kumar.
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Forms and String Limitations

2001-12-10 Thread Jørg Vidar Bryne

Jeremy Reed [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This is the problem: The user tries to submit a news article of 2+ pages
 (approx 4400 characters) but the article gets truncated to about 4050
 characters.  Is there some sort of limitation on PHP variables that is
 causing this?

Are you using form method=getor form method=post ?

I'm not certain about the details but GET is not useful for handeling large
data, while POST has a default setting of max 2MB pr. request.

-Jørg





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RegEx gurus help...

2001-12-10 Thread Brian V Bonini

I need to replace all relative links in an html
doc with absolute links on the fly weather it
be an image link,
img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'
img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13'

a URL,
a href=/dealers/index.asp

a link to an external JS file
script language='JavaScript' src='/_js/scripts.js'
type='text/javascript'/script

or external css file.
link rel=stylesheet href=../_css/style.css type=text/css

Anyone done this before and have a prefab regex laying
around they want to share?

-Brian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Frames creating problems...

2001-12-10 Thread dhaval desai

Hello Guys,

Well I have a website with frames. The problem here is
that I have a serach box in the top frame and I want
the results to be displayed in the other frame.

I have seen this on lot of websites but now I am
wondering how to do it when I am facing this problem..

Any help would be greately appreciated.

Thanx to all

Best Regards,
Dhaval Desai



__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 10 Dec 2001 15:10:38 -0000 Issue 1044

2001-12-10 Thread php-general-digest-help


php-general Digest 10 Dec 2001 15:10:38 - Issue 1044

Topics (messages 77176 through 77197):

Re: Doing statistics with MySql data?
77176 by: Martin Towell
77179 by: Fred

Announcement: Frederick Webmail v1.0.0 released
77177 by: Richard Heyes

KISGB (Keep It Simple Guest Book) v2.6 released
77178 by: Gaylen Fraley

Re: how do i get the browser's screen resolution?
77180 by: R'twick Niceorgaw

JavaScript and PHP
77181 by: Jordan
77182 by: Richard Crawford

PHP+MYSQL: unable to select database
77183 by: josep
77185 by: Jon Farmer

PHP Safe Mode control
77184 by: Charles Williams

variables
77186 by: Lennart Johansen
77188 by: Andrew Brampton

PHP+MYSQL: unable to select database even FLUSH PRIVILEGES
77187 by: josep

PHP+MYSQL unable to select database
77189 by: josep
77191 by: Miles Thompson
77193 by: Benjamin Pflugmann

Re: Store locator / postcode proximity
77190 by: Rich Buggy

PHP and plugin detection
77192 by: Daniel Reichenbach

WEB PAGE CALCI
77194 by: Chamarty Prasanna Kumar

Re: PHP Forms and String Limitations
77195 by: Jørg Vidar Bryne

RegEx gurus help...
77196 by: Brian V Bonini

Frames creating problems...
77197 by: dhaval desai

Administrivia:

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

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

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


--

---BeginMessage---

try looking at http://informit.com/
has heaps of good books online there - you might be able to find a good book
on sql.

-Original Message-
From: Daniel Alsén [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 1:27 PM
To: PHP
Subject: [PHP] Doing statistics with MySql data?


Hi,

i have a MySql table with five columns that are filled with different
numerical values. I need some pointers to where i can learn how to build
statistics out of this data (ie the average value of a column, how many
instances there is of a certain value etc).

Regards
# Daniel Alsén| www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   | +46 8 694 82 22  #
# PGP: http://www.mindbash.com/pgp/  #


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

---End Message---
---BeginMessage---

There are built in functions in mysql for just this sort of thing.  There
are AVG() and COUNT() functions as well as many more.  Read up on them here:

http://www.mysql.com/doc/F/u/Functions.html

Fred

Daniel alsén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 i have a MySql table with five columns that are filled with different
 numerical values. I need some pointers to where i can learn how to build
 statistics out of this data (ie the average value of a column, how many
 instances there is of a certain value etc).

 Regards
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   | +46 8 694 82 22  #
 # PGP: http://www.mindbash.com/pgp/  #




---End Message---
---BeginMessage---


My webmail app, Frederick, is now released. Small (though soon to grow in
features) and fast,
it is available from here:

http://www.phpguru.org/frederick/

 - Extremely cusomisable (entirely template based)
 - One installation can be used with various
   urls, each having it's own template sets (skins)
 - Plugin infrastructure in place so extending is a
   simple affair
 - Supports pop3/imap
 - Excellent mime support
 - Intuitive UI
 - BSD License

--
Richard Heyes
If you have any trouble sounding condescending,
find a Unix user to show you how it's done. - Scott Adams


---End Message---
---BeginMessage---

Version 2.6 of my Guest book is released!

Description:

A PHP (version 4.x) guestbook program that does not require an rdbms. Can be
Public or Private through HTTP Authentication. Automated install script,
fully customizable, clean, and fast. Separate multiple logging capabilty for
tracking anything! Includes web-based password protected Admin
functionality, along with email notification, greeting, ip logging, ip
banning, bad word filter, smileys, allowable html tags in comments,
next/previous, etc. Themes for controlling appearance that allow for
background colors, images, animations, etc. Language support for Dutch,
English, French, German, Polish, Portuguese, Spanish, and Surinam.

--
Gaylen
[EMAIL PROTECTED]
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite




---End Message---
---BeginMessage---

Can you hide it in a hidden form element ? or pass it as a variable in the
URL like http://myurl?screen_size=screen size ?

-Original Message-

Re: [PHP] Frames creating problems...

2001-12-10 Thread Jon Farmer

 Well I have a website with frames. The problem here is
 that I have a serach box in the top frame and I want
 the results to be displayed in the other frame.

Javascript! Use the OnCLick event of a button to take the value of the
textbox and update the href of the other frame passing the contents of the
textbox in the querystring.
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RegEx gurus help...

2001-12-10 Thread Jack Dempsey

from the way you describe, i can't help but think that it'd be one hell of a
regex.if all you're doing is stripping out .. i'd load up your fav
editor and do a search and replace where you can approve each changeor,
just change them all and fix what's broken.it'll be much quicker than
trying to write a regex for all of that

-Original Message-
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 9:22 AM
To: PHP Lists
Subject: [PHP] RegEx gurus help...


I need to replace all relative links in an html
doc with absolute links on the fly weather it
be an image link,
img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'
img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13'

a URL,
a href=/dealers/index.asp

a link to an external JS file
script language='JavaScript' src='/_js/scripts.js'
type='text/javascript'/script

or external css file.
link rel=stylesheet href=../_css/style.css type=text/css

Anyone done this before and have a prefab regex laying
around they want to share?

-Brian


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Frames creating problems...

2001-12-10 Thread Paul Burney

on 12/10/01 10:03 AM, dhaval desai at [EMAIL PROTECTED] wrote:

 Well I have a website with frames. The problem here is
 that I have a serach box in the top frame and I want
 the results to be displayed in the other frame.

This isn't the appropriate forum for the question since it isn't php
related.  

That said, you should use the target attribute of the form tag.  Set it to
the name of the frame you wish the content to be in.

HTH.

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Frames creating problems...

2001-12-10 Thread Stefan Rusterholz

If you have the whole form in frame A and want the result in frame B then
use
form action=xyz.php target=frameB

If you have the form in frame A and the search button in frame B then
you'll have to use JavaScript
A HREF=javaScript:parent.frames[1].FORMNAME.submit()GO!/A (you will
have to replace frames[1] with frames[x] where x is the number of the frame.
consult www.teamone.de/selfhtml/ for more informations about that)

Stefan Rusterholz, [EMAIL PROTECTED]
--
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
--
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
--
- Original Message -
From: dhaval desai [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 4:03 PM
Subject: [PHP] Frames creating problems...


 Hello Guys,

 Well I have a website with frames. The problem here is
 that I have a serach box in the top frame and I want
 the results to be displayed in the other frame.

 I have seen this on lot of websites but now I am
 wondering how to do it when I am facing this problem..

 Any help would be greately appreciated.

 Thanx to all

 Best Regards,
 Dhaval Desai



 __
 Do You Yahoo!?
 Send your FREE holiday greetings online!
 http://greetings.yahoo.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.5.1 available

2001-12-10 Thread Monte Ohrt

This is a critical bug fix release. If you use caching, you'll need to
upgrade from 1.5.0.

http://www.phpinsider.com/php/code/Smarty/

Version 1.5.1
-
- removed error message from the generic _read_file() method, the
caller
  should take care of that. (Andrei)
- fixed a bug with incorrectly combined cache and compile id.
(Andrei)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] file downlaod via http

2001-12-10 Thread Helmut Habiger

hi!

is's such a simple question, but ...

i'd like to download a picture.
but instead of typing the URL into my browser, loading the page into the
browser, then right-clicking to to get the save picture as menu, then
entering the local path and press save,
I'd like to write a litte script, where i enter the URL of the picture
(example:http://www.picturesite.com/picture1.jpg;), the local storing
path and all the rest for download is done by the script.

any idea?

thx helmut


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] file downlaod via http

2001-12-10 Thread Valentin V. Petruchek

Security, you know...
Browser will not allow you to save files on LOCAL drive

Otherwise Internet should be very dangerous thing
- Original Message -
From: Helmut Habiger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 5:57 PM
Subject: [PHP] file downlaod via http


 hi!

 is's such a simple question, but ...

 i'd like to download a picture.
 but instead of typing the URL into my browser, loading the page into the
 browser, then right-clicking to to get the save picture as menu, then
 entering the local path and press save,
 I'd like to write a litte script, where i enter the URL of the picture
 (example:http://www.picturesite.com/picture1.jpg;), the local storing
 path and all the rest for download is done by the script.

 any idea?

 thx helmut


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RegEx gurus help...

2001-12-10 Thread Brian V Bonini

Hey thanks! That was a good starting point...

-Brian

 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 10, 2001 9:35 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] RegEx gurus help...


 The code below does almost of the job. There is only one problem.
 If some path is absolute to the server /aaa/bbb/ the path get
 file://aaa// but I think no problems with apache.

 HTH

 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 BALANCED SOLUTIONS

 pre
 ?php

 $the_html = 'I need to replace all relative links in an html
 doc with absolute links on the fly weather it
 be an image link,
 img src=\'/_imgs/imgs_nav/transPix.gif\' width=\'10\' height=\'13\'
 img src=\'../_imgs/imgs_nav/transPix.gif\' width=\'10\' height=\'13\'

 a URL,
 a href=/dealers/index.asp

 a link to an external JS file
 script language=\'JavaScript\' src=\'/_js/scripts.js\'
 type=\'text/javascript\'/script

 or external css file.
 link rel=stylesheet href=../_css/style.css type=text/css';
 echo htmlspecialchars($the_html);
 $ABSOLUTE_HREF = 'http://someserver.com/somedir/somedir2/';

 $count =
 preg_match_all('~(src=|href=)(|\')(?!href://)(.*?)(\2)~',$the_htm
 l,$matches);
 var_dump($matches);
 $the_html =
 preg_replace('~(src=|href=)(|\')(?!href://)(.*?)(\2)~','\1\2'.$AB
 SOLUTE_HREF.'\3\4',$the_html);
 echo htmlspecialchars($the_html);

 ?
 - Original Message -
 From: Brian V Bonini [EMAIL PROTECTED]
 To: PHP Lists [EMAIL PROTECTED]
 Sent: Monday, December 10, 2001 4:21 PM
 Subject: [PHP] RegEx gurus help...


  I need to replace all relative links in an html
  doc with absolute links on the fly weather it
  be an image link,
  img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'
  img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13'
 
  a URL,
  a href=/dealers/index.asp
 
  a link to an external JS file
  script language='JavaScript' src='/_js/scripts.js'
  type='text/javascript'/script
 
  or external css file.
  link rel=stylesheet href=../_css/style.css type=text/css
 
  Anyone done this before and have a prefab regex laying
  around they want to share?
 
  -Brian
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] setting up a user login with PHP

2001-12-10 Thread Ward, Mark

I've got a mySQL database with usernames and passwords. What's the best way
to allow authorized users to enter my site? I'm having some problems using
the forms properly, they've always been my achilles heel when it comes to
web programming. Any help is appreciated. 

Mark Ward


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Store locator / postcode proximity

2001-12-10 Thread Hugh Bothwell


Rich Buggy [EMAIL PROTECTED] wrote in message
018a01c18160$c463c180$[EMAIL PROTECTED]">news:018a01c18160$c463c180$[EMAIL PROTECTED]...
  I'm wondering if anyone has any information about how to get the
  proximity data for postcodes in Australia? Or is it safe to assume
  that if a postcode is, say, 3107, that 3120 or 3110 (for example)
  are nearby as well as 3108 (so, perhaps, 10 above and 10 below could
  be safely assumed to be nearby?)

   Don't even bother trying that for Sydney. There's a border around
Western
 Sydney where the Eastern suburbs are 21xx and the Western ones are 27xx.
For
 example 2148 and 2767 are next to each other.

A search at google.com for australia list postal code got me
http://www.auspost.com.au/postcodes/
from which you can download the full dbase in .csv format...
it gives you town/suburb info which could probably be sufficient.

Alternatively, take a look at
http://www.mapds.com.au/NowWhere_/nowwhere_.html
which provides exactly what you are looking for as a
monthly-fee service (no prices listed, give them a call).




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Logo proposal

2001-12-10 Thread Valentin V. Petruchek

Hello world of php-programmers!

It seemes to me PHP is very powerful tool and very popular among
web-programmers, too. As for me I use php for solving web tasks for 2 years
and I'm very satisfied with it.

It seemes to me current PHP logo (can be found by
http://www.php.net/gifs/logo.gif) doesn't suite to PHP. It's common logo
without any idea except using title in it.

I propose to create and develop new PHP logo corresponding to its power.

My propose is WoodPecker (e.g. like Woody).

Other propositions?

Respectfully, Zliy Pes http://www.zliypes.com.ua






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: eval on a form

2001-12-10 Thread Hugh Bothwell


Paul Roberts [EMAIL PROTECTED] wrote in message
000d01c18101$5dbb2220$01f8883e@laptop1">news:000d01c18101$5dbb2220$01f8883e@laptop1...
 Hi

 I'm trying to pre-fill a form ( the data is passed via sessions or from
 another script).

 i have some check boxes on the form that i would like checked if the
 variable is present.

 any ideas

I would write a checkbox-presenting function - pass it the name of
the variable the checkbox represents, it will see if the variable is set
(and if so, denote it CHECKED) and name the checkbox properly.
This should encapsulate stuff nicely and make your source easier to
follow; something like

function CondCheckbox($variablename) {
$str = INPUT TYPE='CHECKBOX' NAME='$variablename';

  if (isset($GLOBALS[$variablename]))
$str .=  CHECKED;

  return $str.;
}

(note: I have not actually run-tested this; it should be pretty close,
though)


Then your form will look something like

Ingredients:
FORM
?php
echo CondCheckbox(flour).Flourbr;
echo CondCheckbox(butter).Butterbr;
echo CondCheckbox(salt).Saltbr;
echo CondCheckbox(oatmeal).Oatmealbr;
?
input type='submit'
/FORM


Is this something like what you were after?  It would help
if you gave us a slightly more detailed idea of what sort of
data was involved.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Forms and String Limitations

2001-12-10 Thread Jeremy Reed

I'm using the POST method.

We may be on the right track though, there may have been a problem with the
insertion of the data, rather than the retrieval.  However, I still don't
know what could be causing the problem.


JøRg Vidar Bryne [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jeremy Reed [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  This is the problem: The user tries to submit a news article of 2+ pages
  (approx 4400 characters) but the article gets truncated to about 4050
  characters.  Is there some sort of limitation on PHP variables that is
  causing this?

 Are you using form method=getor form method=post ?

 I'm not certain about the details but GET is not useful for handeling
large
 data, while POST has a default setting of max 2MB pr. request.

 -Jørg







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php as cron

2001-12-10 Thread Jay Paulson

I'm trying to test php running as a cron job and I have installed php as a CGI in 
/usr/local/bin and I have edited my crontab file to call a php file every two minutes. 
 However, it's not working and I was wondering if you all would know what's going on.  
Anyway, here's how I have things set up.

crontab file:
*/2 * * * * php /home/crontest.php  /dev/null

crontest.php:
#!/usr/local/bin/php -q
?php
mail([EMAIL PROTECTED],cron test, testing,NULL);
?

email I'm receiving with error:
Subject: Cron  php /home/crontest.php  /dev/null
Body: /bin/sh: php: command not found

thanks for any help.



[PHP] Returned error messages

2001-12-10 Thread Dave Brotherstone


Has anyone got error messages working from MSSQL or Sybase (connecting from
a unix box)?

Dave.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Returned error messages

2001-12-10 Thread Valentin V. Petruchek

My experince: MsSQL is keeping silence even freetds or sybase is not
installed at all...

- Original Message -
From: Dave Brotherstone [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 7:58 PM
Subject: [PHP] Returned error messages



 Has anyone got error messages working from MSSQL or Sybase (connecting
from
 a unix box)?

 Dave.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: setting up a user login with PHP

2001-12-10 Thread Jeremy Reed

The easiest way is to use cookies.
=CODE
?php
require 'auth_functions.php';
if (authenticateUser($form_username, $form_password)){
   setcookie(cookie_passwd,$form_password);
   setcookie(cookie_user,$form_username);
   header(Location:http://$SERVER/index2.php;);
   exit();
} else {
header(Location:http://$SERVER/error.html;);
}
?

This code takes in input from a form as simple as this:
form name=form1 method=post action=index.php
  Login: input type=text name=form_usernamebr
  Password:
  input type=password name=form_password br
  input type=submit name=Submit value=Login
/form
Checks it against the database values using the function 'authenticateUser',
returns TRUE or FALSE.
If true, sends the user onto the correct page, if false, sends them to some
error page.

Now, in each other file, you'll need to check the cookies.  The values for
the cookies are sent automatically by the user's browser.  In this
particular examples, the cookie variables are named '$cookie_user' and
'$cookie_passwd'.  You can see in the example how those are set.

You will check the cookies using the exact same 'authenticateUser' function.
Except in these files, you will use the cookie values as the parameters to
the function instead of the form values.

Hope this helps.

Best regards,

Jeremy Reed

Mark Ward [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've got a mySQL database with usernames and passwords. What's the best
way
 to allow authorized users to enter my site? I'm having some problems using
 the forms properly, they've always been my achilles heel when it comes to
 web programming. Any help is appreciated.

 Mark Ward




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Setting Cookies

2001-12-10 Thread Steve Osborne

I am attempting to use the SetCookie command.  I receive the following
error:

Warning: Cannot add header information - headers already sent by
(reference to current page)...

At this point I have authenticated the user, and am trying to set the cookie
before redirecting them to the registered users section.  Should I be
setting the cookie on the top of the page that I am sending them to?

Any comments or suggestions would be greatly appreciated.

Steve Osborne
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Setting Cookies

2001-12-10 Thread Jeremy Reed

You are getting that error because you have sent output to the browser
BEFORE you try to set the cookie information.  When dealing with cookies, it
is important to do all processing before sending any output to the browser.

Jeremy Reed

Steve Osborne [EMAIL PROTECTED] wrote in message
002b01c181b2$52343700$[EMAIL PROTECTED]">news:002b01c181b2$52343700$[EMAIL PROTECTED]...
 I am attempting to use the SetCookie command.  I receive the following
 error:

 Warning: Cannot add header information - headers already sent by
 (reference to current page)...

 At this point I have authenticated the user, and am trying to set the
cookie
 before redirecting them to the registered users section.  Should I be
 setting the cookie on the top of the page that I am sending them to?

 Any comments or suggestions would be greatly appreciated.

 Steve Osborne
 [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php as cron

2001-12-10 Thread Shane Wright

Hi

You probably need to set the path to your PHP binary in crontab.

Alternatively (this is probs a better way), wrap the whole lot up in a simple 
shell script and get cron to run the shell script.

It's easier than it sounds...

#!/bin/bash
cd /path/to/php/scripts
php  myscript.php  /dev/null

(also, I tend not to have PHP direct output to /dev/null, but to configure 
cron not to send emails on completion - that way you get the info when you 
run the script on the command line but dont get overrun with pointless emails)

Hope that helps :)

--
Shane

On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
 I'm trying to test php running as a cron job and I have installed php as a
 CGI in /usr/local/bin and I have edited my crontab file to call a php file
 every two minutes.  However, it's not working and I was wondering if you
 all would know what's going on.  Anyway, here's how I have things set up.

 crontab file:
 */2 * * * * php /home/crontest.php  /dev/null

 crontest.php:
 #!/usr/local/bin/php -q
 ?php
 mail([EMAIL PROTECTED],cron test, testing,NULL);
 ?

 email I'm receiving with error:
 Subject: Cron  php /home/crontest.php  /dev/null
 Body: /bin/sh: php: command not found

 thanks for any help.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Setting Cookies

2001-12-10 Thread Rasmus Lerdorf

Yes, setting and cookie and redirecting in the same request is not 
reliable.  Some browsers can do it sometimes, others can't.

-Rasmus

On Mon, 10 Dec 2001, Steve Osborne wrote:

 I am attempting to use the SetCookie command.  I receive the following
 error:
 
 Warning: Cannot add header information - headers already sent by
 (reference to current page)...
 
 At this point I have authenticated the user, and am trying to set the cookie
 before redirecting them to the registered users section.  Should I be
 setting the cookie on the top of the page that I am sending them to?
 
 Any comments or suggestions would be greatly appreciated.
 
 Steve Osborne
 [EMAIL PROTECTED]
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php as cron

2001-12-10 Thread Darren Gamble

Good day,

Doesn't having the statement #!/usr/local/bin/php -q at the start of the
program makes running php (rather than the script itself) redundant?  Why
not just call the script in the crontab?


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Shane Wright [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 11:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php as cron


Hi

You probably need to set the path to your PHP binary in crontab.

Alternatively (this is probs a better way), wrap the whole lot up in a
simple 
shell script and get cron to run the shell script.

It's easier than it sounds...

#!/bin/bash
cd /path/to/php/scripts
php  myscript.php  /dev/null

(also, I tend not to have PHP direct output to /dev/null, but to configure 
cron not to send emails on completion - that way you get the info when you 
run the script on the command line but dont get overrun with pointless
emails)

Hope that helps :)

--
Shane

On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
 I'm trying to test php running as a cron job and I have installed php as a
 CGI in /usr/local/bin and I have edited my crontab file to call a php file
 every two minutes.  However, it's not working and I was wondering if you
 all would know what's going on.  Anyway, here's how I have things set up.

 crontab file:
 */2 * * * * php /home/crontest.php  /dev/null

 crontest.php:
 #!/usr/local/bin/php -q
 ?php
 mail([EMAIL PROTECTED],cron test, testing,NULL);
 ?

 email I'm receiving with error:
 Subject: Cron  php /home/crontest.php  /dev/null
 Body: /bin/sh: php: command not found

 thanks for any help.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Setting Cookies

2001-12-10 Thread Valentin V. Petruchek

Not necessary on the top, but before any html begins

Zliy Pes, http://zliypes.com.ua

- Original Message -
From: Steve Osborne [EMAIL PROTECTED]
To: PHP-General (E-mail) [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 9:39 PM
Subject: [PHP] Setting Cookies


 I am attempting to use the SetCookie command.  I receive the following
 error:

 Warning: Cannot add header information - headers already sent by
 (reference to current page)...

 At this point I have authenticated the user, and am trying to set the
cookie
 before redirecting them to the registered users section.  Should I be
 setting the cookie on the top of the page that I am sending them to?

 Any comments or suggestions would be greatly appreciated.

 Steve Osborne
 [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Setting Cookies

2001-12-10 Thread Casey Allen Shobe

On Monday 10 December 2001 14:39, Steve Osborne wrote:
 Warning: Cannot add header information - headers already sent by
 (reference to current page)...

 At this point I have authenticated the user, and am trying to set the
 cookie before redirecting them to the registered users section.  Should I
 be setting the cookie on the top of the page that I am sending them to?

Yes, or do what I do and redirect to a dologin page that sets the cookie and 
autorefreshes after one second to the real page, which requires the cookie to 
be set already.

-- 
Casey Allen Shobe
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php as cron

2001-12-10 Thread jr


Why not just use lynx to run it?

*/2 * * * * /usr/local/bin/lynx -dump crontest.php 

JR

 
 On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
  I'm trying to test php running as a cron job and I have installed php as a
  CGI in /usr/local/bin and I have edited my crontab file to call a php file
  every two minutes.  However, it's not working and I was wondering if you
  all would know what's going on.  Anyway, here's how I have things set up.
 
  crontab file:
  */2 * * * * php /home/crontest.php  /dev/null
 
  crontest.php:
  #!/usr/local/bin/php -q
  ?php
  mail([EMAIL PROTECTED],cron test, testing,NULL);
  ?
 
  email I'm receiving with error:
  Subject: Cron  php /home/crontest.php  /dev/null
  Body: /bin/sh: php: command not found
 
  thanks for any help.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php as cron

2001-12-10 Thread Jay Paulson

I was wondering how to disable the auto email after the cron job is done.
How exactly do you disable it?

thanks for the help btw!

- Original Message -
From: Shane Wright [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 12:47 PM
Subject: Re: [PHP] php as cron


 Hi

 You probably need to set the path to your PHP binary in crontab.

 Alternatively (this is probs a better way), wrap the whole lot up in a
simple
 shell script and get cron to run the shell script.

 It's easier than it sounds...

 #!/bin/bash
 cd /path/to/php/scripts
 php  myscript.php  /dev/null

 (also, I tend not to have PHP direct output to /dev/null, but to configure
 cron not to send emails on completion - that way you get the info when you
 run the script on the command line but dont get overrun with pointless
emails)

 Hope that helps :)

 --
 Shane

 On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
  I'm trying to test php running as a cron job and I have installed php as
a
  CGI in /usr/local/bin and I have edited my crontab file to call a php
file
  every two minutes.  However, it's not working and I was wondering if you
  all would know what's going on.  Anyway, here's how I have things set
up.
 
  crontab file:
  */2 * * * * php /home/crontest.php  /dev/null
 
  crontest.php:
  #!/usr/local/bin/php -q
  ?php
  mail([EMAIL PROTECTED],cron test, testing,NULL);
  ?
 
  email I'm receiving with error:
  Subject: Cron  php /home/crontest.php  /dev/null
  Body: /bin/sh: php: command not found
 
  thanks for any help.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php as cron

2001-12-10 Thread Jay Paulson

I don't want to use lynx to run the script because I don't want this script
accessible through a web browser :)

- Original Message -
From: [EMAIL PROTECTED]
To: Darren Gamble [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 1:12 PM
Subject: RE: [PHP] php as cron



 Why not just use lynx to run it?

 */2 * * * * /usr/local/bin/lynx -dump crontest.php

 JR


  On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
   I'm trying to test php running as a cron job and I have installed php
as a
   CGI in /usr/local/bin and I have edited my crontab file to call a php
file
   every two minutes.  However, it's not working and I was wondering if
you
   all would know what's going on.  Anyway, here's how I have things set
up.
  
   crontab file:
   */2 * * * * php /home/crontest.php  /dev/null
  
   crontest.php:
   #!/usr/local/bin/php -q
   ?php
   mail([EMAIL PROTECTED],cron test, testing,NULL);
   ?
  
   email I'm receiving with error:
   Subject: Cron  php /home/crontest.php  /dev/null
   Body: /bin/sh: php: command not found
  
   thanks for any help.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php as cron

2001-12-10 Thread Darren Gamble

Good day,

Calling another program with this script is unnecessary, since you are using
the shebang operator.

Instead of:

*/2 * * * * php /home/crontest.php  /dev/null

Use:

*/2 * * * * /home/crontest.php  /dev/null

Which should work just fine.

As pointed out, the reason you were getting the message was because cron is
not able to find php because /usr/local/bin is not in the path.  If you
really want to use it, then the following:

*/2 * * * * /usr/local/bin/php /home/crontest.php  /dev/null

would also work.  You could remove the #! line in your script if you do so.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 12:12 PM
To: Darren Gamble
Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] php as cron



Why not just use lynx to run it?

*/2 * * * * /usr/local/bin/lynx -dump crontest.php 

JR

 
 On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
  I'm trying to test php running as a cron job and I have installed php as
a
  CGI in /usr/local/bin and I have edited my crontab file to call a php
file
  every two minutes.  However, it's not working and I was wondering if you
  all would know what's going on.  Anyway, here's how I have things set
up.
 
  crontab file:
  */2 * * * * php /home/crontest.php  /dev/null
 
  crontest.php:
  #!/usr/local/bin/php -q
  ?php
  mail([EMAIL PROTECTED],cron test, testing,NULL);
  ?
 
  email I'm receiving with error:
  Subject: Cron  php /home/crontest.php  /dev/null
  Body: /bin/sh: php: command not found
 
  thanks for any help.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: setting up a user login with PHP

2001-12-10 Thread py

or you could use:
http://phpclasses.upperdesign.com/browse.html/package/288
py


At 01:08 PM 12/10/01 -0500, Jeremy Reed wrote:
The easiest way is to use cookies.
=CODE
?php
require 'auth_functions.php';
if (authenticateUser($form_username, $form_password)){
setcookie(cookie_passwd,$form_password);
setcookie(cookie_user,$form_username);
header(Location:http://$SERVER/index2.php;);
exit();
} else {
header(Location:http://$SERVER/error.html;);
}
?

This code takes in input from a form as simple as this:
form name=form1 method=post action=index.php
   Login: input type=text name=form_usernamebr
   Password:
   input type=password name=form_password br
   input type=submit name=Submit value=Login
/form
Checks it against the database values using the function 'authenticateUser',
returns TRUE or FALSE.
If true, sends the user onto the correct page, if false, sends them to some
error page.

Now, in each other file, you'll need to check the cookies.  The values for
the cookies are sent automatically by the user's browser.  In this
particular examples, the cookie variables are named '$cookie_user' and
'$cookie_passwd'.  You can see in the example how those are set.

You will check the cookies using the exact same 'authenticateUser' function.
Except in these files, you will use the cookie values as the parameters to
the function instead of the form values.

Hope this helps.

Best regards,

Jeremy Reed

Mark Ward [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I've got a mySQL database with usernames and passwords. What's the best
way
  to allow authorized users to enter my site? I'm having some problems using
  the forms properly, they've always been my achilles heel when it comes to
  web programming. Any help is appreciated.
 
  Mark Ward
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



[PHP] mail attachment query

2001-12-10 Thread caspar kennerdale

so i have a mail script which allows people to send attachments. This is
activated by an htmlform, which allows users to select the file from their
hard drive and post to the recipient.

The problem I have is this-

The file attachment is sent via email as a .dat file.

If I specify the name of the file and its attachment in a variable called
mail title all is well and good -

$mail_body .= Content-type:$mime_type; name=\$mail_title

This is of course if $mail_title is spomething likle mypicture.jpeg, if I
leave the extension out then it os sent as a dat file.

Now firstly the mime type might change depending onthe typeoffile the user
wishes to send-
it may be an swf or a doc. If the user specifies the type of file it is then
this is fine.

If the user doesnt specify the typeoffile being sent then all I have to go
on is the name of the file uploaded which appears as a temp name such as-

/tmp/phpHy3WIj

so is their any way of auto detecting thje mime type of a file from simply
the 'file' inpuit box on the form or at any other stgae-- or does the user
have to declare the type of file they are sending?

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Shell scripting

2001-12-10 Thread Dan McCullough

I am setting up a shell script to provide a menu for some tasks that our server admin 
would like
to do via script rather then vi'ing the file, now I am almost finished but I would 
like to get rid
of this ugly part of the output.

X-Powered-By: PHP/4.0.4pl1
Content-type: text/html

Is there away that I can get the echo to stay off for that part.

dan

=
dan mccullough

Theres no such thing as a problem unless the servers are on fire!


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shell scripting

2001-12-10 Thread Rouvas Stathis

Start php with -q, eg: php -q script.php

-Stathis.

Dan McCullough wrote:
 
 I am setting up a shell script to provide a menu for some tasks that our server 
admin would like
 to do via script rather then vi'ing the file, now I am almost finished but I would 
like to get rid
 of this ugly part of the output.
 
 X-Powered-By: PHP/4.0.4pl1
 Content-type: text/html
 
 Is there away that I can get the echo to stay off for that part.
 
 dan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Using @file

2001-12-10 Thread Jeff Lewis

I am using this line in part of my code but am getting an error that looks like below:

Code:
$serverDetails = @file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);

Error:
2: php_network_getaddresses: gethostbyname failed 
(c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)

What would be causing this error?  It works on some machines but not others?

Jeff



RE: [PHP] Using @file

2001-12-10 Thread Darren Gamble

Good day,

The error means that it can not resolve the name.

Replace the comma in the name with a period.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 1:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Using @file


I am using this line in part of my code but am getting an error that looks
like below:

Code:
$serverDetails =
@file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);

Error:
2: php_network_getaddresses: gethostbyname failed 
(c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)

What would be causing this error?  It works on some machines but not others?

Jeff

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Using @file

2001-12-10 Thread Jeff Lewis

Sorry that was a typo, it is a period, I mistyped into the email.  If it
cant resolve the name, what would cause that problem?

Jeff
- Original Message -
From: Darren Gamble [EMAIL PROTECTED]
To: 'Jeff Lewis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 3:19 PM
Subject: RE: [PHP] Using @file


 Good day,

 The error means that it can not resolve the name.

 Replace the comma in the name with a period.

 
 Darren Gamble
 Planner, Regional Services
 Shaw Cablesystems GP
 630 - 3rd Avenue SW
 Calgary, Alberta, Canada
 T2P 4L4
 (403) 781-4948


 -Original Message-
 From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 10, 2001 1:24 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Using @file


 I am using this line in part of my code but am getting an error that looks
 like below:

 Code:
 $serverDetails =
 @file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);

 Error:
 2: php_network_getaddresses: gethostbyname failed
 (c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)

 What would be causing this error?  It works on some machines but not
others?

 Jeff




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Using @file

2001-12-10 Thread Darren Gamble

Good day,

Again, this error means that the server can not resolve a name.

Please ensure that the name www.myserver.com can be DNS resolved.  Please
contact your DNS administrator if it can not.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 1:32 PM
To: Darren Gamble; [EMAIL PROTECTED]
Subject: Re: [PHP] Using @file


Sorry that was a typo, it is a period, I mistyped into the email.  If it
cant resolve the name, what would cause that problem?

Jeff
- Original Message -
From: Darren Gamble [EMAIL PROTECTED]
To: 'Jeff Lewis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 3:19 PM
Subject: RE: [PHP] Using @file


 Good day,

 The error means that it can not resolve the name.

 Replace the comma in the name with a period.

 
 Darren Gamble
 Planner, Regional Services
 Shaw Cablesystems GP
 630 - 3rd Avenue SW
 Calgary, Alberta, Canada
 T2P 4L4
 (403) 781-4948


 -Original Message-
 From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 10, 2001 1:24 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Using @file


 I am using this line in part of my code but am getting an error that looks
 like below:

 Code:
 $serverDetails =
 @file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);

 Error:
 2: php_network_getaddresses: gethostbyname failed
 (c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)

 What would be causing this error?  It works on some machines but not
others?

 Jeff



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Using @file

2001-12-10 Thread Jeff Lewis

Again, this works on some servers and othes not.  Does IIS support this
particular function?

Jeff
- Original Message -
From: Darren Gamble [EMAIL PROTECTED]
To: 'Jeff Lewis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 3:32 PM
Subject: RE: [PHP] Using @file


 Good day,

 Again, this error means that the server can not resolve a name.

 Please ensure that the name www.myserver.com can be DNS resolved.  Please
 contact your DNS administrator if it can not.

 -Original Message-
 From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 10, 2001 1:32 PM
 To: Darren Gamble; [EMAIL PROTECTED]
 Subject: Re: [PHP] Using @file


 Sorry that was a typo, it is a period, I mistyped into the email.  If it
 cant resolve the name, what would cause that problem?

 Jeff
 - Original Message -
 From: Darren Gamble [EMAIL PROTECTED]
 To: 'Jeff Lewis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, December 10, 2001 3:19 PM
 Subject: RE: [PHP] Using @file


  Good day,
 
  The error means that it can not resolve the name.
 
  Replace the comma in the name with a period.
 
  -Original Message-
  From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 10, 2001 1:24 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Using @file
 
 
  I am using this line in part of my code but am getting an error that
looks
  like below:
 
  Code:
  $serverDetails =
  @file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);
 
  Error:
  2: php_network_getaddresses: gethostbyname failed
  (c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)
 
  What would be causing this error?  It works on some machines but not
 others?
 
  Jeff
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] WEB PAGE CALCI

2001-12-10 Thread Matthew Moreton

Hi Chamarty,

The function you are looking to use is:

filesize(file);

This will return the size of a file, surprisingly!  Use it on all the files
in your docuemnt and add the results.

Regards

Matt.
Email: [EMAIL PROTECTED]

- Original Message -
From: Chamarty Prasanna Kumar [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 12:16 PM
Subject: [PHP] WEB PAGE CALCI




 Hi All,

  Using PHP,is there any function for

 calculating the size of a Web page, means the size of

 everything the browser has to load to render the page.

 That includes the HTML file, all the graphics,

 animations, CSS, php. And the input being URL of the

 page.


 Thanks in advance,


 Kumar.



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php-4.1.0 distribution broke??

2001-12-10 Thread Bob Scott

Hello all!

I've tried several times today to get the
latest PHP (4.1.0) tarball from php.net (as well as
a few mirror sites) and it looks like the
tarball is broken...!

Anyone having like problems??

Cheers!
-bob

.
.
.
.
.
php-4.1.0/ext/sysvshm/setup.stub
php-4.1.0/ext/sysvshm/sysvshm.c
tar: Skipping to next header

gzip: stdin: invalid compressed data--crc error

gzip: stdin: invalid compressed data--length error
tar: Child returned status 1
tar: Error exit delayed from previous errors
[bscott@bscott samba]$ tar --version
tar (GNU tar) 1.13.17
Copyright 2000 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
[bscott@bscott samba]$



--
Bob Scott   Web / DB Developer
http://www.covalent.netCovalent Technologies, Inc.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php-4.1.0 distribution broke??

2001-12-10 Thread Maciej Uhlig

as far as I can see the current release is 4.0.6.

did you see any announcement about 4.1.0?

they'll let you know when 4.1.0 is released. just be patient :-)

Maciek

 -Original Message-
 From: Bob Scott [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 10, 2001 10:06 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php-4.1.0 distribution broke??
 
 
 Hello all!
 
 I've tried several times today to get the
 latest PHP (4.1.0) tarball from php.net (as well as
 a few mirror sites) and it looks like the
 tarball is broken...!
 
 Anyone having like problems??


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Using @file

2001-12-10 Thread Darren Gamble

Good day,

While I am sure most of the readers of the list are finding this
conversation amusing, I will still try to explain this a bit better to you.

DNS, or Domain Name Service, is the protocol which translates names into IP
addresses.  If you supply a computer with a name, it must use DNS (or
NetBIOS, or a hosts file, etc.) in order to determine what an IP address is
from a name.

If you have not correctly configured your machine to use DNS, then your
computer will not be able to find the server you are asking it to.  The
error message you have supplied indicates that this is the problem.

From a command prompt on the server you are trying to run this on, try to
ping the server you are trying to reach by name (e.g. ping
www.myserver.com .  If you can not reach the server, then this is the
reason.  If this is the case, please contact the administrator of your
machine/network to correct this problem and take this discussion off the PHP
list.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 1:50 PM
To: Darren Gamble; [EMAIL PROTECTED]
Subject: Re: [PHP] Using @file


Again, this works on some servers and othes not.  Does IIS support this
particular function?

Jeff
- Original Message -
From: Darren Gamble [EMAIL PROTECTED]
To: 'Jeff Lewis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 3:32 PM
Subject: RE: [PHP] Using @file


 Good day,

 Again, this error means that the server can not resolve a name.

 Please ensure that the name www.myserver.com can be DNS resolved.  Please
 contact your DNS administrator if it can not.

 -Original Message-
 From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 10, 2001 1:32 PM
 To: Darren Gamble; [EMAIL PROTECTED]
 Subject: Re: [PHP] Using @file


 Sorry that was a typo, it is a period, I mistyped into the email.  If it
 cant resolve the name, what would cause that problem?

 Jeff
 - Original Message -
 From: Darren Gamble [EMAIL PROTECTED]
 To: 'Jeff Lewis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, December 10, 2001 3:19 PM
 Subject: RE: [PHP] Using @file


  Good day,
 
  The error means that it can not resolve the name.
 
  Replace the comma in the name with a period.
 
  -Original Message-
  From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 10, 2001 1:24 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Using @file
 
 
  I am using this line in part of my code but am getting an error that
looks
  like below:
 
  Code:
  $serverDetails =
  @file(http://www.myserver,com/versions.php?l=$scripturlv=$version;);
 
  Error:
  2: php_network_getaddresses: gethostbyname failed
  (c:\inetpub\wwwroot\yabbse\Sources\Admin.php ln 43)
 
  What would be causing this error?  It works on some machines but not
 others?
 
  Jeff
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Template class

2001-12-10 Thread Wolfram Kriesing

(just in case any of the people on PEAR-DEV will read this at all,
since everyone must be tired of the template class debates :-)  )

i just wanted to say what i had to write, because i didnt see any of
the existing template classes/engines provide me with that

the main features are:
# compiling template class which (almost) only replaces '{' by ?php
and '}' by ?, with pre and post filters
# uses indention to create the '{' and '}' for php-code inside the
template, so clean code is a requirement and no closing tags like:
{/if} are needed
# leaves all the power of php to you, not only the functionality the
template engine implements
# nothing to learn, just use '{' and '}' instead of the php-tags in
your template and indent your code properly
# the seperation of source and representation is all up to the
programmer (either this is good or bad)
# provides some default filter


a possible template
-
{if(sizeof($disadvantages))}
{foreach($disadvantages as $aDisadvantage)}
li{$aDisadvantage}/li
{else}
no disadvantages registered yet :-)
-

the compiled code is nothing more than this
-
?php if(sizeof($disadvantages)) { ?
?php foreach($disadvantages as $aDisadvantage) { ?
li?=$aDisadvantage?/li
?php }  }  else { ?
no disadvantages registered yet :-)
?php }  ?
-
so you can see - easy to use, nothing to learn and should be fast :-)

feel free to have a look at
http://wolfram.kriesing.de/programming/



PS: BTW what was the decision on a multiple classes in PEAR
which do the same thing?

--
Wolfram

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Template class

2001-12-10 Thread Rasmus Lerdorf

What's the point of something like this?  Just to type { instead of ?
doesn't seem like any sort of benefit to me.

-Rasmus

On Mon, 10 Dec 2001, Wolfram Kriesing wrote:

 (just in case any of the people on PEAR-DEV will read this at all,
 since everyone must be tired of the template class debates :-)  )
 
 i just wanted to say what i had to write, because i didnt see any of
 the existing template classes/engines provide me with that
 
 the main features are:
 # compiling template class which (almost) only replaces '{' by ?php
 and '}' by ?, with pre and post filters
 # uses indention to create the '{' and '}' for php-code inside the
 template, so clean code is a requirement and no closing tags like:
 {/if} are needed
 # leaves all the power of php to you, not only the functionality the
 template engine implements
 # nothing to learn, just use '{' and '}' instead of the php-tags in
 your template and indent your code properly
 # the seperation of source and representation is all up to the
 programmer (either this is good or bad)
 # provides some default filter
 
 
 a possible template
 -
 {if(sizeof($disadvantages))}
 {foreach($disadvantages as $aDisadvantage)}
 li{$aDisadvantage}/li
 {else}
 no disadvantages registered yet :-)
 -
 
 the compiled code is nothing more than this
 -
 ?php if(sizeof($disadvantages)) { ?
 ?php foreach($disadvantages as $aDisadvantage) { ?
 li?=$aDisadvantage?/li
 ?php }  }  else { ?
 no disadvantages registered yet :-)
 ?php }  ?
 -
 so you can see - easy to use, nothing to learn and should be fast :-)
 
 feel free to have a look at
 http://wolfram.kriesing.de/programming/
 
 
 
 PS: BTW what was the decision on a multiple classes in PEAR
 which do the same thing?
 
 --
 Wolfram
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php as cron

2001-12-10 Thread Martin Towell

to stop errors from being email to you, redirect stderr to /dev/null:
*/2 * * * * /home/crontest.php  /dev/null 2 /dev/null

-Original Message-
From: Jay Paulson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 6:19 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] php as cron


I was wondering how to disable the auto email after the cron job is done.
How exactly do you disable it?

thanks for the help btw!

- Original Message -
From: Shane Wright [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 10, 2001 12:47 PM
Subject: Re: [PHP] php as cron


 Hi

 You probably need to set the path to your PHP binary in crontab.

 Alternatively (this is probs a better way), wrap the whole lot up in a
simple
 shell script and get cron to run the shell script.

 It's easier than it sounds...

 #!/bin/bash
 cd /path/to/php/scripts
 php  myscript.php  /dev/null

 (also, I tend not to have PHP direct output to /dev/null, but to configure
 cron not to send emails on completion - that way you get the info when you
 run the script on the command line but dont get overrun with pointless
emails)

 Hope that helps :)

 --
 Shane

 On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
  I'm trying to test php running as a cron job and I have installed php as
a
  CGI in /usr/local/bin and I have edited my crontab file to call a php
file
  every two minutes.  However, it's not working and I was wondering if you
  all would know what's going on.  Anyway, here's how I have things set
up.
 
  crontab file:
  */2 * * * * php /home/crontest.php  /dev/null
 
  crontest.php:
  #!/usr/local/bin/php -q
  ?php
  mail([EMAIL PROTECTED],cron test, testing,NULL);
  ?
 
  email I'm receiving with error:
  Subject: Cron  php /home/crontest.php  /dev/null
  Body: /bin/sh: php: command not found
 
  thanks for any help.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



RE: [PHP] php-4.1.0 distribution broke??

2001-12-10 Thread Bob Scott

Bizzare --

About 2 hours ago http://www.php.net/downloads.php

listed 4.1.0 dated 10 Dec 2001 as being the latest release.

Now it's back to 4.0.6

I guess I will wait :)

Thanks
-bob

--
Bob Scott   Web / DB Developer
http://www.covalent.netCovalent Technologies, Inc.

On Mon, 10 Dec 2001, Maciej Uhlig wrote:

 as far as I can see the current release is 4.0.6.

 did you see any announcement about 4.1.0?

 they'll let you know when 4.1.0 is released. just be patient :-)

 Maciek

  -Original Message-
  From: Bob Scott [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 10, 2001 10:06 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] php-4.1.0 distribution broke??
 
 
  Hello all!
 
  I've tried several times today to get the
  latest PHP (4.1.0) tarball from php.net (as well as
  a few mirror sites) and it looks like the
  tarball is broken...!
 
  Anyone having like problems??




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Redirect function

2001-12-10 Thread Steve Osborne

Is there a function or command in php that will redirect a user to another
page, similar to Response.Redirect(URL) in ASP?

Steve Osborne
Database Programmer
Chinook Multimedia Inc.
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] I can't see the PHP variables....

2001-12-10 Thread Javier Morquecho Morquecho

Hi..

I'm making changes to an PHP application (Postnuke).

The problem is than I can not see the PHP variables, like
echo host=.$HTTP_HOST;

But just in a specific modulethe question is, is there a PHP
instriction to enable an disable those variables???..

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Redirect function

2001-12-10 Thread Martin Towell

header(location: $url);

-Original Message-
From: Steve Osborne [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 11:36 AM
To: PHP-General (E-mail)
Subject: [PHP] Redirect function


Is there a function or command in php that will redirect a user to another
page, similar to Response.Redirect(URL) in ASP?

Steve Osborne
Database Programmer
Chinook Multimedia Inc.
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



[PHP] Re: Shell scripting

2001-12-10 Thread J Smith


Add the -q argument to the php command, i.e.

$ php -q

or edit the first line of your script to something like this:

#!/path/to/php -q

There are some other arguments to the cgi executable. Use the -h argument 
for details.

J



Dan McCullough wrote:

 I am setting up a shell script to provide a menu for some tasks that our
 server admin would like to do via script rather then vi'ing the file, now
 I am almost finished but I would like to get rid of this ugly part of the
 output.
 
 X-Powered-By: PHP/4.0.4pl1
 Content-type: text/html
 
 Is there away that I can get the echo to stay off for that part.
 
 dan
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] get data from file

2001-12-10 Thread Kurth Bemis

I need to get data from a web page generated by mrtg in my page

i have come up with the following code

?php
$file = /virt/usaexpress/www/noc/mrtg/216.107.214.1_4.html;

 $string = implode(\n, file($file));
 $string1 = explode(META HTTP-EQUIV=\Content-Type\ 
CONTENT=\text/html; charset=iso-8859-1\, $string);
$string2 = explode(/HEAD, $string1[1]);

$stat = eregi(!--(.*)--,$string2[0]);

echo $stat;
//while (list ($key, $val) = each ($string3)) {
 //echo $key = $valbr;
//}

?

however - I get a 1 when look on the php site - under manual...

any ideas?

~kurth


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] @file problems w/ remote files

2001-12-10 Thread Joseph Fung

Hi,

This is regarding the same problem that Jeff posted earlier (yes, the exast
same problem - I'm working with him).  He seems to have given some of you
the wrong impression about the problem - he is not ignoring your posts, it's
just that the posts aren't helping the problem ;)

The problem is that the @ isn't suppressing the warnings properly.  Our code
is currently trying to pull the results of a script off a server - and if it
can't, it uses the most current copy stored locally.  The problem, is that
while we are expecting the @ to suppress the warnings (and thereby letting
us continue on to use file() on the local copy), it is instead allowing file
to spit out a warning which kills the script.

We are currently getting a errornum of 2, and it's spitting out
fopen(filename) - Success which is exceedingly annoying.

What would be perfect, is if someone knows of an alternate way to download a
file from a server - if that failed, set a flag and continue processing
rather than simply erroring out.

Thanks for any help - sorry for the miscommunication earlier.

Joseph


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] time stuff

2001-12-10 Thread natesanden

Was wondering if anyone could help?


suppose the date is 12-10-01

--
$timestamp = time();
 
//this is the sent on date
 $yd_expl = explode(':',08-01-01);

 
$today=mktime(0,0,0,strftime('%m',$timestamp),strftime('%d',$timestamp),strftime('%y',$timestamp));
 $sent=mktime($yd_expl[0],$yd_expl[1],$yd_expl[2]);
 if($today  $sent)
 { $bgcolor=white; }
 else
 { $bgcolor=lightblue; }


it returns$today: 1007971200
 $sent: 100800

I want it to return a smaller number for sent on (since the sent on date is before 
todays date), than it does for today

Thanks



[PHP] Re: Redirect function

2001-12-10 Thread Hugh Bothwell


Steve Osborne [EMAIL PROTECTED] wrote in message
000901c181db$bfca1f40$[EMAIL PROTECTED]">news:000901c181db$bfca1f40$[EMAIL PROTECTED]...
 Is there a function or command in php that will redirect a user to another
 page, similar to Response.Redirect(URL) in ASP?


header(Location: http://www.MyNewUrl.com/index.php;);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: time stuff

2001-12-10 Thread Hugh Bothwell


[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 suppose the date is 12-10-01
 --
 $timestamp = time();
 
 //this is the sent on date
 $yd_expl = explode(':',08-01-01);

Uh, better make that
... = explode('-', '08-01-01');

Otherwise I think you'll get { 6 } instead of { 8, 1, 1 }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to use gd/php with no freetype?

2001-12-10 Thread Rasmus Lerdorf

Yes, you are out of luck without Freetype.  You need to install Freetype, 
then build GD against that and then finally build PHP against that 
Freetype-enabled GD.  

As for your second question, the ImageTTFText() function takes the TTF 
font filename as an argument.  See php.net/imagettftext

-Rasmus

On Thu, 6 Dec 2001 [EMAIL PROTECTED] wrote:

 Hello and thanks for your time. 
 
  After endless searching, I am still lost
 
 let's just assume I can't install freetype, and it looks like that for 
 matters I won't get into. (linux, raq 3) 
 
 What solution would allow me to specify fonts for text written into images? 
 Instead of using the default font, imagine I want to use helvetica. Am I 
 out of luck without freetype? And if somehow I get freetype installed does 
 php allow the method to name the font such as Arial and if so, which file 
 do I edit so by default I can specify the font so the text written to the 
 image looks as I intended? Thanks. I searched and couldn't find answer to 
 both q's, esp. the first. 
 
 Joel
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Emailing attachments upload to a form

2001-12-10 Thread Ben Clumeck

When I use the script to upload an attachment to my form it does not email
the attachment.  I am using the mail() function to email the results of the
form to me. Is there any other code I need to put in my mail() function to
make this work, if so where would I put it?

I am currently using the following code:
?
mail ([EMAIL PROTECTED], Form Results, Name: $name\nMessage:
$message\nAttachment: $attachment, From: $fromemail);
?

Thanks,

Ben


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] exec problems

2001-12-10 Thread J. Heffner

Hello,

I need to write a script that will stuff the names of all the files 
in a directory into an array, which I can then use for some 
adminstrative processing. Seems easy enough:

exec (ls, $fileArray, $isComplete);

This will run fine if I call the php file containing this code from 
bash (using the php cgi), but not if I use it inside a php file 
accessed via the web server. I'm running apache with suexec enabled 
on a Redhat Linux box.

Looking in the error log revealed the following error:

/ls: No such file or directory

I thought it might have something to do with the absence of a path 
name, so I added the fully qualified path to the command string, but 
unfortunately,  that didn't make any difference.  Php version is 
4.0.3pl1.

Thanks for your help.

jh

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Uploading files with FORM METHOD=POST on webhostings

2001-12-10 Thread M

Hello, first of all, thanks very much for your answer about WAP and WML
php headers. I corrected headers and page works ok now.

==

Now a question about uploading files (.gif .jpg) using form
method=post to be stored into Mysql blob fields.

I hope somebody here having sites on www.blueboxinternet.com hosting
company, because I have big trouble there I can't solve, and support
says I first shoud read faq because they have lot of customers with no
problems.

I make industrial and commercial catalogs, so my customers should be
able to send (upload) pictures of products and goodies directly from
their HD to site, these pictures stored in Mysql tables and shown when
customer pages are called by someone.
The only way I know to perform this is

html
Form actionmyscript.php method=POST Enctype=MULTIPART/FORM-DATA
Enter filename input type=file name=myfile
Input type=submit name=upload value=send
/form

?PHP
  if($upload)
  {
$fp=Fopen ($myfile,r);

   /* here lot of commands to store file into mysql tables */
...
  }
?
/html

This script will store picture-file into some tmp directory on bluebox
servers and will return tmp file name into $myfile var when script
called again by 'form action' command. Then I can treat file and store
in DB.

This script worked fine on bluebox servers  until NOVEMBER 1st ,
when they made some important changes on their servers. When this change
happened, my script began to receive this error:

Warning: open_basedir restriction in effect. File is in wrong directory
in
/home/httpd/vhosts/meucatalogo.com/web_users/gratis/rest_prox.php on
line 25

Bluebox support says I am recording my files on tmp directory with owner
'someowner' and trying to read file with 'anotherowner' owner.
I argue I have no control about owners and file modes into their servers
(specially into their tmp directories), and that PHP performs this task
in a transparent way for me. Thats to say, I have no tools to bypass
this problem.
Then they answer I shoud read faq.

Case some of you have site using this (otherwise excellent web hosting)
company, I would greatly appreciate what solution for upload files thru
HTML forms there exists.

Thanks very much

Miguel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] exec problems

2001-12-10 Thread Brian Clark

* J. Heffner ([EMAIL PROTECTED]) [Dec 10. 2001 20:06]:

 I need to write a script that will stuff the names of all the files 
 in a directory into an array, which I can then use for some 
 adminstrative processing. Seems easy enough:
 
 exec (ls, $fileArray, $isComplete);
 
 This will run fine if I call the php file containing this code from 
 bash (using the php cgi), but not if I use it inside a php file 
 accessed via the web server. I'm running apache with suexec enabled 
 on a Redhat Linux box.
 
 Looking in the error log revealed the following error:
 
 /ls: No such file or directory

It is possible that your (host's?) server has safe_mode enabled and 
you or someone else has set safe_mode_exec_dir. Just a guess.

http://www.php.net/manual/en/features.safe-mode.php

-- 
 -Brian Clark


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] what is Trans-sid in PHP

2001-12-10 Thread John King

Running a script that requires:

Trans-sid enabled in php

How would I find if this is enabled or disabled? Did a phpinfo() on the
server but could not find this? Was it a misprint?

Thanks,

John 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Single character input on command line

2001-12-10 Thread August Zajonc

Interested in getting a single character at a time on the command line using
php.

ie, I'd like to type 2 and be able to trap that keystroke right away and act
on it.

Before spending a lot of time tracking down possibilites (readline
input_buffer, reading the stdin pipe) thought I'd ask if anyone's done this
already and has an elegant way I'm missing.

Thanks,

- August


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Single character input on command line

2001-12-10 Thread Martin Towell

i'd be interested in knowing this too (for future reference...)

-Original Message-
From: August Zajonc [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 1:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Single character input on command line


Interested in getting a single character at a time on the command line using
php.

ie, I'd like to type 2 and be able to trap that keystroke right away and act
on it.

Before spending a lot of time tracking down possibilites (readline
input_buffer, reading the stdin pipe) thought I'd ask if anyone's done this
already and has an elegant way I'm missing.

Thanks,

- August


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



[PHP] Encrypted pages/email with PHP?

2001-12-10 Thread Erica Douglass

(posting again because it looks like the first one didn't go through)

Hi,

I've sniffed around on Google and PHPBuilder, but I can't seem to find any
information on creatnig encrypted pages with PHP.

Here is what I am looking for. I have a client who owns a retail store.
Thus, he has a manual credit card swiper. He would like to have orders from
his website listed on a special page with the customer's name, credit card
number, etc. where he can go once a day and process the orders manually. I
explained that he could also have the customer data sent in an encrypted
email, and he is fine with that.

Anyway, I'm looking for some solution that creates an encrypted page,
passworded, where I can make sure that the information is not being passed
down the wire in plain-text. I can't seem to find a good tutorial explaining
exactly what I would need to create this. Will I need to buy a
Thawte/Verisign ID just for this? (That seems unreasonable, as he would be
the only one accessing the page.) How would I go about setting this up?

I run my own server, so I can install programs to do this. Currently I'm
running on a Cobalt RaQ (http://www.cobalt.com). Any links regarding setting
this sort of site up would be helpful.

Thanks,
Erica

P.S. After my experience, I'd be happy to create a tutorial regarding this
if there isn't one already. Assuming I complete this successfully, I will
post the results back to this list.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] what is Trans-sid in PHP

2001-12-10 Thread Jon Niola

When you doa  phpinfo()  look at the top block. you will probably see 
something like ./configure --enable-track-vars --enable-trans-sid etc. If 
it is not here your PHP module was not compiled with trans-sid enabled.

--Jon

At 09:13 PM 12/10/2001 -0500, John King wrote:
Running a script that requires:

Trans-sid enabled in php

How would I find if this is enabled or disabled? Did a phpinfo() on the
server but could not find this? Was it a misprint?

Thanks,

John

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Redirect + SESSION question!!!

2001-12-10 Thread Mehmet Kamil ERISEN

Hello All,
I have switched hosting companies.  previous server was
php4.04pl1 now I am on a server that is php4.06.

I have a file (functions.php) that stores all my SESSION
and other functions.  A Header file, that has the general
feel and look of the site. In brief most of my pages have 
include(functions.php);
include(header.php);

I also use the Header(Location: mysite.com) kind of
functions a lot.

Well, it worked fine in the prev server, now it does not. I
read the documentation
(http://download.php.net/manual/en/function.header.php)
, and it suggests to use of the ob_start() and 
ob_end_clean() etc...  I used those. I can redirect, but
now, my SESSION does not work!!!

Anybody had a similar experience? Please help... 
thanks.
erisen

__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Encrypted pages/email with PHP?

2001-12-10 Thread Adrian Teasdale

Erica

Can I suggest that you use PGP to send the information encrypted.  There is
a wonderful script which can be found here:

http://www.phpuk.org/code.php

We use this on various sites to encrypt sensitive information

In terms of a server certificate, you will need this to protect the client
from entering information into a form on the site.  Server certs encrypt the
traffic between the browser and the server.

Hope this helps

Ade

--- i n o v i c a h o s t i n g . c o m --

Powerful hosting from www.inovicahosting.com





 -Original Message-
 From: Erica Douglass [mailto:[EMAIL PROTECTED]]
 Sent: 11 December 2001 03:48
 To: [EMAIL PROTECTED]
 Subject: [PHP] Encrypted pages/email with PHP?


 (posting again because it looks like the first one didn't go through)

 Hi,

 I've sniffed around on Google and PHPBuilder, but I can't seem to find any
 information on creatnig encrypted pages with PHP.

 Here is what I am looking for. I have a client who owns a retail store.
 Thus, he has a manual credit card swiper. He would like to have
 orders from
 his website listed on a special page with the customer's name, credit card
 number, etc. where he can go once a day and process the orders manually. I
 explained that he could also have the customer data sent in an encrypted
 email, and he is fine with that.

 Anyway, I'm looking for some solution that creates an encrypted page,
 passworded, where I can make sure that the information is not being passed
 down the wire in plain-text. I can't seem to find a good tutorial
 explaining
 exactly what I would need to create this. Will I need to buy a
 Thawte/Verisign ID just for this? (That seems unreasonable, as he would be
 the only one accessing the page.) How would I go about setting this up?

 I run my own server, so I can install programs to do this. Currently I'm
 running on a Cobalt RaQ (http://www.cobalt.com). Any links
 regarding setting
 this sort of site up would be helpful.

 Thanks,
 Erica

 P.S. After my experience, I'd be happy to create a tutorial regarding this
 if there isn't one already. Assuming I complete this successfully, I will
 post the results back to this list.



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Redirect + SESSION question!!!

2001-12-10 Thread Mehmet Kamil ERISEN

I am almost there folks.  The issue is being resolved by
using the ob_start(garbage); at the begining of the
login.php script, and ob_end_flush(); at the end of the
login.php script (in case the authentication fails and user
stays on the page), and also put ob_end_flush(); at the top
of the index.php page.
Woow. I guess the problem was all the sudden the $SESSION[]
operations were considered output bu Header().

Gurus, do you think I am filling up my pages with garbage,
or what I am saying is making sense?

Thanks.
Erisen
--- Mehmet Kamil ERISEN [EMAIL PROTECTED] wrote:
 Hello All,
 I have switched hosting companies.  previous server was
 php4.04pl1 now I am on a server that is php4.06.
 
 I have a file (functions.php) that stores all my SESSION
 and other functions.  A Header file, that has the general
 feel and look of the site. In brief most of my pages have
 
 include(functions.php);
 include(header.php);
 
 I also use the Header(Location: mysite.com) kind of
 functions a lot.
 
 Well, it worked fine in the prev server, now it does not.
 I
 read the documentation
 (http://download.php.net/manual/en/function.header.php)
 , and it suggests to use of the ob_start() and 
 ob_end_clean() etc...  I used those. I can redirect, but
 now, my SESSION does not work!!!
 
 Anybody had a similar experience? Please help... 
 thanks.
 erisen
 
 __
 Do You Yahoo!?
 Check out Yahoo! Shopping and Yahoo! Auctions for all of
 your unique holiday gifts! Buy at
 http://shopping.yahoo.com
 or bid at http://auctions.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]