php-general Digest 13 Jan 2003 01:21:46 -0000 Issue 1819

Topics (messages 131329 through 131381):

Re: strip php tags from code ?
        131329 by: Matt
        131330 by: Timothy Hitchens \(HiTCHO\)

Re: highlight keywords issue
        131331 by: Timothy Hitchens \(HiTCHO\)
        131370 by: Hatem Ben
        131374 by: Hatem Ben

Re: Simple Form Processing
        131332 by: Justin French
        131334 by: Jason Wong

php editor
        131333 by: Hannes Smit
        131335 by: Jason Wong
        131336 by: rush
        131363 by: Steven Balthazor

return last update for a whole website?
        131337 by: arnaud gonzales

SESSION variable to pass login ID
        131338 by: Willie G
        131341 by: Tom Rogers
        131348 by: Willie G
        131349 by: Nova
        131350 by: Willie G
        131351 by: John W. Holmes

File information JPEG Files
        131339 by: harald.mohring.gmx.de
        131340 by: Warren Vail
        131342 by: Tom Rogers

Phorum 3.4 Released!
        131343 by: Brian Moon

count characters
        131344 by: harald.mohring.gmx.de
        131345 by: Reuben D. Budiardja
        131346 by: Jason Sheets

Pre-built CMS - Anyone recommend one?
        131347 by: Nick Wilson
        131354 by: Chris Hayes
        131358 by: Chris Mason

test
        131352 by: Karl James
        131353 by: Karl James
        131355 by: Karl James
        131356 by: Karl James

Sorry about that guys,
        131357 by: Karl James

What means  "ioctl"
        131359 by: harald.mohring.gmx.de
        131360 by: Rick Emery
        131364 by: Nova
        131376 by: nicos.php.net

PHP/MySQL help?
        131361 by: Steven M
        131362 by: Johannes Schlueter
        131366 by: Steven M
        131368 by: Timothy Hitchens \(HiTCHO\)
        131371 by: Steven M
        131375 by: Timothy Hitchens \(HiTCHO\)
        131380 by: Steven M

Re: Permission Denied
        131365 by: Stephen
        131367 by: Timothy Hitchens \(HiTCHO\)

Re: OOP for Web Programming Paradigm
        131369 by: olinux
        131381 by: Victor

using "getimagesize" to read out image informations form local harddrive
        131372 by: harald.mohring.gmx.de
        131378 by: Nova

object in session & security
        131373 by: Hannes Smit
        131377 by: Timothy Hitchens \(HiTCHO\)

Re: php5 cvs
        131379 by: Sean Malloy

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 ---
>----- Original Message -----
>From: "David D" <[EMAIL PROTECTED]>
>Sent: Monday, January 06, 2003 7:47 AM
>Subject: [PHP] strip php tags from code ?


> I only want to keep html code of a page.
> I want to remove php tags.

It sound like you want the parser output of the page.  You can use PHPs
output control to buffer the page output, and capture it into a variable to
do whatever you want with it.

http://www.php.net/manual/en/ref.outcontrol.php

Alternately, you can find a template class that does it.


--- End Message ---
--- Begin Message ---
So you want to remove only the unparsed/raw php script blocks.

Why... are you displaying PHP without parsing??

If this is the case you can write a couple of very simple preg_replace
with a call
back and all is done.



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: David D [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 6 January 2003 10:48 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] strip php tags from code ?
> 
> 
> I only want to keep html code of a page.
> I want to remove php tags.
> Some tell that strip_tags is not adapted.
> 
> sample of what i want to do:
> <html>
> na
> <?php echo 'na';?>
> </html>
> ->
> <html>
> na
> </html>
> 
> php tags can be :
> <? ?>or <?= ?>
> or <script language='php'></script>  /i
> 
> Merci.
> 
> 
> 
> ..
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
You will need to break apart the entire document then process each area
inside of the
tags and to be very careful for nested tags.

The simplest way around I have found to do with is to add to tags that
have been processed
with attributes that are ignored by the browser renderer eg... <a
href="/page.html" done="yes">PHP</a>
as you can see the <a href has been processed because I have added in a
extra attribute then continue
to process the entire page from my preg matches.

