php-general Digest 16 May 2008 10:39:24 -0000 Issue 5462

Topics (messages 274395 through 274411):

Re: changing order of items
        274395 by: Nathan Rixham
        274397 by: Jason Murray
        274405 by: Chris W

question about validation and sql injection
        274396 by: Sudhakar
        274399 by: Dmitri
        274400 by: Chris
        274404 by: Chris W

fsockopen + fputs
        274398 by: debussy007
        274410 by: Per Jessen

Re: Good HTML parser needed
        274401 by: Yi Wang

Re: SCanning text of PDF documents
        274402 by: Ray Hauge
        274403 by: Robert Cummings

$_SESSION lost
        274406 by: hce
        274407 by: Chris

Plugins... (like wordpress?)
        274408 by: Ryan S
        274411 by: Nathan Rixham

SetEnv directives in VirtualHost configuration not accessible in PHP
        274409 by: Dietrich Bollmann

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 ---
afan pasalic wrote:
this one bugs me for a while. how to change order.

I have a list of tasks. by status, task could be 1 (todo) or 0 (done) -
status value stored in mysql. I can list tasks per status or all.
order number is stored in mysql too.
the easiest way to change order is to have form for each task where you
will enter manually number and then submit (one submit button for whole
form). but, if you change order number for any task you have to change
then all order numbers "below" the task manually

solution with "arrows" (or up/down buttons) where you click on arrow and
the task switch the place with its "neighbor" is easy and fancy. Though,
I get in trouble if, e.g. tasks 10, 11, 12, and 13 change status from 1
to 0 and I have to move task 14 to place 6. I have to click first 4
times (to switch places with tasks 13, 12, 11, and 10) - but nothing is
actually happening on screen (of course) before start switching places
with 9, 8, 7, and 6.

how do you avoid this "gap"?
what solution do you use at all?

thanks for any help.

-afan


flex 3 / dataset would handle all this for you extremely easily.

if you want to stick with html then I'd recommend splitting into two tables (todo / done) and having a simple ajax updater to re-order the tables.
--- End Message ---
--- Begin Message ---
On Thu, May 15, 2008 at 2:09 PM, afan pasalic <[EMAIL PROTECTED]> wrote:

> this one bugs me for a while. how to change order.
>
> I have a list of tasks. by status, task could be 1 (todo) or 0 (done) -
> status value stored in mysql. I can list tasks per status or all.
> order number is stored in mysql too.
> the easiest way to change order is to have form for each task where you
> will enter manually number and then submit (one submit button for whole
> form). but, if you change order number for any task you have to change
> then all order numbers "below" the task manually
>
> solution with "arrows" (or up/down buttons) where you click on arrow and
> the task switch the place with its "neighbor" is easy and fancy. Though,
> I get in trouble if, e.g. tasks 10, 11, 12, and 13 change status from 1
> to 0 and I have to move task 14 to place 6. I have to click first 4
> times (to switch places with tasks 13, 12, 11, and 10) - but nothing is
> actually happening on screen (of course) before start switching places
> with 9, 8, 7, and 6.
>
> how do you avoid this "gap"?
> what solution do you use at all?
>
> thanks for any help.
>
> -afan
>  <http://www.php.net/unsub.php>
>
>
I am assuming that each time you click the up or down arrow you are
re-loading the page (via a GET request).  A simple solution to this, would
be to adjust the URLs assigned to the up and down arrows to carry an extra
variable, the item either directly above or directly below the one selected,
and instead of doing whole-sale renumbering, create a swap function.  That
just swaps the position of the two items.

example:

<?php
$rows = get_items_in_list();
for ($i = 0 ; $i < count($rows); $i ++) {
  echo $rows[$i]['taskname']."&nbsp;";
  // create move up link
  if ($i > 0) {
    echo '<a
href="page.php?this='.rows[$i]['position'].'&other='.$rows[($i-1)]['position'].'">move
up</a>&nbsp;';
  }
  //create mode down link
  if ($i < (count($rows) -1)) {
    echo '<a
href="page.php?this='.rows[$i]['position'].'&other='.$rows[($i+1)]['position'].'">move
up</a><br/>';
  }
}
?>

