php-windows Digest 5 May 2002 22:36:37 -0000 Issue 1129
Topics (messages 13551 through 13560):
Re: Security Alert! PHP CGI cannot be accessed directly. HELP
13551 by: Numero 6
13558 by: Roberto Valverde
Re: PHP4.04 Methodes mkdir(), fopen() brings an Error on a WinXP/IIS5.0 PC "Permission
denied"
13552 by: toby z
mail() doesn't work with $ variable
13553 by: Cheyenne Vermeulen
13554 by: Cheyenne Vermeulen
mail() funtion won't work
13555 by: Derek Bond
13556 by: Cheyenne Vermeulen
Small Doubt in PHP Manual...pls help
13557 by: theN
13560 by: Ross Fleming
Re: How can i install PHP as an Apache module on windows 2000?
13559 by: alphapoet
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 ---
[EMAIL PROTECTED] (Roberto Valverde), il 04 mag 2002, trasse
un profondo sospiro e disse:
> Hi all,
>
> please I need help, the Message error is:
>
> Security Alert! PHP CGI cannot be accessed directly.
> This PHP CGI binary was compiled with force-cgi-redirect enabled. This
> means that a page will only be served up if the REDIRECT_STATUS CGI
> variable is set. This variable is set, for example, by Apache's Action
> directive redirect.
>
> You may disable this restriction by recompiling the PHP binary with
> the --disable-force-cgi-redirect switch. If you do this and you have
> your PHP CGI binary accessible somewhere in your web tree, people will
> be able to circumvent .htaccess security by loading files through the
> PHP parser. A good way around this is to define doc_root in your
> php.ini file to something other than your top-level DOCUMENT_ROOT.
> This way you can separate the part of your web space which uses PHP
> from the normal part using .htaccess security. If you do not have any
> .htaccess restrictions anywhere on your site you can leave doc_root
> undefined. If you are running IIS, you may safely set
> cgi.force_redirect=0 in php.ini.
You have to add a new key in php.ini: cgi.force_redirect = 0
(if you're running IIS or PWS, either Win98 or NT)
--- End Message ---
--- Begin Message ---
Thank you,
But I have try too use that new line on my php.ini file but I still can't
get it to work out. I use Win Xp Pro with IIS 5.1
I've done a reset to the server & restarted windows too. but still it shows
the some msg error.
Rob
"Numero 6" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> [EMAIL PROTECTED] (Roberto Valverde), il 04 mag 2002, trasse
> un profondo sospiro e disse:
>
> > Hi all,
> >
> > please I need help, the Message error is:
> >
> > Security Alert! PHP CGI cannot be accessed directly.
> > This PHP CGI binary was compiled with force-cgi-redirect enabled. This
> > means that a page will only be served up if the REDIRECT_STATUS CGI
> > variable is set. This variable is set, for example, by Apache's Action
> > directive redirect.
> >
> > You may disable this restriction by recompiling the PHP binary with
> > the --disable-force-cgi-redirect switch. If you do this and you have
> > your PHP CGI binary accessible somewhere in your web tree, people will
> > be able to circumvent .htaccess security by loading files through the
> > PHP parser. A good way around this is to define doc_root in your
> > php.ini file to something other than your top-level DOCUMENT_ROOT.
> > This way you can separate the part of your web space which uses PHP
> > from the normal part using .htaccess security. If you do not have any
> > .htaccess restrictions anywhere on your site you can leave doc_root
> > undefined. If you are running IIS, you may safely set
> > cgi.force_redirect=0 in php.ini.
>
> You have to add a new key in php.ini: cgi.force_redirect = 0
> (if you're running IIS or PWS, either Win98 or NT)
--- End Message ---
--- Begin Message ---
i had the same problem .....
checkout your dir where you've saved the file you are
executing .....
check the path in your code .....
with me ... i put another "\" in the path after the
ie
$fp=fopen("c:\\name.txt", "w");
vat happened after this waz .... it didnt give me the
errors you are getting ....
and then my problm started here .....
its not saving the things to the disk .....
i'm not getting any errors but it doesnt work the way
i want it to anyway .....
can someone tell me how i can save the fields im
taking as input fron my form to disk ????
thnx ....
--- Thorsten Hodes <[EMAIL PROTECTED]> wrote: > Hi
Newsgroup!
>
> I have a big Problem with PHP-4.0.4 on a WinXP/IIS
> 5.0 PC, when I want to
> write an File or create a Folder with
> the PHP-Methodes "mkdir" bzw. "fopen"! The PHP
> brings me an Error like:
>
> Warning: MkDir failed (File exists) in
> functions.inc.php on line 56
>
> Warning:
> fopen("C:/Programme/MyCMS/mainnavi.php","r+") -
> Permission denied
> in functions.inc.php on line 69
>
> Warning: Supplied argument is not a valid
> File-Handle resource in
> functions.inc.php on line 131
>
> Warning: Supplied argument is not a valid
> File-Handle resource in
> functions.inc.php on line 132
>
> ...! The Error-Message means, that the File currenty
> exists. But this is
> false! And then the Error means too, that I havn't
> any Permission to write a
> File or a Folder.
>
> This is the code, that I wrote:
> ...
>
mkdir("".$GLOBALS["rootpath"]."/contents/c".$area_id."",
> 0777);
> //Erzeugt Contentordner
>
mkdir("".$GLOBALS["rootpath"]."/contents/c".$area_id."/forms",
> 0777);
> //Enthält Formulardateien f. Content (Datenstruktur
> usw.)
> ...
> ...
> $file = "".$GLOBALS["rootpath"]."mainnavi.php";
> $fp = fopen($file, "r+");
> ...
>
> .......
>
> Can someone help me? I don't have any Idea what
> Settings I must set on IIS
> or WinXP? I have give IIS (virtual webfolder) rights
> to write, execute
> and read any Script or File, too but the error is
> always the same. What can
> I do more to fix the Error!
>
> For Testings, I install Apache insteat of IIS, but
> the Problem was the
> same!!
>
> I think it can be a PHP-Bug, or not???
>
> Thank you for your help!!
>
> My E-Mail Address is: [EMAIL PROTECTED] :-)
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
--- End Message ---
--- Begin Message ---
Hi all!
I'm pretty green on this and i'm trying to create a form that sends a authorization
mail
using a few variable using the ()mail script.
I have all settings correct, added the smtp right, even tested it with the following
script wich worked fine....
"<?php
print mail ('[EMAIL PROTECTED]',
'No need for reply -- PHP test!', /* subject */
"hi Cheyenne\nLine 2\n"); /* body */
?>"
When using the concerning script wich i copied below, it just doesnt send the mail and
gives me the following error : "Warning: Server Error in x:\apache
group\apache\htdocs\php-pages\register.php on line 103"
It does in fact store the submitted data in the database so it is only the mail that's
given
me a headache!!! What is it i'm doing wrong? (i've put the 'error-line' 103 in
bold/italic)
The source:
<html>
<head>
<title>Inschrijven</title>
</head>
<body>
<p align="left">
<?
require "../db.php";
require "../functions.inc.php";
$result=mysql_query("SELECT * FROM CATEGORIE");
$result2=mysql_query("SELECT * FROM CATEGORIE");
$result3=mysql_query("SELECT * FROM CATEGORIE");
?>
<?php
if ($submit)
{
$geboortedatum=$jaar."-".$maand."-".$dag;
$van=$jaar2."-".$maand2."-".$dag2;
$tot=$jaar3."-".$maand3."-".$dag3;
$postcode=$postcode1.$postcode2;
for ($ix=0;$ix<count($rijbewijs);$ix++)
{
$rijbewijzen.=$rijbewijs[$ix]." ";
}
if (emailcheck($email)!="oke")
{
$fout.="Vul een geldig e-mailadres in.<br>";
}
if (strlen($ervaring)==0)
{
$fout.="Vul een geldige waarde in voor <b>ervaring</b>.<br>";
}
if (strlen($nationaliteit)==0)
{
$fout.="Vul een geldige waarde in voor <b>nationaliteit</b>.<br>";
}
if (strlen($naam)==0)
{
$fout.="Vul een geldige naam in.<br>";
}
if (strlen($voornaam)==0)
{
$fout.="Vul een geldige voornaam in.<br>";
}
if (strlen($adres)<7)
{
$fout.="Vul een geldig adres in.<br>";
}
if (strlen($postcode)!=6)
{
$fout.="Vul een geldige postcode in.<br>";
}
if (strlen($plaats)<5)
{
$fout.="Vul een geldige woonplaats in.<br>";
}
if (strlen($tel)<10 || strlen($mobiel)<10)
{
$fout.="Een telefoonnummer bestaat uit minimaal 10 cijfers.<br>";
}
if ($fout)
{
$fout.="<br>Klik <a href=javascript:history.go(-1)>hier</a> om de invoer te
verbeteren.";
echo "<h1>FOUTE INVOER</h1>";
echo $fout;
}
else
{
srand((double)microtime()*1000000);
$mailcode= rand(1000,9999);
if ($register=mysql_query("INSERT INTO TEST
VALUES('','$naam','$voornaam','$geslacht','$geboortedatum','$adres','$postcode','$plaats','$tel','$mobiel','$email','$nationaliteit','$opleiding','$rijbewijzen','$cat1','$cat2','$cat3','$van','$tot','$ervaring','$info','$mailcode','0')"))
{
//variabalen declareren voor te versturen verificatie mail
/* recipients */
$recipient.= "$voornaam $naam <$email>" ;
/* subject */
$subject= "E-mail verificatie TEST";
/* message */
$message.= "Beste ". $voornaam.",\n\n" ;
$message.= "Je hebt je ingeschreven op de website van TEST.\n\n";
$message.= "Om je inschrijving definitief te maken klik je op onderstaande
link.\n\n";
$message.= "http://notnamed.com/validate/validate.php?code=".$mailcode."\n\n";
$message.= "Staat je emailprogramma niet toe om email-links te volgen kun je ook de
volgende URL intypen:\n\n";
$message.= "http://notnamed.com/validate/validate.php\n\n";
$message.= "Daar vul je dan de volgende code in:\n".$mailcode."\n\n";
$message.= "Noteer deze persoonlijke code!\n".$mailcode."\n\n";
$message.= "Deze code, samen met je emailadres geeft je de mogelijkheid\n\n";
$message.= "om te reageren op vacatures en je gegevens aan te passen.\n\n";
$message.= "Met vriendelijke groet,\n\TEST";
$headers= "From: [EMAIL PROTECTED]>\n";
$headers.= "X-Mailer: PHP\n"; // mailer
$headers.= "Return-Path: <[EMAIL PROTECTED]>"; // Return path for errors
mail($recipient, $subject, $message, $headers);
echo "Uw gegevens zijn opgeslagen in het systeem.<br>";
echo "U heeft een e-mailbericht ontvangen met daarin verdere instructies om de
inschrijving definitief te maken.<br>";
echo "Pas als u die instructies heeft opgevolgd is uw inschrijving definitief.<br>";
}
else
{
echo "Er ging iets mis bij het invoeren in de database.<br>br>".mysql_error();
}
}
}
else{
?>
</p>
<form method=post action="<?echo $PHP_SELF;?>">
<table border=0 width="461">
<tr>
<td width="127">Naam</td>
<td colspan="3">
<input type=text size=20 name=naam>
</td>
</tr>
<tr>
<td width="127">Voornaam</td>
<td colspan="3">
<input type=text size=20 name=voornaam>
</td>
</tr>
<tr>
<td width="127">Geslacht</td>
<td colspan="3">
<input type=radio name=geslacht value=M checked>
Man
<input type=radio name=geslacht value=V>
Vrouw </td>
</tr>
<tr>
<td width="127">Geboortedatum</td>
<td colspan="3">
<select name=dag>
<?
for ($i=1;$i<32;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<select name=maand>
<?
for ($i=1;$i<13;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<select name=jaar>
<?
for ($i=1940;$i<1999;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td width="127">Adres</td>
<td colspan="3">
<input type=text size=30 name=adres>
</td>
</tr>
<tr>
<td width="127">Postcode</td>
<td colspan="3">
<input type=text size=4 maxlength=4 name=postcode1>
<input type=text size=2 maxlength=2 name=postcode2>
</td>
</tr>
<tr>
<td width="127">Woonplaats</td>
<td colspan="3">
<input type=text size=20 name=plaats>
</td>
</tr>
<tr>
<td width="127">Nationaliteit</td>
<td colspan="3">
<input type=text size=20 name=nationaliteit>
</td>
</tr>
<tr>
<td width="127">Opleiding</td>
<td colspan="3">
<select name=opleiding>
<option>Laag</option>
<option>Midden</option>
<option>Hoog</option>
</select>
</td>
</tr>
<tr>
<td width="127" rowspan="2" valign="top">Rijbewijs</td>
<td colspan="3" valign="top">
<input type=checkbox name=rijbewijs[] value=A>
A
<input type=checkbox name=rijbewijs[] value=B>
B
<input type=checkbox name=rijbewijs[] value=C>
C </td>
</tr>
<tr>
<td valign="top" height="52" width="74">
<input type=checkbox name=rijbewijs[]2 value=D>
D</td>
<td valign="top" height="52" width="36">
<input type=checkbox name=rijbewijs[]22 value=E>
E</td>
<td valign="top" height="52" width="206"><br>
<br>
</td>
</tr>
<tr>
<td width="127">Telefoon</td>
<td colspan="3">
<input type=text size=10 name=tel value="0000000000">
</td>
</tr>
<tr>
<td width="127">Mobiel</td>
<td colspan="3">
<input type=text size=11 name=mobiel value="0000000000">
</td>
</tr>
<tr>
<td width="127">E-mailadres</td>
<td colspan="3">
<input type=text size=20 name=email>
</td>
</tr>
<tr>
<td width="127">Beroepscategorie</td>
<td colspan="3">
<select name=cat1>
<option value=0>-- Keuze 1 --</option>
<?
while ($row=mysql_fetch_array($result))
{?>
<option value="<?echo $row[ID];?>">
<?echo $row[NL];?>
</option>
<?}?>
</select>
<select name=cat2>
<option value=0>-- Keuze 2 --</option>
<?
while ($row2=mysql_fetch_array($result2))
{?>
<option value="<?echo $row2[ID];?>">
<?echo $row2[NL];?>
</option>
<?}?>
</select>
<select name=cat3>
<option value=0>-- Keuze 3 --</option>
<?
while ($row3=mysql_fetch_array($result3))
{?>
<option value="<?echo $row3[ID];?>">
<?echo $row3[NL];?>
</option>
<?}?>
</select>
</td>
</tr>
<tr>
<td width="127">Ervaring</td>
<td colspan="3">
<input type=text size=20 name=ervaring>
</td>
</tr>
<tr>
<td width="127">Beschikbaar</td>
<td colspan="2">van<br>
<br>
tot </td>
<td width="206">
<select name=dag2>
<?
for ($i=1;$i<32;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<select name=maand2>
<?
for ($i=1;$i<13;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<select name=jaar2>
<?
for ($i=2001;$i<2002;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<br>
<select name=dag3>
<?
for ($i=1;$i<32;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<select name=maand3>
<?
for ($i=1;$i<13;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
<select name=jaar3>
<?
for ($i=2001;$i<2020;$i++)
{
?>
<option>
<?echo $i;?>
</option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td width="127">Vink het vakje aan als u nieuws wilt ontvangen.</td>
<td valign=top colspan="3">
<input type=checkbox size=20 name=info value=1>
</td>
</tr>
<tr>
<td width="127">
<input type=submit name=submit value=Inschrijven>
</td>
<td colspan="3">
<input type=reset value=Opnieuw name="reset">
</td>
</tr>
</table>
</form>
<?}?>
<p>
</body>
</html>
Hope anyone can help me out on this one...
Thanks in advance!!
Regards, Cheyenne
--- End Message ---
--- Begin Message ---
The error occurs on 103 wich is the following line:
mail($recipient, $subject, $message, $headers);
Thanks in advance!
Regards
--- End Message ---
--- Begin Message ---
I'm runngin XP Pro, apache and php 4.2
I set my php.ini correctly, even rebooted....and my mail() still won't
work.... grrr
Bond
www.phpwebpages.com
--- End Message ---
--- Begin Message ---
You could try the following script to test it.. also check your firewall
settings.
"<?php
print mail ('[EMAIL PROTECTED]',
'No need for reply -- PHP test!', /* subject */
"hi Cheyenne\nLine 2\n"); /* body */
?>"
Regards!
--- End Message ---
--- Begin Message ---
<quote>
Note that the "?>" sequence also eats a end-of-line character
after it, so this end-of-line won't get generated to the implicitly
echo'ed output. If you need to generate an end-of-line after the
"?> sequence, you MUST follow it by another end-of-line...
</quote>
This above is a User Contributed Note on "Instruction Separation" of the
PHP manual. Could some one please explain what it means. Thanks
--
Lots of Luck
theN
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
It means that the ?>'\n' is actually taken by the PHP parser. I think the
best way to explain it is with the following demo:
random text
<? echo "hello"; ?>
<? echo "world"; ?>
more random text
will produce:
random text
helloworldmore random text
instead of the (commonly) expected:
random text
hello
world
more random text
However, since newline characters are of little or not significance in the
land of HTML, I can't see this affecting you, however if they don't mention
these things, people will submit it as a bug.
Hope that helped
Ross
-----Original Message-----
From: theN [mailto:[EMAIL PROTECTED]]
Sent: 05 May 2002 21:43
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Small Doubt in PHP Manual...pls help
<quote>
Note that the "?>" sequence also eats a end-of-line character
after it, so this end-of-line won't get generated to the implicitly
echo'ed output. If you need to generate an end-of-line after the
"?> sequence, you MUST follow it by another end-of-line...
</quote>
This above is a User Contributed Note on "Instruction Separation" of the
PHP manual. Could some one please explain what it means. Thanks
--
Lots of Luck
theN
[EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I've done what Cybero recommends below, still, my .php files don't seem to
be excuting properly. I've verified all paths and even made sure the Load
and Add's are under the proper sections in the httpd.conf file. Running
php.exe. -i from command line gives me the proper output (ie, the html for
the phpinfo() function), but, I don't seem to get any data from the actual
php file calling that function... Please assist if you can...
FYI... I'm configuring Apache 1.3.24/PHP 4.2
"Cybero" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
add this lines to httpd.conf :
LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
Guilherme dávalos <[EMAIL PROTECTED]> píse v diskusním
příspěvku:001b01c1e718$6b6f6b60$[EMAIL PROTECTED]
Hi,
i'm trying to run an application on Apache 1.3 at windows 2000 professional,
but it was made on php/Linux. I suppose that i'm having the following
problem beacuse the installation of PHP on windows is CGI version by
default.
the problem is:
[Thu Apr 18 12:28:00 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: c:/php/php.exe
So, how can i install PHP as an Apache module on windows 2000?
---
Odchádzajúca správa neobsahuje vírusy.
Skontrolované antivírusovým systémom AVG (http://www.grisoft.cz).
Verzia: 6.0.342 / Vírusová databáza: 189 - dátum vydania: 14.3.2002
--- End Message ---