php-windows Digest 16 Oct 2002 07:27:22 -0000 Issue 1390

Topics (messages 16385 through 16392):

Re: read registry
        16385 by: franky
        16388 by: J Wynia

HTTP-authentication
        16386 by: Davy Obdam

Re: PHP_SELF
        16387 by: Cam Dunstan

Does anyone know the status of PHPDoc
        16389 by: Asendorf, John

Re: fwrite is adding blank lines
        16390 by: benjamin delman

Need help with HTTP-Authentication
        16391 by: Davy Obdam

No TrueType support in GD2 ?
        16392 by: Alexander Winkler

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 ---
Thanks... but HKEY_CURRENT_USER hive is not available for the IUSR_Machine
so i need to use HKEY_USERS\.DEFAULT...

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q221081

Thanks...

Franky
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Franky wrote:
> Thanks... but HKEY_CURRENT_USER hive is not available for the IUSR_Machine
> so i need to use HKEY_USERS\.DEFAULT...
> 
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q221081
> 
> Thanks...
> 
> Franky
> [EMAIL PROTECTED]
> 
> 
That was just an example. The point is to use the RegRead method and 
give it a valid key. The key has to exist on the machine trying to 
execute the method. Obviously, trying to access a key that doesn't exist 
isn't going to work.

J Wynia
phpgeek.com

--- End Message ---
--- Begin Message ---
Hiya people,

I am building a admin page for a guestbook and i want more people to be
able to log in. I have made a table in the database called
user(gebruikers) wich keeps both a loginname(loginnaam) and password. I
have 2 users in this table right now. Now i ve a problem.. I can login
with the first person (myself), but i am unable to login with the second
user. Here is my code, i hope someone can help me..:)

<?php
function authenticate() 
{
        Header( "WWW-authenticate: basic realm=\"Gastenboek admin
pagina\"");
        Header( "HTTP/1.0 401 Unauthorized");
        echo   "U moet een geldinge loginnaam en wachtwoord invoeren om
deze functie te kunnen gebruiken!\n";
        exit;
}