Nested tags are going to be your biggest issue.



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Hatem Ben [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, 12 January 2003 7:24 PM
> To: PHP List
> Subject: [PHP] highlight keywords issue
> 
> 
> Heya all,
> 
> I'm trying to highlight search keywords in a string, 
> everything work expect when this keyword is inside a tag like this :
> 
> keyword (php) :
> 
> <a href="?go=php">php</a>
> 
> <img src="php.gif" border=0 alt="php.net">
> 
> will be highlighted to :
> 
> <a href="?go=<b style="color: black; background-color: 
> #ffff66">php</b>"><b
> style="color: black; background-color: #ffff66">php</b></a>
> 
> <img src="<b style="color: black; background-color: 
> #ffff66">php</b>.gif" border=0 alt="<b style="color: black; 
> background-color: #ffff66">php</b>.net">
> 
> I have tryed to separate text from html, then highlight it 
> then join html/text again, but this will be very long and not 
> really usefull !
> 
> I'm using preg_replace :
> 
> preg_replace('|\b('.quotemeta($keyword).')\b|iU', '<b 
> style="color: black;
> background-color: #ffff66">\\1</b>', $content);
> 
> Any help to fix that ?
> 
> Thanks;
> Hatem
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
I have find this code very helpfull :

----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
To: "'Hatem Ben'" <[EMAIL PROTECTED]>; "'PHP List'"
<[EMAIL PROTECTED]>
Sent: Sunday, January 12, 2003 2:28 PM
Subject: RE: [PHP] highlight keywords issue


> You will need to break apart the entire document then process each area
> inside of the
> tags and to be very careful for nested tags.
>
> The simplest way around I have found to do with is to add to tags that
> have been processed
> with attributes that are ignored by the browser renderer eg... <a
> href="/page.html" done="yes">PHP</a>
> as you can see the <a href has been processed because I have added in a
> extra attribute then continue
> to process the entire page from my preg matches.
>
> Nested tags are going to be your biggest issue.
>
>
>
> Timothy Hitchens (HiTCHO)
> Open Platform Consulting
> e-mail: [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: Hatem Ben [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, 12 January 2003 7:24 PM
> > To: PHP List
> > Subject: [PHP] highlight keywords issue
> >
> >
> > Heya all,
> >
> > I'm trying to highlight search keywords in a string,
> > everything work expect when this keyword is inside a tag like this :
> >
> > keyword (php) :
> >
> > <a href="?go=php">php</a>
> >
> > <img src="php.gif" border=0 alt="php.net">
> >
> > will be highlighted to :
> >
> > <a href="?go=<b style="color: black; background-color:
> > #ffff66">php</b>"><b
> > style="color: black; background-color: #ffff66">php</b></a>
> >
> > <img src="<b style="color: black; background-color:
> > #ffff66">php</b>.gif" border=0 alt="<b style="color: black;
> > background-color: #ffff66">php</b>.net">
> >
> > I have tryed to separate text from html, then highlight it
> > then join html/text again, but this will be very long and not
> > really usefull !
> >
> > I'm using preg_replace :
> >
> > preg_replace('|\b('.quotemeta($keyword).')\b|iU', '<b
> > style="color: black;
> > background-color: #ffff66">\\1</b>', $content);
> >
> > Any help to fix that ?
> >
> > Thanks;
> > Hatem
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

--- End Message ---
--- Begin Message ---
I have find this very helpfull :

preg_match_all("|<[^>]+>(.*)</[^>]+>|", $haystack, $out, PREG_SET_ORDER);

It's almost done, only if i can restrict the regexp to <a > and <img> tags
only ... :(

I need to look for "Mastering Regular Expressions" book tomorrow :D it's
really boring without good docs

----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>
To: "'Hatem Ben'" <[EMAIL PROTECTED]>; "'PHP List'"
<[EMAIL PROTECTED]>
Sent: Sunday, January 12, 2003 2:28 PM
Subject: RE: [PHP] highlight keywords issue


> You will need to break apart the entire document then process each area
> inside of the
> tags and to be very careful for nested tags.
>
> The simplest way around I have found to do with is to add to tags that
> have been processed
> with attributes that are ignored by the browser renderer eg... <a
> href="/page.html" done="yes">PHP</a>
> as you can see the <a href has been processed because I have added in a
> extra attribute then continue
> to process the entire page from my preg matches.
>
> Nested tags are going to be your biggest issue.
>
>
>
> Timothy Hitchens (HiTCHO)
> Open Platform Consulting
> e-mail: [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: Hatem Ben [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, 12 January 2003 7:24 PM
> > To: PHP List
> > Subject: [PHP] highlight keywords issue
> >
> >
> > Heya all,
> >
> > I'm trying to highlight search keywords in a string,
> > everything work expect when this keyword is inside a tag like this :
> >
> > keyword (php) :
> >
> > <a href="?go=php">php</a>
> >
> > <img src="php.gif" border=0 alt="php.net">
> >
> > will be highlighted to :
> >
> > <a href="?go=<b style="color: black; background-color:
> > #ffff66">php</b>"><b
> > style="color: black; background-color: #ffff66">php</b></a>
> >
> > <img src="<b style="color: black; background-color:
> > #ffff66">php</b>.gif" border=0 alt="<b style="color: black;
> > background-color: #ffff66">php</b>.net">
> >
> > I have tryed to separate text from html, then highlight it
> > then join html/text again, but this will be very long and not
> > really usefull !
> >
> > I'm using preg_replace :
> >
> > preg_replace('|\b('.quotemeta($keyword).')\b|iU', '<b
> > style="color: black;
> > background-color: #ffff66">\\1</b>', $content);
> >
> > Any help to fix that ?
> >
> > Thanks;
> > Hatem
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

--- End Message ---
--- Begin Message ---
Did you read that link at all?????????

adapting the manual's code to suit your form names and directory
preferences:

if (is_uploaded_file($_FILES['image1']['tmp_name'])) {
    copy($_FILES['image1']['tmp_name'],
"$DOCUMENT_ROOT/images/$_FILES['image1']['name']");
} else {
    echo "Couldn't do it!";
}

So, to summarise what i *think* is wrong with your code:

1. $_FILES['image1']['image1'] should have been
$_FILES['image1']['tmp_name']

2. $DOCUMENT_ROOT/images/$file :: what is $file???? where is that defined???
I *think* you wish to save the file with same name as the user had it
named??? if so "$DOCUMENT_ROOT/images/$_FILES['image1']['name']" is what you
want, or better still, for clarity,
"{$DOCUMENT_ROOT}/images/{$_FILES['image1']['name']}"


If all else fails do a print_r($_FILES) and make sure that the file is at
least being uploaded.


Like I said before, there is a perfect working example in the manual... get
it working THEN try to adapt it to suit your needs :)


Cheers,

Justin



on 12/01/03 11:39 PM, Kyle Babich ([EMAIL PROTECTED]) wrote:

> This is what I tried:
> 
> if (is_uploaded_file($HTTP_POST_FILES['image1']['image1']) {
> move_uploaded_file($HTTP_POST_FILES['image1']['image1'],
> "$DOCUMENT_ROOT/images/$file");
> }
> 
> and also this:
> 
> if (is_uploaded_file($_FILES['image1']['image1']) {
> move_uploaded_file($_FILES['image1']['image1'],
> "$DOCUMENT_ROOT/images/$file");
> }
> 
> and this:
> 
> if (is_uploaded_file($_FILES['image1']['image1'])) {
> copy($_FILES['image1']['image1'], "$DOCUMENT_ROOT/images");
> }
> 
> ,the image (which was within the size range) was never uploaded.  I have
> a feeling that I am makeing 1 or 2 of the same mistakes in all three but
> through my experimenting and reading I am having no luck.  I also bought
> Programming PHP but I trust it less and less as I even find simple
> mistakes like missing quotes in example code.  So what's going wrong?
> 
> Thank you again,
> Kyle
> 
> On Sun, 12 Jan 2003 15:17:42 +1100, "Justin French"
> <[EMAIL PROTECTED]> said:
>> Hi,
>> 
>> the files themselves are available in the $_FILES array, but it's not as
>> simple as that.
>> 
>> may i recommend you start by copying the Examples 18-1 and 18-2 from this
>> page:
>> http://www.php.net/manual/en/features.file-upload.php
>> 
>> Once you've got THAT code working smoothly and understand what's
>> happening,
>> THEN start modifying it to a 3-file form.
>> 
>> I'd personally push forms through using POST method rather than get
>> whenever
>> possible -- especially when dealing with files... the manual does it this
>> way too :)
>> 
>> 
>> Justin
>> 
>> 
>> 
>> on 12/01/03 12:18 PM, Kyle Babich ([EMAIL PROTECTED]) wrote:
>> 
>>> I just broke skin with php and I'm learning forms, which I'm not good
>>> with at all.  These are snippets from post.html:
>>> 
>>> <form method="get" action="process.php" enctype="multipart/form-data">
>>> and
>>> <input type="file" name="image1" maxlength="750" allow="images/*"><br>
>>> <input type="file" name="image2" maxlength="750" allow="images/*"><br>
>>> <input type="file" name="image3" maxlength="750" allow="images/*"><br>
>>> 
>>> but how would I pass the actual image on because when I do something like
>>> this:
>>> <?php echo "{$_GET[image1]}";
>>> ?>
>>> as you could probably guess only the filename prints.
>>> 
>>> So how do I take the image instead of just the filename?
>>> 
>>> Thank you,
>>> --
>>> Kyle
>> 
>> 

--- End Message ---
--- Begin Message ---
On Sunday 12 January 2003 20:39, Kyle Babich wrote:
> This is what I tried:
>
> if (is_uploaded_file($HTTP_POST_FILES['image1']['image1']) {
>       move_uploaded_file($HTTP_POST_FILES['image1']['image1'],
> "$DOCUMENT_ROOT/images/$file"); }
>
> and also this:
>
> if (is_uploaded_file($_FILES['image1']['image1']) {
>       move_uploaded_file($_FILES['image1']['image1'],
> "$DOCUMENT_ROOT/images/$file"); }
>
> and this:
>
> if (is_uploaded_file($_FILES['image1']['image1'])) {
>     copy($_FILES['image1']['image1'], "$DOCUMENT_ROOT/images");
> }
>
> ,the image (which was within the size range) was never uploaded.  I have
> a feeling that I am makeing 1 or 2 of the same mistakes in all three but
> through my experimenting and reading I am having no luck.  I also bought
> Programming PHP but I trust it less and less as I even find simple
> mistakes like missing quotes in example code.  So what's going wrong?

So what *does* $_FILE contain? 

Hint: if your code doesn't behave as expected always print_r() your variables 
so you can whether they contain what you expected them to contain.

And if $_FILE doesn't contain anything then check php.ini to ensure that you 
have enables file uploads.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Wilcox's Law:
        A pat on the back is only a few centimeters from a kick in the pants.
*/

--- End Message ---
--- Begin Message ---
is there a php editor which supports the tree-view for the code itself. I
believe tools like visual basic uses this option. You can easily collapse
pieces of code, for example a function or a class. Is there any place where
i can download a tool like this?

And if there's not, what is your favourite editor? i use ultraedit /
dreamweaver mx..



--- End Message ---
--- Begin Message ---
On Sunday 12 January 2003 21:51, Hannes Smit wrote:
> is there a php editor which supports the tree-view for the code itself. I
> believe tools like visual basic uses this option. You can easily collapse
> pieces of code, for example a function or a class. Is there any place where
> i can download a tool like this?

I believe maguma studio has this feature (before you ask, google for it). Also 
the old 'favourites' like vim (at least in one incarnation) has it as well .

> And if there's not, what is your favourite editor? i use ultraedit /
> dreamweaver mx..

Search the archives, this gets asked at least once a week if not more.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You should make a point of trying every experience once -- except
incest and folk-dancing.
                -- A. Bax, "Farewell My Youth"
*/

--- End Message ---
--- Begin Message ---
I think Scite (http://www.scintilla.org/SciTE.html) can do it.

rush
--
http://www.templatetamer.org/



--- End Message ---
--- Begin Message ---
I am a fan of eclipse (www.eclipse.org) I use the java editor for editing
php files (its close enough for my needs); for those who want php specific
functionality then this plugin looks quite nice:
http://phpeclipse.sourceforge.net/ .  The CVS functionality included in
eclipse is what makes the package tremendously valuable to me (it keeps
track of local changes as well as provides for looking back at previous cvs
revisions and performing diffs against your current code, all within the
IDE).  

HTH,
Steven Balthazor

-----Original Message-----
From: Hannes Smit [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 12, 2003 6:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php editor


is there a php editor which supports the tree-view for the code itself. I
believe tools like visual basic uses this option. You can easily collapse
pieces of code, for example a function or a class. Is there any place where
i can download a tool like this?

And if there's not, what is your favourite editor? i use ultraedit /
dreamweaver mx..




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

--- End Message ---
--- Begin Message ---
Hi all,
What do u suggest me to get the last update date for the wole website , not
for a specific file.
I’ve seen filemtime() exist but does dirmtime() exist and would do it if I
specify the root directory of my website for argument?
There is probably a simple way to do it ?

Tia                   zeg
--- End Message ---
--- Begin Message ---
Hi,

I have been trying to solve the problem of using session variables, but I
have not had any luck.  What I want to do is simple, I want to set my userid
and password in a login screen and use it later (in another php form) to log
into the database.

In my login PHP file I have the following:

if(isset($_POST['userid']) && isset($_POST['pword'])){
        $_SESSION['user'] = $_POST['userid'];
        $_SESSION['password'] = $_POST['pword'];
}

In my connect to database PHP file I have:

if(isset($_SESSION['user'])){
    $user=$_SESSION['user'];
    echo "Print $user";
}else{
        echo "Print Missing User";
}


The message I always get is "Print Missing User", so I must assume the
global variable is not working.  Can anyone help me out here?

Thanks,
Larry


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

Monday, January 13, 2003, 1:04:49 AM, you wrote:
WG> Hi,

WG> I have been trying to solve the problem of using session variables, but I
WG> have not had any luck.  What I want to do is simple, I want to set my userid
WG> and password in a login screen and use it later (in another php form) to log
WG> into the database.

WG> In my login PHP file I have the following:

WG> if(isset($_POST['userid']) && isset($_POST['pword'])){
WG>         $_SESSION['user'] = $_POST['userid'];
WG>         $_SESSION['password'] = $_POST['pword'];
WG> }

WG> In my connect to database PHP file I have:

WG> if(isset($_SESSION['user'])){
WG>     $user=$_SESSION['user'];
WG>     echo "Print $user";
WG> }else{
WG>         echo "Print Missing User";
WG> }


WG> The message I always get is "Print Missing User", so I must assume the
WG> global variable is not working.  Can anyone help me out here?

WG> Thanks,
WG> Larry

Make sure you have session_start() at the begining of the second file.

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
Tom,

I do have a session_start() in both files, but it does not seem to help.

- Larry

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 12, 2003 11:36 AM
To: Willie G
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSION variable to pass login ID


Hi,

Monday, January 13, 2003, 1:04:49 AM, you wrote:
WG> Hi,

WG> I have been trying to solve the problem of using session variables, but
I
WG> have not had any luck.  What I want to do is simple, I want to set my
userid
WG> and password in a login screen and use it later (in another php form) to
log
WG> into the database.

WG> In my login PHP file I have the following:

WG> if(isset($_POST['userid']) && isset($_POST['pword'])){
WG>         $_SESSION['user'] = $_POST['userid'];
WG>         $_SESSION['password'] = $_POST['pword'];
WG> }

WG> In my connect to database PHP file I have:

WG> if(isset($_SESSION['user'])){
WG>     $user=$_SESSION['user'];
WG>     echo "Print $user";
WG> }else{
WG>         echo "Print Missing User";
WG> }


WG> The message I always get is "Print Missing User", so I must assume the
WG> global variable is not working.  Can anyone help me out here?

WG> Thanks,
WG> Larry

Make sure you have session_start() at the begining of the second file.

--
regards,
Tom


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



--- End Message ---
--- Begin Message ---
This statement doesnt look right to me.

if(isset($_POST['userid']) && isset($_POST['pword'])){
$_SESSION['user'] = $_POST['userid'];
$_SESSION['password'] = $_POST['pword'];
}

the if should be:

if ((statement)&&(statement))
{

}

so:

if ((isset($_POST['userid'])) && (isset($_POST['pword'])))
{
$_SESSION['user'] = $_POST['userid'];
$_SESSION['password'] = $_POST['pword'];
}

That should work.

"Willie G" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Tom,
>
> I do have a session_start() in both files, but it does not seem to help.
>
> - Larry
>
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 12, 2003 11:36 AM
> To: Willie G
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] SESSION variable to pass login ID
>
>
> Hi,
>
> Monday, January 13, 2003, 1:04:49 AM, you wrote:
> WG> Hi,
>
> WG> I have been trying to solve the problem of using session variables,
but
> I
> WG> have not had any luck.  What I want to do is simple, I want to set my
> userid
> WG> and password in a login screen and use it later (in another php form)
to
> log
> WG> into the database.
>
> WG> In my login PHP file I have the following:
>
> WG> if(isset($_POST['userid']) && isset($_POST['pword'])){
> WG>         $_SESSION['user'] = $_POST['userid'];
> WG>         $_SESSION['password'] = $_POST['pword'];
> WG> }
>
> WG> In my connect to database PHP file I have:
>
> WG> if(isset($_SESSION['user'])){
> WG>     $user=$_SESSION['user'];
> WG>     echo "Print $user";
> WG> }else{
> WG>         echo "Print Missing User";
> WG> }
>
>
> WG> The message I always get is "Print Missing User", so I must assume the
> WG> global variable is not working.  Can anyone help me out here?
>
> WG> Thanks,
> WG> Larry
>
> Make sure you have session_start() at the begining of the second file.
>
> --
> regards,
> Tom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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

I just found my mistake.  I added some debug logic, and found that the
$_POST logic was in the calling form, not the called form.  As soon as I
moved the "if(isset($_POST['userid']) && isset($_POST['pword'])){" to the
second form, everything started to work.  Thanks to everyone who responded.

- Larry

-----Original Message-----
From: Nova [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 12, 2003 3:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSION variable to pass login ID


This statement doesnt look right to me.

if(isset($_POST['userid']) && isset($_POST['pword'])){
$_SESSION['user'] = $_POST['userid'];
$_SESSION['password'] = $_POST['pword'];
}

the if should be:

if ((statement)&&(statement))
{

}

so:

if ((isset($_POST['userid'])) && (isset($_POST['pword'])))
{
$_SESSION['user'] = $_POST['userid'];
$_SESSION['password'] = $_POST['pword'];
}

That should work.

"Willie G" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Tom,
>
> I do have a session_start() in both files, but it does not seem to help.
>
> - Larry
>
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 12, 2003 11:36 AM
> To: Willie G
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] SESSION variable to pass login ID
>
>
> Hi,
>
> Monday, January 13, 2003, 1:04:49 AM, you wrote:
> WG> Hi,
>
> WG> I have been trying to solve the problem of using session variables,
but
> I
> WG> have not had any luck.  What I want to do is simple, I want to set my
> userid
> WG> and password in a login screen and use it later (in another php form)
to
> log
> WG> into the database.
>
> WG> In my login PHP file I have the following:
>
> WG> if(isset($_POST['userid']) && isset($_POST['pword'])){
> WG>         $_SESSION['user'] = $_POST['userid'];
> WG>         $_SESSION['password'] = $_POST['pword'];
> WG> }
>
> WG> In my connect to database PHP file I have:
>
> WG> if(isset($_SESSION['user'])){
> WG>     $user=$_SESSION['user'];
> WG>     echo "Print $user";
> WG> }else{
> WG>         echo "Print Missing User";
> WG> }
>
>
> WG> The message I always get is "Print Missing User", so I must assume the
> WG> global variable is not working.  Can anyone help me out here?
>
> WG> Thanks,
> WG> Larry
>
> Make sure you have session_start() at the begining of the second file.
>
> --
> regards,
> Tom
>
>
> --
> 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



--- End Message ---
--- Begin Message ---
Well, start debugging your code then. Do a print_r() of $_POST and
$_SESSION at different points in your files. Maybe you're losing your
session on a certain page or it's getting reset. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Willie G [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 12, 2003 2:53 PM
> To: Tom Rogers; Willie G
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] SESSION variable to pass login ID
> 
> Tom,
> 
> I do have a session_start() in both files, but it does not seem to
help.
> 
> - Larry
> 
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 12, 2003 11:36 AM
> To: Willie G
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] SESSION variable to pass login ID
> 
> 
> Hi,
> 
> Monday, January 13, 2003, 1:04:49 AM, you wrote:
> WG> Hi,
> 
> WG> I have been trying to solve the problem of using session
variables,
> but
> I
> WG> have not had any luck.  What I want to do is simple, I want to set
my
> userid
> WG> and password in a login screen and use it later (in another php
form)
> to
> log
> WG> into the database.
> 
> WG> In my login PHP file I have the following:
> 
> WG> if(isset($_POST['userid']) && isset($_POST['pword'])){
> WG>         $_SESSION['user'] = $_POST['userid'];
> WG>         $_SESSION['password'] = $_POST['pword'];
> WG> }
> 
> WG> In my connect to database PHP file I have:
> 
> WG> if(isset($_SESSION['user'])){
> WG>     $user=$_SESSION['user'];
> WG>     echo "Print $user";
> WG> }else{
> WG>         echo "Print Missing User";
> WG> }
> 
> 
> WG> The message I always get is "Print Missing User", so I must assume
the
> WG> global variable is not working.  Can anyone help me out here?
> 
> WG> Thanks,
> WG> Larry
> 
> Make sure you have session_start() at the begining of the second file.
> 
> --
> regards,
> Tom
> 
> 
> --
> 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



--- End Message ---
--- Begin Message ---
How can i get the file information of a uploaded jpeg-file.
i need the heigt and width in pixel and the resolution.
Thanks Harry


--- End Message ---
--- Begin Message ---
I you are into bit crunching, check out

http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/JPEG.txt

if not, somehow view the jpeg in ie, right click on the picture, and select
properties, look under dimensions.

Warren Vail
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 12, 2003 8:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] File information JPEG Files


How can i get the file information of a uploaded jpeg-file.
i need the heigt and width in pixel and the resolution.
Thanks Harry



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



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

Monday, January 13, 2003, 2:10:57 AM, you wrote:
hmgd> How can i get the file information of a uploaded jpeg-file.
hmgd> i need the heigt and width in pixel and the resolution.
hmgd> Thanks Harry

Use getimagesize()

$info = getimagesize('image.jpg');
echo 'Width = '.$info[0].' Hieght = '.$info[1]."<br>';

Resolution is meaningless until you need to print it I think.
-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
Phorum 3.4 has been released.  This is a biggest update in over a year.  For
those not familiar with Phorum, it was the first PHP/MySQL based message
board ever made.  It focuses on simplicity for those that want to add a
message board to their existing site without having to comprimise their
sites design.

You can download it now at http://phorum.org/download.php

Thanks,

Brian Moon
Phorum Dev Team



--- End Message ---
--- Begin Message ---
I want to count characters without space "character".
$char="hello world"
so the result should be 10.
Can anybody help me?


--- End Message ---
--- Begin Message ---
On Sun, 12 Jan 2003 [EMAIL PROTECTED] wrote:

> I want to count characters without space "character".
> $char="hello world"
> so the result should be 10.
> Can anybody help me?

$char="hello world";
$temp=str_replace(" ", "", $char);
echo strlen($temp);
 
should give you 10.
  
RDB


 
> 
> 
> 

-- 

--- End Message ---
--- Begin Message ---
Try the following code, please note you may want to trim() the string as
well if it is coming from a user.

<?php
        $char = 'hello world';

        $number_characters = strlen(str_replace(' ', '', $char'));
?>

Jason


On Sun, 2003-01-12 at 10:32, [EMAIL PROTECTED] wrote:
> I want to count characters without space "character".
> $char="hello world"
> so the result should be 10.
> Can anybody help me?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

I'm looking for a *free*, pre-built CMS with PHP/MySQL.

I've looked at ezpublish but I'm having trouble installing.

Criteria: 

*   Must have SE friendly urls (example.com/4/34/)
*   Must allow different 'sections' for articles
*   Must be easy to fix templates for the html/css

Anyone make a recommendation?

Many thanks...

-- 
Nick Wilson     //  www.tioka.com



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

I'm looking for a *free*, pre-built CMS with PHP/MySQL.

I've looked at ezpublish but I'm having trouble installing.

Criteria:

*   Must have SE friendly urls (example.com/4/34/)
*   Must allow different 'sections' for articles
*   Must be easy to fix templates for the html/css
I happen to know a bit of the history of PHPNuke and the several forks it has lead to.
The basic idea of PHPNuke and its first generation forks is this:

-----------------------------------------------------------------
HEADER OF THE PAGE
-----------------------------------------------------------------
LEFT | | RIGHT
| CENTER |
BLOCKS | | BLOCKS
| |
-----------------------------------------------------------------
FOOTER OF THE PAGE
-----------------------------------------------------------------

Somehow limiting the creativity of the designer of a 'theme'.
The left and right blocks can be form the core team or from third parties and their queality varies wildly. They can contain a menu, weather, links to center modules, search engines, polls etc. In the center would show the current "module" which can also be taken from anywhere, and can be a news system, a forum, and many other things.

Xaraya and Envolution attempt to really change this strict setup.

In historical order, not claiming to be exact or complete:

PHPNuke
* has built in news articles in sections by default.
Optional planning of articles and optional feature to let visitors discuss articles (also in most other CMSses here)
* I'm not sure about the search engine friendly urls.
* AFAIK it has a separate directory file for the skins, called 'theme', where you can design the various CSS styles and the HTML code for basic features such as the side blocks.
But i cannot recommend it because the single project leader is hard to reach and tends to ignore security warnings.
www.phpnuke.org (often slow)

MyPHPNuke is a fork of PHPNuke, and seems to limit itself in layout and seems to have a limited functionality (no modules, i THINK).
www.myphpnuke.org (or .com)

xOOps
is also a fork of PHPNuke and tries to put it all in classes. I have no details, check their site. i think xoops.org

PostNuke
is also a PHPNuke fork, a very strong CMS with very strict rules for the modules. They are still working towards the 1.0 version but many people already used the 0.64 version on production sites.
Very strong system, uses Adodb to allow the use of different databases (MySQL now with people working hard on ?Postgress and ?Oracle), many modules were made for it but it is not always claear whether it will work in the version of Postnuke you are working on.
* There is a way to create search engine friendly URL's, i think it is a setting you can choose, you may need Apache to do it. If in doubt ask on one of the support areas
* I find the third party module 'ContentExpress' (http://pn.arising.net/ce/) the best way to edit articles.
I made a menu module for it (http://www.hieris.info/about/DynMenu).
* Like PHPNuke Postnuke has 'themes' of which you can download several.
http://www.postnuke.com

Xaraya
after a conflict in which some people kept on harrassing the developers, the central developers of Postnuke decided to fork to Xaraya, leaving Postnuke with just a handful of developers. I must say that Postnuke now is up and running again.
Anyway, Xaraya has some real high quality developers but.... they ain't finished yet and after the hectic at Postnuke they decided not to offer in between versions but to work steady on the 1.0 version.
When ready it will really kick ass.
The entire system will use templates, allowing you to build pages with all content bits just however you like best. Ready for the future: if you do not want to use HTMl but rather XML, it's entirely possible already. It will allow SE friendly URLs for sure and a rocking article system.
The one i hope to join.
www.Xaraya.org

Envolution
another fork of Postnuke, uses a templating system, to the joy of some and the horror of many. I did not check it as their template system will never allow the flexibility i need.
http://www.envolution.com/



--- End Message ---
--- Begin Message ---
eZPublish is probably your best bet.

-----Original Message-----
From: Nick Wilson [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 12, 2003 3:31 PM
To: php-general
Subject: [PHP] Pre-built CMS - Anyone recommend one?


Hi all, 

I'm looking for a *free*, pre-built CMS with PHP/MySQL.

I've looked at ezpublish but I'm having trouble installing.

Criteria: 

*   Must have SE friendly urls (example.com/4/34/)
*   Must allow different 'sections' for articles
*   Must be easy to fix templates for the html/css

Anyone make a recommendation?

Many thanks...

-- 
Nick Wilson     //  www.tioka.com




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

--- End Message ---
--- Begin Message ---
test
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
test
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
test
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
TEST
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
To mail listing;
 
sorry about that, i didnt think about all the variables involved
thanks for your warning and understanding.
 
wont happen again!!!
thanks
 
Karl
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
I got the error-message:
Warning: fopen("", "r") - Inappropriate ioctl for device
what means ioctl?
Harry


--- End Message ---
--- Begin Message ---
"ioctl" is an IO controls structure.

Just look at the fopen("","r").  Do you notice anything missing?

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <>
Sent: Sunday, January 12, 2003 3:59 PM
Subject: [PHP] What means "ioctl"


I got the error-message:
Warning: fopen("", "r") - Inappropriate ioctl for device
what means ioctl?
Harry



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



--- End Message ---
--- Begin Message ---
You have not specified a file name to open with fopen().

//will not work
$fp = fopen("", "r");

//will work
$fp = fopen("file.txt", "r");

"Harald Mohring" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I got the error-message:
> Warning: fopen("", "r") - Inappropriate ioctl for device
> what means ioctl?
> Harry
>
>


--- End Message ---
--- Begin Message ---
"ioctl performs a variety of control functions on devices and STREAMS."
    It stands for I/O Control.

--
Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

"Harald Mohring" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> I got the error-message:
> Warning: fopen("", "r") - Inappropriate ioctl for device
> what means ioctl?
> Harry
>
>


--- End Message ---
--- Begin Message ---
What am i doing wrong with the script below? What i am trying to do is check
whether the "newtest" field has a 0 or a  1 value then redirect the user to
a different page based on the answer.

I am then trying to add 2 to the value in the "points" field of my database
and then  to set the "newtest" field value to 1 so the user is directed to
the second of the two pages if they click the link again

My database is MySQL and the connection details are correct and stored in an
external script.  I have missed out the PHP tags on the code below in case
that interferes with how it appears on the list.  I really would appreciate
any help with this as i am a newbie to MySQL and PHP and am finding it a
really steep learning curve.  Thanks.

Steven M
-------------------------------------------------------
include 'db.php';

$result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
list($number) = mysql_fetch_row($result);
mysql_close();

if($number==0)
{mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'");
mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");
header("Location: redirect1.php");
}
elseif($number==1)
{
header("Location: redirect2.php");
}
else
{
header("Location: error.php");
}
-------------------------------------------------------



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

On Sunday 12 January 2003 23:58, Steven M wrote:
> include 'db.php';
>
> $result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
> list($number) = mysql_fetch_row($result);

Here you are closing your conenction to the MySQL-Server:
> mysql_close();

> if($number==0)

But here you need it again:
> {mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'");
> mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");

So remove the mysql_close() if it don't work: Post the error message!

johannes
--- End Message ---
--- Begin Message ---
Hi Johannes

Thanks for the help.  I have taken out the mysql_close() and it looks like
it is submitting ok (ie no error messages) but it is not updating the
database when i check it.  Any ideas?

Thanks.

Steven
"Johannes Schlueter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi Steven,

On Sunday 12 January 2003 23:58, Steven M wrote:
> include 'db.php';
>
> $result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
> list($number) = mysql_fetch_row($result);

Here you are closing your conenction to the MySQL-Server:
> mysql_close();

> if($number==0)

But here you need it again:
> {mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'");
> mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");

So remove the mysql_close() if it don't work: Post the error message!

johannes


--- End Message ---
--- Begin Message ---
Hmm from your code below:

....FROM users WHERE 14 = '$0'"

What is "14" it isn't a field I would hope!!


Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Steven M [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 9:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP/MySQL help?
> 
> 
> Hi Johannes
> 
> Thanks for the help.  I have taken out the mysql_close() and 
> it looks like it is submitting ok (ie no error messages) but 
> it is not updating the database when i check it.  Any ideas?
> 
> Thanks.
> 
> Steven
> "Johannes Schlueter" <[EMAIL PROTECTED]> wrote in message 
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Steven,
> 
> On 
> Sunday 12 January 2003 23:58, Steven M wrote:
> > include 'db.php';
> >
> > $result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
> > list($number) = mysql_fetch_row($result);
> 
> Here you are closing your conenction to the MySQL-Server:
> > mysql_close();
> 
> > if($number==0)
> 
> But here you need it again:
> > {mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'"); 
> > mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");
> 
> So remove the mysql_close() if it don't work: Post the error message!
> 
> johannes
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
I thought i read somewhere that you could refer to the field by number.  Was
i wrong? It doesn't seem to make a difference anyway.  It still doesn't
work.  Here's the code with words instead of numbers.  I'd be grateful if
you could let me know if there are any obvious errors.

Best wishes.

Steven M

include 'db.php';

$result = mysql_query("SELECT newtest FROM users WHERE newtest = '$0'");
list($number) = mysql_fetch_row($result);

if($number==0)
{mysql_query("UPDATE users SET points = '$+2' WHERE newtest = '$0'");
mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");
header("Location: redirect1.php");
}
elseif($number==1)
{
header("Location: redirect2.php");
}
else
{
header("Location: error.php");
}


--- End Message ---
--- Begin Message ---
You can't use numbers as vars:

$1 etc are illegal syntax for PHP



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Steven M [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 10:04 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP/MySQL help?
> 
> 
> I thought i read somewhere that you could refer to the field 
> by number.  Was i wrong? It doesn't seem to make a difference 
> anyway.  It still doesn't work.  Here's the code with words 
> instead of numbers.  I'd be grateful if you could let me know 
> if there are any obvious errors.
> 
> Best wishes.
> 
> Steven M
> 
> include 'db.php';
> 
> $result = mysql_query("SELECT newtest FROM users WHERE 
> newtest = '$0'");
> list($number) = mysql_fetch_row($result);
> 
> if($number==0)
> {mysql_query("UPDATE users SET points = '$+2' WHERE newtest = 
> '$0'"); mysql_query("UPDATE users SET newtest = '$1' WHERE 
> newtest = '$0'");
> header("Location: redirect1.php");
> }
> elseif($number==1)
> {
> header("Location: redirect2.php");
> }
> else
> {
> header("Location: error.php");
> }
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Oops...many thanks for that.  Sorry, i am extremely new to this.

Best wishes.

Steven M


--- End Message ---
--- Begin Message ---
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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
:
:
:


--- End Message ---
--- Begin Message ---
Did you use the umask(0) prior to the mkdir() in your script??


Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Stephen [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 9:09 AM
> To: [EMAIL PROTECTED]
> 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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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
> 

--- End Message ---
--- Begin Message ---
I'm no OOP programmer but maybe extend your class to
include methods for each situation.

something like this:

function countSingle($cid)

function countMulti($cidArray)

function countAll() 


HTH,
olinux


--- Victor <[EMAIL PROTECTED]> wrote:
> Hello. I have this question. When I program, I try
> to create a class for 
> each table. Example below.
> 
> Now what some complain about, and logically so, is
> that this might 
> impose an overhead (I load all data even if I just
> need a counter and 
> NOT description).
> 
> So I say we can make a STATIC version of each
> Accessor with $cid as 
> argument; But then they say what if i want to load
> an array of all 2000 
> counters, for example. I say first get all the
> $cid's, then in an array, 
> load a class for each one, etc.. That however makes
> lots of SQL calls 
> instead of one big one. I suppose I can get all data
> and then load it 
> into classes, but that seems like a bad approach,
> especially for 
> calculated values.
> 
> What I am curious about is what paradigms do you
> guys use to address 
> these issues? Is my paradigm good and it's worth to
> just provide static 
> methods for frequently necessary fields to reduce
> overhead, or is there 
> a better way of dealing with this stuff?
> 
> class Counter
> {
>     var $db;
> 
>     var $cid;
>     var $counter;
>     var $descr;
> 
>     /**
>      * Default Constructor
>      * @param int $cid - Counter ID
>      */
>     function Counter($cid=false)
>     {
>        global $db;
>        $this->db = &$db;
>        if (isset($cid) && $cid) $this->load($cid);
>     }
> 
>     /**
>      * Description
>      * @param int $cid - Counter ID
>      * @return bool
>      */
>     function load($cid=0)
>     {
>        if (!$cid) return false;
> 
>        $q = "SELECT * FROM counter WHERE cid =
> $cid";
>        $r = $this->db->getRow($q); // Using PEAR
> here.
> 
>        if (!DB::isError($r)) {
>           $this->cid     = $r["cid"];
>           $this->counter = $r["counter"];
>           $this->descr   = $r["descr"];
>           return true;
>        }
>        return false;
>     }
> 
>    
>
#################################################################
>     # Accessor Methods
>    
>
#################################################################
>     function getCid()     { return $this->cid; }
>     function getCounter() { return $this->counter; }
>     function getDescr()   { return $this->descr; }
> 
>    
>
#################################################################
>     # Mutator Methods
>    
>
#################################################################
>     function setCid($v)     { $this->iaid    = $v; }
>     function setCounter($v) { $this->counter = $v; }
>     function setDescr($v)   { $this->descr   = $v; }
> 
>     // Many other methods, etc.... Static methods,
> etc...
> }
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
olinux wrote:
I'm no OOP programmer but maybe extend your class to
include methods for each situation.

something like this:

function countSingle($cid)

function countMulti($cidArray)

function countAll()

HTH,
olinux
Hmm, yes, that's an interesting idea. Except perhaps include the first arg as a by-refrence return variable, so that func can return true false. Yeah, I think that's not bad. Still, would have to have static accessors, but oh well...

--- End Message ---
--- Begin Message ---
isn't it possible to get image informations from the local harddrive?

$fotoinfo=getimagesize("C:\\Eigene Dateien\\Temp\\Foto.jpg");

if i use that code, the errormessage is always "getimagesize: unable to open
file for reading"

got anybody a solution?


--- End Message ---
--- Begin Message ---
Why \\ between directories? Isnt it just a single?

"Harald Mohring" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> isn't it possible to get image informations from the local harddrive?
>
> $fotoinfo=getimagesize("C:\\Eigene Dateien\\Temp\\Foto.jpg");
>
> if i use that code, the errormessage is always "getimagesize: unable to
open
> file for reading"
>
> got anybody a solution?
>
>


--- End Message ---
--- Begin Message ---
Hello,

Im building a object oriented webapplication with PHP. I know PHP doesnt
fully support OOP.
I made a class called Database. This class contains several variables. One
of these vars is the username and the password for the database. When i
create a Database object I want to register it in the applications session,
so it available through the whole app. Is this secure? is it possible to
view this variable from the outside? To make it more secure i tried
'crypt()'. But this doesnt work in this way:

class Database{
 var $server="db.provider.com";
 var $username="myusername";
 var $password=crypt("8d3j22d");
 var $database="webshop";
}

it results in:

Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or
T_FUNCTION or T_VAR or '}'


--- End Message ---
--- Begin Message ---
It is viewable from the script only not the outside world eg the visitor
to the website
unless you output it.

Also you are better offer having your vars set by methods from a
constructor then you can
do what you just showed below.



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Hannes Smit [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 9:48 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] object in session & security
> 
> 
> Hello,
> 
> Im building a object oriented webapplication with PHP. I know 
> PHP doesnt fully support OOP. I made a class called Database. 
> This class contains several variables. One of these vars is 
> the username and the password for the database. When i create 
> a Database object I want to register it in the applications 
> session, so it available through the whole app. Is this 
> secure? is it possible to view this variable from the 
> outside? To make it more secure i tried 'crypt()'. But this 
> doesnt work in this way:
> 
> class Database{
>  var $server="db.provider.com";
>  var $username="myusername";
>  var $password=crypt("8d3j22d");
>  var $database="webshop";
> }
> 
> it results in:
> 
> Parse error: parse error, unexpected T_VARIABLE, expecting 
> T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
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:[EMAIL PROTECTED]]
Sent: Sunday, 12 January 2003 11:23 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sent: Sunday, January 12, 2003 11:13 PM
To: electroteque
Cc: [EMAIL PROTECTED]
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" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 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" <[EMAIL PROTECTED]> wrote in message
> > 000b01c2b9d2$ae5e46c0$6400a8c0@DANNYS">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" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > 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

--- End Message ---

Reply via email to