Then your page would just have to watch for those two variables being set at
load and select the appropriate items in the database based on the order and
swap their two positions, this will allow you to handle gaps in the
positioning scheme, for example when you are only listing the status 1 items
and not all the items.

*note* The code above is completely off-the-cuff and not tested, don't blame
me if there are any bugs in it ;)

Regards,

Jason

--- End Message ---
--- Begin Message ---
afan pasalic wrote:
this one bugs me for a while. how to change order.

I have a list of tasks. by status, task could be 1 (todo) or 0 (done) -
status value stored in mysql. I can list tasks per status or all.
order number is stored in mysql too.
the easiest way to change order is to have form for each task where you
will enter manually number and then submit (one submit button for whole
form). but, if you change order number for any task you have to change
then all order numbers "below" the task manually

solution with "arrows" (or up/down buttons) where you click on arrow and
the task switch the place with its "neighbor" is easy and fancy. Though,
I get in trouble if, e.g. tasks 10, 11, 12, and 13 change status from 1
to 0 and I have to move task 14 to place 6. I have to click first 4
times (to switch places with tasks 13, 12, 11, and 10) - but nothing is
actually happening on screen (of course) before start switching places
with 9, 8, 7, and 6.

how do you avoid this "gap"?
what solution do you use at all?

thanks for any help.

-afan




If I understand you right the problem is because you are showing a list of items with the status of todo and there are other items with a status of done, that if shown would have a priority in between the the ones with a status of todo. So if you simply swithch the priority value with the next record up in the priority order, it may not move because of unseen items with the done status.

I have had this problem before but in much different type of application. Basically you have several "groups" of records in the same table and you want to sort them independent of each other. What I have done is to specify what field(s) in the table define each group. In my case I have often had 1 2 or even 3 fields needed to define the groups. In your case it is just the todo / done status field. What I do is have the up and down arrow and have the link pass the ID of the item I want to move, the sort order value(priority in your case), the value(s) of the group field(s) and the direction I want to move the item. So the url for the move button would be something like this....

Status ToDo = 1
Status Done = 2
ID of Record to move is say 34
priority of record 34 is say 21
Record has a status of ToDo.


Move.php?ID=34&Order=21&Status=1&Move=Up

Then the move function does something like this.....

if($Move == 'Up){
  $query = "SELECT ID, Priority FROM `todolist \n";
  $query .= "WHERE `Priority` < '$Order' AND `Status` = '$Status' \n";
  $query .= "ORDER BY `Priority` DESC \n";
  $query .= "LIMIT 1 \n";
}else{
  $query = "SELECT ID, Priority FROM `todolist \n";
  $query .= "WHERE `Priority` > '$Order' AND `Status` = '$Status' \n";
  $query .= "ORDER BY `Priority` \n";
  $query .= "LIMIT 1 \n";
}
run query....
$TempID = $row['ID'];
$TempPriority = $row['Priority'];

$query = "UPDATE `todolist` SET `Priority` = '$Order' \n";
$query .= "WHERE `ID` = '$TempID' "
run query....
$query = "UPDATE `todolist` SET `Priority` = '$TempPriority' \n";
$query .= "WHERE `ID` = '$ID' "
run query...












--
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm";

Ham Radio Repeater Database.
http://hrrdb.com

--- End Message ---
--- Begin Message ---
A) validating username in php

as part of a registration form a user fills there desired username and this
is stored in a mysql. there are certain conditions for the username.

a) the username should only begin either letters or numbers, and Underscore
character
example = user123, 123user, u_ser123, user_123 = completely case insensitive
b) a user may choose not to have an underscore or numbers sometimes. example
= username

presently my validation for username is

$username = $_POST["username"];
if( $username == "" || !eregi("^[a-zA-Z0-9_]+$", $username) )
{
$error.="User name cannot be blank or has special characters";
}

Question = how can i rewrite this php validation for username to meet the
above criteria or is my validation correct


B) preventing sql injection

