[PHP] problem redirecting to protected directory

2003-12-03 Thread Bart
Hello,

Can you people help me with the following authentication-problem?

I have a directory names 'secure' that contains only html-files. Access is
only allowed for
registered website-visitors. Within the directory it isn't possible to place
php-files for
access-control so I have passwd-protected this directory with one 'username'
and 'password'.

Above this 'secure'-dir I've placed a login-form that checks a MySQL-db for
the entered login.
When a correct login is entered the visitor has to be able to access the
'secure'-dir without
knowing/seeing the 'username' and 'password' that protects the dir.

How can I redirect the visitor to this 'secure'-dir without showing the
login-popup?

I've tried to use the header-function several ways, but the popup keeps
popping!!

> header('http://username:[EMAIL PROTECTED]/securedir/');
>
header('http://www.domain.com/securedir/?PHP_AUTH_USER=username&PHP_AUTH_PW=
password');
> header('http://[EMAIL PROTECTED]/securedir/:password');

Strange thing is that when I use the JavaScript below the redirect works and
no popup is shown.
The only problem with JavaScript is that when it is disabled in the visitors
browser the script
isn't executed and the full url is visible when viewing the source of the
page!

>> start..JavaScript <<

  window.location="http://username:[EMAIL PROTECTED]/securedir/";

>> endJavaScript <<


How can I redirect a logged in user to the 'secure'-dir and also pass the
'username' and
'password' that give access to this dir?

I hope you can help me out with this...

Thanks in advance.
Best regards,

Bart


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



[PHP] header, also stumped

2003-12-10 Thread Bart

Hello,

I've got the following header-problems. How can I get this to work:

header("Location: h--p://user:[EMAIL PROTECTED]/securedir/");


I have a directory with password-protection to wich I want to redirect 
without the login-popup showing...

I've tried a lot but the popup keeps showing.

Does anyone have any ideas?

Regards,

Bart
!>


-Oorspronkelijk bericht-
Van: Jon Kriek [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 10 december 2003 1:15
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] header function, I'm stumped




-- 
Jon Kriek
www.phpfreaks.com
www.jonkriek.com

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



RE: [PHP] header, also stumped

2003-12-10 Thread Bart

I've tried to test it in a browser with copy-url and it works fine.

Through the script however it doesn't (using the same/correct url!!).

Any ideas...

Regards,
Bart
!>

-Oorspronkelijk bericht-
Van: Richard Davey [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 10 december 2003 17:06
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] header, also stumped


Hello Bart,

Wednesday, December 10, 2003, 3:34:31 PM, you wrote:

B> I've got the following header-problems. How can I get this to work:
B> header("Location: h--p://user:[EMAIL PROTECTED]/securedir/");

B> I have a directory with password-protection to wich I want to redirect
B> without the login-popup showing...

B> I've tried a lot but the popup keeps showing.

Test this - copy and paste that URL you use in the Header function
(well, a correct version of it) into a browser. Does that also pop-up
the password window? If it does (and my guess is that it will) then
the issue is with your servers configuration, not your code.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
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] Newbie with sorting problem

2004-01-06 Thread Bart Koppe
Hi all,

I'm quite a newbie ot php/mysql, so my question might be oversimple 
(though i tried for hours to understand..)
I'm making an addressbook, as a try out, to see how it al works. All is 
great actually, but only the sorting of the addresses seems complicated 
for me..
I have a databse called 'addressen', and four fields of this db are 
called 'id', 'name', 'surname' and 'address'
To display the content i use this:


	include( "file_that_connects_with_my_database.php");
	$result = mysql_query(
  "SELECT id, name, surname, address FROM addresses");
  	if (!$result) {
  		echo( "Error performing query: " .
  mysql_error() . "");
   		exit();
  	}
   	while ( $row = mysql_fetch_array($result) ) {
 		$addressid = $row["id"];
  		$nametext = $row["name"];
   		$surnametext = $row["surname"];
   		$addresstext = $row["address"];
   		//the table
  		echo( "");
  		echo( $addressid. "");
  		echo( $nametext. "");
  		echo( $surnametext. "");
  		echo( $addresstext "");
	  	echo( "");
  	}
