php-windows Digest 18 Jun 2002 09:25:14 -0000 Issue 1198
Topics (messages 14249 through 14264):
Re: [PHP-INST] Windows Install troubles.
14249 by: MikeParton
Guidelines for installing PHP on Apache Win32 - comments please
14250 by: Jacques Steyn
Re: Windows Install troubles.
14251 by: Stuart Dallas
Re: [PHP-INST] Re: [PHP-WIN] Windows Install troubles.
14252 by: MikeParton
Permissions on a text file
14253 by: Angie Tollerson
14259 by: Tomator
Re: PHPSESSID
14254 by: Brian Huff
MSIE6.2
14255 by: Dean Hayes
Re: PHP 4.2.1 Form Error
14256 by: Steve Yates
appending to stored form input in xml file.... ????
14257 by: toby z
14258 by: Tomator
14261 by: toby z
14262 by: Tomator
Re: Script not working correctly
14260 by: Tomator
LDAP...
14263 by: Brian McGarvie
Date Comparsion
14264 by: Jack
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 ---
what versions of Apache, PHP and what "SQL" do you have installed? Do you
mean MySQL? If so, what version?
----- Original Message -----
From: "Shiloh Madsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 17, 2002 5:13 PM
Subject: [PHP-INST] Windows Install troubles.
> Hi all. Im having difficulty getting PHP up and running with my Windows
> system. I am trying to get PHP, Apache and SQL installed and running. I
> installed apache, installed PHP, copied the required DLLs into the
> apache\modules directory, and added the lines to AddModule and
> LoadModule. After doing this, when I try to view a PHP page in my
> browser, it shows the raw code/html behind the page. Any ideas why? Im
> pasting the page in question below this so you can see it.
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html>
> <head>
> <title>Login Page</title>
> </head>
> <?php
> $dbhost = "127.0.0.1";
> $dbuser = "root";
> $dbpass = "invictus";
> $db = "LoginInfo";
>
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
> if (! $LoginDB) {
> print "<p>Unable to connect to the database server at this time.</p>";
> exit();
> } else {
> ?>
> <style type="text/css">
> body { color: white; background: black; }
> </style>
> <p align="Center"><img src="Banner.png" width="666" height="103" alt="D&D
Resource Page" border="0">"</p>
> <br><br><br><br>
> <form name="Login" method="Post" action="<?echo $PHP_SELF?>">
> <p align="Center">
> Login: <input type="text" name="User Name">
> Password: <input type="password" name="Password">
> <input type="submit" name="Submit" value="Submit"
> </p>
>
> </form>
>
> <?php
> {
> ?>
>
> </html>
>
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Quite a few notes have been posted here on guys battling to get this
kind of environment going.
If you have tips on installing PHP for Apache on Win 98, could you
please read
http://www.knowsystems.com/notes/phpinstallnotes.html
and comment. The notes in the PHP Manual are ancient and need an update.
I've had some good feedback from the friendly guys on this list, but
have not been able to get the system going yet.
So I put together all the suggestions for all to see - and hopefully get
a fix so that others do not battle as I have done.
Please note that somewhere there is something missing in these
guidelines - which is where I desparately need your help. So don't
follow them yet...
Thanks
Jacques
--
___________________
Jacques Steyn
+27 (0)11 478-1259
http://www.knowsystems.com
--- End Message ---
--- Begin Message ---
On Monday, June 17, 2002 at 10:13:37 PM, Shiloh Madsen wrote:
> added the lines to AddModule and
> LoadModule
Have you added the AddType line?
AddType application/x-httpd-php .php
--
Stuart
--- End Message ---
--- Begin Message ---
This is what I have in my Apache httpd.conf on Win NT 4.0 SP6a:
LoadModule php4_module "C:/program files/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
php works as advertised for me
Apache=2.0.36
PHP=4.2.1
----- Original Message -----
From: "Stuart Dallas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 17, 2002 5:36 PM
Subject: [PHP-INST] Re: [PHP-WIN] Windows Install troubles.
> On Monday, June 17, 2002 at 10:13:37 PM, Shiloh Madsen wrote:
> > added the lines to AddModule and
> > LoadModule
>
> Have you added the AddType line?
>
> AddType application/x-httpd-php .php
>
> --
> Stuart
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I have a text file that I need PHP to be able to read and write too, but
I don't won't people to be able to browse to it. Since it's a txt file
I can't put login programming on it. And in IIS it seems the only way
to turn off internet browsing to the file is to remove Internet Guest
BUT that is what PHP is set up on. What do I do to fix this problem?
Thanks!
Angie Tollerson
Alliance Technologies
Web Programmer
(515)245-7628
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
> I have a text file that I need PHP to be able to read and write too, but
> I don't won't people to be able to browse to it. Since it's a txt file
> I can't put login programming on it. And in IIS it seems the only way
> to turn off internet browsing to the file is to remove Internet Guest
> BUT that is what PHP is set up on. What do I do to fix this problem?
> Thanks!
Don't store this file in folder being accesible from Internet. If you place
it elsewhere nobody should be able to see it. PHP, as local process will
have acces to this directory.
--- End Message ---
--- Begin Message ---
There is, but I dont think you want to do it...
if you recompile PHP with "--enable-trans-sid" turned off, then PHP will
not slap on that id at the end of the URL. However, if you do this, you
will completely lose the ability to track sessions when people dont have
cookies turned on.
You could manually rewrite EVERY page you use to pass hidden form fields
between pages, but that kind of code requires a hell of a lot of
maintenance.
personally, I'd just take a page from the book of REST and leave that
ugly session id on your URL. Both the Apple Store and Amazon do it...
and those are just the A's ;)
--
Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424
> PHP v.4.2.1
> Apache v1.3.x
> NT 4 workstation SP6
>
> I am using IE6 with the default (medium) cookie privacy settings.
>
> What I'm finding is that the session ID is being passed with the URL i.e.
> ?PHPSESSID=blahblah. I understand that PHP does this when it can't save
> session cookies on the client for some reason and this is borne out by the
> fact that when I set cookie privacy to 'Allow all cookies' the get string
> disappears.
>
> As most IE6 users will probably maintain default cookie settings - is there
> something else I can do to stop PHP putting the session ID in the URL?
> TIA
> Rich
>
--- End Message ---
--- Begin Message ---
does any one know a way i can use the command $HTTP_REFERER $HTTP_USER_AGENT
& $REMOTE_ADDR in internet explorer6.2 as every time i try to use the
commands it returns a blank page unless i use the if and elseif statments.
This would be a great help as i need to include this in a new counter i am
building at the moment
Dean "The Insane Guy" Hayes
I know i am Insane why do you think my name is The Insane Guy
blah blah blah more bull crap stuff insert it here --> <--
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
--- End Message ---
--- Begin Message ---
"Mike" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> then reinstalled PHP with the newer version. PhP seems to
> work again but I keep getting line errors on everything,
You are aware that the default for automatic variable creation changed
in 4.2? You now need to reference variables by either:
1) extract($HTTP_POST_VARS); //or GET, etc., at the beginning of the script,
then by $myvarname
2) echo $HTTP_POST_VARS['myvarname']; // for each var reference
3) set register_globals=on in your php.ini (this is documented in the first
part of the new default file), then by $myvarname
- Steve Yates
- Only XT users know that January 1, 1980 was a Tuesday.
/ Taglines by Taglinator - www.srtware.com /
--- End Message ---
--- Begin Message ---
im trying to store input from my form into ctnt.xml
file thru
ctnt.php
the problem is ....
how do i append to this file ie
i want the input of each form subbmission to get
stored in this same ctnt.xml
without overwriting ....
i now i sholud use $fp=fopen("c:\\name.xml", "a+");
i get an error ven i try to open n.xml in internet
explorer
& here is the error i get :
"XML document must have a top level element. Error
processing resource file:///C:/n.xml'. "
here is my ctnt.php file ....
<?php
$doc = domxml_new_doc("1.0");
$fp=fopen("c:\\n.xml", "a+");
$ctnt_root = $doc->create_element("ctnt-root");
$ctnt_root = $doc->append_child($ctnt_root);
$fp=fopen("c:\\n.xml", "a+");
$ctnt_info= $doc->create_element("ctnt-info");
$ctnt_info = $ctnt_root->append_child($ctnt_info);
$sr_no = $doc->create_element("sr-no");
$sr_no = $ctnt_info->append_child($sr_no);
$txt = $doc->create_text_node("$srno");
$txt = $sr_no->append_child($txt);
$cat_id = $doc->create_element("cat-id");
$cat_id = $ctnt_info->append_child($cat_id);
$txt = $doc->create_text_node("$cat");
$txt = $cat_id->append_child($txt);
$lang_id = $doc->create_element("lang-id");
$lang_id = $ctnt_info->append_child($lang_id);
$txt = $doc->create_text_node("$lang");
$txt = $lang_id->append_child($txt);
$memb_id = $doc->create_element("memb-id");
$memb_id = $ctnt_info->append_child($memb_id);
$txt = $doc->create_text_node("$login");
$txt = $memb_id->append_child($txt);
$ttle = $doc->create_element("title");
$ttle = $ctnt_info->append_child($ttle);
$txt = $doc->create_text_node("$title");
$txt = $ttle->append_child($txt);
$bdy = $doc->create_element("body");
$bdy = $ctnt_info->append_child($bdy);
$txt = $doc->create_text_node("$body");
$txt = $bdy->append_child($txt);
$date_time = $doc->create_element("date-time");
$date_time = $ctnt_info->append_child($date_time);
$txt = $doc->create_text_node("$date_time");
$txt = $date_time->append_child($txt);
$doc->dump_file("c:\\ctnt.xml", false, true);
//$fp=fopen("c:\\ctnt.xml", "wb");
//fwrite($fp, "$root");
?>
m i messing it up somewhere ????
id really appriciate any help ....
& please do letme know if i sholud send the form as
well ....
thnx a million .....
mr. seven-rude-son (b.a.t hkg).... ive tried to
improve on my WRITTING ! ! ! !
toby ....
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--- End Message ---
--- Begin Message ---
> im trying to store input from my form into ctnt.xml
> file thru
> ctnt.php
>
> the problem is ....
> how do i append to this file ie
> i want the input of each form subbmission to get
> stored in this same ctnt.xml
> without overwriting ....
>
> i now i sholud use $fp=fopen("c:\\name.xml", "a+");
> i get an error ven i try to open n.xml in internet
> explorer
> & here is the error i get :
>
> "XML document must have a top level element. Error
> processing resource file:///C:/n.xml'. "
It is rather clear. As HTML may have syntax errors and be correctly
displayed, an XML document can't. Any XML compilant processor will refuse to
process XML with errors.
An XML MUST have TOP LEVEL ELEMENT. HTML should have it also (<HTML> &
</HTML> pair). This means that you can NOT simply append some content do XML
file, becouse it would add some text AFTER ending tag of top element. I
haven't read your code, becouse I think your problem is with understanding
XML where everything MUST by correct.
To get correct results try to remove last line of XML document (with top
element's closing tag), append file and, finally, place closing tag. Or
store your data in database (such as textfile) and generate your XML
dynamically with PHP as others do.
--- End Message ---
--- Begin Message ---
>Or
>store your data in database (such as textfile) and
>generate your XML
>dynamically with PHP as others do.
thnx ....
but please do tell me how i can do that ...
id be really gratefull if u could give me a link or
sumthing .....
since ive just started working with these tools ....
thnx a million
toby .....
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "toby z" <[EMAIL PROTECTED]>
To: "Tomator" <[EMAIL PROTECTED]>; "php hlp list"
<[EMAIL PROTECTED]>
Sent: Tuesday, June 18, 2002 9:40 AM
Subject: Re: [PHP-WIN] Re: appending to stored form input in xml file....
????
> >Or
> >store your data in database (such as textfile) and
> >generate your XML
> >dynamically with PHP as others do.
>
> thnx ....
> but please do tell me how i can do that ...
> id be really gratefull if u could give me a link or
> sumthing .....
> since ive just started working with these tools ....
>
> thnx a million
>
> toby .....
>
>
>
I'm new to PHP also, but I easily create HTMLs dynamically. Everything is
described in PHP documentation.
To maintenance text files could be helpfull functions like explode() &
implode(), but I prefer MySQL.
XML is also mentioned id PHP docs.
PHP programming is fun if you are familiar with programming from elsewhere.
--- End Message ---
--- Begin Message ---
> I created this script to ping a host and if a response is not received
then
> insert into a second table and ping it after x amount of minutes. The
script
> seems to work fine until it starts to ping the hosts in the second table
> then it goes to page cant be displayed. I need to script to entire script
to
> run constantly but with a delay before it runs. Please help.
Your script IS working correctly but maybe not as you want. PHP is not
designed to run 'constatnly running" scripts. If you try, you will geat an
timeout (after 30 seconds).
If you want to repeat pinging any server after x seconds, use REFRESH. In
that way, your script will generate HTML page (with text "ping problems,
waiting...") and refresh it running script again (and again and.... until
you close browser window or go to another page). Try this:
<html>
<head>
<meta http-equiv="refresh" content="x;URL=http://want.to.ping.it.again">
</head>
...
</html>
where "x" in third line is amount of seconds to wait
--- End Message ---
--- Begin Message ---
I'm just experimenting with LDAP...
[ Windows 2000 Server/IIS/php 4.2.1]
I've uncommented the php_ldap.dll in my .ini... when I execute the following simple
piece of code it gives me:
Fatal error: Call to undefined function: ldap_connect() in E:\wwwshell\test\index.php
on line 5
<?
function checkUser ($username,$password) {
$ldapserver = 'ip_for_ad_svr';
$ds=ldap_connect($ldapserver);
if ($ds) {
$dn="cn=$username,cn=Users, DC=[sitename], DC=[sitesuffix]";
$r=@ldap_bind($ds,$dn,$password);
if ($r) { return true;
} else {
return false;
}
}
}
if(checkNTUser("brian","moo")) {
echo "USR Auth!";
} else {
echo "USR NOT Auth!";
}
?>
What have I not done?
[ http://www.the-local-guide.com :: http://www.mcgarvie.net ]
--- End Message ---
--- Begin Message ---
Dear all
I had a form which let user to input the leave_from and leave_to date into,
the format of the date that user input is "yyyy-mm-dd".
Now i want to compare the leave_from and leave_to date to find out the
number of days between!
What should i do or any function in php can provide this operation?
--
Thx a lot!
Jack
[EMAIL PROTECTED]
--- End Message ---