php-general Digest 14 Nov 2008 08:14:26 -0000 Issue 5789
Topics (messages 283265 through 283282):
standard safe permissions for php scripts in web directory
283265 by: Noor Ahmed Afridi
283272 by: Chris
Re: Printing Web Page
283266 by: Patrick Moloney
Re: PECL HTTP Extension
283267 by: Micah Gersten
Re: building an admin tree with varying node types
283268 by: Rene Veerman
283269 by: Boyd, Todd M.
Parsing out excel's .xls textboxes?
283270 by: Nitsan Bin-Nun
283271 by: Ashley Sheridan
283280 by: Nitsan Bin-Nun
Strange results
283273 by: Craige Leeder
283274 by: Micah Gersten
283275 by: Craige Leeder
283279 by: Jochem Maas
mySQL query question
283276 by: Michael S. Dunsavage
283277 by: Micah Gersten
283278 by: Michael S. Dunsavage
283281 by: Jochem Maas
283282 by: Michael S. Dunsavage
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 ---
Sounds like a weird question though :( what should be standard safe php
script/directory permissions under Apache.
--
Regards,
Noor Afridi
--- End Message ---
--- Begin Message ---
Noor Ahmed Afridi wrote:
Sounds like a weird question though :( what should be standard safe php
script/directory permissions under Apache.
I don't understand the question.
For the php scripts themselves or for stuff that the php scripts action
(eg create dirs/files) ?
It depends on the setup.
If php/apache is running in cgi mode, the php scripts should be owned by
the user. Eg website is running as user 'mydomain'. The php scripts
should be owned by that user, otherwise you'll get errors about a
mismatch of user and the script won't execute.
If php/apache is running in isapi mode (apache runs as user 'www' or
'www-data' or some such variant), then apache will need read access to
the file(s) and folder(s) but not 'write' access (of course unless
you're writing to some files).
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Thanks to all. That worked well. I just had to insert the stylesheet
link on each of a couple dozen pages, but it worked.
My pages were a little complicated and took some work - and could
probably use more but I'll deal with that as I go.
Some samples I found were very simple print stylesheets, others were
longer but written from scratch. I started with my previous screen
stylesheet and modified it. That seemed to work pretty well.
Patrick
--- End Message ---
--- Begin Message ---
Perhaps you should try the PECL list:
[EMAIL PROTECTED]
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Rui Quelhas wrote:
> Since i'm not obtaining any kind of response from people o first answered
> me. I guess is better to talk through here.
> To my first message, Micah Gersten asked me if i've placed the extension
> path on 'php.ini' my answer was yes, i've tried to do that but it still
> wasn't loading the extension. Jochem Maas advised me to place the complete
> path to the extension like this
> 'extension=/usr/lib/php/extensions/no-debug-non-zts-20060613/http.so',
> i've also tried it, again with no success.
> In the last response, Thodoris told me to place in the php.ini the line
> 'extension_dir=".;/usr/lib/php/extensions/no-debug-non-zts-20060613;/usr/lib/php/modules"',
> adding again the extension directive 'extension=http.so'. Well, seems like
> there is no such path like '/usr/lib/php/modules', for the sound of it, the
> closest match i get is '/usr/include/php/ext/' (path with the header files
> of each extension) or '/usr/libexec/apache2' (path also with '.so' files
> regarding apache modules). Either way, i've changed the unexisting path by
> each one of these and again nothing happened. I don't know what else i can
> do. Could somebody that has installed PECL extensions successfuly on Leopard
> help me? I just need to know what i must do in the inicialization files (php
> or apache) just like i was installing my first extension and having the fact
> that there is the native Leopard 'php.ini.default' already in place.
>
> Regards
>
> Rui Quelhas
>
>
--- End Message ---
--- Begin Message ---
Rene Veerman wrote:
i'm still trying to get my head around how the operations are done.
sometimes i see that java app re-arrange large parts of the tree, and
i wonder if it's still the same tree i'm looking at :)
omg, somebody grab the LART and give me a good spanking on the back of
my head..
a binary search tree cannot be used to store an actual tree of
information, right? (just double checking)
so far apparently all i got is a modified pre-order tree. I was told
this is the same as a binary tree, and from there confusion set in quickly..
so the search continues...
--
--------------------------------------------------------------
Rene Veerman, creator of web2.5 CMS http://mediabeez.ws/
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Rene Veerman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 13, 2008 4:06 PM
> To: Boyd, Todd M.
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] building an admin tree with varying node types
>
> Rene Veerman wrote:
> > i'm still trying to get my head around how the operations are done.
> > sometimes i see that java app re-arrange large parts of the tree, and
> > i wonder if it's still the same tree i'm looking at :)
> >
> >
> omg, somebody grab the LART and give me a good spanking on the back of
> my head..
>
> a binary search tree cannot be used to store an actual tree of
> information, right? (just double checking)
>
> so far apparently all i got is a modified pre-order tree. I was told
> this is the same as a binary tree, and from there confusion set in
> quickly..
>
> so the search continues...
It is my understanding that a "binary tree" is any tree where each node can
have a maximum of 2 children. There are several implementations--they differ on
how they are balanced, for the most part.
HTH,
Todd Boyd
Web Programmer
--- End Message ---
--- Begin Message ---
Hi,
I have an excel parser I found out on the net a while ago.
It does a really great job untill now.
I need to parse out an excel file (.xls) with excel's textboxes in it,
I want to fetch the textboxes content from the .xls somehow.
I have no idea where to look out for this,
I have even considered trying to understand the structure of a common .xls
file by myself but I even don't know what direction I should be heading to!
If you have any idea, suggestion, anything that might help, feel free to
come up and surprise me ;)
Thanks in Advance,
Nitsan
--- End Message ---
--- Begin Message ---
On Fri, 2008-11-14 at 00:45 +0200, Nitsan Bin-Nun wrote:
> Hi,
> I have an excel parser I found out on the net a while ago.
> It does a really great job untill now.
> I need to parse out an excel file (.xls) with excel's textboxes in it,
> I want to fetch the textboxes content from the .xls somehow.
>
> I have no idea where to look out for this,
> I have even considered trying to understand the structure of a common .xls
> file by myself but I even don't know what direction I should be heading to!
>
> If you have any idea, suggestion, anything that might help, feel free to
> come up and surprise me ;)
>
> Thanks in Advance,
> Nitsan
First question to ask; which version of the format is the file?
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
It is binary file, saved from office 2003.
There is no way of changing the office version (so I can save it as .xml of
something) so I have to figure out how to parse these textboxes.
Nitsan
On 11/14/08, Ashley Sheridan <[EMAIL PROTECTED]> wrote:
>
> On Fri, 2008-11-14 at 00:45 +0200, Nitsan Bin-Nun wrote:
> > Hi,
> > I have an excel parser I found out on the net a while ago.
> > It does a really great job untill now.
> > I need to parse out an excel file (.xls) with excel's textboxes in it,
> > I want to fetch the textboxes content from the .xls somehow.
> >
> > I have no idea where to look out for this,
> > I have even considered trying to understand the structure of a common
> .xls
> > file by myself but I even don't know what direction I should be heading
> to!
> >
> > If you have any idea, suggestion, anything that might help, feel free to
> > come up and surprise me ;)
> >
> > Thanks in Advance,
> > Nitsan
> First question to ask; which version of the format is the file?
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
--- End Message ---
--- Begin Message ---
So, I have this class which contains a method LoadIO. I was doing some
debugging as to why a condition wouldn't pass like I thought it would,
and It's starting to piss me off.
The three echo's near the bottom are not printing what it should. The
middle echo is not even printing static text.
Here's the definition:
/***********
* Public Method LoadIO
* INCOMPLETE
* @param $fpType Integer
* @param $fpName String
* @throws FileException
* @return Object
***
* LoadIO handles the loading of IO modules. IO modules are stored in
* - /system/IO/ // System IO files
* - /IO/ // User defined third party modules
***********/
const mciInput = 0;
const mciOutput = 1;
public function loadIO($fpType, $fpName) {
global $gcIOPath, $gcSystemPath;
//
// Check paramaters for syntatic validity
//
if ( $fpType != Ember::mciInput && $fpType != Ember::mciOutput ) {
throw new Exception('Invalid \'fpType\' paramater', 1002);
}
//
// Variable assignment
//
$fType = ($fpType == self::mciInput) ? 'Input' : 'Output';
$fFile = $gcIOPath . $fType . '/' . $fpName . '.php';
// Check User IO Path first.
// If it does not exist there, check the System IO Path
if ( !file_exists($fFile) ) {
$fFile = $gcSystemPath . 'IO/' . $fType . '/' . $fpName . '.php';
if ( !file_exists($fFile) ) {
throw new Exception("File '$fpName.php' not found.", 1001);
}
}
if ( !(include_once $fFile) ) throw new Exception("File '$fFile'
could not be included.");
echo 'stage 1<br />';
echo "-" & $fpType & "- is equal to " & self::mciInput & "<br />";
echo 'stage 2<br />';
if ( $fpType == self::mciInput ) {
echo 5;
array_push($this->maInput, new $fpName);
echo 'it\'s done';
}
}
The Call:
$Page->loadIO(Ember::mciOutput, 'html');
The Output:
stage 1
0stage 2
HELP!
--- End Message ---
--- Begin Message ---
Craige Leeder wrote:
>
> So, I have this class which contains a method LoadIO. I was doing some
> debugging as to why a condition wouldn't pass like I thought it would,
> and It's starting to piss me off.
>
> The three echo's near the bottom are not printing what it should. The
> middle echo is not even printing static text.
>
> Here's the definition:
>
> /***********
> * Public Method LoadIO
> * INCOMPLETE
> * @param $fpType Integer
> * @param $fpName String
> * @throws FileException
> * @return Object
> ***
> * LoadIO handles the loading of IO modules. IO modules are stored in
> * - /system/IO/ // System IO files
> * - /IO/ // User defined third party modules
> ***********/
> const mciInput = 0;
> const mciOutput = 1;
> public function loadIO($fpType, $fpName) {
> global $gcIOPath, $gcSystemPath;
> //
> // Check paramaters for syntatic validity
> //
> if ( $fpType != Ember::mciInput && $fpType != Ember::mciOutput ) {
> throw new Exception('Invalid \'fpType\' paramater', 1002);
> }
> //
> // Variable assignment
> //
> $fType = ($fpType == self::mciInput) ? 'Input' : 'Output';
> $fFile = $gcIOPath . $fType . '/' . $fpName . '.php';
> // Check User IO Path first.
> // If it does not exist there, check the System IO Path
> if ( !file_exists($fFile) ) { $fFile = $gcSystemPath .
> 'IO/' . $fType . '/' . $fpName . '.php';
> if ( !file_exists($fFile) ) { throw new
> Exception("File '$fpName.php' not found.", 1001);
> }
> }
> if ( !(include_once $fFile) ) throw new Exception("File '$fFile'
> could not be included.");
>
> echo 'stage 1<br />';
> echo "-" & $fpType & "- is equal to " & self::mciInput & "<br />";
> echo 'stage 2<br />';
> if ( $fpType == self::mciInput ) {
> echo 5;
> array_push($this->maInput, new $fpName);
> echo 'it\'s done';
> }
> }
>
>
> The Call:
>
> $Page->loadIO(Ember::mciOutput, 'html');
>
>
> The Output:
>
> stage 1
> 0stage 2
>
> HELP!
>
I think you meant this:
echo "-" & $fpType & "- is equal to " & self::mciInput & "<br />";
to be
echo "-" . $fpType . "- is equal to " . self::mciInput . "<br />";
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
--- End Message ---
--- Begin Message ---
Micah Gersten wrote:
I think you meant this:
echo "-" & $fpType & "- is equal to " & self::mciInput & "<br />";
to be
echo "-" . $fpType . "- is equal to " . self::mciInput . "<br />";
And this is how you know you've been doing too much ASP, lol
Thanks Micah!
--- End Message ---
--- Begin Message ---
Craige Leeder schreef:
> Micah Gersten wrote:
>>
>> I think you meant this:
>> echo "-" & $fpType & "- is equal to " & self::mciInput & "<br />";
>> to be
>> echo "-" . $fpType . "- is equal to " . self::mciInput . "<br />";
>>
> And this is how you know you've been doing too much ASP, lol
yeah, I'm with Indiana Jones when it comes to ASP ... I hate snakes.
>
> Thanks Micah!
>
--- End Message ---
--- Begin Message ---
okay I want to pull an integer from a database called confirm_number,
add 1 and repost it back to the database
here's the code I'm using.
$queryconfirm="SELECT confirm_number from contacts ORDER BY contact DESC
LIMIT 1";
$confirmresult=$queryconfirm;
now here's the problem
I want to add 1 to confirm_number:
$confirm_number=$confirmresult;
$confirm_number+=1;
Now all this does is set the confirm_number record to 1 in the database.
So I assume that $queryconfirm somehow is not being passed to
confirm_number? But, while we're here the confirm_number is supposed to
be 5 digits long and the +1 should make it 10001, 10002, 10003 etc
how would I set the original number to 1000 to begin with? Or should I
just set that in the database record its self when I'm ready to use the
website?
--
Michael S. Dunsavage
--- End Message ---
--- Begin Message ---
If you're just adding one, there is no reason to retrieve the data,
process it, and update it. You can just update the number.
http://dev.mysql.com/doc/refman/5.0/en/update.html
Also, you should read the MySQL manual on default values:
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html
http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Michael S. Dunsavage wrote:
> okay I want to pull an integer from a database called confirm_number,
> add 1 and repost it back to the database
>
>
> here's the code I'm using.
>
>
> $queryconfirm="SELECT confirm_number from contacts ORDER BY contact DESC
> LIMIT 1";
> $confirmresult=$queryconfirm;
>
> now here's the problem
>
> I want to add 1 to confirm_number:
>
> $confirm_number=$confirmresult;
> $confirm_number+=1;
>
> Now all this does is set the confirm_number record to 1 in the database.
> So I assume that $queryconfirm somehow is not being passed to
> confirm_number? But, while we're here the confirm_number is supposed to
> be 5 digits long and the +1 should make it 10001, 10002, 10003 etc
>
> how would I set the original number to 1000 to begin with? Or should I
> just set that in the database record its self when I'm ready to use the
> website?
>
--- End Message ---
--- Begin Message ---
On Fri, 2008-11-14 at 00:52 -0600, Micah Gersten wrote:
> If you're just adding one, there is no reason to retrieve the data,
> process it, and update it. You can just update the number.
> http://dev.mysql.com/doc/refman/5.0/en/update.html
But, the problem is that the confirm_number is a confirmation number
that gets e-mailed out. So I have to pull it from the DB any way
--
Michael S. Dunsavage
--- End Message ---
--- Begin Message ---
Michael S. Dunsavage schreef:
> okay I want to pull an integer from a database called confirm_number,
> add 1 and repost it back to the database
>
>
> here's the code I'm using.
>
>
> $queryconfirm="SELECT confirm_number from contacts ORDER BY contact DESC
> LIMIT 1";
> $confirmresult=$queryconfirm;
>
> now here's the problem
>
> I want to add 1 to confirm_number:
>
> $confirm_number=$confirmresult;
> $confirm_number+=1;
>
> Now all this does is set the confirm_number record to 1 in the database.
> So I assume that $queryconfirm somehow is not being passed to
AFAIKT your not querying the DB at all and your merely adding 1 to a string,
which results in 1.
adding 1 to a php variable will never cause and update in a database ...
well actually there might be a way to do that but I can't think of it using
some kind of hyper funky object but I'm pretty sure there is no way to
overload the + operator.
> confirm_number? But, while we're here the confirm_number is supposed to
> be 5 digits long and the +1 should make it 10001, 10002, 10003 etc
>
> how would I set the original number to 1000 to begin with? Or should I
> just set that in the database record its self when I'm ready to use the
> website?
1000 + 1 != 10001
you might consider setting a default of 1000 or 10000 or whatever on the given
field so it's automatically populated with that number when a contact record is
created.
--- End Message ---
--- Begin Message ---
On Fri, 2008-11-14 at 08:46 +0100, Jochem Maas wrote:
> 1000 + 1 != 10001
>
> you might consider setting a default of 1000 or 10000 or whatever on
> the given
> field so it's automatically populated with that number when a contact
> record is
> created.
Sorry. Hit the 0 one to few times.
--
Michael S. Dunsavage
--- End Message ---