till now i have been capturing the form values and directly inserting into
the table without considering sql injection however for this project as it
is for a forum i would like to implement prevention of sql injection. from
what i have read about preventing sql injection there are several steps that
need to be followed,

htmlentities
addslashes
trim
mysql-real-escape-string
magic_quotes_gpc is ON
magic_quotes_runtime is OFF
magic_quotes_sybase is OFF

as i have not done preventing sql injection i am not sure what is the
correct process.

Question =

a) please advice a step by step process of how to go about avoiding the sql
injection before the insert sql query is executed starting from

$username = $_POST["username"];               till the

insert into tablename(field1, field2) values($value1, $value2) SQL query is
executed which will prevent sql injection even if the user enters any
special characters while filling the form.

b) should i consider the setting of magic quotes as in should it be ON or
OFF or should i ignore it if so should it be
ON or OFF

c) also with the prevention methods if a user types a special character in
the data will that character be written in the table as a escaped character
or how does it store those special characters

d) a very important point here, i have a feature where a user can check if a
username is available or not. so while storing a username if the username is
stored as john\smith in mysql and if the user is searching for johnsmith
this would not match, so even in the table the username should be stored
without slashes as i have to read the username and compare with what the
user has typed to see if they both are same or different.
please advice if i have missed any other steps to prevent sql injection.

thanks a lot for your help.

--- End Message ---
--- Begin Message --- your validation looks good enough to me. If you only allow alphanumerical chars, then your should not be worried about sql injection also use addslashes($username) before you insert into database and you should be fine.

Usually addslashes is enough to prevent this, but the validation that you have is also enough. So if you worried about the sql injection, then use both and you should be fine.

Sudhakar wrote:

A) validating username in php

as part of a registration form a user fills there desired username and this
is stored in a mysql. there are certain conditions for the username.

a) the username should only begin either letters or numbers, and Underscore
character
example = user123, 123user, u_ser123, user_123 = completely case insensitive
b) a user may choose not to have an underscore or numbers sometimes. example
= username

presently my validation for username is

$username = $_POST["username"];
if( $username == "" || !eregi("^[a-zA-Z0-9_]+$", $username) )
{
$error.="User name cannot be blank or has special characters";
}

Question = how can i rewrite this php validation for username to meet the
above criteria or is my validation correct


B) preventing sql injection

till now i have been capturing the form values and directly inserting into
the table without considering sql injection however for this project as it
is for a forum i would like to implement prevention of sql injection. from
what i have read about preventing sql injection there are several steps that
need to be followed,

htmlentities
addslashes
trim
mysql-real-escape-string
magic_quotes_gpc is ON
magic_quotes_runtime is OFF
magic_quotes_sybase is OFF

as i have not done preventing sql injection i am not sure what is the
correct process.

Question =

a) please advice a step by step process of how to go about avoiding the sql
injection before the insert sql query is executed starting from

$username = $_POST["username"];               till the

insert into tablename(field1, field2) values($value1, $value2) SQL query is
executed which will prevent sql injection even if the user enters any
special characters while filling the form.

b) should i consider the setting of magic quotes as in should it be ON or
OFF or should i ignore it if so should it be
ON or OFF

c) also with the prevention methods if a user types a special character in
the data will that character be written in the table as a escaped character
or how does it store those special characters

d) a very important point here, i have a feature where a user can check if a
username is available or not. so while storing a username if the username is
stored as john\smith in mysql and if the user is searching for johnsmith
this would not match, so even in the table the username should be stored
without slashes as i have to read the username and compare with what the
user has typed to see if they both are same or different.
please advice if i have missed any other steps to prevent sql injection.

thanks a lot for your help.



--

Open Source ALL content management
with streaming video
http://wiki.sharedlog.com



--- End Message ---
--- Begin Message ---
Dmitri wrote:
> your validation looks good enough to me. If you only allow
> alphanumerical chars, then your should not be worried about sql injection
> also use addslashes($username) before you insert into database and you
> should be fine.
> 
> Usually addslashes is enough to prevent this, but the validation that
> you have is also enough. So if you worried about the sql injection, then
> use both and you should be fine.

