php-general Digest 6 Mar 2004 14:08:01 -0000 Issue 2630

Topics (messages 179621 through 179646):

Re: UK Bank Holidays 2
        179621 by: Tom Rogers
        179625 by: Ben Ramsey
        179627 by: Ryan A
        179631 by: Shaun
        179633 by: Jason Wong
        179634 by: Shaun
        179635 by: electroteque
        179636 by: Jason Wong

Re: FIle Upload problems
        179622 by: Andre Cerqueira
        179623 by: Brian V Bonini
        179624 by: Jason Wong
        179644 by: Brian V Bonini

Re: php/mysql run on  Microsoft Personal Web Server 4.0 ?
        179626 by: Five

Let's start a php-advanced list!
        179628 by: Galen
        179629 by: Rasmus Lerdorf
        179630 by: Jason Wong
        179632 by: electroteque
        179646 by: Brian V Bonini

Am i dreaming or is the php frontpage broken ?
        179637 by: electroteque

Newbie
        179638 by: Amimu Austin
        179645 by: Brian V Bonini

Re: undefined index -------- please help !!!!!!!!
        179639 by: Dominique ANOKRE
        179641 by: John Nichel

when is a PDF not a PDF?
        179640 by: Rick Fleischer

Re: odd, sporatic upload problem ...
        179642 by: Raditha Dissanayake

How to write this correctly?
        179643 by: Labunski

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 ---
Hi,

Saturday, March 6, 2004, 12:03:15 PM, you wrote:
TR> Hi,

TR> Saturday, March 6, 2004, 10:39:13 AM, you wrote:
S>> Hi,

S>> How can PHP recognise dates that are UK Bank Holidays?

S>> Thanks for your help


TR> Well first question is:
TR> What are the rules for a bank holiday in the UK
TR> is it  the first monday of a month, after christmas day , new year
TR> etc..

TR> If there is such a rule PHP can usually dig it out. If they are
TR> decided by committee then you are on your own :)

TR> -- 
TR> regards,
TR> Tom


This may help you

http://www.dti.gov.uk/er/bankhol.htm

Probably the best way to tackle this is to store the info in a table
as it looks like it is decided by rules, committee and the Queen

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
WTF? isnt this the second time today this has appeared on the list?

Dude, other than the people in the UK nobody cares about
UK bank holidays...search google for this query and maybe someone from
there has written something for it..or read the manual a couple of times and
you'll see that the bottom question is a real dumb one.


Ryan: Well, that's not a very nice way to treat someone on the list, even if it was the second time you'd seen the question in the same day or even if it was a question that is obviously in the manual. Some people are just at different proficiencies in their learning process and don't yet know to go to the manual for certain questions. If we treated every newbie like this, then we wouldn't have people coding in PHP!

Shaun: Consequently, the question was a valid one that the manual could not answer, and the short answer is, "no." PHP does not have an intrensic way of telling on what dates UK banking holidays fall (mainly because not everyone coding PHP lives in the UK). You will need to write your own function for this. The easiest way would be to just look at a calendar for several years in advance and just plug all the dates into an array and test the array to see if today's day is in there. If it is, then today is a banking holiday.

Hope that helps.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey

--- End Message ---
--- Begin Message ---
> Ryan:  Well, that's
> not a very nice way to treat someone on the list,
> even if it was the second time
> you'd seen the question in the same day
> or even if it was a question that is obviously in the manual.  Some
> people are just at different proficiencies in their learning process and
> don't
> yet know to go to the manual for certain questions.  If we treated
> every newbie like this, then we
> wouldn't have people coding in PHP!

Hi _uncle_ Ben,
I have nothing against newbies or newbie questions even though I may read
questions like which is the
best shopping cart, best PHP IDE etc 3+ times in a month, or why
register_globals are better off or why
"this code does not work" when its just a semicolon missing...although I
must say the most frequient seems
to be then ones where people write to the list without even trying to do a
single word search on google.
I too was a newbie and compared to some
guys on the list I still most certainly am. But when you write a question
that does not get answered the first
time round...then retry a bit later is just downright irritating. If the guy
wrote some code a bit later on to do
his "holiday thing" and hit a wall...I and a crapload of people here will be
most willing to lend a hand if he needed
help, theres just gotto be a limit. If the guy thought that the first
message didnt get through then its cool...but by
the 2 in the subject.....COME ON for petes sake.
Anyway, you have your view on this so..

