php-general Digest 17 Aug 2004 16:13:18 -0000 Issue 2942
Topics (messages 194026 through 194045):
Re: Move_uploaded_file()
194026 by: Jason Wong
194039 by: Info.Best-IT
194041 by: Jason Wong
Re: Cache
194027 by: Octavian Rasnita
194030 by: raditha dissanayake
Re: The_'_character_and_Hidden_(POST)_form_fields...
194028 by: Torsten Roehr
Re: [OFF] - Fraudulent web orders - any ideas?
194029 by: Markus Mayer
Control manager ...
194031 by: Marko Rastislav
194037 by: Jason Wong
Sessions nightmare continue...
194032 by: Angelo Zanetti
194034 by: Jason Wong
194036 by: Craig Donnelly
194040 by: Chris Shiflett
Re: back button doesn't work with sessions?
194033 by: Harlequin
PHP & MySQL Installation
194035 by: Harlequin
Re: Sessions nightmare continue...SOLVED
194038 by: Angelo Zanetti
problem with new mktime feature
194042 by: Marcos Thiago M. Fabis
Techniques for doing story
194043 by: rogue
194044 by: Matthew Sims
194045 by: raditha dissanayake
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 Tuesday 17 August 2004 09:38, [EMAIL PROTECTED] wrote:
> Warning: move_uploaded_file([�absolute_path�]/file.csv): failed to open
> stream: Permission denied in [�absolute_path�]/file.csv on line 83
Give php permissions to [�absolute_path�]/ ?
--
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
------------------------------------------
/*
What we see depends on mainly what we look for.
-- John Lubbock
*/
--- End Message ---
--- Begin Message ---
How do you do that exactly - sorry for the stupid question - but the perms
for [�absolute_path�]/ is already rwxrw-rw-.
Let me know if you are referring to a different way to set permissions...
Thanks for your help!
/T
on 8/16/04 23:52, Jason Wong at [EMAIL PROTECTED] wrote:
> On Tuesday 17 August 2004 09:38, [EMAIL PROTECTED] wrote:
>
>> Warning: move_uploaded_file([�absolute_path�]/file.csv): failed to open
>> stream: Permission denied in [�absolute_path�]/file.csv on line 83
>
> Give php permissions to [�absolute_path�]/ ?
--- End Message ---
--- Begin Message ---
Please do not top post.
On Tuesday 17 August 2004 19:31, [EMAIL PROTECTED] wrote:
> How do you do that exactly - sorry for the stupid question - but the perms
> for [�absolute_path�]/ is already rwxrw-rw-.
>
> Let me know if you are referring to a different way to set permissions...
1) What is the real name of your destination directory? I have been assuming
that "[�absolute_path�]" is a substitution for the real path. If
"[�absolute_path�]" is indeed your path then I suggest that you rename it to
use just alphanumerals.
2) The webserver must have 'x' permission for every parent directory of the
destination directory and must have 'wx' for the destination directory
itself.
To test and to convince yourself that move_uploaded_file() is working (or
otherwise) use /tmp as the destination directory.
--
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
------------------------------------------
/*
Windows: an Unrecoverable Acquisition Error!
*/
--- End Message ---
--- Begin Message ---
From: "pan" <[EMAIL PROTECTED]>
> What provides the new data?
> Can you run a html update from whatever is supplying the new data?
>
Hmm, I don't think I can. The data is stored in MySQL by a separate program,
but that data can be used in more pages.
I think the only good solution would be to run a program that create a cache
for every page from that site.
This would not be very simple because the site could have more template
styles available for the users, and all the page could appear in more
languages, and some pages could be accessed from a form with many options,
etc.
It would not be very practicly to create such many cached pages.
I begin to think that it is not really possible to do what I want and I
guess that if the PHP program is well done, the speed difference would not
be too big.
Teddy
--- End Message ---
--- Begin Message ---
Octavian Rasnita wrote:
From: "pan" <[EMAIL PROTECTED]>
What provides the new data?
Can you run a html update from whatever is supplying the new data?
Hmm, I don't think I can. The data is stored in MySQL by a separate program,
but that data can be used in more pages.
I think the only good solution would be to run a program that create a cache
for every page from that site.
This would not be very simple because the site could have more template
styles available for the users, and all the page could appear in more
languages, and some pages could be accessed from a form with many options,
etc.
It would not be very practicly to create such many cached pages.
I begin to think that it is not really possible to do what I want and I
guess that if the PHP program is well done, the speed difference would not
be too big.
that's usually the case some developers spend a lot of time chaning
double quoates to single quotes all it get's them is a saving of 2
milliseconds per script. However delivering static html instead of
dynamic generated html will be faster under very high loads. So you may
want to keep at it if you have a large site.
In a related thread i have posted about the use of squid i think you may
want to look at it.
An approach that may work in your case is to host the scripts on a
private ip and use wget to 'download' the entire site on to the htdoc
folder of your public site. wget could be invoked by the same program
that inserts the data into the db.
finally media wiki (the software that powers wikipedia.org ) has a good
caching mechanism which you might want to look at.
Teddy
--
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 ---
"Sean O'Donnell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> the ’ character...
>
> *damn outlook rewrote it in my email. =/
>
> SEAN O'DONNELL
> PROGRAMMER/ANALYST
Hi Sean,
generally apply htmlentities() to all data to output. Use double quotes for
your HTML attributes so single quotes in your strings won't be a problem.
Regards, Torsten Roehr
--- End Message ---
--- Begin Message ---
On Monday 16 August 2004 17:03, Brian Dunning wrote:
> I think I may have solved it by an even simpler method: I emailed the
> perpetrator to "thank him for all of his orders" to see what he'd say.
:-) Great idea! (me shows the thumbs up)
> Anyone know who the "proper authorities" are, to whom I could give my
It doesn't matter where the fraud comes from, its worth following up because
my guess is you could be dealing with a small part of some organised credit
card fraud group. My best suggestion is to give the FBI a quick call or look
at their web site. Although the orders may be foreign (what location comes
back when you put the IP address into http://www.geobytes.com/IpLocator.htm),
as far as I know, this is something the FBI can handle, and if they don't, I
would expect they know who does.
Hope this helps.
best regards
Markus
--- End Message ---
--- Begin Message ---
Hallo all.
Could me somebody recommend with building-up automatic MANAGER (DEAMON),
that will be with me communicate by MAILOV? Something how's too MANAGER for
control this conference? Just SCRIPT would with me communicate by mail and
he execute operations, according control word in transmiting body messages,
or in mesage subject.
Existig some SCRIPT on which I would teach it myself, or would enough the
SCRIPT re-do? I don't have literature and with access on i-network with
browser have I problem. I just starting with PHP. Thanks. ... kofi-SK.
PS: M�m probl�m s anglinou :o(.
--- End Message ---
--- Begin Message ---
On Tuesday 17 August 2004 17:25, Marko Rastislav wrote:
> Could me somebody recommend with building-up automatic MANAGER (DEAMON),
> that will be with me communicate by MAILOV? Something how's too MANAGER for
> control this conference? Just SCRIPT would with me communicate by mail and
> he execute operations, according control word in transmiting body messages,
> or in mesage subject.
>
> Existig some SCRIPT on which I would teach it myself, or would enough the
> SCRIPT re-do? I don't have literature and with access on i-network with
> browser have I problem. I just starting with PHP. Thanks. ... kofi-SK.
If I understand you correctly, you want to be able to send mails (containing
certain instructions) to a server and have the instructions carried out?
This is certainly possible, most MTAs allow you to have addresses which
executes programs whenever mail is delivered to them. Refer to your MTA
documentation to see how such addresses can be setup then configure it
execute your php script. The contents of the mail are usually made available
on STDIN so your php script would have to read from STDIN and parse out the
instructions. Then depending on what your instructions are you can use exec()
and friends to execute them.
--
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
------------------------------------------
/*
If you have to ask what jazz is, you'll never know.
-- Louis Armstrong
*/
--- End Message ---
--- Begin Message ---
Hi all,
Still no luck with sessions. I have installed an older version: 4.3.1
and have register_globals=Off
I have 2 test pages a1.php and a2.php
All I want to do is register a session variable, set a value for it and
then in a2.php check that it is still registered and view the session's
value.
a1.php:
<?
session_start();
header("Cache-control: private"); // IE 6 Fix.
if(isset($_POST['Submit']))
{
$_SESSION["login"]="inside";
session_write_close();
header("Location: a2.php");
exit();
}
?>
I can successfully register the session variable and set the value of
it on page a1.php but when I go to page a2.php the session variable is
not set and the value isnt set either.
a2.php:
<?
session_start();
header("Cache-control: private"); // IE 6 Fix.
if(!isset($_SESSION["login"]))
echo("<br>session variable NOT set");
else
echo("<br>session variable set");
echo("<br>session ID: " . session_id());
echo("<br>session value: " . $_SESSION["login"]);
?>
I have been trying to get this to work for ages with no luck. I have
been reading the manual and have googled and cant seem to find the
problem. if anyone can help that would be great.
thanks in advance
Angelo
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
On Tuesday 17 August 2004 17:46, Angelo Zanetti wrote:
> Still no luck with sessions. I have installed an older version: 4.3.1
> and have register_globals=Off
>
> I have 2 test pages a1.php and a2.php
>
> All I want to do is register a session variable, set a value for it and
> then in a2.php check that it is still registered and view the session's
> value.
>
> a1.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(isset($_POST['Submit']))
> {
> $_SESSION["login"]="inside";
> session_write_close();
> header("Location: a2.php");
> exit();
> }
> ?>
>
> I can successfully register the session variable and set the value of
> it on page a1.php
Are you positive that $_SESSION["login"] is set? Is your browser accepting
cookies (at the least temporary or session cookies?).
> but when I go to page a2.php the session variable is
> not set and the value isnt set either.
>
> a2.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(!isset($_SESSION["login"]))
> echo("<br>session variable NOT set");
> else
> echo("<br>session variable set");
>
> echo("<br>session ID: " . session_id());
> echo("<br>session value: " . $_SESSION["login"]);
>
> ?>
OK, do you have access to the directory (assuming you're using files) that
stores the session files? If so, check the session file written in a1.php to
see whether $_SESSION["login"] was set correctly, then check session_id() in
a2.php matches that the name of said session file.
--
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
------------------------------------------
/*
Work continues in this area.
-- DEC's SPR-Answering-Automaton
*/
--- End Message ---
--- Begin Message ---
Why are you testing if $_POST['submit'] is set are you posting something to
the page??
In the two scripts you posted the code block wont be executed because there
is no post variable
being set.
Try this:
a1.php
==================================================
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
$_SESSION["login"]="inside";
session_write_close();
header("Location: a2.php");
exit();
?>
<pre>
<?php print_r($_SESSION); ?>
</pre>
==================================================
AND
a2.php
==================================================
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
if(!isset($_SESSION["login"])){
echo("<br>session variable NOT set");
}else{
echo("<br>session variable set");
}
echo("<br>session ID: " . session_id());
echo("<br>session value: " . $_SESSION["login"]);
?>
<pre>
<?php print_r($_SESSION); ?>
</pre>
==================================================
Works fine now.
HTH
Craig
"Angelo Zanetti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Still no luck with sessions. I have installed an older version: 4.3.1
> and have register_globals=Off
>
> I have 2 test pages a1.php and a2.php
>
> All I want to do is register a session variable, set a value for it and
> then in a2.php check that it is still registered and view the session's
> value.
>
> a1.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(isset($_POST['Submit']))
> {
> $_SESSION["login"]="inside";
> session_write_close();
> header("Location: a2.php");
> exit();
> }
> ?>
>
>
> I can successfully register the session variable and set the value of
> it on page a1.php but when I go to page a2.php the session variable is
> not set and the value isnt set either.
>
> a2.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(!isset($_SESSION["login"]))
> echo("<br>session variable NOT set");
> else
> echo("<br>session variable set");
>
> echo("<br>session ID: " . session_id());
> echo("<br>session value: " . $_SESSION["login"]);
>
> ?>
>
> I have been trying to get this to work for ages with no luck. I have
> been reading the manual and have googled and cant seem to find the
> problem. if anyone can help that would be great.
>
> thanks in advance
> Angelo
> --------------------------------------------------------------------
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Hi Angelo,
--- Angelo Zanetti <[EMAIL PROTECTED]> wrote:
> Still no luck with sessions.
[snip]
> a1.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(isset($_POST['Submit']))
> {
> $_SESSION["login"]="inside";
> session_write_close();
> header("Location: a2.php");
> exit();
> }
> ?>
I see two problems immediately. First, you're doing more than testing
sessions here. You need to trim down your test code to do only that and
nothing else. Right now, the important bit is within a conditional
statement, and that's needless complexity. You want to be 100% sure that
you're testing what you mean to be testing.
The second problem is that you send an improper Location header, and this
may very well be what is causing your problem. This header requires an
absolute URL, and some browsers will not include cookies in the request
for the new URL when you use a relative one, even if it seems to "work"
otherwise.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
Frank
I use a back button on a couple of sites that use session variables and
don't seem to have an issue with them. However, my back buttons are held
within IFRAME tags as I am accessing resources externally.
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Frank Keessen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all!
>
> Can you please help me with the following;
>
> I've got a form (that comes in 'three parts' a1.php a2.php and a3.php)with
sessions that refuses to go back!
>
> On A2.php and A3.php i made a back button like:
>
> <input type="image" src="images/back_button.jpg" onClick="history.back()">
>
> and
>
> <input type="image" src="images/back_button.jpg" onclick="history.go(-1)">
>
> And i've added the follwing line directly after Session_start();
> header("Cache-control: private");
>
> When i'm hitting the back button it's stays on it's page!!! So no browser
back for me!
>
> Can somebody help? Thanks!
>
> Frank
>
--- End Message ---
--- Begin Message ---
Hi all. I'm probably biting off a little more than I can chew here but here
goes...
I've been asked to move some resources I have developed from our hosting
company's server and host them locally. I know I am going to need a licence
for MySQL as we are developing commercial applications and not prepared to
release the source code but will we need a licence for PHP...?
Also... What flavour of Linux do these sit best on...? Mandrake has been
recommended but I am open to suggestions...
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
--- End Message ---
--- Begin Message ---
Thanks to all that responded, I have finally found the problem:
When I installed PHP again, I kept on modifying the PHP.ini in the
WINNT directory (as specified in the manual) but the PHP.ini that was
being looked up was the 1 in the c:\php directory so I kept on trying
all new things and nothing worked.
Thanks again. Please remeber so that you dont make the same mistake as
me
Angelo
>>> "Craig Donnelly" <[EMAIL PROTECTED]> 8/17/2004 12:04:42 PM
>>>
Why are you testing if $_POST['submit'] is set are you posting
something to
the page??
In the two scripts you posted the code block wont be executed because
there
is no post variable
being set.
Try this:
a1.php
==================================================
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
$_SESSION["login"]="inside";
session_write_close();
header("Location: a2.php");
exit();
?>
<pre>
<?php print_r($_SESSION); ?>
</pre>
==================================================
AND
a2.php
==================================================
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
if(!isset($_SESSION["login"])){
echo("<br>session variable NOT set");
}else{
echo("<br>session variable set");
}
echo("<br>session ID: " . session_id());
echo("<br>session value: " . $_SESSION["login"]);
?>
<pre>
<?php print_r($_SESSION); ?>
</pre>
==================================================
Works fine now.
HTH
Craig
"Angelo Zanetti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> Still no luck with sessions. I have installed an older version:
4.3.1
> and have register_globals=Off
>
> I have 2 test pages a1.php and a2.php
>
> All I want to do is register a session variable, set a value for it
and
> then in a2.php check that it is still registered and view the
session's
> value.
>
> a1.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(isset($_POST['Submit']))
> {
> $_SESSION["login"]="inside";
> session_write_close();
> header("Location: a2.php");
> exit();
> }
> ?>
>
>
> I can successfully register the session variable and set the value
of
> it on page a1.php but when I go to page a2.php the session variable
is
> not set and the value isnt set either.
>
> a2.php:
>
> <?
> session_start();
> header("Cache-control: private"); // IE 6 Fix.
>
> if(!isset($_SESSION["login"]))
> echo("<br>session variable NOT set");
> else
> echo("<br>session variable set");
>
> echo("<br>session ID: " . session_id());
> echo("<br>session value: " . $_SESSION["login"]);
>
> ?>
>
> I have been trying to get this to work for ages with no luck. I have
> been reading the manual and have googled and cant seem to find the
> problem. if anyone can help that would be great.
>
> thanks in advance
> Angelo
> --------------------------------------------------------------------
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Hi everyone;
I�m having a trouble with mktime. It is not generating negative values since the
OS was updated to "Linux version 2.6.7 (gcc version 3.2.3)".
I belive php uses mktime from glibc, and when this library was changed, mktime
with this new "stupid feature" stoped generate values that represent dates lower than
Dec-31-1969.
All my systems that store dates are using mktime, so the birthday fields are not
working under 1969.
I�m using PHP 4.3.8, and always upgrading !
How can i fix that?
Example:
<?
echo date ("M-d-Y", mktime (0,0,0,12,32,1997));
echo "<br>";
echo date ("M-d-Y", mktime (0,0,0,1,1,1968));
?>
The result is:
Jan-01-1998
Dec-31-1969
Thnx in advance, and sorry my poor english!
[s]
Mt
--- End Message ---
--- Begin Message ---
Hi all,
I want to do something like this:
http://www.cgnetworks.com/story_custom.php?story_id=2259
Where we can publish an article, multiple page even and lay it out in a
nice design with images etc. How do you think this is done? These
stories are dynamically generated it seems since the page is passed in
the URL. I am just not sure where to start...
Thanks,
Rogue
--- End Message ---
--- Begin Message ---
> Hi all,
>
> I want to do something like this:
>
> http://www.cgnetworks.com/story_custom.php?story_id=2259corresponding
>
> Where we can publish an article, multiple page even and lay it out in a
> nice design with images etc. How do you think this is done?
Uh...HTML? It is a website, correct?
> These stories are dynamically generated it seems since the page is
passed in the URL. I am just not sure where to start...
>
> Thanks,
> Rogue
PHP has nothing to do with the layout. The story is probably stored in a
database and the story_id var is passed through $_GET to pull up the
cooresponding story.
Learn HTML and CSS and you can make a website look however you want it to
look. PHP simply makes the pages change depending on user events.
--
--Matthew Sims
--<http://killermookie.org>
--- End Message ---
--- Begin Message ---
please ask a PHP specific question.
rogue wrote:
Hi all,
I want to do something like this:
http://www.cgnetworks.com/story_custom.php?story_id=2259
Where we can publish an article, multiple page even and lay it out in
a nice design with images etc. How do you think this is done? These
stories are dynamically generated it seems since the page is passed in
the URL. I am just not sure where to start...
Thanks,
Rogue
--
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 ---