Ahh, that's just wrong.

I can encode an sql query into hex code and that'll pass alpha-numeric
validation.

Use mysql_real_escape_string when you save your data, or use
parameterized queries.

http://www.php.net/mysql_real_escape_string
http://www.php.net/manual/en/pdo.prepared-statements.php
http://www.php.net/manual/en/mysqli.prepare.php

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Sudhakar wrote:
A) validating username in php

If you do what needs to be done to prevent sql injection, it doesn't
matter what you let users have for their user name.




B) preventing sql injection


htmlentities

this has nothing to do with sql injection it just is needed so when you
print data to the screen that may include html entities, they display right.


addslashes
This is a generic way to escape things and is a bad idea since it
doesn't know what system you are using for your DB so you can't be sure
it does it right.

trim

This is handy when reading form data just so you don't store any extra
spaces at the beginning and end of entries.  Often users will
inadvertently add a space to the end or have spaces the come in from
copy and paste.  Again nothing to do with sql injection.

mysql-real-escape-string
If you are using MySQL this is the only function you need to prevent sql
injection.  Simply run any variable that will be part of a query through
this function and then put single quotes around all variables in your
queries and sql injection will be a non issue.

Example....
$UserName = mysql_real_escape_string($UserName);
$query = "SELECT * FROM `user` WHERE `UserName` = '$UserName' ";

run the query and all will be good.  Many add the password to the where
clause too but I prefer to use a php if statement to be sure the
comparison is case sensitive (depending on the Collation you use in
MySQL your conditional tests may or may not be case sensitive).



magic_quotes_gpc is ON
If you can, you should have this off.  In php 6 Off will be the only
option.  With it on it adds slashes in an attempt to do a generic escape
of characters to prevent sql injection.  Since you can't be sure that
will work right, the best bet is to read in your form data like this....

$UserName = trim(stripslashes($_POST['UserName']));

I do the same thing for all data read from forms.  Then before I use the
var as part of a query, I use the mysql_real_escape_string function on
it.  The only exception is when I am expecting an integer returned from
a form, in which case I use this...

$Status = (int) $_POST['Status'];
that way no mater what the user or some hacker tries to get in, I am
sure $Status contains an integer and I don't need to bother with the
mysql_real_escape_string on that var.


If magic_quotes_gpc is off, you can and should remove the strip slashes
function call.  Note the only reason I use trim is to get rid of any
white space that may be at the ends of the string.


magic_quotes_runtime is OFF
magic_quotes_sybase is OFF


These should both be off too.




--
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm";

Ham Radio Repeater Database.
http://hrrdb.com

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

I use fsockopen and fputs to call a distant URL, but I have the following
error : 
The requested URL /registration/test was not found on this server.

This is my code:

$req = 
        'username=' . $usr . '&password=' . $pass . 
        '&date_of_birth=' . $year . "-" . $month . "-" . $day . 
        '&email=' . $email . '&country=' . $country;

$fp = fsockopen("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br>\n";
} else {
        $header = "POST /registration/test HTTP/1.0\r\n";
        $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
        fputs ($fp, $header . $req);
        
    while (!feof($fp)) {
                echo fgets($fp, 1024);
    }
    fclose($fp);
}

However the path www.example.com/registration/test exists
so why does it says it cannot find the requested url ?

Any idea ? Thank you for any help !!
-- 
View this message in context: 
http://www.nabble.com/fsockopen-%2B-fputs-tp17264395p17264395.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
debussy007 wrote:

> However the path www.example.com/registration/test exists
> so why does it says it cannot find the requested url ?
> 
> Any idea ? Thank you for any help !!

