|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Mon Jan 13 2003 - 07:27:33 CST
php-general Digest 13 Jan 2003 13:27:33 -0000 Issue 1820
Topics (messages 131382 through 131431):
Free web-hosting
131382 by: Rambler
Does PHP's imap_utf7_en/decode compatible with Microsoft Outlook Express?
131383 by: Hunte Swee
php_network_getaddresses()
131384 by: Stanislav Skrypnik
131385 by: Jason Sheets
Re: Permission Denied
131386 by: Stephen
131387 by: Sean Malloy
131389 by: Timothy Hitchens \(HiTCHO\)
Re: php5 cvs
131388 by: daniel
Favorite Email validation routine?
131390 by: Peter Janett
131391 by: Manuel Lemos
131392 by: Justin French
131393 by: Justin French
Re: Pre-built CMS - Anyone recommend one?
131394 by: Jason Wong
class inside class
131395 by: Michael Hall
131400 by: Hatem Ben
131414 by: . Nilaab
131425 by: Michael Hall
Png Could not find/open font
131396 by: Breno Cardoso Perucchi
131397 by: Timothy Hitchens \(HiTCHO\)
131398 by: Jason k Larson
Sessions 'funny' and Zone Alarm Pro 3
131399 by: Neil Stirton
True type font errors . Help me
131401 by: Breno Cardoso Perucchi
131402 by: Torsten Rosenberger
stupid question (Back Function)
131403 by: Remon Redika
131404 by: Sean Malloy
"document contained no data"
131405 by: Justin French
131415 by: Marek Kilimajer
131417 by: Jason Wong
131420 by: Justin French
131423 by: Justin French
131424 by: Marek Kilimajer
Re: Encrypt in Javascript and Decrypt in PHP????
131406 by: Marek Kilimajer
Re: occasional mcrypt problems
131407 by: Marek Kilimajer
Can I Copy a directory using PHP?
131408 by: Alex Ciurea
131410 by: Timothy Hitchens \(HiTCHO\)
131413 by: rw.xend.net
Re: Loading Information into an array.
131409 by: Marek Kilimajer
Session wierdness...
131411 by: Duncan Abbott
131412 by: Timothy Hitchens \(HiTCHO\)
Session wierdness
131416 by: Duncan Abbott
Windows - PHP.INI
131418 by: Naqashzade, Sadeq
pls help with session
131419 by: James Tan
131422 by: Jason k Larson
Need some help in "exec"-attack
131421 by: Alex Ciurea
131427 by: Jason Wong
131429 by: Alex Ciurea
131430 by: Alex Ciurea
131431 by: Jason Wong
attachment problem
131426 by: Lars Olsson
131428 by: Timothy Hitchens \(HiTCHO\)
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hello everybody!
Can anybody advice me the best free web-hosting with PHP?
Thank you.
attached mail follows:
Hi all,
It seems true that php's imap_utf7_en/decode does not compatible with
microsoft outlook express.
We create imap folder(include chinese chars) using IMP, all it ok in IMP
problem, but when use OE
to connect to imap server, the folder can't be shown correctly. And vice
versa.
So my problem is what is wrong? PHP or Outlook Express?
Hunte
Thanks
attached mail follows:
Hi all,
I have the problem with this peace of code.
This code has to include file containing some Javascript functions.
<?
//my_file.php
define ("PATH", "http://mysite/");
$javascript=PATH."inc/javascript_functions.js";
include ($javascript);
?>
When I run this I got message:
"Warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in
name resolution in /physical/location/inc/my_file.php on line 5
Warning: Failed opening 'http://mysite/inc/javascript_functions.js' for
inclusion (include_path='.:/php/includes:/usr/share/php') in
/physical/location/inc/my_file.php on line 5"
I was trying to find info about php_network_getaddresses() but no luck.
Any help would be very appreciated.
Stas.
attached mail follows:
Include will evaluate the file as PHP code, that most likely is not what
you want it to do. Take a look at file_get_contents(), manual page
available at http://www.php.net/manual/en/function.file-get-contents.
Jason
phpSun, 2003-01-12 at 19:36, Stanislav Skrypnik wrote:
> Hi all,
> I have the problem with this peace of code.
> This code has to include file containing some Javascript functions.
> <?
> //my_file.php
> define ("PATH", "http://mysite/");
> $javascript=PATH."inc/javascript_functions.js";
> include ($javascript);
> ?>
>
> When I run this I got message:
>
> "Warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in
> name resolution in /physical/location/inc/my_file.php on line 5
> Warning: Failed opening 'http://mysite/inc/javascript_functions.js' for
> inclusion (include_path='.:/php/includes:/usr/share/php') in
> /physical/location/inc/my_file.php on line 5"
>
> I was trying to find info about php_network_getaddresses() but no luck.
> Any help would be very appreciated.
> Stas.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Yes, I just added it but same error:
Warning: mkdir(c:\inetpub\wwwroot\phpiw\packs\bob) [function.mkdir]:
Permission denied in c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line
28
Here's the part where I try and make the folder:
function do_dir($package) {
umask(0);
if(mkdir($this->currentfolder().'packs\\bob', 0777)) {
return true;
} else {
echo 'There is already a package by the name of '.$package.'! Delete
it and try again.<br><br>';
return false;
}
}
Any ideas?
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <hitcho
php.net>
To: "'Stephen'" <webmaster
melchior.us>; <php-general
lists.php.net>
Sent: Sunday, January 12, 2003 6:33 PM
Subject: RE: [PHP] Permission Denied
: Did you use the umask(0) prior to the mkdir() in your script??
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
: > -----Original Message-----
: > From: Stephen [mailto:webmaster
melchior.us]
: > Sent: Monday, 13 January 2003 9:09 AM
: > To: php-general
lists.php.net
: > Subject: Re: [PHP] Permission Denied
: >
: >
: > Ok, I got it to make a directory as a absolute path but I'm
: > getting a "Permission Denied" error again. I'm running IIS so
: > I can't CHMOD and all the permission options are checked in
: > the options box.
: >
: >
: > ----- Original Message -----
: > From: "Jason Wong" <php-general
gremlins.biz>
: > To: <php-general
lists.php.net>
: > Sent: Sunday, January 12, 2003 4:03 AM
: > Subject: Re: [PHP] Permission Denied
: >
: >
: > : On Sunday 12 January 2003 10:10, Stephen wrote:
: > : > There's already a folder named packs but my problem was
: > not having the /
: > : > before it. One more question. How can I dynamically get
: > the path to the
: > : > current folder? Like your at
: > http://www.bob.com/joe/index.php and you want
: > : > to get the
: > http://www.bob.com/joe/ bit and do it dynamically?
: > :
: > : print_r($_SERVER) will show you which bits you can use.
: > :
: > : --
: > : Jason Wong -> Gremlins Associates -> www.gremlins.biz
: > : Open Source Software Systems Integrators
: > : * Web Design & Hosting * Internet & Intranet Applications
: > Development *
: > :
: > : /*
: > : I'll show you MY telex number if you show me YOURS ...
: > : */
: > :
: > :
: > : --
: > : PHP General Mailing List (http://www.php.net/)
: > : To unsubscribe, visit: http://www.php.net/unsub.php
: > :
: > :
: > :
: >
: >
: >
: > --
: > PHP General Mailing List (http://www.php.net/)
: > To unsubscribe, visit: http://www.php.net/unsub.php
: >
:
:
:
attached mail follows:
I'm assuming you are using IIS.
If your harddrive is formatted using NTFS, you are going to have to add a
new entry to the ACL list for the directory to let the IUSR_<machinename>
account access the directory.
There are plenty of readmes/articles on managing NTFS permissions. I don't
have time to go into the details of how to do it, only to tell you that that
is what you have to do.
BTW; By default Windows XP (If thats what you are using) enables Simple
Sharing/File Permisisons. To turn that off
in Windows Explorer;
Tools | Folder Options | View | (Scroll Right Down to bottom) Use simple
sharing <-- untick
-----Original Message-----
From: Stephen [mailto:webmaster
melchior.us]
Sent: Monday, 13 January 2003 2:36 PM
To: hitcho
php.net
Cc: PHP List
Subject: Re: [PHP] Permission Denied
Yes, I just added it but same error:
Warning: mkdir(c:\inetpub\wwwroot\phpiw\packs\bob) [function.mkdir]:
Permission denied in c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line
28
Here's the part where I try and make the folder:
function do_dir($package) {
umask(0);
if(mkdir($this->currentfolder().'packs\\bob', 0777)) {
return true;
} else {
echo 'There is already a package by the name of '.$package.'! Delete
it and try again.<br><br>';
return false;
}
}
Any ideas?
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <hitcho
php.net>
To: "'Stephen'" <webmaster
melchior.us>; <php-general
lists.php.net>
Sent: Sunday, January 12, 2003 6:33 PM
Subject: RE: [PHP] Permission Denied
: Did you use the umask(0) prior to the mkdir() in your script??
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
: > -----Original Message-----
: > From: Stephen [mailto:webmaster
melchior.us]
: > Sent: Monday, 13 January 2003 9:09 AM
: > To: php-general
lists.php.net
: > Subject: Re: [PHP] Permission Denied
: >
: >
: > Ok, I got it to make a directory as a absolute path but I'm
: > getting a "Permission Denied" error again. I'm running IIS so
: > I can't CHMOD and all the permission options are checked in
: > the options box.
: >
: >
: > ----- Original Message -----
: > From: "Jason Wong" <php-general
gremlins.biz>
: > To: <php-general
lists.php.net>
: > Sent: Sunday, January 12, 2003 4:03 AM
: > Subject: Re: [PHP] Permission Denied
: >
: >
: > : On Sunday 12 January 2003 10:10, Stephen wrote:
: > : > There's already a folder named packs but my problem was
: > not having the /
: > : > before it. One more question. How can I dynamically get
: > the path to the
: > : > current folder? Like your at
: > http://www.bob.com/joe/index.php and you want
: > : > to get the
: > http://www.bob.com/joe/ bit and do it dynamically?
: > :
: > : print_r($_SERVER) will show you which bits you can use.
: > :
: > : --
: > : Jason Wong -> Gremlins Associates -> www.gremlins.biz
: > : Open Source Software Systems Integrators
: > : * Web Design & Hosting * Internet & Intranet Applications
: > Development *
: > :
: > : /*
: > : I'll show you MY telex number if you show me YOURS ...
: > : */
: > :
: > :
: > : --
: > : PHP General Mailing List (http://www.php.net/)
: > : To unsubscribe, visit: http://www.php.net/unsub.php
: > :
: > :
: > :
: >
: >
: >
: > --
: > PHP General Mailing List (http://www.php.net/)
: > To unsubscribe, visit: http://www.php.net/unsub.php
: >
:
:
:
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Who owns the htdocs root (I know it is Windows) when you right click you should should see sharing/security.
Do you if not what OS Ver are you using?
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Stephen [mailto:webmaster
melchior.us]
> Sent: Monday, 13 January 2003 1:36 PM
> To: hitcho
php.net
> Cc: PHP List
> Subject: Re: [PHP] Permission Denied
>
>
> Yes, I just added it but same error:
>
> Warning: mkdir(c:\inetpub\wwwroot\phpiw\packs\bob)
> [function.mkdir]: Permission denied in
> c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line 28
>
> Here's the part where I try and make the folder:
>
> function do_dir($package) {
> umask(0);
> if(mkdir($this->currentfolder().'packs\\bob', 0777)) {
> return true;
> } else {
> echo 'There is already a package by the name of
> '.$package.'! Delete it and try again.<br><br>';
> return false;
> }
> }
>
> Any ideas?
> ----- Original Message -----
> From: "Timothy Hitchens (HiTCHO)" <hitcho
php.net>
> To: "'Stephen'" <webmaster
melchior.us>; <php-general
lists.php.net>
> Sent: Sunday, January 12, 2003 6:33 PM
> Subject: RE: [PHP] Permission Denied
>
>
> : Did you use the umask(0) prior to the mkdir() in your script??
> :
> :
> : Timothy Hitchens (HiTCHO)
> : Open Platform Consulting
> : e-mail: tim
hitcho.com.au
> :
> : > -----Original Message-----
> : > From: Stephen [mailto:webmaster
melchior.us]
> : > Sent: Monday, 13 January 2003 9:09 AM
> : > To: php-general
lists.php.net
> : > Subject: Re: [PHP] Permission Denied
> : >
> : >
> : > Ok, I got it to make a directory as a absolute path but I'm
> : > getting a "Permission Denied" error again. I'm running IIS so
> : > I can't CHMOD and all the permission options are checked in
> : > the options box.
> : >
> : >
> : > ----- Original Message -----
> : > From: "Jason Wong" <php-general
gremlins.biz>
> : > To: <php-general
lists.php.net>
> : > Sent: Sunday, January 12, 2003 4:03 AM
> : > Subject: Re: [PHP] Permission Denied
> : >
> : >
> : > : On Sunday 12 January 2003 10:10, Stephen wrote:
> : > : > There's already a folder named packs but my problem was
> : > not having the /
> : > : > before it. One more question. How can I dynamically get
> : > the path to the
> : > : > current folder? Like your at
> : > http://www.bob.com/joe/index.php and you want
> : > : > to get the
> : > http://www.bob.com/joe/ bit and do it dynamically?
> : > :
> : > : print_r($_SERVER) will show you which bits you can use.
> : > :
> : > : --
> : > : Jason Wong -> Gremlins Associates -> www.gremlins.biz
> : > : Open Source Software Systems Integrators
> : > : * Web Design & Hosting * Internet & Intranet Applications
> : > Development *
> : > :
> : > : /*
> : > : I'll show you MY telex number if you show me YOURS ...
> : > : */
> : > :
> : > :
> : > : --
> : > : PHP General Mailing List (http://www.php.net/)
> : > : To unsubscribe, visit: http://www.php.net/unsub.php
> : > :
> : > :
> : > :
> : >
> : >
> : >
> : > --
> : > PHP General Mailing List (http://www.php.net/)
> : > To unsubscribe, visit: http://www.php.net/unsub.php
> : >
> :
> :
> :
>
>
attached mail follows:
right ok , but obviously it wouldnt have an effect anyway prior to php5 thanks
anyway.
>===== Original Message From "Sean Malloy" <sean
element.net.au> =====
>No the documentaton you are talking about, was that prior to ZE2 people were
>using underscores to denote private functions/variables. With ZE2, they
>wouldn't have to.
>
>-----Original Message-----
>From: Dan Rossi [mailto:daniel
electroteque.org]
>Sent: Sunday, 12 January 2003 11:23 PM
>To: zeev
zend.com
>Cc: php-general
lists.php.net
>Subject: RE: [PHP] php5 cvs
>
>
>its cool , i cant remember where i saw the reference , but it was claiming
>to prefix the functions with underscores to denote private functions in php
>4 for the rollover of php5, it was a pretty legit resource i cant remember
>where though have too many bookmarks, oh well at least i know now , i think
>it meant to underscore them , to make the private functions recognisable so
>then the rewrite for the proper OO in php5 can be easy as adding private
>where the underscores are ??, i gave 5 a test, compiled with no problems
>except my ming extension didnt seem to load properly so will stick with for
>4.3 for now.
>aparantly its still not true OO as you have to add the constructor of the
>base class inside the sub class constructor where other languages dont need
>to do this, i was told from my c++ flatmate of mine but correct me if i'm
>wrong but sadly i dont know much c++ apart from modding source code now and
>then :D
>
>-----Original Message-----
>From: Zeev Suraski [mailto:zeev
zend.com]
>Sent: Sunday, January 12, 2003 11:13 PM
>To: electroteque
>Cc: php-general
lists.php.net
>Subject: Re: [PHP] php5 cvs
>
>
>Not sure what you mean by 'changed', but the way to denote private
>functions is by adding 'private' to the method declaration, and not by
>prefixing them with _.
>
>You can do it using:
>
>class bar {
> private function foo()
> {
> ...
> }
> ...
>};
>
>Zeev
>
>At 09:43 12/01/2003, electroteque wrote:
>>hmm has the public and private function accessor changed ? i have been
>>building my classes with test() and _test() to differentiate from public
>and
>>private and have been waiting to try it out but i can still access both !
>??
>>
>>"Electroteque" <daniel
electroteque.org> wrote in message
>>news:20030112014117.25347.qmail
pb1.pair.com...
>> > lol no , i am gonna try and upgrade my workfrom dinasour php3 to php
>4.3,
>>i
>> > have a development box here
home i just upgraded to the 4.3 release
>from
>> > rc3 and am gonna try out version 5 then it doesnt matter how stable it
>is
>>at
>> > home really :D
>> >
>> > "Danny Shepherd" <danny
kyboshed.com> wrote in message
>> > news:000b01c2b9d2$ae5e46c0$6400a8c0
DANNYS...
>> > > It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't
>>even
>> > > reached beta status yet, so don't even think about using it for
>>production
>> > > work. That said, I didn't have any problems building it and it seems
>> > pretty
>> > > stable.
>> > >
>> > > A list of changes and features can be found at
>> > > http://www.php.net/ZEND_CHANGES.txt.
>> > >
>> > > HTH
>> > >
>> > > Danny.
>> > >
>> > > ----- Original Message -----
>> > > From: "electroteque" <daniel
electroteque.org>
>> > > To: <php-general
lists.php.net>
>> > > Sent: Saturday, January 11, 2003 6:50 PM
>> > > Subject: [PHP] php5 cvs
>> > >
>> > >
>> > > > hi guys just noticed php5 cvs in the snaps page , does this have the
>> > zend
>> > > > 2.0 engine ? more specific question has it got the proper OO built
>in
>> > yet
>> > > ?
>> > > >
>> > > >
>> > > >
>> > > > --
>> > > > PHP General Mailing List (http://www.php.net/)
>> > > > To unsubscribe, visit: http://www.php.net/unsub.php
>> > > >
>> > >
>> >
>> >
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I'm looking for everyone's favorite email syntax validation routine. Code that takes an email address and does regex on it to determine if it's formatted correctly.
I know there are some on phpclasses.org that actually check the mx record and server of the domain, but I'm just looking for a good, clean and fast email address syntax check.
So, what is your favorite bit of code to do that?
Thanks,
Peter Janett
attached mail follows:
Hello,
On 01/13/2003 03:21 AM, Peter Janett wrote: > I'm looking for everyone's favorite email syntax validation routine. Code > that takes an email address and does regex on it to determine if it's > formatted correctly. > > I know there are some on phpclasses.org that actually check the mx record > and server of the domain, but I'm just looking for a good, clean and fast > email address syntax check. > > So, what is your favorite bit of code to do that?
This class that I don't know if you seen also comes with complex regex for simple e-mail address validation:
http://www.phpclasses.org/emailvalidation
--Regards, Manuel Lemos
attached mail follows:
I use, and love the simplicity of, validEmailFormat()... it's a near-as-possible port of someone's Perl script which has become close to the definitive script/function for Perl developers.
http://www.killersoft.com/downloads/pafiledb.php?action=category&id=1
Cheers,
Justin
on 13/01/03 4:21 PM, Peter Janett (phplist
newmediaone.com) wrote:
> I'm looking for everyone's favorite email syntax validation routine. Code > that takes an email address and does regex on it to determine if it's > formatted correctly. > > I know there are some on phpclasses.org that actually check the mx record > and server of the domain, but I'm just looking for a good, clean and fast > email address syntax check. > > So, what is your favorite bit of code to do that? > > Thanks, > > Peter Janett > > >
attached mail follows:
Just checked the URL -- there are now 2 versions... I'm using 1.0
Justin
on 13/01/03 4:38 PM, Justin French (justin
indent.com.au) wrote:
> I use, and love the simplicity of, validEmailFormat()... it's a
> near-as-possible port of someone's Perl script which has become close to the
> definitive script/function for Perl developers.
>
> http://www.killersoft.com/downloads/pafiledb.php?action=category&id=1
>
> Cheers,
>
> Justin
>
>
>
> on 13/01/03 4:21 PM, Peter Janett (phplist
newmediaone.com) wrote:
>
>> I'm looking for everyone's favorite email syntax validation routine. Code
>> that takes an email address and does regex on it to determine if it's
>> formatted correctly.
>>
>> I know there are some on phpclasses.org that actually check the mx record
>> and server of the domain, but I'm just looking for a good, clean and fast
>> email address syntax check.
>>
>> So, what is your favorite bit of code to do that?
>>
>> Thanks,
>>
>> Peter Janett
>>
>>
>>
>
attached mail follows:
On Monday 13 January 2003 05:07, Chris Mason wrote: > eZPublish is probably your best bet.
Have a look at Typo3. More difficult than average to install and use but extremely powerful and flexible.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* The sixth sheik's sixth sheep's sick. [so say said sentence sextuply...] */
attached mail follows:
--G'day:
I am using a 'wrapper' class to create all the boilerplate HTML on a website, plus do stuff like authentication and print menus etc according to properties set dynamically within the class.
The actual content of each page is generated by seperate 'content' classes. These classes are 'embedded' within and instantiated within the wrapper class, but are otherwise independent of it.
This system allows for something approaching a PHP "object publishing" application, which is where I'm heading.
My problem is that now I need to get at the values of some wrapper class properties from within a content class: in other words, I need to access the dynamically assigned values of the properties of one class, from inside another class (which is embedded within the first, though I'm not sure that really matters).
I can't use the $this-> mechanism because the value is inside a different class. I can't use the first class's handle (eg $page , from $page = new WebPage()) because the embedded class doesn't know about it. I have been playing around with declaring globals, and with PHP's class/object functions, but have got nowhere yet.
Is this possible, and if so, does anyone have any pointers? Hope my description of the problem makes sense.
TIA Mick
---------------------------------------------------- MICHAEL HALL Web Development Officer Batchelor Institute of Indigenous Tertiary Education W: mick.hall
nt.gov.au (08) 8951 8352 H: ninti
ninti.com (08) 8953 1442 ----------------------------------------------------
attached mail follows:
Assuming you have
class WebPage { var $property1; function get_property1() { return $this->$property1; } }
class Sample extends WebPage{ }
To access $property1 from your WebPage class just do
$page = new Sample; $prop1 = $page->get_property1();
Otherwise try to send a snippets of code to see exactly what's you'r doing :)
Regards, Hatem
----- Original Message -----
From: "Michael Hall" <ninti
ninti.com>
To: <php-general
lists.php.net>
Sent: Monday, January 13, 2003 7:19 AM
Subject: [PHP] class inside class
> --
>
> G'day:
>
> I am using a 'wrapper' class to create all the boilerplate HTML on a
website,
> plus do stuff like authentication and print menus etc according to
properties
> set dynamically within the class.
>
> The actual content of each page is generated by seperate 'content'
classes.
> These classes are 'embedded' within and instantiated within the wrapper
class,
> but are otherwise independent of it.
>
> This system allows for something approaching a PHP "object publishing"
> application, which is where I'm heading.
>
> My problem is that now I need to get at the values of some wrapper class
> properties from within a content class: in other words, I need to access
the
> dynamically assigned values of the properties of one class, from inside
another
> class (which is embedded within the first, though I'm not sure that really
> matters).
>
> I can't use the $this-> mechanism because the value is inside a different
> class.
> I can't use the first class's handle (eg $page , from $page = new
WebPage())
> because the embedded class doesn't know about it.
> I have been playing around with declaring globals, and with PHP's
class/object
> functions, but have got nowhere yet.
>
>
> Is this possible, and if so, does anyone have any pointers? Hope my
description
> of the problem makes sense.
>
> TIA
> Mick
>
> ----------------------------------------------------
> MICHAEL HALL Web Development Officer
> Batchelor Institute of Indigenous Tertiary Education
> W: mick.hall
nt.gov.au (08) 8951 8352
> H: ninti
ninti.com (08) 8953 1442
> ----------------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If these two classes are in separate files then you will need to include one of the classes in with the other class using the include() or require() functions. Have you also used the extends keyword to extend the main class? When you use inheritance properties, you can use the $this-> mechanism within the classes to reference all functions of both classes. Read about inheritance of classes for more information. If you already knew the above and it doesn't help you, then just ignore it. I'm just trying to narrow down your problem. Good luck.
> -----Original Message-----
> From: Michael Hall [mailto:ninti
ninti.com]
> Sent: Monday, January 13, 2003 12:20 AM
> To: php-general
lists.php.net
> Subject: [PHP] class inside class
>
>
> --
>
> G'day:
>
> I am using a 'wrapper' class to create all the boilerplate HTML
> on a website,
> plus do stuff like authentication and print menus etc according
> to properties
> set dynamically within the class.
>
> The actual content of each page is generated by seperate
> 'content' classes.
> These classes are 'embedded' within and instantiated within the
> wrapper class,
> but are otherwise independent of it.
>
> This system allows for something approaching a PHP "object publishing"
> application, which is where I'm heading.
>
> My problem is that now I need to get at the values of some wrapper class
> properties from within a content class: in other words, I need to
> access the
> dynamically assigned values of the properties of one class, from
> inside another
> class (which is embedded within the first, though I'm not sure
> that really
> matters).
>
> I can't use the $this-> mechanism because the value is inside a different
> class.
> I can't use the first class's handle (eg $page , from $page = new
> WebPage())
> because the embedded class doesn't know about it.
> I have been playing around with declaring globals, and with PHP's
> class/object
> functions, but have got nowhere yet.
>
>
> Is this possible, and if so, does anyone have any pointers? Hope
> my description
> of the problem makes sense.
>
> TIA
> Mick
>
> ----------------------------------------------------
> MICHAEL HALL Web Development Officer
> Batchelor Institute of Indigenous Tertiary Education
> W: mick.hall
nt.gov.au (08) 8951 8352
> H: ninti
ninti.com (08) 8953 1442
> ----------------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Thankyou Nilaab and Hatem for the replies.
I can see that extending classes is probably the way to go. I was kind of aware of how it works, but didn't see it as an obvious solution. But looking at it more closely, I think I should be able to put most common stuff in a basic class. Different kinds of pages can then be created by extension classes with one or two unique functions, and the rest inherited ... pretty obvious really :)
Mick
Quoting "
Nilaab" <superbus22
attbi.com>:
> If these two classes are in separate files then you will need to include
> one
> of the classes in with the other class using the include() or require()
> functions. Have you also used the extends keyword to extend the main class?
> When you use inheritance properties, you can use the $this-> mechanism
> within the classes to reference all functions of both classes. Read about
> inheritance of classes for more information. If you already knew the above
> and it doesn't help you, then just ignore it. I'm just trying to narrow
> down
> your problem. Good luck.
>
>
> > -----Original Message-----
> > From: Michael Hall [mailto:ninti
ninti.com]
> > Sent: Monday, January 13, 2003 12:20 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] class inside class
> >
> >
> > --
> >
> > G'day:
> >
> > I am using a 'wrapper' class to create all the boilerplate HTML
> > on a website,
> > plus do stuff like authentication and print menus etc according
> > to properties
> > set dynamically within the class.
> >
> > The actual content of each page is generated by seperate
> > 'content' classes.
> > These classes are 'embedded' within and instantiated within the
> > wrapper class,
> > but are otherwise independent of it.
> >
> > This system allows for something approaching a PHP "object publishing"
> > application, which is where I'm heading.
> >
> > My problem is that now I need to get at the values of some wrapper class
> > properties from within a content class: in other words, I need to
> > access the
> > dynamically assigned values of the properties of one class, from
> > inside another
> > class (which is embedded within the first, though I'm not sure
> > that really
> > matters).
> >
> > I can't use the $this-> mechanism because the value is inside a different
> > class.
> > I can't use the first class's handle (eg $page , from $page = new
> > WebPage())
> > because the embedded class doesn't know about it.
> > I have been playing around with declaring globals, and with PHP's
> > class/object
> > functions, but have got nowhere yet.
> >
> >
> > Is this possible, and if so, does anyone have any pointers? Hope
> > my description
> > of the problem makes sense.
> >
> > TIA
> > Mick
> >
> > ----------------------------------------------------
> > MICHAEL HALL Web Development Officer
> > Batchelor Institute of Indigenous Tertiary Education
> > W: mick.hall
nt.gov.au (08) 8951 8352
> > H: ninti
ninti.com (08) 8953 1442
> > ----------------------------------------------------
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
----------------------------------------------------
Michael Hall Web Development Officer
Batchelor Institute of Indigenous Tertiary Education
Work: mick.hall
nt.gov.au (08) 8951 8352
Home: ninti
ninti.com (08 8953 1442
----------------------------------------------------
attached mail follows:
How I can resolve this ? This is my configuration of php (phpinfo) Somebody can help me ? This is very important GD GD Support enabled GD Version bundled (2.0 compatible) FreeType Support enabled FreeType Linkage with freetype GIF Read Support enabled PNG Support enabled WBMP Support enabled
Warning: Could not find/open font in
/usr/home/hosting/b4u/public_html/congressos/fenasoft/ProgramacaoListar.php
on line 5
?PNG IHDRj+PLTEϿT_%Y)IDATxocP"0(" ~"
"Ie
&cQ]Fu".*Y"
uPIENDB`,
Breno
breno
omegatec.net
attached mail follows:
I would suggest that in your script it is using a font for a GD operation and you need to make sure that PHP know's how to find that font.
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Breno Cardoso Perucchi [mailto:breno
omegatec.net]
> Sent: Monday, 13 January 2003 4:37 PM
> To: php-general
lists.php.net
> Subject: [PHP] Png Could not find/open font
>
>
> How I can resolve this ?
> This is my configuration of php (phpinfo)
> Somebody can help me ? This is very important
> GD
> GD Support enabled
> GD Version bundled (2.0 compatible)
> FreeType Support enabled
> FreeType Linkage with freetype
> GIF Read Support enabled
> PNG Support enabled
> WBMP Support enabled
>
> Warning: Could not find/open font in
> /usr/home/hosting/b4u/public_html/congressos/fenasoft/Programa
> caoListar.php
> on line 5
> ?PNG IHDRj+PLTEϿT_%Y)IDATxocP" 0(" ~"
> "Ie
&cQ]Fu".*Y"
uPIENDB`,
>
>
> Breno
> breno
omegatec.net
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
One of the parameters you specified for (and I'm guessing here) imagettftext was a path to a font file. PHP needs to know the full path to this file. I'm betting it doesn't exist, as it didn't on mine until I copied it there. I realized from others that you can use windows font files if you want. So just copy, for instance, arial.ttf where you need it.
HTH, Jason k Larson
Breno Cardoso Perucchi wrote:
> How I can resolve this ?
> This is my configuration of php (phpinfo)
> Somebody can help me ? This is very important
> GD
> GD Support enabled
> GD Version bundled (2.0 compatible)
> FreeType Support enabled
> FreeType Linkage with freetype
> GIF Read Support enabled
> PNG Support enabled
> WBMP Support enabled
>
> Warning: Could not find/open font in
> /usr/home/hosting/b4u/public_html/congressos/fenasoft/ProgramacaoListar.php
> on line 5
> ?PNG IHDRj+PLTEϿT_%Y)IDATxocP"0(" ~"
> "Ie
&cQ]Fu".*Y"
uPIENDB`,
>
>
> Breno
> breno
omegatec.net
attached mail follows:
Hi,
I've started developing a shopping cart and was just testing and found that I get strange results when Zone Alarm's Cookie Control is set to anything other than "Off".
If anything, I would expect the shopping cart to forget its contents between pages but instead I am getting weird results.
(I have many other files/classes being called from this test.php file)
test.php -------- <html> <head>
<?php // I include all my necessary files/functions (none of which require the session // to already be started)
session_start(); if ( !isset( $_SESSION[ 'cart' ] ) ) { $_SESSION[ 'cart' ] = new Cart(); }
?>
</head> <body>
<?php $f_id = isset( $_POST[ 'f_id' ] ) ? $_POST[ 'f_id' ] : 1; $f_price = isset( $_POST[ 'f_price' ] ) ? $_POST[ 'f_price' ] : 0; $f_qty = isset( $_POST[ 'f_qty' ] ) ? $_POST[ 'f_qty' ] : 1; $f_desc = isset( $_POST[ 'f_desc' ] ) ? $_POST[ 'f_desc' ] : '';
// Form action $f_act = isset( $_POST[ 'f_act' ] ) ? $_POST[ 'f_act' ] : '';
if ( $f_act == 'add' ) { $_SESSION[ 'cart' ] -> add_item( $f_id, $f_qty, $f_desc, $f_price, '' ); } elseif ( $f_act == 'remove' ) { $_SESSION[ 'cart' ] -> remove_item( $f_id ); } elseif ( $f_act == 'update' ) { $_SESSION[ 'cart' ] -> update_item( $f_id, $f_qty, $f_price, false ); } else { echo '<pre>'; print_r ($_SESSION); echo '</pre>'; }
?>
<form action="<?php echo $_SERVER[ 'PHP_SELF' ]; ?>" method="post"> <input type="hidden" name="f_price" value="10.00" /> Product = CD <input type="hidden" name="f_desc" value="CD" /> <input type="hidden" name="f_id" value="1" /> Qty:<input type="text" name="f_qty" size="3" maxlength="4" value="1" /> <input type="submit" name="f_act" value="add" class="button" /> <input type="submit" name="f_act" value="remove" class="button" /> <input type="submit" name="f_act" value="update" class="button" /> </form>
<?php echo '<pre>'; print_r ($_SESSION); echo '</pre>';
?> </body> </html>
--------------------------------------------------------------
This script obviously calls itself (not sure if that is part of the problem?)
Scenario (with ZA cookie control set to Medium) -----------------------------------------------
Leave the quantity set to 1 and click add, the session then shows that there is one item in the cart.
Click add again and there are 3 items in the cart. Click again and there are 5 items.
If I now change the quantity to say 10, there will be 16 items (the 5 that were there a minute ago plus the 10 plus what appears to be the value that quantity was previously set to i.e. 1.
Thus if I then go and set the quantity to 5, it will take the previous value (10) plus the new value (5) and add it to the cart (16), giving 31.
Turning ZA OFF and all works as expected.
Since my cart is a serious of objects/arrays, I changed the following to try and track down the problem.
Changed: -------- session_start(); if ( !isset( $_SESSION[ 'cart' ] ) ) { $_SESSION[ 'cart' ] = new Cart(); }
?>
To:
---
session_start();
if ( !isset( $_SESSION[ 'cart' ] ) ) {
$_SESSION[ 'cart' ] = new Cart();
$_SESSION[ 'count' ] = 0;
}
$_SESSION[ 'count' ]++;
echo $_SESSION[ 'count' ];
?>
The count variable was also going up in the same fashion as the cart items
which makes me think that the page itself is being called several times
before
being displayed.
I'm tearing my hair out here and I can't leave it as is and the cart has to
go into production and I can't have people buying 31 items when they wanted
3 :)
Anyone any suggestions at all.
Regards,
Neil Stiron
attached mail follows:
Hello,
I am one week recompiling source of php-4.2.3 to put support TTF I am having problem with gd true type font . I've been trying execute this php. But, always show me this error
Warning: Could not find/open font in
/usr/home/hosting/b4u/public_html/congressos/fenasoft/ProgramacaoListar.php
on line 5
?PNG IHDRj+PLTEϿT_%Y)IDATxocP"0(" ~"
"Ie
&cQ]Fu".*Y"
uPIENDB`,
This is my phpinfo GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with freetype
I found a webhosting that function my php.This is php configuration of webhosting GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with TTF library
Thanks for help me.
Breno
breno
omegatec.net
attached mail follows:
Hello
> Warning: Could not find/open font in > /usr/home/hosting/b4u/public_html/congressos/fenasoft/ProgramacaoListar.php > on line 5
You must give the absolute path to your font dir
for example /usr/home/hosting/b4u/fontsdir
BR/Torsten
attached mail follows:
hi everyone,
It's Possible We used Php Scripting to Back the client Browser Like This Below : (ussualy I make it with java script) :
"javascript:history.back(1)"
but right now, i need using the 'header's function', functionaly to back the page to previouse page.
sorry before :)
attached mail follows:
You could grab the referring page and send the user back to it, but some proxies/software stop your browser from sending that information, so it might not work in all situations
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?">Back</a>
however, quoting the docs on using the referrer:
This is set by the user agent (client browser). Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
-----Original Message-----
From: Remon Redika [mailto:reymond
unri.ac.id]
Sent: Monday, 13 January 2003 8:33 PM
To: php-general
lists.php.net
Subject: [PHP] stupid question (Back Function)
hi everyone,
It's Possible We used Php Scripting to Back the client Browser Like This Below : (ussualy I make it with java script) :
"javascript:history.back(1)"
but right now, i need using the 'header's function', functionaly to back the page to previouse page.
sorry before :)
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi gang,
I'm encountering a strange, random, sporadic error on a new server. Basically, sometimes, in a non-repeatable fashion, a page will not load.
In NN7 Mac, the error is "the page contained no data". In IE5.x Mac, the error is along the lines of "host not found" or "could not access URL ...".
Until 5 minutes ago, I was pretty damn sure it was the host, and have been complaining constantly for about a week, but I was just using some non-PHP stuff on the server without any problems, which leads me to believe it may be a problem with my code, or perhaps with a portion of the installation or PHP, or a combination.
Problem is, this will be like finding a needle in a haystack. For starters, I can't repeat the problem on my server. I also can't repeat the problem on another server. It's also random -- I can go a day without seeing the error, and then get stuck with them for half an hour or more. It's also on any and every script, not just *a script* or *some scripts*.
I'm also not inclined to post any code, because the application is quite large and complex, with many include files and modules.
I guess what I'm hoping for is some wild stabs in the dark as to what the problem might be, and where I might start looking.
I have no idea where to start. It seems to me that if it IS my code, it must be something high up at the start of my scripts, in the include()'d files.
The code does make a "persistent" connection to the DB in an auto-prepend file at the beginning of each and every script: <? $db = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db("db_name",$db); ?>
The code also:
- (occasionally) makes use of header() redirects - makes use of trans_sid for users without cookies (I have them enabled, so pretty much rules that out), but I thought it was worth mentioning, especially since this feature is unique to this server (my local test server doesn't have it for example) - inserts a row into the database for my statics/counters - calls session_start();
Any ideas?
You're probably all laughing and shaking your head with a "no", but it's worth a shot, I'm all out of ideas!!
Justin
attached mail follows:
Couple things you can try: - if you are using output buffer, try turning it off - check other virtual hosts on the server when these problems occur - if you have access to the logs, check them if the server is not dying
Justin French wrote:
>Hi gang, > >I'm encountering a strange, random, sporadic error on a new server. >Basically, sometimes, in a non-repeatable fashion, a page will not load. > >In NN7 Mac, the error is "the page contained no data". In IE5.x Mac, the >error is along the lines of "host not found" or "could not access URL ...". > >Until 5 minutes ago, I was pretty damn sure it was the host, and have been >complaining constantly for about a week, but I was just using some non-PHP >stuff on the server without any problems, which leads me to believe it may >be a problem with my code, or perhaps with a portion of the installation or >PHP, or a combination. > >Problem is, this will be like finding a needle in a haystack. For starters, >I can't repeat the problem on my server. I also can't repeat the problem on >another server. It's also random -- I can go a day without seeing the >error, and then get stuck with them for half an hour or more. It's also on >any and every script, not just *a script* or *some scripts*. > >I'm also not inclined to post any code, because the application is quite >large and complex, with many include files and modules. > > >I guess what I'm hoping for is some wild stabs in the dark as to what the >problem might be, and where I might start looking. > > >I have no idea where to start. It seems to me that if it IS my code, it >must be something high up at the start of my scripts, in the include()'d >files. > >The code does make a "persistent" connection to the DB in an auto-prepend >file at the beginning of each and every script: ><? >$db = mysql_connect($dbhost, $dbuser, $dbpass); >mysql_select_db("db_name",$db); >?> > >The code also: > >- (occasionally) makes use of header() redirects >- makes use of trans_sid for users without cookies (I have them enabled, so >pretty much rules that out), but I thought it was worth mentioning, >especially since this feature is unique to this server (my local test server >doesn't have it for example) >- inserts a row into the database for my statics/counters >- calls session_start(); > > >Any ideas? > > >You're probably all laughing and shaking your head with a "no", but it's >worth a shot, I'm all out of ideas!! > > >Justin > > > >
attached mail follows:
On Monday 13 January 2003 17:46, Justin French wrote: > Hi gang, > > I'm encountering a strange, random, sporadic error on a new server. > Basically, sometimes, in a non-repeatable fashion, a page will not load. > > In NN7 Mac, the error is "the page contained no data". In IE5.x Mac, the > error is along the lines of "host not found" or "could not access URL ...".
That looks like a network problem. Check the server logs to confirm whether a request was logged.
a) if the request is not logged then i) you have network problems OR ii) your webserver is severely ill
b) if in all cases, the request is logged but you get that error then you could try putting some simple code at the beginning of your page to confirm that the page _is_ being executed. Something like writing a line to a file.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Success is relative: It is what we can make of the mess we have made of things. -- T.S. Eliot, "The Family Reunion" */
attached mail follows:
on 13/01/03 9:34 PM, Marek Kilimajer (kilimajer
webglobe.sk) wrote:
> Couple things you can try: > - if you are using output buffer, try turning it off
nope, not using any ob :)
> - check other virtual hosts on the server when these problems occur
can't tell for sure... without constantly surfing a site for hours "hoping" to get an error... I do, however, occasionally check other sites on the same server (one using the same library of code), and haven't spotted a problem yet.
> - if you have access to the logs, check them if the server is not dying
I have access to the logs, but it's a bit tricky -- I have to wait until I spot an error, then download a 10+meg log, and try and find my request... but I'll work on that next for sure.
Justin
> Justin French wrote: > >> Hi gang, >> >> I'm encountering a strange, random, sporadic error on a new server. >> Basically, sometimes, in a non-repeatable fashion, a page will not load. >> >> In NN7 Mac, the error is "the page contained no data". In IE5.x Mac, the >> error is along the lines of "host not found" or "could not access URL ...". >> >> Until 5 minutes ago, I was pretty damn sure it was the host, and have been >> complaining constantly for about a week, but I was just using some non-PHP >> stuff on the server without any problems, which leads me to believe it may >> be a problem with my code, or perhaps with a portion of the installation or >> PHP, or a combination. >> >> Problem is, this will be like finding a needle in a haystack. For starters, >> I can't repeat the problem on my server. I also can't repeat the problem on >> another server. It's also random -- I can go a day without seeing the >> error, and then get stuck with them for half an hour or more. It's also on >> any and every script, not just *a script* or *some scripts*. >> >> I'm also not inclined to post any code, because the application is quite >> large and complex, with many include files and modules. >> >> >> I guess what I'm hoping for is some wild stabs in the dark as to what the >> problem might be, and where I might start looking. >> >> >> I have no idea where to start. It seems to me that if it IS my code, it >> must be something high up at the start of my scripts, in the include()'d >> files. >> >> The code does make a "persistent" connection to the DB in an auto-prepend >> file at the beginning of each and every script: >> <? >> $db = mysql_connect($dbhost, $dbuser, $dbpass); >> mysql_select_db("db_name",$db); >> ?> >> >> The code also: >> >> - (occasionally) makes use of header() redirects >> - makes use of trans_sid for users without cookies (I have them enabled, so >> pretty much rules that out), but I thought it was worth mentioning, >> especially since this feature is unique to this server (my local test server >> doesn't have it for example) >> - inserts a row into the database for my statics/counters >> - calls session_start(); >> >> >> Any ideas? >> >> >> You're probably all laughing and shaking your head with a "no", but it's >> worth a shot, I'm all out of ideas!! >> >> >> Justin >> >> >> >> >
attached mail follows:
on 13/01/03 10:05 PM, Jason Wong (php-general
gremlins.biz) wrote:
> On Monday 13 January 2003 17:46, Justin French wrote: >> Hi gang, >> >> I'm encountering a strange, random, sporadic error on a new server. >> Basically, sometimes, in a non-repeatable fashion, a page will not load. >> >> In NN7 Mac, the error is "the page contained no data". In IE5.x Mac, the >> error is along the lines of "host not found" or "could not access URL ...". > > That looks like a network problem. Check the server logs to confirm whether a > request was logged. > > a) if the request is not logged then > i) you have network problems OR > ii) your webserver is severely ill
This is harder than it sounds :) because the error is so random and intermittent, I might have to click around the site for a whole day before I get the error... then I've gotta download a 10meg log file, and try and find my request somewhere down the bottom.
> b) if in all cases, the request is logged but you get that error then you > could try putting some simple code at the beginning of your page to confirm > that the page _is_ being executed. Something like writing a line to a file.
Again, I'm not sure how I'd distinguish MY request from the others... given that it might take a minute, or an hour, or a day for an error to occur... I *wish* I could repeat the error reliably, so that I could get to the bottom of it.
perhaps I could log page,date,time,IP address for a few days, then I could at least find my IP in the log, and the rough time of the error...
Justin
attached mail follows:
> > > >perhaps I could log page,date,time,IP address for a few days, then I could >at least find my IP in the log, and the rough time of the error... > > Or log only requests from your IP.
> >Justin > > > >
attached mail follows:
This has been solved - the extra characters are stored in session, otherwise attacker can repeat it too. Password can be stored on the server using one way has - on the client the script hashes twice, first to get hashed password, then together with random string
Gerald Timothy Quimpo wrote:
>On Saturday 11 January 2003 12:12 am, Scott Fletcher wrote: > > >>The only thing that is important to me is that the password get >>encrypted before transmitting across the internet. >> >> > >from other posts further in the thread it looks like you aren't >ready to use https. that's too bad. that would really be the >right solution. > >but since you must hash, one problem with hashing is, it is still >necessary to have the hash vary from one invocation to another. >otherwise, if the hash is the same every time the user logs in >(i.e., if all you do is take the password and run it through md5), >then anyone who can sniff the hash will be able to replay a login. > >unfortunately, if you want the hash to be different from one >invocation to the next, then the password cannot be stored >on the server as a one-way hash. instead, it would be either >plaintext or encrypted on the server. this way, when you >want to send the hash over the internet, instead of just hashing >the password, you can generate a few extra characters. append >(or prepend) the characters to the password. then hash the >whole thing. > >then, when you send the hash over, send the extra characters >too. on the server side, you would then take the password from >the database (or wherever), decrypt it (if it's encrypted), append >or prepend the extra characters, hash the whole thing, and >compare the hashes. > >tiger > > >
attached mail follows:
As you have magic_quotes on, automatically happens *addslashes*, now you need to reverse the proces
Steve Yates wrote:
>"Marek Kilimajer" <kilimajer
webglobe.sk> wrote in message
>news:3E1F4816.8050509
webglobe.sk...
>
>
>>try
>>$_POST['Credit_Card_Number']=stripslashes($_POST['Credit_Card_Number']);
>>
>>
>
> But if magic_quotes_gpc=on shouldn't that happen automatically?
>
> - Steve Yates
> - Brainstorm? No, but I had a braindrizzle once.
>
>~ Taglines by Taglinator - www.srtware.com ~
>
>
>
>
>
attached mail follows:
Hello,
I want to write a script that makes a backup of a database directory.
Actually, to copy all database files to another directory. I've figured that I have to use the "copy" function of the PHP, but the function doesn't works only with files?
Is it possible to copy the entire directory to another location, using PHP? I presume that is more "resource-friendly" than to copy the directory file-by-file.
Thanks and best regards, Alexoiul
attached mail follows:
If you are using Unix simply call out the shell using back ticks `mv xxx xxx` or check out.
http://www.php.net/manual/en/function.exec.php
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Alex Ciurea [mailto:alex
netonwave.com]
> Sent: Monday, 13 January 2003 7:53 PM
> To: php-general
lists.php.net
> Subject: [PHP] Can I Copy a directory using PHP?
>
>
> Hello,
>
> I want to write a script that makes a backup of a database directory.
>
> Actually, to copy all database files to another directory.
> I've figured that I have to use the "copy" function of the
> PHP, but the function doesn't works only with files?
>
>
>
> Is it possible to copy the entire directory to another
> location, using PHP? I presume that is more
> "resource-friendly" than to copy the directory file-by-file.
>
>
> Thanks and best regards,
> Alexoiul
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Careful!
use cp instead of mv
Quoting "Timothy Hitchens (HiTCHO)" <hitcho
php.net>:
### If you are using Unix simply call out the shell using back ticks `mv xxx
### xxx` or check out.
###
### http://www.php.net/manual/en/function.exec.php
###
###
###
### Timothy Hitchens (HiTCHO)
### Open Platform Consulting
### e-mail: tim
hitcho.com.au
###
### > -----Original Message-----
### > From: Alex Ciurea [mailto:alex
netonwave.com]
### > Sent: Monday, 13 January 2003 7:53 PM
### > To: php-general
lists.php.net
### > Subject: [PHP] Can I Copy a directory using PHP?
### >
### >
### > Hello,
### >
### > I want to write a script that makes a backup of a database directory.
### >
### > Actually, to copy all database files to another directory.
### > I've figured that I have to use the "copy" function of the
### > PHP, but the function doesn't works only with files?
### >
### >
### >
### > Is it possible to copy the entire directory to another
### > location, using PHP? I presume that is more
### > "resource-friendly" than to copy the directory file-by-file.
### >
### >
### > Thanks and best regards,
### > Alexoiul
### >
### >
### > --
### > PHP General Mailing List (http://www.php.net/)
### > To unsubscribe, visit: http://www.php.net/unsub.php
### >
###
###
### --
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
###
###
attached mail follows:
while($img1=mysql_fetch_array($result)){ $img2=mysql_fetch_array($result); // now you have $img1 and $img2 echo "<tr><td><img src='$img1[src]'></td><td>$img1[comment]<br><div align='right'>$img2[comment]</div></td><td><img src='$img2[src]'></td></tr> }
Philip J. Newman wrote:
>I have a table with images and comments. > >if i have $x amout of images that each have a comment. > >the comments are displayed in the center colum of the table with the images loading left and right of each comment. > >http://www.philipnz.com/example.jpg > >I can get the images to load in their left and right position, how ever i can't get the right array to print each comment with the image. > >Any help would be cool. > >Phil > > >
attached mail follows:
I can't seem to be able to set a session var from within a function in an include file....
I have a call to a function at the top of my doc (but after session_start()) and if I write the line: $_SESSION['userData'] = test1; in the function body - it does nothing...
... but if I put this statement on the line above or below the call to the function, it works
I've tried using session_register() instead but the same thing happens. The block of code is definitely being executed.
Someone please please help me, I'm going insane. Thanks...
attached mail follows:
Do this for me:
print_r($GLOBALS);
and see if you have the $_SESSIONS array visible.. you will need to view the output in a text editor as the print_r won't look good rendered in the browser.
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Duncan Abbott [mailto:duncan
phonicmonkey.net]
> Sent: Monday, 13 January 2003 1:05 AM
> To: php-general
lists.php.net
> Subject: [PHP] Session wierdness...
>
>
> I can't seem to be able to set a session var from within a
> function in an include file....
>
> I have a call to a function at the top of my doc (but after
> session_start()) and if I write the line:
> $_SESSION['userData'] = test1; in the function body - it does
> nothing...
>
> .... but if I put this statement on the line above or below
> the call to the function, it works
>
> I've tried using session_register() instead but the same
> thing happens. The block of code is definitely being executed.
>
> Someone please please help me, I'm going insane. Thanks...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I can't seem to be able to set a session var from within a function in an include file....
I have a call to a function at the top of my doc (but after session_start()) and if I write the line: $_SESSION['userData'] = test1; in the function body - it does nothing...
... but if I put this statement on the line above or below the call to the function, it works
I've tried using session_register() instead but the same thing happens. The block of code is definitely being executed.
Someone please help me, I'm going insane. Thanks...
attached mail follows:
Hi, I'm using Win2K Prof. and installed Apache 1.3.2 as my web server plus PHP 4.0.6 as module. I have several sie on my computer. for one of them I need to include certain file before any thing. I know that there is auto_prepend_file in php.ini but this will run for all of my sites :-( Is there any way? I know that in Linux I must be able to use .httaccess but do not know how? and in Windows I do not know at all.
Any one can help me?
Tnx Sadeq
attached mail follows:
Dear Sir/Madam,
I've been coding session for quite sometime, but this is the first time i encounter such problem...
index.php(login form) -> login.php (verifies and set session userkey=1) -> main.php (check session userkey) if check session userkey fail, gets redirected back to index.php
in the login.php page, i've tested out session_is_registered("userkey");
it was TRUE.
but when i redirect it to main.php and did a checking on session_is_registered("userkey"); it return FALSE...
i've session_start(); at every start of the php page...
what's wrong? I've output session not set on main.php when the userkey session is not set. when i click on back button and retry login, it works!!! what happened?
please check my code again...
==============login.php================== include "lib/mysql.php"; include "lib/u007lib.php";
// connecting to mysql db , my own lib... $rs = getdb(""); $rs->query("select * from ct_user where companyid like '" . $HTTP_POST_VARS["companyid"] . "'"); $rs2 = getdb("");
$erron = "";
if(!$rs->eof) {
// if company records found... $rs2->query("select * from ct_login where loginid like '" . $HTTP_POST_VARS["loginid"] . "' and userid=" . $rs->fields("id") . " and pass like '" . $HTTP_POST_VARS["password"] . "'");
if(!$rs2->eof) { // if loginid and password match...
session_start(); // session key to be checked... $userkey = $rs2->fields("lvl");
$userid = $rs2->fields("id"); $userloginid = $rs2->fields("loginid");
$usercomid = $rs->fields("id"); $usercompany = $rs->fields("company"); $usercompanyid = $rs->fields("companyid");
// registering session key session_register("userkey"); session_register("usercomid"); session_register("usercompany"); session_register("usercompanyid");
session_register("userid"); session_register("userloginid");
setcookie("companyid", $HTTP_POST_VARS["companyid"], time()+(60*60*24*30)); setcookie("loginid", $HTTP_POST_VARS["loginid"], time()+(60*60*24*30));
//redirecting to main.php //header("location: main.php"); exit(); if (session_is_registered("userkey")) { header("location: main.php"); return; } else { echo "session not set!"; } // always return TRUE...
} else { $erron = "Invalid User / Password"; }
} else { $erron = "No Such Company ID"; }
?> =============end of login code========================
=============beginning code of main.php================= <? session_start(); include "lib/u007lib.php"; include "lib/mysql.php";
// check session userkey if (!session_is_registered("userkey")) { echo "session not set!"; exit(); } // RETURNED FALSE HERE? Y?
if($HTTP_SESSION_VARS["userkey"]-0 < 1) { header("location: ./"); return; } ?> ==============end of main.php code=====================
best regards,
-- James Tan IT Technical SpecialistNextMove Technology Sdn. Bhd. james
nextmovetech.com Tel: 03-5192 1366 Fax: 03-5192 1280 Lot 2-2, Jalan SU6A, Persiaran Tengku Ampuan, Lion Industrial Park, Section 22, 40000 Shah Alam, Selangor D.E.
attached mail follows:
It looks to me like you are losing the session id. Try something along the lines of this for the redirect:
header("location: main.php?PHPSESSID=".Session_Id());
This could/should be being pushed via cookies, but it appears as though it is not. The best way to troubleshoot is to print the before and after session ids, if they change, you are just creating new empty sessions, which should explain the lacking session variables.
HTH, Jason k Larson
James Tan wrote:
> Dear Sir/Madam,
>
> I've been coding session for quite sometime, but this is the first time i
> encounter such problem...
>
> index.php(login form) -> login.php (verifies and set session userkey=1) ->
> main.php (check session userkey)
> if check session userkey fail, gets redirected back to index.php
>
> in the login.php page, i've tested out
> session_is_registered("userkey");
>
> it was TRUE.
>
> but when i redirect it to main.php
> and did a checking on session_is_registered("userkey");
> it return FALSE...
>
> i've session_start(); at every start of the php page...
>
> what's wrong?
> I've output session not set on main.php when the userkey session is
> not set.
> when i click on back button and retry login, it works!!! what happened?
>
> please check my code again...
>
> ==============login.php==================
> include "lib/mysql.php";
> include "lib/u007lib.php";
>
> // connecting to mysql db , my own lib...
> $rs = getdb("");
> $rs->query("select * from ct_user where companyid like '" .
> $HTTP_POST_VARS["companyid"] . "'");
> $rs2 = getdb("");
>
> $erron = "";
>
> if(!$rs->eof)
> {
>
> // if company records found...
> $rs2->query("select * from ct_login where loginid like '" .
> $HTTP_POST_VARS["loginid"] . "' and userid=" . $rs->fields("id") . " and
> pass like '" . $HTTP_POST_VARS["password"] . "'");
>
> if(!$rs2->eof)
> {
> // if loginid and password match...
>
> session_start();
> // session key to be checked...
> $userkey = $rs2->fields("lvl");
>
> $userid = $rs2->fields("id");
> $userloginid = $rs2->fields("loginid");
>
> $usercomid = $rs->fields("id");
> $usercompany = $rs->fields("company");
> $usercompanyid = $rs->fields("companyid");
>
> // registering session key
> session_register("userkey");
> session_register("usercomid");
> session_register("usercompany");
> session_register("usercompanyid");
>
> session_register("userid");
> session_register("userloginid");
>
>
> setcookie("companyid", $HTTP_POST_VARS["companyid"],
> time()+(60*60*24*30));
> setcookie("loginid", $HTTP_POST_VARS["loginid"], time()+(60*60*24*30));
>
> //redirecting to main.php
> //header("location: main.php"); exit();
> if (session_is_registered("userkey")) { header("location: main.php");
> return; }
> else { echo "session not set!"; } // always return TRUE...
>
> }
> else
> {
> $erron = "Invalid User / Password";
> }
>
> }
> else
> {
> $erron = "No Such Company ID";
> }
>
> ?>
> =============end of login code========================
>
> =============beginning code of main.php=================
>
> ==============end of main.php code=====================
>
>
>
> best regards,
> --
> James Tan
> IT Technical Specialist
>
> NextMove Technology Sdn. Bhd.
> james
nextmovetech.com
> Tel: 03-5192 1366
> Fax: 03-5192 1280
> Lot 2-2, Jalan SU6A,
> Persiaran Tengku Ampuan,
> Lion Industrial Park, Section 22,
> 40000 Shah Alam, Selangor D.E.
attached mail follows:
Hi all,
this is my situation: I want to execute some comands using 'shell_exec':
$command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php /usr/dest_dir;cd /usr/dest_dir;ls -la"); echo "<pre>$command</pre>";
Actually, these commands: 1) ls -la /usr/dest_dir 2) cp -R /usr/source_dir/1.php /usr/dest_dir 3) cd /usr/dest_dir 4) ls -la
This is what I get:
total 8 drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. total 8 drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 ..
the first 3 lines, before the 'cp' command the last 3 lines, after the 'cp' command.
As you can see, no changes.
I've looked in the logs of the apache webserver and i've found this line:
cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
Note: source_dir and dest_dir are both owned by mysql
Another thing :
cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
The path begin with a back tick . Is that normal?
attached mail follows:
On Monday 13 January 2003 19:53, Alex Ciurea wrote: > Hi all, > > this is my situation: > I want to execute some comands using 'shell_exec': > > $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php > /usr/dest_dir;cd /usr/dest_dir;ls -la"); > echo "<pre>$command</pre>"; > > Actually, these commands: > 1) ls -la /usr/dest_dir > 2) cp -R /usr/source_dir/1.php /usr/dest_dir > 3) cd /usr/dest_dir > 4) ls -la > > This is what I get: > > total 8 > drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . > drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. > total 8 > drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . > drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. > > the first 3 lines, before the 'cp' command > the last 3 lines, after the 'cp' command. > > As you can see, no changes. > > I've looked in the logs of the apache webserver and i've found this line: > > cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied > > Note: source_dir and dest_dir are both owned by mysql
Presumably you're trying to backup a mysql database. In a standard setup the database files are only accessible to the 'mysql' user. Your webserver, under normal circumstances, would not be able to access those files. Once you get over this hurdle, the second problem is that your destination directory is not writeable by any user other than mysql.
In short you're better off using mysqldump to backup your databases.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* "Consequences, Schmonsequences, as long as I'm rich." -- "Ali Baba Bunny" [1957, Chuck Jones] */
attached mail follows:
Hi,
I think I've solved the problem
group owner of the dest_dir must be apache !!!
----- Original Message -----
From: "Alex Ciurea" <alex
netonwave.com>
To: "php mailing" <php-general
lists.php.net>
Sent: Monday, January 13, 2003 1:53 PM
Subject: [PHP] Need some help in "exec"-attack
> Hi all, > > this is my situation: > I want to execute some comands using 'shell_exec': > > $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php > /usr/dest_dir;cd /usr/dest_dir;ls -la"); > echo "<pre>$command</pre>"; > > Actually, these commands: > 1) ls -la /usr/dest_dir > 2) cp -R /usr/source_dir/1.php /usr/dest_dir > 3) cd /usr/dest_dir > 4) ls -la > > This is what I get: > > total 8 > drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . > drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. > total 8 > drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . > drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. > > the first 3 lines, before the 'cp' command > the last 3 lines, after the 'cp' command. > > As you can see, no changes. > > I've looked in the logs of the apache webserver and i've found this line: > > cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied > > Note: source_dir and dest_dir are both owned by mysql > > Another thing : > > cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied > > The path begin with a back tick . Is that normal? > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
:( Yes I've realised that.
It seemed to me that is more efficient to make a copy of that files, rather than a mysqldump.
but Yes, in order to access files of the mysql directory, I have to give to the webserver all the rights, solution that I don't aproove, for security reasons.
----- Original Message -----
From: "Jason Wong" <php-general
gremlins.biz>
To: <php-general
lists.php.net>
Sent: Monday, January 13, 2003 3:08 PM
Subject: Re: [PHP] Need some help in "exec"-attack
> On Monday 13 January 2003 19:53, Alex Ciurea wrote: > > Hi all, > > > > this is my situation: > > I want to execute some comands using 'shell_exec': > > > > $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php > > /usr/dest_dir;cd /usr/dest_dir;ls -la"); > > echo "<pre>$command</pre>"; > > > > Actually, these commands: > > 1) ls -la /usr/dest_dir > > 2) cp -R /usr/source_dir/1.php /usr/dest_dir > > 3) cd /usr/dest_dir > > 4) ls -la > > > > This is what I get: > > > > total 8 > > drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . > > drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. > > total 8 > > drwxr-xr-x 2 mysql mysql 4096 Jan 13 13:29 . > > drwxr-xr-x 18 mysql mysql 4096 Jan 13 12:25 .. > > > > the first 3 lines, before the 'cp' command > > the last 3 lines, after the 'cp' command. > > > > As you can see, no changes. > > > > I've looked in the logs of the apache webserver and i've found this line: > > > > cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied > > > > Note: source_dir and dest_dir are both owned by mysql > > Presumably you're trying to backup a mysql database. In a standard setup the > database files are only accessible to the 'mysql' user. Your webserver, under > normal circumstances, would not be able to access those files. Once you get > over this hurdle, the second problem is that your destination directory is > not writeable by any user other than mysql. > > In short you're better off using mysqldump to backup your databases. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > "Consequences, Schmonsequences, as long as I'm rich." > -- "Ali Baba Bunny" [1957, Chuck Jones] > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
On Monday 13 January 2003 21:13, Alex Ciurea wrote: > Hi, > > I think I've solved the problem > > group owner of the dest_dir must be apache !!!
NB if mysql is running whilst you're copying the files then you could end up with incorrect backups.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Q: How many marketing people does it take to change a lightbulb? A: I'll have to get back to you on that. */
attached mail follows:
Hi all!
I'm writing a webmail application in PHP and most basic things are working now. However, I've recently run into a problem concerning mail attachments. This is the situation right now:
When the user opens a letter there are links to all attachments. The links looks like this: http://www.lassoweb.nu/webmail/attachment.php/mailbox=INBOX&msguid=218&part=2
Mailbox is the mailbox name, msguid is the message number and part corresponds to the part of the letter that is an attachment. When the user clicks the link the attachment data is extracted from the message and displayed in the browser (if possible). This works nice, but here comes the problem. Since the document is named 'attachment.php', that's the name that comes up in the save box whenever the user tries to save the file. Iv'e tried setting the Content-Disposition header to tell the browser what to call the attachment, but to no avail. The browser still insists on calling all attachments 'attachment.php'!
I've been trying to figure this out for a couple of days now, but no luck yet. Perhaps someone out there have had the same problem (and solved it)?
I'm thankful for any hints
/Lars 'lasso' Olsson (lasso
lassoweb.nu)
PS. One solution might be to 'trick' the browser by creating a fake URL (like http://www.lassoweb.nu/webmail/void/bob.gif), but in order for this to work I need to tell Apache to send all requests to the 'void' directory to a single PHP file. Anyone knows how to set this up? DS.
attached mail follows:
So you have tried as per the manual:
header("Content-Disposition: attachment; filename=downloaded.pdf");
I use this all the time without issue.. do you have a shell that you can use to "wget -S" and see if the correct headers are coming out??
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Lars Olsson [mailto:lasso
lassoweb.nu]
> Sent: Monday, 13 January 2003 11:05 PM
> To: php-general
lists.php.net
> Subject: [PHP] attachment problem
>
>
> Hi all!
>
> I'm writing a webmail application in PHP and most basic things are
> working now. However, I've recently run into a problem
> concerning mail
> attachments. This is the situation right now:
>
> When the user opens a letter there are links to all attachments. The
> links looks like this:
> http://www.lassoweb.nu/webmail/attachment.php/mailbox=INBOX&ms
guid=218&part=2
Mailbox is the mailbox name, msguid is the message number and part corresponds to the part of the letter that is an attachment. When the user clicks the link the attachment data is extracted from the message and displayed in the browser (if possible). This works nice, but here comes the problem. Since the document is named 'attachment.php', that's the name that comes up in the save box whenever the user tries to save the file. Iv'e tried setting the Content-Disposition header to tell the browser what to call the attachment, but to no avail. The browser still insists on calling all attachments 'attachment.php'!
I've been trying to figure this out for a couple of days now, but no luck yet. Perhaps someone out there have had the same problem (and solved it)?
I'm thankful for any hints
/Lars 'lasso' Olsson (lasso
lassoweb.nu)
PS. One solution might be to 'trick' the browser by creating a fake URL (like http://www.lassoweb.nu/webmail/void/bob.gif), but in order for this to work I need to tell Apache to send all requests to the 'void' directory to a single PHP file. Anyone knows how to set this up? DS.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]