Cheers,
-Ryan

--- End Message ---
--- Begin Message ---
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Ryan:  Well, that's
> > not a very nice way to treat someone on the list,
> > even if it was the second time
> > you'd seen the question in the same day
> > or even if it was a question that is obviously in the manual.  Some
> > people are just at different proficiencies in their learning process and
> > don't
> > yet know to go to the manual for certain questions.  If we treated
> > every newbie like this, then we
> > wouldn't have people coding in PHP!
>
> Hi _uncle_ Ben,
> I have nothing against newbies or newbie questions even though I may read
> questions like which is the
> best shopping cart, best PHP IDE etc 3+ times in a month, or why
> register_globals are better off or why
> "this code does not work" when its just a semicolon missing...although I
> must say the most frequient seems
> to be then ones where people write to the list without even trying to do a
> single word search on google.
> I too was a newbie and compared to some
> guys on the list I still most certainly am. But when you write a question
> that does not get answered the first
> time round...then retry a bit later is just downright irritating. If the
guy
> wrote some code a bit later on to do
> his "holiday thing" and hit a wall...I and a crapload of people here will
be
> most willing to lend a hand if he needed
> help, theres just gotto be a limit. If the guy thought that the first
> message didnt get through then its cool...but by
> the 2 in the subject.....COME ON for petes sake.
> Anyway, you have your view on this so..
>
> Cheers,
> -Ryan

Hi All,

Thank you for your replies. To be perfectly honest I wanted to make my post
look like a repost because the first reply I got seemed rather flippant to
me:

[snip]
Can PHP recognise dates that are UK Bank Holidays?
[/snip]

Yes http://catb.org/~esr/faqs/smart-questions.html

I didn't want to start a posting war - ironic now I know - so I just started
a new thread.

Ryan, I may be getting out of my league here, but if the makers of PHP
didn't care about us here in the UK then why was this function created:
gmmktime();

I know reposting like this is wrong but I was just trying to make a point.

Sorry guys

--- End Message ---
--- Begin Message ---
On Saturday 06 March 2004 16:17, Shaun wrote:

[snip]

> Ryan, I may be getting out of my league here, but if the makers of PHP
> didn't care about us here in the UK then why was this function created:
> gmmktime();

What has *that* got to do with UK users? The fact is that for historical 
reasons all timezones are based off GMT (or UTC). Thus any kind of 'portable' 
timekeeping will have to be based off UTC. For instance the mail that you're 
reading will have it's Date: header expressed with reference to UTC. In short 
having functions that help convert local time to and from UTC is a good 
thing. Don't kid yourself into thinking that gmmktime() is there for UK 
users' sake :-)

> I know reposting like this is wrong but I was just trying to make a point.

Which is? In most cases reposting at such a short time interval will only 
annoy a lot people.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The probability of an auto lockout varies directly with the intensity of the 
rain
                -- Murphy's Laws of Locksmithing n11
*/

--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 06 March 2004 16:17, Shaun wrote:
>
> [snip]
>
> > Ryan, I may be getting out of my league here, but if the makers of PHP
> > didn't care about us here in the UK then why was this function created:
> > gmmktime();
>
> What has *that* got to do with UK users? The fact is that for historical
> reasons all timezones are based off GMT (or UTC). Thus any kind of
'portable'
> timekeeping will have to be based off UTC. For instance the mail that
you're
> reading will have it's Date: header expressed with reference to UTC. In
short
> having functions that help convert local time to and from UTC is a good
> thing. Don't kid yourself into thinking that gmmktime() is there for UK
> users' sake :-)
>
> > I know reposting like this is wrong but I was just trying to make a
point.
>
> Which is? In most cases reposting at such a short time interval will only
> annoy a lot people.
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> The probability of an auto lockout varies directly with the intensity of
the
> rain
> -- Murphy's Laws of Locksmithing n11
> */

I think its fairly obvious I am not an advanced PHP programmer. That's why I
said I may be getting out of my league!