Take a look at the accesslog on www.example.com - that'll tell you
what's happening.


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
On 5/15/08, Eric Butera <[EMAIL PROTECTED]> wrote:
> On Wed, May 14, 2008 at 10:56 PM, Yi Wang <[EMAIL PROTECTED]> wrote:
>  > Can anyone provide some code that can't be stripped by strip_tags?
>  >
>  >
>  > On 5/15/08, Eric Butera <[EMAIL PROTECTED]> wrote:
> >> On Wed, May 14, 2008 at 11:38 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>  >>  >
>  >>  >
>  >>  >  On Wed, 2008-05-14 at 11:18 -0400, Eric Butera wrote:
> >> > > On Tue, May 13, 2008 at 4:07 AM, James Dempster <[EMAIL PROTECTED]> wrote:
>  >>  >  > > http://htmlpurifier.org/
>  >>  >  > >
>  >>  >  > >  --
>  >>  >  > >  /James
>  >>  >  > >
>  >>  >  >
>  >>  >  > This is the only real solution.
>  >>  >
> >> > That depends... if I'm the webmaster and I want to input arbitrary HTML,
>  >>  >  then htmlpurifier is unnecessary.
>  >>  >
>  >>  >
>  >>  >
>  >>  >  Cheers,
>  >>  >  Rob.
>  >>  >  --
>  >>  >  http://www.interjinn.com
>  >>  >  Application and Templating Framework for PHP
>  >>  >
>  >>  >
>  >>
>  >>
>  >> OP said "users."  Strip tags doesn't bother with tag attributes so
>  >>  that is a security hole.  Any regex type solution will encounter the
>  >>  same set of issues.
>  >>
>  >>  Htmlpurifier actually strips down and re-builds your html from the
>  >>  ground against a nice whitelist filtering system that you can
>  >>  customize to your needs.  No nasty tags/attributes will get through
>  >>  unless you want them to.
>  >>
>  >>
>  >>  --
>  >>  PHP General Mailing List (http://www.php.net/)
>  >>  To unsubscribe, visit: http://www.php.net/unsub.php
>  >>
>  >>
>  >
>  >
>  > --
>  > Regards,
>  > Wang Yi
>  >
>
>
> I meant if you used the allow tags parameter.  If you allow say the
>  <b> tag, then you could say <b key="value"> and it would pass right
>  through.
>
>  <?php
>
>  $str = "<b>hi</b><b onMouseOver='alert(/xss/);'>xss</b>";
>
>  echo "raw:\n";
>  var_dump($str);
>
>  echo "strip tags:\n";
>  var_dump(strip_tags($str));
>
>  echo "allow b:\n";
>  var_dump(strip_tags($str, '<b>'));
>  ?>
>
>  raw:
>  string '<b>hi</b><b onMouseOver='alert(/xss/);'>xss</b>' (length=47)
>  strip tags:
>  string 'hixss' (length=5)
>  allow b:
>  string '<b>hi</b><b onMouseOver='alert(/xss/);'>xss</b>' (length=47)
>

Yes, you are right. I always used to involved plain text.

Thanks!

--

cheers,
Yi Wang

--- End Message ---
--- Begin Message ---
Angelo Zanetti wrote:
Hi All.

This is a quick question.

A client of ours wants a solution that when a PDF document is uploaded that
we use PHP to scan the documents contents and save it in a DB.

I know you can do this with normal text documents using the file commands
and functions.

Is it possible with PDF documents?

My feeling is NO, but perhaps someone will prove me wrong.

Thanks in advance.

Angelo

Web: http://www.elemental.co.za



One thing you'll have to watch is that if the PDF was created by a scanner, then the "text" on the PDF is actually just an image and cannot be read without OCR. I got stumped on that one for a while when I was doing something similar :)

--
Ray Hauge
www.primateapplications.com

--- End Message ---
--- Begin Message ---
On Thu, 2008-05-15 at 20:17 -0500, Ray Hauge wrote:
>
> One thing you'll have to watch is that if the PDF was created by a 
> scanner, then the "text" on the PDF is actually just an image and cannot 
> be read without OCR.  I got stumped on that one for a while when I was 
> doing something similar :)