?>
This scripts works, but.. my desire is now to be able to sort the 
output, wich is generated by the 'while' loop, for instance on 'name', 
or on 'surname' . sort(), ksort()? I couldn't understand the 
explanations i found (and so declared myself as newbie :)

Can anybody help me with this? I would be delighted...

Thanks in advange!

Bart Koppe

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


RE: [PHP] Re: help using ereg_replace()

2002-01-14 Thread Bart Brinkmann

I own and have read "Mastering Regular Expressions" (excellent book). I've
programmed perl for 3 years and have recently started migrating one of my
projects into php. I can't stand ereg, I prefer preg. While functions such
as substitute and match differ in syntax from perl to php, this book will
teach you quite a bit about how to effectively use preg, which i've found to
be easier, and faster than ereg.

For the record, I like perl's syntax better...   ;p

Hope this helps,

/bart

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 11:26 AM
To: liljim
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: help using ereg_replace()


liljim,

Thanks for the advice (and especially the explanation!) -- I note that
you chose the Perl regexp engine rather than the "e" regexp engine
(POSIX?).  Quite a few people recommended O'Reilly's "Mastering Regular
Expressions" over the weekend.  Does anyone know if it covers the Perl
syntax*?  This seems like a good book to learn more.

Erik
* I don't know Perl


On Monday, January 14, 2002, at 11:11  AM, liljim wrote:

> I would use preg_replace to do this.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to protect JavaScript?

2002-01-16 Thread Bart Brinkmann

This would only be true if your javascript files were parsed with php. If
not, then php can't do anything about it of course. Look into mod_rewrite. I
haven't used it in the sense that you're looking for, but I don't see why
you couldn't.

http://httpd.apache.org/docs-2.0/misc/rewriteguide.html


/bart

-Original Message-
From: Martin Thoma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 9:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to protect JavaScript?


Hello! I want to protect a JavaScript: It should only be readable out of
the document, where it is included (with 

RE: [PHP] How to protect JavaScript?

2002-01-16 Thread Bart Brinkmann

Here's a good primer on mod_rewrite:

http://www.freebsddiary.org/rewrite.php

I used it to accomplish the following...
A user hits a url of say: http://foo.com/84838

I then want to return an object out of our database who's id is 84838. A 404
handler will not help in this case. So, I chose to use mod_rewrite. Anytime
/\d+$ is requested, I use mod rewrite to redirect to a php page that fetches
the object.

Thus a request for:
http://foo.com/84838   redirects to:
http://foo.com/object?id=84838

The user does not see the redirect, their url will remain
"http://foo.com/84838";.

Check out the primer above, it's pretty straght-forward.

/bart

-Original Message-
From: Martin Thoma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 9:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to protect JavaScript?


Hi Bart,

thanx for your answer.

> This would only be true if your javascript files were parsed with php.If
> not, then php can't do anything about it of course.

This is possible, I tried it out.

> Look into mod_rewrite. I
> haven't used it in the sense that you're looking for, but I don't see why
> you couldn't.
>
> http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

This is a lot of stuff... Could you give me a hint where the way leads to?

Martin



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RTFM

2002-01-18 Thread Bart Brinkmann

> no such thing as a stupid question...

I strongly disagree. Refer to the topic: "RTFM". A stupid question is one
that is posted to this message board before the poster bothers to do a shred
of independent thinking. I've seen way too many of these questions come
through this list. The MySQL list was about the same. It was more of a
bother to read than it was a benefit. This list is about the same quality.
Every once in a long while something useful comes along, but unfortunately
their burried underneath 100 other postings of lazy newbies asking questions
like *scrolls about 10 messages down* "How to send url on if statement".

1) if statements are surely covered on php.net
2) It is not a php-specific question
3) If you don't understand how "if statements" work, use that 8lb mass on
your shoulders - RTFM