I guess the point I was trying to make was that I didn't want to continue
the previous thread.

I can see this is a contentious issue, I wont do it again :)

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

> I know reposting like this is wrong but I was just trying to make a point.

Which is? In most cases reposting at such a short time interval will only 
annoy a lot people.

I think it was 4 hours apart, one at 7am another at 11am but still .. google first, 
ask list after.

--- End Message ---
--- Begin Message ---
On Saturday 06 March 2004 17:10, electroteque wrote:

NB Your mail client is severely broken in the quoting department.

> > Which is? In most cases reposting at such a short time interval will only
> > annoy a lot people.
>
> I think it was 4 hours apart, one at 7am another at 11am but still ..
> google first, ask list after.

If you feel the need to repost, wait at least one day. This *is* an 
international list and people *do* live, work and play in different 
timezones.

And in any case reposting the exact same question will still annoy people no 
matter what the time interval. If you do repost try to bring something new to 
the table, some signs that you have been doing some work of your own whilst 
waiting for a response to the earlier post.

Something like ...

I've read the manual, chapter X, section Y and haven't found an answer to my 
problem; 

OR: 

I've googled for "abc xyz" and haven't found anything useful.

OR:

I've tried "this", "that" and "other" and I still couldn't get it to work, 
because I was expecting "something" and got "something else" instead. 

... would hopefully convince people that you really did try to solve the 
problem on your own and only used the list as a last resort and wasn't just 
sitting on your backside, twiddling your thumbs and waiting for someone to do 
your work for you.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Insufficient facts always invite danger.
                -- Spock, "Space Seed", stardate 3141.9
*/

--- End Message ---
--- Begin Message --- try echo'ing $_FILES['image_upload']['tmp_name'], and check if the path exists

maybe some wrong configuration on php.ini
upload_tmp_dir ?


it is usually a good idea trying to isolate the smallest piece of code that gives the unwanted result
makes it easier for other ppl to help, and sometimes you find out the bug, by yourself, on the way



Brian V Bonini wrote:
The form:

<form  enctype="multipart/form-data" action="<?php echo
$_SERVER['PHP_SELF'] ?>" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="10000">
<fieldset>
<legend>Add Rider</legend>
<label for="rider_name">Name:</label>
<input type="text" name="rider_name" id="rider_name" size="30"
maxlength="30" /><br />
<label for="rider_license_cat">Lic. Cat.:</label>
<input type="text" name="rider_license_cat" id="rider_license_cat"
size="2" maxlength="1" /><br />
<label for="comments">Comments:</label>
<input type="text" name="comments" id="comments" size="30"
maxlength="30" /><br />
<label for="image_upload">Upload Image:</label>
<input name="image_upload" id="image_upload" type="file" /><br />
<p><input type="submit" name="action" value="Add Rider"></p>
</fieldset>
</form>

The code:

if (is_uploaded_file($_FILES['image_upload']['tmp_name'])) {
                    move_uploaded_file($_FILES['image_upload']['tmp_name'],
$upload_file_path);
            echo "success";
                } else {
                echo "Possible file upload attack. Filename: " .
$_FILES['image_upload']['name'] . "<br />\n";
            switch($_FILES['HTTP_POST_FILES']['userfile']['error']){
                case 0: //no error; possible file attack!
                    echo "There was a problem with your upload.<br
/>\n";
                    break;
                case 1: //uploaded file exceeds the upload_max_filesize
directive in php.ini
                    echo "The file you are trying to upload is too
big.<br />\n";
                    break;
                case 2: //uploaded file exceeds the MAX_FILE_SIZE
directive that was specified in the html form
                    echo "The file you are trying to upload is too
big.<br />\n";
                    break;
                case 3: //uploaded file was only partially uploaded
                    echo "The file you are trying upload was only
partially uploaded.<br />\n";
                    break;
                case 4: //no file was uploaded
                    echo "You must select an image for upload.<br />\n";
                    break;
                default: //a default error, just in case!  :)
                    echo "There was a problem with your upload.<br
/>\n";
                    break;
                        }
            }
}

No matter what I try this keeps falling through to the default switch.