I love the tables where you have something like the following:

    .-----------------.----------------------.
    | This is a short | This is a different  |
    | paragraph about | piece of content     |
    | something in a  | about another thing. |
    | table           |                      |
    `-----------------^----------------------'

And of course when you cut and paste you get the following:

    This is a short This is a different
    paragraph about piece of content
    something in a about another thing.
    table

Oh yes, that's what I expected too. It's not even something you can
clean with a macro. You have carefully piece them back together, or
copy/paste one line at a time-- or just type it :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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

I've just installed PHP 5.2.4 on a FC 7 with a web server.

$ php -v
PHP 5.2.4 (cli) (built: Sep 18 2007 08:50:58)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

It seems some PHP module might be missing, I tested it with a page1.php:

session_start();
$_SESSION['favcolor'] = 'green';

Then I click a link in page1.php to go another page2.php:

session_start();
echo "favcolr =" . $_SESSION['favcolor'];

It only displayed "favcolr =", it was empty in $_SESSION['favcolor'].
The test script page1.php and page2.php are working fine on other
machines.

I checked with php modules, the "session" is there.

What could I be missing in PHP modules or setup?

Thank you.

--- End Message ---
--- Begin Message ---
> $ php -v
> PHP 5.2.4 (cli) (built: Sep 18 2007 08:50:58)
> Copyright (c) 1997-2007 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

This shows the php command line version, not the webserver php version.
To do that, look at a phpinfo() page. They may indeed be the same but
don't think that they always will be. I can run php4 for my webserver
version and php5 command line and vice-versa.

> It seems some PHP module might be missing, I tested it with a page1.php:

More likely the session.save_path is either not writable or not
accessible by this script.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Hey,

Have just started screwing around with wordpress and I must say... it has a lot 
of really really nice bits and pieces... two of my favourites are widgets and 
plugins... not a hundred percent certain exactly what the diff is though! :)

Anyway, was thinking it would be a great way to program for my next project... 
instead of jumping into the code again and again... write specific code and 
throw the file into the directory... then it either gets read and executed 
automatically or have a feature like WP where you have to "activate" it... only 
problem is, i dont know where to begin... i did do a little google searching 
and have a rough idea.. but would appreciate it if YOU could give me some links 
or code that got you started... something that was easy when you were 
beginning... something that lit that lightbulb in your head when you read it...

Thanks in advance!
R

 ------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



      

--- End Message ---
--- Begin Message ---
Ryan S wrote:
Hey,

Have just started screwing around with wordpress and I must say... it has a lot 
of really really nice bits and pieces... two of my favourites are widgets and 
plugins... not a hundred percent certain exactly what the diff is though! :)

Anyway, was thinking it would be a great way to program for my next project... instead of 
jumping into the code again and again... write specific code and throw the file into the 
directory... then it either gets read and executed automatically or have a feature like 
WP where you have to "activate" it... only problem is, i dont know where to 
begin... i did do a little google searching and have a rough idea.. but would appreciate 
it if YOU could give me some links or code that got you started... something that was 
easy when you were beginning... something that lit that lightbulb in your head when you 
read it...

Thanks in advance!
R

 ------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)




In all honesty, with PHP specifically, there is no finer tool to get you started than the manual. Simply go through and read it, copy all the examples and run them, fiddle around, and within a few hours you'll be reading PHP easily, and within a few days writing out your first programs and applications.

I've been PHP'ing at senior level for several years now, and still consult the manual once or twice a day, not least for the fine user submitted code, examples and comments on each section.

There's a function for everything!

Also, get a specific "script" in your head, give it a try and regularly consult this board, we'll all be more than happy to help and point you in the right directions!

Many Regards

Nathan

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

I have the following directive in my virtual host configuration:

  SetEnv APP_CONFIG_SECTION  "development"

and would like to access the value from PHP with
getenv('APP_CONFIG_SECTION') or $_SERVER['APP_CONFIG_SECTION'] or
whatever. But none of them work.

Is there any PHP / Zend / Apache2 / ... configuration option etc. I have
to activate / deactivate in order to use SetEnv?

I am using the Debian packate apache / php installation and the current
version of the Zend Framework.

I tried to use `safe_mode_allowed_env_vars = PHP_, APP_CONFIG_' in 
php.ini - but this didn't change anything either.

mod_env seems to be loaded also: /etc/apache2/mods-enabled/env.load
-> ../mods-available/env.load

Thanks, Dietrich




--- End Message ---

Reply via email to