Just my $0.02 USD.

/bart

-Original Message-
From: Andrew [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 18, 2002 4:49 PM
To: Nick Wilson; [EMAIL PROTECTED]
Subject: RE: [PHP] RTFM


Nick
My personal feelings on this is that there is no such thing as a stupid
question... sometimes what you might find the simplest if things becomes
very difficult for another person to grasp!
If you do not like the emails that people post... use the delete button!


Andrew

-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 18, 2002 4:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RTFM


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Hi all,
just a very quick note: I've been following the list for about a
week and I probably follow one or two threads a day. Some of the stuff
here is *very* interesting. Unfortunately most of the stuff posted is a
little ridiculous in that it's posted by people that clearly don't know
where the online manual is located.

Don't get me wrong, I'm no expert and I don't object to the 'I had a
look but...' posts I just think the list might be a little more
interesting if those that *really* know there stuff stopped giving
detailed answers to Q's like 'my html page shows the php code' and were
just a little less tolerant.

Feel free to fry me.
- --

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8SJLTHpvrrTa6L5oRAg8SAKCLzzFk6i29BzABak9ezbtsVIIw9wCgnn4o
+Evq2JM0f2FDj1O1WEvm82o=
=NaDy
-END PGP SIGNATURE-

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Multi Threading in PHP

2002-02-06 Thread Bart Frackiewicz

Hi,

a few days ago i saw here a thread about multi threading, but this didn´t answer my 
question.

I have a page, that must search the best price in multiple databases/plain text files 
and perhaps one day xml-interfaces, some of them can be located on extern hosts, every 
search can be a single function/object method.

In my dreams i call this in multi thread (with a timeout functionality) to handle lost 
connections or anything else that would cause endless queries, and return after this 
to print out the results. Is this possible with any function today? Or will this be 
possible in future?

Best Regards,

Bart Frackiewicz


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




[PHP] Re: function not returning TRUE

2002-02-12 Thread Bart Veldhuizen

Hi Nick,

did you double-check your query ($qry)? Run it from the mysql client or 
from phpMyAdmin to make sure its returning some rows of data.

Cheers,

Bart


Nick Wilson wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Hi all
> Can anyone see any reason why this function does not appear to be
> returning true? It appears to be returning 1 though?
> 
> [snip snip]
> 
> if(!$this->_db_connect()) {
> return FALSE;
> }
> 
> if(!($result=mysql_query($qry))) {
> return FALSE;
> } else {
> 
> /* Set properties */
> $this->set_content_table($content_table);
> $this->set_tip_section($section);
> $this->set_auth_id($auth_id);
> $this->set_tip_id(mysql_insert_id());
> $this->set_tip_title($title);
> $this->set_tip_description($desc);
> $this->set_tip_keywords($keywords);
> $this->set_tip_text($text);
> return TRUE;
> }
> return TRUE;
> }
> 
> 
> the way I'm testing the condition is like:
> 
> $test=myfunction();
> 
> if($test) {
> do x
> } else do y
> 


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




Re: [PHP] How to change Return-path and sender address

2001-12-06 Thread Bart Frackiewicz

Hi Sanjay,

you can add extra headers in the mail command.

example from php.net:

mail("[EMAIL PROTECTED]", "the subject", $message,
 "From: webmaster@$SERVER_NAME\r\n"
."Reply-To: webmaster@$SERVER_NAME\r\n"
."X-Mailer: PHP/" . phpversion());

Bart