-- André Cerqueira

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
On Fri, 2004-03-05 at 21:33, Andre Cerqueira wrote:
> try echo'ing $_FILES['image_upload']['tmp_name'], and check if the path 
> exists

Gives me nothing, hmmm...

> 
> maybe some wrong configuration on php.ini
> upload_tmp_dir ?

%more php.ini && ls -l / | grep tmp
register_globals = On
upload_tmp_dir = /tmp
file_uploads = 1 
 
drwxrwxrwt  29 root  wheel    1536 Mar  5 21:39 tmp

In the form if I trim off the local /PATH/to/file/ it returns successful
and created a 0 byte file where it should. Obviously not what ultimately
needs to happen but.... Am I supposed have to translate the local path
first of something?

-- 
Brian V Bonini <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
On Saturday 06 March 2004 10:42, Brian V Bonini wrote:
> On Fri, 2004-03-05 at 21:33, Andre Cerqueira wrote:
> > try echo'ing $_FILES['image_upload']['tmp_name'], and check if the path
> > exists
>
> Gives me nothing, hmmm...

If you had enable error reporting and checked what errors were reported you 
would probably have solved your problem already.

> In the form if I trim off the local /PATH/to/file/ it returns successful
> and created a 0 byte file where it should. Obviously not what ultimately
> needs to happen but.... Am I supposed have to translate the local path
> first of something?

I don't see anywhere in your form where you have "/PATH/to/file/", what are 
you referring to?

Also the following is obviously incorrect ...

  switch($_FILES['HTTP_POST_FILES']['userfile']['error']){

... it should be ...

  switch($_FILES['userfile']['error']){

... and you should have substituted 'userfile' with 'image_upload' as that is 
what you're using in your form.

Do yourself a favour, study the example in the manual, get it working, 
understand how it works, THEN modify it in small incremental steps until it 
does what you want.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Live from New York ... It's Saturday Night!
*/

--- End Message ---
--- Begin Message ---
> Do yourself a favour, study the example in the manual, get it working, 
> understand how it works, 

Lighten up Francis, it was 10pm at night after a 14 hour day and 62 hour
week. 

I appreciate the help but can do without the cynicism.


-- 
Brian V Bonini <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
"Five" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I've been learning php/mysql by uploading my scripts to a php/mysql enabled website.
> It's getting to be a drag uploading each script change to check if it works.
> I think this can be done but wanted to double check before starting instalation.
> Will  "Microsoft Personal Web Server 4.0"   running on Win98se support php and  
> mysql?
>
> advance thanks
> Dale

If anyone is sstill interested, here's an excelent website that walks you through 
downloading, installing and configuring apache,
php, and mysql.

http://internetmaster.com/installtutorial/index.htm

If it can work for my dyslexic eyes, it can work for anyone.

--- End Message ---
--- Begin Message --- From my earlier post, I've had a number of people email me, on and off list, that there isn't much in the way of an "advanced" php mailing list. It also sounds like at least a few people are quite interested in the possibility.

Who runs the php official mailing lists? Can we ask them to start a php-advanced list? Give it a description like "Ready to take you coding to the next level? Got questions about high-level PHP code? This is the list for you." Redirect people asking questions like "What is SQL" and "What's wrong with this code" or "How do I <insert simple task>" (which a search in the manual would have found the function to do this) to the php-general list. That would leave our group free to discuss meaty things and really get somewhere.

Anybody else interested in this type of list?

-Galen
--- End Message ---
--- Begin Message ---
On Fri, 5 Mar 2004, Galen wrote:

>  From my earlier post, I've had a number of people email me, on and off
> list, that there isn't much in the way of an "advanced" php mailing
> list. It also sounds like at least a few people are quite interested in
> the possibility.
>
> Who runs the php official mailing lists? Can we ask them to start a
> php-advanced list? Give it a description like "Ready to take you coding
> to the next level? Got questions about high-level PHP code? This is the
> list for you." Redirect people asking questions like "What is SQL" and
> "What's wrong with this code" or "How do I <insert simple task>" (which
> a search in the manual would have found the function to do this) to the
> php-general list. That would leave our group free to discuss meaty
> things and really get somewhere.
>
> Anybody else interested in this type of list?

This has come up many times before and I really don't think it will work.
Splitting advanced users from beginners means that there will be nobody to
answer the beginner questions which means they will get posted to the
advanced list where the people with the answers are.  It is a
self-defeating separation.  Having everyone in one big lump means that
both camps and all the camps in between learn from each other.

The other question is who decides what is advanced?  Chances are what you
think is advanced may seem trivial to me, or vice-versa.

-Rasmus

--- End Message ---
--- Begin Message ---
On Saturday 06 March 2004 14:57, Galen wrote:

>  From my earlier post, I've had a number of people email me, on and off
> list, that there isn't much in the way of an "advanced" php mailing
> list. It also sounds like at least a few people are quite interested in
> the possibility.

The only way you can run more than one list on a similar topic is if:

i) You have a clear distinction on what exactly should be discussed on which 
particular list

ii) List members apply rigorous self-policing to (a) refuse to answer 
off-topic posts (b) ask posters of said posts to re-post on the appropriate 
list