function CheckPwd($user,$pass) 
{
        //Open database connectie
        include("scripts/db_connect.php");
        //Maak query
        $sql_query = "SELECT DISTINCT loginnaam, wachtwoord FROM
gebruikers WHERE loginnaam='$user'";
        //Verstuur query
        $sql_id = mysql_query($sql_query, $link) or die("error in
query");
        //Resultaat
        $sql = mysql_fetch_assoc($sql_id);
        $username =  $sql['loginnaam'];
        $password =  $sql['wachtwoord'];
        return ($user != $username || $pass != $password) ? false :
true;
        //Sluit database connectie
        mysql_free_result($sql_id);
        mysql_close($link);
}

if(!isset($PHP_AUTH_USER)) 
{
        authenticate();
}
elseif(!CheckPwd($PHP_AUTH_USER,$PHP_AUTH_PW)) 
{
        authenticate();
}

?>

Thanks already..

Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Sven,
Noticed the semi colon in your query string - I don`t think you should be
including that.  db says he uses it with no problems - but if you look up
mysql_query in the manual - it says  "The query string should not end with a
semicolon."

Either that, or maybe you lose the database connection (and result set) that
the $result variable originally pointed to when you recurse back into the
script - how big is the script? - too big to include in a mail?

CD


----- Original Message -----
From: "Sven Schnitzke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 15, 2002 6:57 PM
Subject: WG: [PHP-WIN] PHP_SELF


> Hi,
> is the real name of your table test_tabel as in the
> code sample or test_table as in the text ?
>
> Sven Schnitzke
>
>
> -----Ursprüngliche Nachricht-----
> Von: Rodrigo San Martin [SMTP:[EMAIL PROTECTED]]
> Gesendet am: Sonntag, 13. Oktober 2002 09:33
> An: [EMAIL PROTECTED]
> Betreff: [PHP-WIN] PHP_SELF
>
> Hi
>
> Have a problem. Need to pass a multiple array through a form using a
> PHP_SELF.
> I pass it whith a hidden variabel but i get an error warning.
>
> "Warning: Supplied argument is not a valid MySQL result resource in..."
>
> The code is:
>
> $qu2             ="SELECT * FROM test_tabel ;";
> $result       = mysql_query($qu2);
> $num         = mysql_num_rows($result);
>
> i take out some info from test_table (there are some questions in the
table
> that the user need to answer), the user does some operation, clicks submit
> and is supposed to be presented whith the next question in the table. I
pass
> the variable like this:
>
> <INPUT TYPE='hidden' VALUE='$result' NAME='result'>
>
> But no way josey. I get that warning.
>
> Anybody got i nice solution please.
>
>
>
>
>
> ------------------------------------------
> Rodrigo San Martin
> Institutt for datateknologi og informatikk
>
> http://www.idi.ntnu.no/~rodrigo
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
PHPDoc:

Who is maintaining it? Is it still being worked on?  I've found a couple
conflicting sites and dates and wonder if anyone is using it and how they're
coming with it?

http://www.phpdoc.de says they are at 0.1.0 beta?
but http://www.callowayprints.com/phpdoc/ says they are at 2.3.5?

Very confused... and I can never seem to make PEAR do what I want it to
do...

Thanks,

John

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit
--- End Message ---
--- Begin Message ---
I thought I would display this code in the body of the message, because I
dont want people to worry about the attachment containing a virus. Can't
seem to figure out why this is added blank lines when writing the file.

The DEFAULT case opens the file and loads it into a Form Textarea. CASE 1
then re-writes the file with the textarea variable. If there was a blank
lane in the textarea, it gets written as two blank lines.

Please help.

-----------------------------

<html>
<head>
 <link rel="stylesheet" type="text/css" href="/css/headline_admin.css" />
</head>
<body>

<?


/****************************************************/
/*    BEGIN SWITCH 'CASE'    */
/****************************************************/

switch ($case) {
 case 2:
  /****************************************************/
  /*    CASE 2 CASE 2 CASE 2    */
  /****************************************************/

  $includefile = stripslashes($includefile);

  $file = fopen("$file_name", "w") or die("could not open.");
  $fp = fwrite($file, $includefile) or die("could not write.");
  fclose($file);

  echo("$file_name created.");

  break;
 default:
  /****************************************************/
  /*    DEFAULT DEFAULT     */
  /****************************************************/

  /****************************************************/
  /*    VARIABLE DEFINITIONS    */
  /****************************************************/
  $file_name = "D:\Inetpub\wwwroot\includes\portal_links.inc";


  $files_array = file("$file_name");

  echo("<table align=center><tr><th>Editing:
$file_name</th></tr><tr><td><br>");
  echo("<form action=portal_edit.php method=post><input type=hidden
name=case value=2>");
  echo("<input type=hidden name=file_name value=$file_name>");
  echo("<textarea cols=100 rows=35 wrap=off name=includefile>");

  for ($t = 0; $t < count($files_array); $t++){
   echo("$files_array[$t]");
  }

  echo("</textarea><br><input type=submit value=save></form>");
  echo("</td></tr></table>");

  break;
}
/****************************************************/
/*    END SWITCH 'CASE'     */
/****************************************************/

?>
"Benjamin Delman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> attached is a script i wrote to open a file, display it's contents in a
> textarea, then submit to a different case where the file is re-written.
>
> what i notice is that when there is a blank line, after re-writing that
> blank line gets doubled. so there are now two blank lines where there was
> one. why is this? anyone know how to prevent this from happening?
>
> many thanks for you help.
>
> benjamin
>
>
>


--- End Message ---
--- Begin Message ---
Hi People,.

I have a problem with HTTP-Authentication, i have 2 users in my
database, and i want both to be able to login. However it works, but
only the first user is able to login. I Use a MySQL 3.23.xx database,
PHP 4.2.3 and Apache 2.0.40. Can anyone help me with this, any help
would be greatly apreciated. Thanks already;-)Maybe some examples?? ;-)

Best regards,
 
Davy Obdam,
mailto:[EMAIL PROTECTED]




--- End Message ---
--- Begin Message ---
When using the php_gd2.dll that comes with php 4.2.3 all truetype function
seaze to function... can this be correct?
Has anyone gotten them to work with this dll or is there another one and if
so.. where can I get it?

Thanx for your help,

Alexander


--- End Message ---

Reply via email to