-Ursprüngliche Nachricht-
Von: sanjay [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 6. Dezember 2001 11:29
An: [EMAIL PROTECTED]
Betreff: [PHP] How to change Return-path and sender address


Hi

I have a script which sends email from the web. The problem is the
header of
the message contains "Return-path" and "Sender" email address as the
[EMAIL PROTECTED]

So, can some one help how can I set Return-path and Sender address as
From
Address?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Q regarding recursive function

2001-12-06 Thread Bart Verbeek

Hello,

I'm using the following function:
>>BEGIN CODE<<
$q_cat ="SELECT cat_id, cat_naam, cat_parent_id FROM cat";
$r_cat = mysql_query($q_cat) or die ("Invalid Query fout Q=cat");
if ($r_cat)


$n=0;
if (mysql_num_rows($r_cat) > 0)


while ($row_cat = mysql_fetch_array($r_cat))


$item[$row_cat[cat_id]][naam] = $row_cat[cat_naam];
$item[$row_cat[cat_id]][id] = $row_cat[cat_id];
$kidsof[$row_cat[cat_parent_id]][] = $row_cat[cat_id];
  }
  }
  }

#CAT-FUNCTIE
function print_tree($id=0,$spatie=0,$sid)


global $kidsof;
global $item;
global $sid;
$j=0;
while ($j < $spatie)


echo "  ";
$j++;
  }
$i=0;
$spatie++;
print ("".$item[$id][naam]."\n");
while ($i < count($kidsof[$id]))


print_tree($kidsof[$id][$i],$spatie,$sid);
$i++;
  }
  }

print_tree();
>>END CODE<<

It prints the tree of categories with all childs under the parent categories
with there parents.

But when I call the function with $id=5 (I want the categorie-tree of cat 5
and children) nothing happens.
How can I change the function so the cat-tree for $id=$var1 will be shown??


Kind regards,

Bart



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] stripping white space?

2001-07-09 Thread Bart Veldhuizen

Hi Brian,

>* Persuade someone at Zend to modify PHP so that a filter function can
>  be specified which all output text is passed through - would have the
>  same restrictions as the "header" function

You can already achieve this by using the built-in output buffering
function. Read http://www.zend.com/manual/function.ob-start.php for more
information and a simple example on this.

Why not go for HTTP compression though? The gain would be much larger than
just stripping out the whitespace/comments and such..

Have fun,

Bart




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen

Hi Maxim,

> 1. HTTP compression, which is not 100% compatible, but catches most
> of the browsers anyway.

Yes. The standard PHP implementation actually inspects the HTTP headers to
determine if the browser supports gzip encoding. If not, it will send the
files uncompressed. Looking at our website stats, 97%+ of the people use a
version 4 browser so they're fine.

> 2. Our own caching system: in two words: ob_*() to save the output
> as a text file, mod_rewrite to check for file and throw the plain .txt
files
> if exist, PostgreSQL triggers to update (delete cached) .txt files.

Hah! We think alike :) I implemented a similar system on our own website a
few weeks ago. It does not cache complete pages (that's hardly possible due
to the dynamic nature of our site), but instead caches HTML 'blocks'.  (one
page can consist of multiple blocks). Instead of serving those files
directly from the filesystem I let PHP inspect them first: each file
contains a timestamp that allows for expiry times.

The results are wonderful: our website (http://www.blender.nl) has
approximately 80.000 pageviews a day and the system load is almost never
higher than 0.4. (Dual PIII/450/512MB/FreeBSD)

If people are interested I'll publish the code for the caching module.

> 3. Browser/Platform detection: there's no need to make
> cross-platform heavy but compatible pages, just specific style sheets and
> html tags for specific browser families.

Clever! That's something I will put on my to-do list as well.

> 4. clever HTML design, so there are less tags, tables etc, to have
> files smaller. And *that* also includes less comments and double quotes on
> integers. We do nothing with XML, so that is why I am so shocked why
people
> here discourage me that much.

In my experience once you use HTTP compression, adding a few comments or
whitelines do hardly add to the filesize anymore. I don't think it's worth
the trouble to write super-compact HTML.

I don't know a single thing about XML, so I'll skip that discussion :)

Bart



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen

Hi Maxim,

I wrote a mini-manual about the module. You can get it with the code from:

http://helium.homeip.net/stuff/cache.tar.gz

I hope it helps you and I look forward to suggestions and contributions!

Bart