Otherwise one of two things will probably happen:

1) The people who are experienced and are most able to question the more 
"advanced" questions will be sick and tired of answering the FAQs and 
"newbie" questions and may only subscribe to the "advanced" list. This means 
the "newbie" list will be in the hands of newbies and thus newbies will be 
asking and answering "newbie" questions.

2) The more likely case would be that because it is pretty difficult to draw 
the line between "newbie" questions and "advanced" questions there will be 
even more cross-posting. Witness the amount of DB-related, solely 
Windows-related, and installation-related questions that appear on this list. 
That is despite the fact that those issues are covered by their own lists.

> Who runs the php official mailing lists? Can we ask them to start a
> php-advanced list? Give it a description like "Ready to take you coding
> to the next level? Got questions about high-level PHP code? This is the
> list for you." Redirect people asking questions like "What is SQL" and
> "What's wrong with this code" or "How do I <insert simple task>" (which
> a search in the manual would have found the function to do this) to the
> php-general list. That would leave our group free to discuss meaty
> things and really get somewhere.

The crux of the matter is who decides what are "meaty", "advanced" things? IMO 
99% of so called newbie questions are answered in the manual, user comments 
in the manual, FAQs, list archives, and Google. So to run a "newbie" list one 
would only have to auto-post the above list of resources to the list every 
few minutes, hopefully the newbies will get the idea very quickly and learn 
to solve the simple problems on their own. Then they can subscribe to the 
"advanced" list for discussions on problems not answered in the above list of 
resources.

> Anybody else interested in this type of list?

It will only work if there is:

(a) a clear definition of "advanced" topics -- pretty difficult to define
(b) some kind of moderation

So if you can solve those two problems then yeah, maybe.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Plus ,ca change, plus c'est la m^eme chose.
        [The more things change, the more they remain the same.]
                -- Alphonse Karr, "Les Gu^epes"
*/

--- End Message ---
--- Begin Message ---
This has come up many times before and I really don't think it will work.
Splitting advanced users from beginners means that there will be nobody to
answer the beginner questions which means they will get posted to the
advanced list where the people with the answers are.  It is a
self-defeating separation.  Having everyone in one big lump means that
both camps and all the camps in between learn from each other.

The other question is who decides what is advanced?  Chances are what you
think is advanced may seem trivial to me, or vice-versa.

I agree totally with rusmus here, sorry but what make you so elite ? Where
here together, i'm sure you came here like myself along time ago as a newby,
do your bit and show your "advanced knowledge" by answering questions. If u
dont want anyone emailing you offlist just say so, dont get a huff about it
later ;)

--- End Message ---
--- Begin Message ---
On Sat, 2004-03-06 at 01:57, Galen wrote:
> Who runs the php official mailing lists? Can we ask them to start a 
> php-advanced list? Give it a description like "Ready to take you coding 
> to the next level? Got questions about high-level PHP code? This is the 
> list for you." Redirect people asking questions like "What is SQL" and 
> "What's wrong with this code" or "How do I <insert simple task>" (which 
> a search in the manual would have found the function to do this) to the 
> php-general list. That would leave our group free to discuss meaty 
> things and really get somewhere.

