php-general Digest 14 Dec 2002 19:55:50 -0000 Issue 1763
Topics (messages 128272 through 128292):
Re: Text Fields - How Big Can They Be?
128272 by: Jason Wong
Re: Problems with text files from a Mac
128273 by: Justin French
Re: Is there any alternative to FuseBox?
128274 by: Jason Wong
128288 by: Javier
128292 by: Jason Wong
Re: Mail Error
128275 by: Jason Wong
Re: File Upload
128276 by: Tom Rogers
128277 by: Jason Wong
128280 by: Paul Roberts
128281 by: Paul Roberts
128282 by: Bogdan Stancescu
128283 by: Jason Wong
session_start
128278 by: John Taylor-Johnston
I did: Re: session_start
128279 by: John Taylor-Johnston
128284 by: Jason Wong
php --with-GD
128285 by: info.t-host.com
migrating from register_globals on to off
128286 by: Willem
128287 by: John W. Holmes
php --with-gd support
128289 by: info.t-host.com
Compiling PHP and RH Linux
128290 by: Todd Cary
128291 by: Chris Hewitt
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Saturday 14 December 2002 15:46, Monty wrote:
> Hi John, I'm using POST for the form. But it's the HTML form field itself
> that won't allow me to paste in a large amount of text. If I can get the
> field to accept the text, there's no problem sending it via POST to the PHP
> script.
I think that is browser-dependent. For example, for NN (4.x) I think it was
64K.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
If you don't strike oil in twenty minutes, stop boring.
-- Andrew Carnegie, on public speaking
*/
--- End Message ---
--- Begin Message ---
1. they can export the CSV as DOS/Windows from Excel on the Mac with ease
2. they can pipe the CSV thru any text editor that lets them choose between
mac/win/unix line endings (BBEdit/Lite for example)
3. $filecontents = str_replace('\r', '\n', $filecontents); //should work
on 13/12/02 1:22 PM, Sterling Anderson ([EMAIL PROTECTED]) wrote:
> I am working on an application for a school district and am having some
> problems with the files they are supplying for import.
> They are supplying data files and I am writing routines to populate the
> database using these files. Its a simple file upload then I just need to
> parse through the tab separated value file. I am using the most recent
> PHP build on Windows with IIS ISAPI and a MSSQL database. They are
> sending text files from a Macintosh application.
> I noticed on the documentation for fgetcsv() that it cannot read the end
> of line character on Mac files. I have not been able to find a good work
> around for this issue. When I grab the entire contents of the file then
> try doing a string replacement on the "\r" or even "\t" for that matter
> it does not work.
> Has anyone found a good solution for dealing with Mac files?
>
Justin French
--------------------
http://Indent.com.au
Web Development &
Graphic Design
--------------------
--- End Message ---
--- Begin Message ---
On Saturday 14 December 2002 12:25, Javier wrote:
> I was reading FuseBox's beginners' guide but I didn't completely understood
> the way that framework works.
>
> How do you process the data obtained from forms? Is it the same script that
> displays the form?
Doesn't fusebox have it's own mailing list where you can ask questions? If so
wouldn't that be a better place to do so?
In answer to the question in your subject:
http://marc.theaimsgroup.com/?l=php-general&m=103964196113392&w=2
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
The big cities of America are becoming Third World countries.
-- Nora Ephron
*/
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Jason Wong) wrote in
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:
Hi, sorry that I didn't make it clear.
I'm looking for an alternative to php-fusebox.
So I was asking how do you process the data from forms and so.
> On Saturday 14 December 2002 12:25, Javier wrote:
>> I was reading FuseBox's beginners' guide but I didn't completely
>> understood the way that framework works.
>>
>> How do you process the data obtained from forms? Is it the same
>> script that displays the form?
>
> Doesn't fusebox have it's own mailing list where you can ask
> questions? If so wouldn't that be a better place to do so?
>
> In answer to the question in your subject:
>
> http://marc.theaimsgroup.com/?l=php-general&m=103964196113392&w=2
>
--
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)
--- End Message ---
--- Begin Message ---
On Saturday 14 December 2002 23:57, Javier wrote:
> [EMAIL PROTECTED] (Jason Wong) wrote in
> [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:
>
> Hi, sorry that I didn't make it clear.
> I'm looking for an alternative to php-fusebox.
For processing of forms, there are a number of classes on www.phpclasses.org
which do the job just fine.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Be cheerful while you are alive.
-- Phathotep, 24th Century B.C.
*/
--- End Message ---
--- Begin Message ---
On Saturday 14 December 2002 11:34, Manuel Ochoa wrote:
> I have a Windows server running Apache 2 and PHP 4.3
>
> I got the following error while using the mail() function:
> Warning: mail() [function.mail]: SMTP server response: 550 User not local.
> We don't relay in C:\Apache2\htdocs\mymail.php on line 22 Any ideas?
The smtp server specified in php.ini does not allow you to send mail.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Good salesmen and good repairmen will never go hungry.
-- R.E. Schenk
*/
--- End Message ---
--- Begin Message ---
Hi,
Saturday, December 14, 2002, 5:55:12 PM, you wrote:
JW> On Saturday 14 December 2002 11:35, Tom Rogers wrote:
>> You are missing this bit:
>>
>> <input type="hidden" name="MAX_FILE_SIZE" value="100000">
JW> I am curious as to why so many people say this in response to file upload
JW> problems?
JW> In practice, none of my upload forms have that "missing bit" but they work
JW> perfectly well using a diverse range of browsers (NN, IE, Mozilla, Opera,
JW> Konqueror).
JW> Could you provide me with an example where your upload would not work without
JW> that "missing bit"?
JW> --
Jason Wong ->> Gremlins Associates -> www.gremlins.biz
JW> Open Source Software Systems Integrators
JW> * Web Design & Hosting * Internet & Intranet Applications Development *
JW> /*
JW> He's like a function -- he returns a value, in the form of his opinion.
JW> It's up to you to cast it into a void or not.
JW> -- Phil Lapsley
JW> */
Just clutching at straws as there was no mention of which browser was being used
and it may have been needed as this is a browser directive. I have never had
trouble uploading files with or without that setting.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
On Saturday 14 December 2002 16:40, Tom Rogers wrote:
> Just clutching at straws as there was no mention of which browser was being
> used and it may have been needed as this is a browser directive. I have
> never had trouble uploading files with or without that setting.
Ah, so in your case you're quoting an urban legend ;-)
I would really like to hear of a case where an upload fails *just because of*
not putting in that hidden element. I've asked on the list before but never
got any definite responses.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
You can't hold a man down without staying down with him.
-- Booker T. Washington
*/
--- End Message ---
--- Begin Message ---
the legend starts here
http://www.php.net/manual/sk/features.file-upload.php
"The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field must precede the
file input field and its value is the maximum filesize accepted. The value is in
bytes."
it also notes
"The MAX_FILE_SIZE is advisory to the browser. It is easy to circumvent this maximum.
So don't count on it that the browser obeys your wish! The PHP-settings for
maximum-size, however, cannot be fooled. "
Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 14, 2002 8:53 AM
Subject: Re: Re[2]: [PHP] File Upload
On Saturday 14 December 2002 16:40, Tom Rogers wrote:
> Just clutching at straws as there was no mention of which browser was being
> used and it may have been needed as this is a browser directive. I have
> never had trouble uploading files with or without that setting.
Ah, so in your case you're quoting an urban legend ;-)
I would really like to hear of a case where an upload fails *just because of*
not putting in that hidden element. I've asked on the list before but never
got any definite responses.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
You can't hold a man down without staying down with him.
-- Booker T. Washington
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
what version of php are you using?
----- Original Message -----
From: "Miro Kralovic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 14, 2002 3:52 AM
Subject: RE: [PHP] File Upload
Thanks Tom, but still no luck.. it seems like it doesn't recognize $testfile
variable at all in PHP script, even thought the globals are ON...
You are missing this bit:
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Ok, have you tried
<?
echo("<pre>");
print_r($_FILES);
echo("</pre>");
?>
at the beginning of the 2nd script? What does it say?
Bogdan
Miro Kralovic wrote:
Hi Bodgan..
yes, I have globals On, Uploads On and SafeMode=off.. no luck...
I did it exactly by the book, damn it..:-(
-----Original Message-----
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 22:09
To: [EMAIL PROTECTED]
Subject: [PHP] Re: File Upload
Globals on? File uploads allowed? Safe mode off?
--- End Message ---
--- Begin Message ---
On Saturday 14 December 2002 18:26, Paul Roberts wrote:
> the legend starts here
> http://www.php.net/manual/sk/features.file-upload.php
>
> "The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field must
> precede the file input field and its value is the maximum filesize
> accepted. The value is in bytes."
I know, I've rftm :)
> it also notes
>
> "The MAX_FILE_SIZE is advisory to the browser. It is easy to circumvent
> this maximum. So don't count on it that the browser obeys your wish! The
> PHP-settings for maximum-size, however, cannot be fooled. "
Exactly. What that says to me is that it is optional. If you include it then
the browser may or may not use it. But if you don't include it then your
browser would allow you to upload any size of file.
However, the point is that a number of people seem to be implying that uploads
only worked for them *after* they've added that MAX_FILE_SIZE thing. But
there isn't any concrete evidence to show that the lack of the MAX_FILE_SIZE
thing does have any effect on whether or not one can upload.
If you have spare time on your hands go through the archives for problems
related to file uploads, invariably someone would suggest adding
MAX_FILE_SIZE. To me, I think it's a load of cobblers, unless someone can
show me otherwise :)
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Preudhomme's Law of Window Cleaning:
It's on the other side.
*/
--- End Message ---
--- Begin Message ---
I used to think I knew how to do this ... take pity :)
I start my session:
session_name("TestALS");
session_start();
I register a variable:
session_register("studentid");
if (isset($_SESSION["studentid"]))
{
$id = $_SESSION["studentid"];
echo "\$studentid= $studentid<br>";
}
Pretend $studentid contains something from a previous form.
Here is my form with nothing else other than a submit button. But the variable does
not get passed unless I add a field. Where did I go wrong? Geez, I know I don't have
to repeat a whole bunch of <input type=hidden name=studentid>. That is what a session
is for.
<form action=this.php>
<input type=submit>
</form>
Should I pass the session id? How? Why does my variable "studentid" NOT get passed
after I click submit. Where did I f*** up?
Like I said, take pity. I have been reading the FAQ:
http://www.php.net/manual/en/ref.session.php
And like I also said, I thought I knew how to do this :)
John
--- End Message ---
--- Begin Message ---
I did call session_start() before anything is output to the browser.
http://www.php.net/manual/en/function.session-start.php
I only have one php file so I know I'm recyling my code each time:
session_name("TestALS");
session_start();
session_register("studentid");
if (isset($_SESSION["studentid"]))
{
$id = $_SESSION["studentid"];
echo "\$studentid= $studentid<br>";
}
--- End Message ---
--- Begin Message ---
On Saturday 14 December 2002 17:19, John Taylor-Johnston wrote:
> I did call session_start() before anything is output to the browser.
> http://www.php.net/manual/en/function.session-start.php
>
> I only have one php file so I know I'm recyling my code each time:
>
> session_name("TestALS");
> session_start();
>
> session_register("studentid");
> if (isset($_SESSION["studentid"]))
> {
> $id = $_SESSION["studentid"];
> echo "\$studentid= $studentid<br>";
> }
RTFM again. Sessions depends on a number of factors including your version of
PHP and the setting of register_globals.
Basically if you're going to be using $_SESSION then you don't use
session_register(). You just assign the value directly to $_SESSION.
<?php // test-session.php
session_start();
if (!isset($_SESSION['studentid'])) { $_SESSION['studentid'] = 24; }
if (isset($_SESSION['studentid']))
{
$_SESSION['studentid']++;
$id = $_SESSION['studentid'];
echo "\$id= $id<br>";
}
?>
--- End Message ---
--- Begin Message ---
Hello List,
I want to know all about copiling, installing and configuring php with gd-support.
Anybody knows.
Oliver Etzel
--- End Message ---
--- Begin Message ---
Hello,
Lately we discovered that, by mistake, we've run PHP with register_globals
on for a few months for all our customers.
Since we want to turn it off, we need to figure out which customers use the
'register_globals' functionality so we can ask them to modify their scripts.
However, checking all php code by hand is a non-trivial task, because there
are 20,000+ php scripts. Is there a way to:
a) parse all .php scripts once and detect whether they depend on register
globals on?
or probably easier:
b) add something to our current setup so that when a scripts is executed and
uses the register globals functionality, we get a notification
automatically?
Any suggestions?
Thanks!
--- End Message ---
--- Begin Message ---
> Lately we discovered that, by mistake, we've run PHP with
register_globals
> on for a few months for all our customers.
>
> Since we want to turn it off, we need to figure out which customers
use
> the
> 'register_globals' functionality so we can ask them to modify their
> scripts.
Why do you want to turn it off? Turning register_globals off doesn't
instantly make your scripts more secure, by any means. All it does is
invite people that depend on it to write a quick work around that
emulates register_globals as best as they can and they drive on with the
same issues the _might_ of had before. The problem is not with
register_globals, it's with poor logic in scripts that do not initialize
their own variables.
> However, checking all php code by hand is a non-trivial task, because
> there
> are 20,000+ php scripts. Is there a way to:
>
> a) parse all .php scripts once and detect whether they depend on
register
> globals on?
>
> or probably easier:
>
> b) add something to our current setup so that when a scripts is
executed
> and
> uses the register globals functionality, we get a notification
> automatically?
No, there's no way to do that very easily. I guess you could parse one
of their HTML forms and parse the ACTION page of the form and check for
_POST, _GET, or maybe even HTTP_GET_POST or HTTP_GET_VARS, but that's no
definitive answer that every script they have uses globals or not.
Bottom line, the best thing you can do is to educate your customers on
how to write PHP scripts correctly and advise them to turn register
globals off on their own site (with .htaccess if you're using apache).
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
Hello List,
I want to know all about copiling, installing and configuring php with gd-support.
Anybody knows a good site or book to read about?
Oliver Etzel
--- End Message ---
--- Begin Message ---
I am new to Linux, so the syntax is still quite foreign for setting up compiles.
Here is what I need to do:
Compile PHP with MySQL, Interbase, and the GD library and then compile Apache
so that it has the newly compiled PHP integrated. Can someone refer me to
some literature on the correct syntax and order for doing this?
Todd
--- End Message ---
--- Begin Message ---
Todd Cary wrote:
I am new to Linux, so the syntax is still quite foreign for setting up
compiles. Here is what I need to do:
Compile PHP with MySQL, Interbase, and the GD library and then compile
Apache so that it has the newly compiled PHP integrated. Can someone
refer me to some
The INSTALL file that comes with the PHP source is quite good, have you
looked at that? Or maybe you do not feel it is enough for your needs?
What Linux are you using? Do you need a particular version of PHP or
Apache? Most linux distributions come with both. If you did an "install
everything" then you probably already have it. I don't know Interbase,
you may need to install some Interbase files to support that. If you
feel you need to recompile, then you need the sources not just the
binaries installed on your computer.
If you have Apache already compiled with mod_so (most seem to) and you
are happy to have PHP as a DSO (OK for many situations), then you would
not need to recompile Apache.
HTH
Chris
--- End Message ---