"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message
news:DC017B079D81D411998C009027B7112A015ED390@EXC-TYO-01...
>
> > /cache/data/articles/0-24/...
> > /cache/data/articles/25-50/...
> > /cache/data/searches/...
>
> this was our original idea, the difficulty is that there's the need to
> access this directory from several places (mod_rewrite, php and postrges).
> It is easy to access but might be hard to combine the URL together.
>
> But you're right, on UNIX systems, if I am not wrong, you cannot hold more
> then 1024 (?) files in a single directory.
> So subfolders is the way to go.
>
> Cheers,
> Maxim Maletsky
>
>
>
> -Original Message-
> From: Bart Veldhuizen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 6:07 PM
> To: Maxim Maletsky; [EMAIL PROTECTED]
> Subject: Re: [PHP] stripping white space?
>
>
> Hi Maxim,
>
> > I am definitely interested in seeing your caching modules - it could be
a
> > useful resource for ours.
> > Right now our caching module is only in the planning stage, but there
are
> > few scratches I wrote myself, and it seems to be very promising.
>
> I'll do my best to write a short blurb on how to use it today and publish
> the code. I also have to do a zillion other things (like work on my new
> house), so I can't promise it'll actually be there today!
>
> > There's a directory called /cached which we will store the file with the
> > exactly same file names (with mod_rewrite there's no need to use any
> > ?var=val&etc=etc&, you just get it looking like a directory) so it is
> > extremely easy to locate a file.
> >
> > ie: if you go to a file
> >
> >articles/2000/10/26/features/doom
> >
> > then apache looks first into
> >
> >cached/articles-2000-10-26-features-doom.txt
>
> I can see one problem that you're gonna run into and that is that this
> directory will contain thousands of files. Not many OS's can handle that.
In
> our case, each article has an article ID and the caching module
> automatically creates subdirectories that will hold a number of cached
> pages. Additionally, I can assign page 'types' to a page. These will
> generate new subdirectories as well. My caching directory looks like this:
>
> /cache/data/articles/0-24/...
> /cache/data/articles/25-50/...
> /cache/data/searches/...
>
> Have fun,
>
> Bart
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen

Hi Remo,

> PS: Can anyone enlighten me concerning HTTP compression?

I wish I could remember where I read this, but the PHP documentation still
does not have this feature described. To enable zlib output compression,
first make sure you have compiled PHP with the --with-zlib option. Next, add
the following line to php.ini:

zlib.output_compression = On


That's all there is to it!

Have fun,

Bart



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] calculating the average of arrays

2001-09-04 Thread Bart Verbeek

Hello,

I want to calculate an average from the following variables/arrays

a - $f[$index][f_d1_perc] with $f[$index][f_d1_weight]
b - $f[$index][f_d2_perc] with $f[$index][f_d2_weight]
c - $f[$index][f_d3_perc] with $f[$index][f_d3_weight]
d - $f[$index][f_d4_perc] with $f[$index][f_d4_weight]
e - $f[$index][f_d5_perc] with $f[$index][f_d5_weight]

All varables are integers:
- $f[$index][f_d _perc] = 0 - 100
- $f[$index][f_d1_weight] = 0 - 10

I want the folowing:

total score = (a *  weight) + (b *  weight) + (c *  weight) + (d *  weight)
+ (e *  weight).
total vars = weight a + weight b + weight c + weight d + weight e.
Average = total score / total average.
The calulated average has to be stored in "$f[$index][f_perc]".

The problem is that not always all the variables are set. How do I check
these arrays and leave them out of the calculation when they don't contain a
value.

Hope anyone can help me...





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Warning - how serious, how to eliminate

2001-09-07 Thread Bart Verbeek

Hello people,

I've got a question regarding the follwing scripts that gives an error.
When I execute the scripts below I get an warning-message:

- Warning: Division by zero in ./scripts/fasen_include.php on line 47...

This is the script I use.
When the vars are set the value has to be added to $totaal and $weight, when
not the var has to be skipped.
At the end of the scripts $totaal is devided by $weight to get an average
($percentage).
What can I do to eliminate the warning and is it serious?
Regards,