It should be obvious why this will not work. And, why should this be an
issue? You are free to participate and choose what discussions you want
to be a part of (unless your delete key is broken) as well as discuss
whatever topics you want (OT), advanced, intermediate, or beginner.

SO what's your real point? Are you annoyed by questions that you think
are beneath you or what?
-- 
Brian V Bonini <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
8:45 pm EST, no content is showing in the middle ?

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

I am a newbie in PHP and MySQL. I have developed a web databse using PHP and
MySQL. However , I need more info on these product. Any sites you can
recommend.

Amimu

CAFCA Limited
Zimbabwe


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--- End Message ---
--- Begin Message ---
On Fri, 2004-03-05 at 06:55, Amimu Austin wrote:
> Hi
> 
> I am a newbie in PHP and MySQL. I have developed a web databse using PHP and
> MySQL. However , I need more info on these product. Any sites you can
> recommend.

php.net
mysql.com
-- 
Brian V Bonini <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
on line 66 there is :

$date=$_POST["date"];

Thanks

----- Original Message -----
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Dominique ANOKRE" <[EMAIL PROTECTED]>; "Php List"
<[EMAIL PROTECTED]>
Sent: Friday, March 05, 2004 8:20 PM
Subject: RE: [PHP] undefined index -------- please help !!!!!!!!


Dominique ANOKRE <mailto:[EMAIL PROTECTED]>
    on Friday, March 05, 2004 12:19 PM said:

> Undefined index: numcpte in c:\inetpub\wwwroot\rech_haut.php on line
> 66
>
> For information, i have not this error when the file recherche.php is
> a simple file without frames !!!
>
> Please help!!

what is on line 66!?!?

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

--- End Message ---
--- Begin Message --- Dominique ANOKRE wrote:
on line 66 there is :

$date=$_POST["date"];

Thanks

$_POST['date'] isn't set.

if ( isset ( $_POST['date'] ) ) {
        $date = $_POST['date'];
}

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
The simple example from http://www.php.net/pdf (hard-wired to paper.pdf)
just displayed the pdf data as a dump.  I can ftp the file and it's OK.  My
hard-wired version is shown below.

<?php
$len = filesize("paper.pdf");
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=paper.pdf");
readfile("paper.pdf");
?> 

// Thanks,
// Rick

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

The most likely reason that one guy can't upload when everyone else can is because he is behind a proxy that limits the size of post data.


Kenn Murrah wrote:

Greetings.

I have an odd (to me) problem ... from most computers, the upload code (shown, in part, below) works just fine .... but from at least one computer, if the user uploads a small file (under 1meg), it works properly . but if he uploads a larger file he gets either a "page not found" (Internet Explorer) or "no data" (Netscape) error .... other users can upload files of any size, with no problem ....

Does anyone have any ideas?
The code (though I'm not at all sure it's relevent) is below:

$customer_trimmed = eregi_replace("[^[:alnum:]\.]","",$customer) ;
$customer_shortened = substr($customer_trimmed,0,18);
$customer_trimmed = $customer_shortened;
$folder_name = $customer_trimmed . date("mdyHis");

$old_umask = umask();
mkdir('/home/upco/uploads/' . $folder_name, 0777);
//umask($old_umask);

$dest_dir = '/home/upco/uploads/' . $folder_name;


--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
// or example I have some link:

<a href='index.php?action=people'>About people</a>

// so this function will output the content of people.txt file:

if ($action=="people"){
function output() {
    $file = file("data/people.txt");
    foreach($file as $value ) {
        $output .= "$value<br>";
    }
    return $output;
}
    $content = output();
}else{
error ();
}

// How can I improve this function so, that it will work automaticly with
other links (below) too.

<a href='index.php?action=industry'>Factories</a>
<a href='index.php?action=art'>Beautiful pictures</a>
<a href='index.php?action=animals'>Zoo</a>
<a href='index.php?action=contact'>Contact us</a>

P.S.
I have tried to improve If tag and the name of .txt file this way:
if ($action=="$action"){
function output() {
    $file = file("data/".$action.".txt");

.. but the syntax is incorrect.
What to do?

Thanks,
Roman

--- End Message ---

Reply via email to