Bart

#BEGIN PHP-SCRIPTS
  for (;;$fase[$i]) {
$weight[$i] = '';
$totaal[$i] = '';

  if (isset($fase[$i][f_d1_perc]) && !empty($fase[$i][f_d1_perc])) {
if (isset($fase[$i][f_d1_weight]) && !empty($fase[$i][f_d1_weight])){
$weight[$i] += $fase[$i][f_d1_weight];
$totaal[$i] += ($fase[$i][f_d1_weight] * $fase[$i][f_d1_perc]);
 }
 }
  if (isset($fase[$i][f_d2_perc]) && !empty($fase[$i][f_d2_perc])) {
if (isset($fase[$i][f_d2_weight]) && !empty($fase[$i][f_d2_weight])){
$weight[$i] += $fase[$i][f_d2_weight];
$totaal[$i] += ($fase[$i][f_d2_weight] * $fase[$i][f_d2_perc]);
 }
 }
  if (isset($fase[$i][f_d3_perc]) && !empty($fase[$i][f_d3_perc])) {
if (isset($fase[$i][f_d3_weight]) && !empty($fase[$i][f_d3_weight])){
$weight[$i] += $fase[$i][f_d3_weight];
$totaal[$i] += ($fase[$i][f_d3_weight] * $fase[$i][f_d3_perc]);
 }
 }
  if (isset($fase[$i][f_d4_perc]) && !empty($fase[$i][f_d4_perc])) {
if (isset($fase[$i][f_d4_weight]) && !empty($fase[$i][f_d4_weight])){
$weight[$i] += $fase[$i][f_d4_weight];
$totaal[$i] += ($fase[$i][f_d4_weight] * $fase[$i][f_d4_perc]);
 }
 }
  if (isset($fase[$i][f_d5_perc]) && !empty($fase[$i][f_d5_perc])) {
if (isset($fase[$i][f_d5_weight]) && !empty($fase[$i][f_d5_weight])){
$weight[$i] += $fase[$i][f_d5_weight];
$totaal[$i] += ($fase[$i][f_d5_weight] * $fase[$i][f_d5_perc]);
 }
 }
  $percentage[$i] = $totaal[$i] / $weight[$i];
  $percentage[$i] = number_format($percentage[$i],1, ',', ' ');
#END PHP-SCRIPTS


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] "no-store" and "no-cache" = no files in browser"s cache ?

2004-09-09 Thread Bart Coninckx
Hi!

Am I assuming correctly that if you add this in the beginning of a PHP 
page
that the browser will not store files for that page to its cache?




I tried it, but the sensitive files I want to avoid from being available 
on
the client's harddrive, still get downloaded and saved in the "Temporary
Internet Files" for IE6. I also tried Mozilla, but I see changes in the
cache as well.


Comments would be greatly appreciated!
Thx!

Bart

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



[PHP] mod_rewirte loses POST data

2005-05-13 Thread Bart Seresia
Hi,

I'm currently developing a webapplication that uses mod_rewrite.

At some point i have to post data but i't seems to get lost, checking the 
web and some archives i've found that normaly mod_rewrite should preserver 
this data, but apparently it doesn't. Could anyone help me?

Im using:
Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7b PHP/4.3.11 Server at 
host.mydomain.com Port 80

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



[PHP] Repost: mod_rewirte loses POST data

2005-05-14 Thread Bart Seresia
Hi,

I'm currently developing a webapplication that uses mod_rewrite.

At some point i have to post data but i't seems to get lost, checking the 
web and some archives i've found that normaly mod_rewrite should preserver 
this data, but apparently it doesn't. Could anyone help me?

Im using:
Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7b PHP/4.3.11 Server at 
host.mydomain.com Port 80

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



[PHP] Re: Repost: mod_rewirte loses POST data

2005-05-14 Thread Bart Seresia
Evert from collan thouht it wy have to do with the rewrite rules or the 
script and asked to post both of them

this are the rewrite rules i use:

 RewriteEngine On
 RewriteRule ^/(.*[^/])/Admin/(.*)$ https://my.domain.com/$1/Admin/$2 
[R,L,NS]
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d [OR]
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
 RewriteRule ^(.*)$ - [L,NS]
 RewriteCond %{QUERY_STRING} !^$
 RewriteRule ^/(.*)/(.*)/$ 
/index.php?shopid=$1&page=$2&%{QUERY_STRING} [L,NS]
 RewriteRule ^/(.*)/(.*)/$  /index.php?shopid=$1&page=$2 
[L,NS]
 RewriteCond %{QUERY_STRING} !^$
 RewriteRule ^/(.*)/$   /index.php?shopid=$1&%{QUERY_STRING} 
[L,NS]
 RewriteRule ^/(.*)/$   /index.php?shopid=$1 
[L,NS]

He also suggested it might be the fault of the php scripting: this is what i 
do:

  if (isset($_GET["page"]))
switch (strtolower($_GET["page"]))
{
// snip //
  break;
 case "basket":
  echo "\n";
  var_dump(get_defined_vars ());
  echo "\n";
  include("includes/basket.inc.php");

in IE i get this output for post and get:

array(18) {
  ["HTTP_POST_VARS"]=>
  array(0) {
  }
  ["_POST"]=>
  array(0) {
  }
  ["HTTP_GET_VARS"]=>
  array(2) {
["shopid"]=>
string(3) "wsn"
["page"]=>
string(6) "Basket"
  }
  ["_GET"]=>
  array(2) {
["shopid"]=>
string(3) "wsn"
["page"]=>
string(6) "Basket"
  }
// snip //

Am i doing something wrong?

"Bart Seresia" <[EMAIL PROTECTED]> schreef in bericht 
news:[EMAIL PROTECTED]
> Hi,
>
> I'm currently developing a webapplication that uses mod_rewrite.
>
> At some point i have to post data but i't seems to get lost, checking the 
> web and some archives i've found that normaly mod_rewrite should preserver 
> this data, but apparently it doesn't. Could anyone help me?
>
> Im using:
> Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7b PHP/4.3.11 Server at 
> host.mydomain.com Port 80 

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



[PHP] Apache 2 on RedHat

2004-12-01 Thread Bart Baenisch
Hi -

I believe I understand the thread unsafeness problem, and I
think a reasonable cure is the prefork MPM for Apache 2, as
RedHat distributes.

If we decide to avoid the work of removing the Apache
2.whatever that RedHat distributes and building our own Apache
1.3.3whatever, are there any other risks to sticking with the
prefork Apache 2?

Thank you for taking the time to respond.

-Bart

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



[PHP] Apache 2 survey

2004-12-02 Thread Bart Baenisch
Hi -

Please help me quantify the risk of Apache 2.x with PHP 5.x.

Thank you for making the time.

If I missed this on php.net or apache.org or somewhere else, 
please point me to the data.  There is other good survey 
info, but not the PHP 5/Apache 2 combo.

Reply to me directly and I'll summarize for the list by 
Monday, 6 December 2005.

If you are using PHP 5.x with Apache 2.x on Linux or Solaris -

what type of HW?  CPU(s?), RAM, Internet bandwidth
what Solaris level or Linux distro?
average % of HW gets used?  particularly CPU & bandwidth

If you tried Apache 2.x and had to switch to Apache 1.x, what 
were the symptoms?

Thank you for your time.

-Bart

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



[PHP] upgrade problems

2001-01-18 Thread Bart A. Verbeek

Hello,
I tried to upgrade php3* to php4 on my win98 machine. Downloaded the binarie
and tried to install it. Every time I trie to request a *.php-file I get the
following error:

>> PHP:  Unable to parse configuration file.

Does anyone know what this meens and how to solve it??

php 3 always worked, but after install php4 keeps giving me these errors.
I use it with MS pws on win98.

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] upgrade problems

2001-01-18 Thread Bart A. Verbeek

Heb ik ook CGI nodig om php4 te draaien??

-Oorspronkelijk bericht-
Van: Chris Hayes [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 18 januari 2001 13:18
Aan: Bart A. Verbeek
Onderwerp: Re: [PHP] upgrade problems



> >> PHP:  Unable to parse configuration file.
>
> Does anyone know what this meens and how to solve it??
Nou ik weet het niet zeker want ik gebruik hetzelfde als jij maar dan met
Apache (wist je dat PWS van Microsoft is?? En dat Apache prima draait onder
Win 98?).
Misschien moet je eens op de upgrade pagina's kijken van PHP.

Je kunt ook kijken of je kunt vonden welke exe nu gebruikt wordt; de oude of
de nieuwe, en of hij wel de php.ini leest en niet php3.ini, die laatste is
onleesbaar voor php4 denk ik!
Heb je ge-edit in php.ini?

Dan moest ik in de Apache configuratie nog veranderen
van AddType application/x-httpd-php3 .php
naar to
AddType application/x-httpd-php .php
(AddType is een Apache commando maar de rest kan ook op PWS van toepassing
zijn.)

Chris




--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Q - php-apache _ php-cgi

2001-03-18 Thread Bart A. Verbeek

Hello,
I'm kind of new to serverside management and got a little question.
PHP can run on a server in different ways; as an Apache-module and as a
cgi-module.
- What is the biggest diffence between these two ways of running?
- When I write scripts for both do I have to pay attention to something or
keep an important aspect in mind..?

I hope you people can clear this out for me
Thanks in advance,
Bart


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ? interbase ?

2001-04-21 Thread Bart A. Verbeek

Hello,

I'm internet-databasing for over a year now and only used MySQL up untill
now.
Last week I spoke with a guy that was interested in running Interbase on a
Unix-webserver,
so I've got a couple of questions...

1.> Can interbase be installed and run on every Unix-type (BSD)?
I've taken a look on the borland site but they only speak of Linux and
windows.
2.> How stable is it comparing to MySQL when running on Unix (bsd)?
3.> Is it possible to run MySQL and Interbase on the same server?
4.> What are the differences between Interbase and MySQL?
5.> Does PHP have the same capabilities for Interbase as for MySQL?
6.> How difficult is it to install a binary (not found on Borland site) or
to compile it from source for a BSD-server?
7.> What's the difference between managing Interbase and managing MySQL on a
Internetserver?
8.> Does anyone know hostingproviders that support Interbase?
9.> Why would anyone choose Interbase when they can use MySQL on the same
server?

I hope anyone can help me!

Thanks in advance...
Regards,

Bart Verbeek


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP Interact with DreamWaver

2001-06-19 Thread Bart A. Verbeek

Hi,
No you don't need to set anything. Just define a (primary) code-editor (I
use the well known Notepad and Write for bigger files), and tell Dreamweaver
not to edit code in files with extensions .php(3/4) and .inc and other used
php-extensions.

Using DW4 myself to -> works very well, also with php. It let's you layout
the page very well and shows a [PHP]-icon everywhere there is code in a
page.

I'm using Ultradev and thought it could handle php dynamicly (like
cooldfusion/java) but it does not -> A shame :)

good luck.

mzl Bart


-Oorspronkelijk bericht-
Van: Jack [mailto:[EMAIL PROTECTED]]
Verzonden: dinsdag 19 juni 2001 12:45
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] PHP Interact with DreamWaver


Dear All
I'm fresh on the php, but i just want to ask what should i do to let my
existing Dreamwaver Made homepage to interact with Php, which means i had
used dreamwave to draw the layout, using firework for the image, then i want
to provide some function for the user like forms input, which i knew php can
handle these things well, so i want to let the php to interact with the
Dreamwaver!

Is there anything i got to set on the Dreamwaver or the php side?

Thx

--
Jack
[EMAIL PROTECTED]