php-general Digest 17 Mar 2002 18:49:42 -0000 Issue 1232

Topics (messages 88804 through 88837):

Re: Again, and Again, and AGAIN!
        88804 by: Jason Wong

Re: check on pictures
        88805 by: Martin Kampherbeek

send fax
        88806 by: Senih
        88818 by: heinisch.creaction.de

Class Function Issue
        88807 by: Jason Bell
        88825 by: heinisch.creaction.de
        88837 by: Jason Bell

problem with file writing
        88808 by: Ben Waldher
        88809 by: Jason Wong

Re: Weird?
        88810 by: jtjohnston

Copy *.*
        88811 by: jtjohnston
        88822 by: heinisch.creaction.de

Invalid Argument ???  Not sure how to debug this
        88812 by: Daniel Negron/KBE
        88813 by: Jason Wong
        88814 by: jtjohnston

mysql fetch field
        88815 by: caspar kennerdale
        88817 by: caspar kennerdale

Re: Problem with sessions.
        88816 by: Carlos Costa Portela
        88824 by: Tom Rogers
        88827 by: Carlos Costa Portela
        88830 by: Tom Rogers
        88831 by: Carlos Costa Portela

Re: retrieving remote web page
        88819 by: heinisch.creaction.de

securing the website with htaccess creates problems with getimagesize
        88820 by: andy

Re: No Sense: [PHP] Update: [PHP] Weird?
        88821 by: heinisch.creaction.de

Re: OBJECTWHAT'S THE RALATION  BETWEEN A,B AND C?
        88823 by: Oliver Heinisch

replacing all non [a-z] chars possible?
        88826 by: andy
        88828 by: bvr
        88829 by: andy
        88832 by: Michael Sims

Session --trans-id
        88833 by: lists.mhess.qn.net

Writing files a problem
        88834 by: Ben Waldher
        88836 by: Jason Wong

Including an external php file existing on another server..
        88835 by: Martin Stix

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 ---
On Sunday 17 March 2002 13:14, Jason Wong wrote:


> You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see
> changelog/history/php.ini for details).


Sorry a typo:

$HTTP_POST_VARS[] has been replaced by $_POST[]


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
What's done to children, they will do to society.
*/
--- End Message ---
--- Begin Message ---
Thanks for repying. Yes, the page has pictures. But all jpg pictures must
link to another jpg pictures. A gif is alowed to link to a html file. The
minium numers of jpg pictures must be 12.

Cheers,
Martin.


----- Original Message -----
From: "Boaz Yahav" <[EMAIL PROTECTED]>
To: "Martin Kampherbeek" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, March 02, 2002 7:35 PM
Subject: RE: [PHP] check on pictures


This is pretty Trivial if the remote pages had a standard. But from your
words I understand that the remote gallery pages can look like anything
and contain links to other places than only images.

Not trivial at all...

Sincerely

      berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Martin Kampherbeek [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 10:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] check on pictures


Can someone help me with this problem?

Someone fills in my form. One field on the form is galleryurl. Here he
types a url with some pictures on it. On this page the are thumbnail
with links to bigger pictures.
Now I want to check if the pictures are realy on it. And I want to check
if there is a link to a picture on the thumbnail and not to a html page.

I hope someone can help me.

Cheers,
Martin.




--- End Message ---
--- Begin Message ---
Hi,
is it possible  to send automated faxes via PHP?
Thanks in advance,
Senih
--- End Message ---
--- Begin Message ---
At 17.03.2002  07:35, you wrote:
>Hi,
>is it possible  to send automated faxes via PHP?
>Thanks in advance,
>Senih
If your ISP or your server is able to, yes.
something like
exec("sendfax options",$foo);
should do this. check out your system and ISP for more infos on it.
Some ISPs offer the sending of faxes via an special e-mail adress,
its forwarding a message to a fax.
HTH Oliver

--- End Message ---
--- Begin Message ---
Hi!  I'm building a class, and am trying to include an authorization function.... the 
code works when used outside of the class, but when I put it inside the class, for 
some reason my session variables won't get set.  Am I attempting the impossible, or am 
I missing something that I need to make this work? Below is the code for the Auth 
function.


function Auth($username,$password) {
                $query = "SELECT id,username,sl FROM KAOPA_users where 
username='$username' AND password=PASSWORD('$password')";
                $Auth = $this->Query($query);
                if ($this->number_returned($Auth) == '1') {
                        $id = mysql_result($Auth,0,"id");
                        $uname = mysql_result($Auth,0,"username");
                        $sl = mysql_result($Auth,0,"sl");
                        global $HTTP_SESSION_VARS;
                        $HTTP_SESSION_VARS["id"] = $id;
                        $HTTP_SESSION_VARS["user"] = $uname;
                        $HTTP_SESSION_VARS["sl"] = $sl;
                }
        }
--- End Message ---
--- Begin Message ---
At 16.03.2002  22:24, you wrote:
>
>Hi!  I'm building a class, and am trying to include an authorization 
>function.... the code works when used outside of the class, but when I put 
>it inside the class, for some reason my session variables won't get 
>set.  Am I attempting the impossible, or am I missing something that I 
>need to make this work? Below is the code for the Auth function.
>
>
>function Auth($username,$password) {
>                 $query = "SELECT id,username,sl FROM KAOPA_users where 
> username='$username' AND password=PASSWORD('$password')";
>                 $Auth = $this->Query($query);
>                 if ($this->number_returned($Auth) == '1') {
>                         $id = mysql_result($Auth,0,"id");
>                         $uname = mysql_result($Auth,0,"username");
>                         $sl = mysql_result($Auth,0,"sl");
>                         global $HTTP_SESSION_VARS;
>                         $HTTP_SESSION_VARS["id"] = $id;
>                         $HTTP_SESSION_VARS["user"] = $uname;
>                         $HTTP_SESSION_VARS["sl"] = $sl;
>                 }
>         }
some vars make trouble, using inside a class or function inside a class. Even
making them global doesnt work. Try to set the vars via an explicit function,
so that theyre available inside your class, or just make them parameters
so your authorisation could look like
$MyClass -> Auth($username,$password,$session_vars);
HTH Oliver

--- End Message ---
--- Begin Message ---
oops... meant to send this to the list

----- Original Message -----
From: "Jason Bell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 17, 2002 10:27 AM
Subject: Re: [PHP] Class Function Issue


> Thanks for the tip. I tried that... I passed $HTTP_SESSION_VARS as a
> parameter, and it didn't work.  :/
>
> I also built another function inside the class to set session variables:
>
>         function SetSVAR($var,$value) {
>                 global $HTTP_SESSION_VARS;
>                 $HTTP_SESSION_VARS[$var] = $value;
>         }
>
> If I call $MyClass->SetSVAR($var,$Value); it works....
> but if I put $this->SetSVAR($var,$Value); inside a class function it
doesn't
> work....
>
> is it because these are in the same class? should they be seperated into 2
> seperate classes?
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, March 17, 2002 4:38 AM
> Subject: Re: [PHP] Class Function Issue
>
>
> At 16.03.2002  22:24, you wrote:
> >
> >Hi!  I'm building a class, and am trying to include an authorization
> >function.... the code works when used outside of the class, but when I
put
> >it inside the class, for some reason my session variables won't get
> >set.  Am I attempting the impossible, or am I missing something that I
> >need to make this work? Below is the code for the Auth function.
> >
> >
> >function Auth($username,$password) {
> >                 $query = "SELECT id,username,sl FROM KAOPA_users where
> > username='$username' AND password=PASSWORD('$password')";
> >                 $Auth = $this->Query($query);
> >                 if ($this->number_returned($Auth) == '1') {
> >                         $id = mysql_result($Auth,0,"id");
> >                         $uname = mysql_result($Auth,0,"username");
> >                         $sl = mysql_result($Auth,0,"sl");
> >                         global $HTTP_SESSION_VARS;
> >                         $HTTP_SESSION_VARS["id"] = $id;
> >                         $HTTP_SESSION_VARS["user"] = $uname;
> >                         $HTTP_SESSION_VARS["sl"] = $sl;
> >                 }
> >         }
> some vars make trouble, using inside a class or function inside a class.
> Even
> making them global doesnt work. Try to set the vars via an explicit
> function,
> so that theyre available inside your class, or just make them parameters
> so your authorisation could look like
> $MyClass -> Auth($username,$password,$session_vars);
> HTH Oliver
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>


--- End Message ---
--- Begin Message ---
I'm having some trouble writing data to a file, when I use this code it
works fine:
<?php

$file = fopen("template.txt", "w");

fwrite ($file, $temp);

fclose ($file);

?>

But several problems with this occur:

<?php

$stuff = include ("news.txt");

$file = fopen ("news.txt", "w");

$newnews = include ("template.txt") . $stuff;

fwrite ($file, $newnews);

?>

First of all, it tries to open template.txt1 instead of template.txt.

Second of all, some letters written to news.txt become a 1 for some odd
reason. I don't know why.

I am using a windows server and I have tried using the mode "wb" but it
doesn't help.



--- End Message ---
--- Begin Message ---
On Sunday 17 March 2002 12:53, Ben Waldher wrote:
> I'm having some trouble writing data to a file, when I use this code it
> works fine:
> <?php
>
> $file = fopen("template.txt", "w");
>
> fwrite ($file, $temp);
>
> fclose ($file);
>
> ?>
>
> But several problems with this occur:
>
> <?php
>
> $stuff = include ("news.txt");
>
> $file = fopen ("news.txt", "w");
>
> $newnews = include ("template.txt") . $stuff;
>
> fwrite ($file, $newnews);
>
> ?>

include() is not the way to read files, use the Filesystem Functions for that.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
A few hours grace before the madness begins again.
*/
--- End Message ---
--- Begin Message ---
Dave,

That's just the problem with the code. See the snippet,
http://www.php.net/manual/en/function.copy.php

The function should MKDIR for me one level at a time as
the function calls itself. It should MKDIR and copy *.*
  if (is_dir($file))
  {
  rec_copy ($from_path.$file."/",  $to_path.$file."/");
       chdir($from_path);
  }

Somehow, some place the code fails.
:) I've been going nuts trying to make it work.

>David Robley wrote:

> > >Scott Furt wrote:
> > > I meant, have you created a physical directory
> > > named $date?
> > > That's your problem.  There's no directory named $date on your
> computer, and
> > > you're trying to write files into a non-existent directory.
> I think what is being suggested is that you may not have a directory
> named whatever "c:\\ccl_www\\".$date."\\ccl_www\\" expands to;
> frinstance
> if $date were 0203 you would need to have an existing directory
> "c:\\ccl_www\\0203\\ccl_www\\"
> Of course, I could be misunderstanding...

--------------------snip-----------------
<?php

#######################################
$date = date ("Ymd");
#######################################
###  Don't forget trailing slash  #####
#######################################
$from_path = "c:/program files/easyphp/ccl_www/";
$to_path = "c:/$date/ccl_www/";
#######################################

if(!is_dir($from_path))
{
echo "failed";
exit;
}else{
rec_copy($from_path, $to_path);
echo "files copies from $from_path and backed up to $to_path";
}

#########################################################################

function rec_copy ($from_path, $to_path) {
#if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
    chdir($from_path);
    $handle=opendir('.');

    while (($file = readdir($handle))!==false)
    {
 if (($file != ".") && ($file != "..")) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file."/",  $to_path.$file."/");
       chdir($from_path);
  }else{
#  echo "error if (is_dir($file))<br>";
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo "error copy($from_path.$file, $to_path.$file)<br>";
  }
 }#end (($file != ".")
    }#end while (($file

    closedir($handle);
 }# end if (is_dir
 else{
# echo "if (is_dir($from_path))<br>";
 }
}# end function

?>


--- End Message ---
--- Begin Message ---
Does anyone know of another snippet any place where I can copy *.*
(files and all sub-directories) from one drive to another? In other
words, a "backing-up" function. The snippet I got from
http://www.php.net/manual/en/function.copy.php has been a disaster.

John

--- End Message ---
--- Begin Message ---
At 17.03.2002  03:10, you wrote:
>
>Does anyone know of another snippet any place where I can copy *.*
>(files and all sub-directories) from one drive to another? In other
>words, a "backing-up" function. The snippet I got from
>http://www.php.net/manual/en/function.copy.php has been a disaster.
>
>John
Which OS are you using ?

--- End Message ---
--- Begin Message ---
Hi all and Good Morning.

I have been struggling with this code:  I was wondering if someone could
lend me a hand.

I am working with this code and can't get the error to disappear.

After running I get
|-----------------------------------------------------------------------------------------|
| Warning: Supplied argument is not a valid MySQL result resource in C:\My 
|Documents\My   |
| Webs\php\TMPibtpit3zq0.php on line 12                                                
|   |
|-----------------------------------------------------------------------------------------|


Line 12 happens to be the WHILE statement.  I am not sure if it is the
while statement or the results its looking for.

TIA  So far, i havent been able to sleep atleast until I get this.

<html>
<?
if (isset($searchstring))
     {

     $db = mysql_connect("localhost","webuser","");
     mysql_select_db("cd_collection",$db);
     $sql= "SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
ORDER BY artist ASC";
     $result = mysql_query($sql,$db);
     echo "<TABLE BORDER=2>";
     echo "<tr><td><b>Artist</b><td><b>Title</b><td><b>Options</b></tr>";
     while ($myrow = mysql_fetch_array($result))
     {
               echo "<tr><td>".$myrow["artist"]."<td>".$myrow["title"];
               echo "<td><a href=\"edit.php?id=".$myrow["cd_id"]."
\">View</a>";
          }
          echo "</TABLE>";
     }
else
     {
          ?>
          <form method="POST" action="<? $PHP_SELF ?>">
          <table border="2" cellspacing="2">
          <tr><td>Insert Your Search String Here.</td>
          <td>Search Type</td></tr>
          <tr>
          <td><input type="text" name="searchstring" size="28"></td>
          <td><select size="1" name="searchtype">
               <option selected value="artist">Artist</option>
               <option value="title">Title</option>
               <option value="category">Category</option>
          </select></td>
          </tr>
          </table>
          <p><input type = "submit" value="Submit" name="B1">
          <input type="reset" value="Reset"></p>
          </form>
  <?
     }
     ?>

     </html>


**DAN**



--- End Message ---
--- Begin Message ---
On Sunday 17 March 2002 16:38, Daniel Negron/KBE wrote:
> Hi all and Good Morning.
>
> I have been struggling with this code:  I was wondering if someone could
> lend me a hand.
>
> I am working with this code and can't get the error to disappear.
>
> After running I get
>
> |--------------------------------------------------------------------------
> |---------------| Warning: Supplied argument is not a valid MySQL result
> | resource in C:\My Documents\My   | Webs\php\TMPibtpit3zq0.php on line 12 
> |                                                  |
> | -------------------------------------------------------------------------
> |----------------|
>
> Line 12 happens to be the WHILE statement.  I am not sure if it is the
> while statement or the results its looking for.

Put in some error checking code when you use the mysql functions as per the 
manual examples and you'll soon find where the error is.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
I'm having an emotional outburst!!
*/
--- End Message ---
--- Begin Message ---
Daniel,

$myrow["artist"] and $myrow["title"]
might be a good place to start. It looks like all your ; are in place.
I don't think you can place " inside [] like that:

echo "<tr><td>".$myrow["artist"]."<td>".$myrow["title"];


> I have been struggling with this code:  I was wondering if someone could
> lend me a hand.
> Line 12 happens to be the WHILE statement.  I am not sure if it is the
> while statement or the results its looking for.
>
> TIA  So far, i havent been able to sleep atleast until I get this.
>
> <html>
> <?
> if (isset($searchstring))
>      {
>
>      $db = mysql_connect("localhost","webuser","");
>      mysql_select_db("cd_collection",$db);
>      $sql= "SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
> ORDER BY artist ASC";
>      $result = mysql_query($sql,$db);
>      echo "<TABLE BORDER=2>";
>      echo "<tr><td><b>Artist</b><td><b>Title</b><td><b>Options</b></tr>";
>      while ($myrow = mysql_fetch_array($result))
>      {
>                echo "<tr><td>".$myrow["artist"]."<td>".$myrow["title"];
>                echo "<td><a href=\"edit.php?id=".$myrow["cd_id"]."
> \">View</a>";
>           }
>           echo "</TABLE>";
>      }
> else
>      {
>           ?>
>           <form method="POST" action="<? $PHP_SELF ?>">
>           <table border="2" cellspacing="2">
>           <tr><td>Insert Your Search String Here.</td>
>           <td>Search Type</td></tr>
>           <tr>
>           <td><input type="text" name="searchstring" size="28"></td>
>           <td><select size="1" name="searchtype">
>                <option selected value="artist">Artist</option>
>                <option value="title">Title</option>
>                <option value="category">Category</option>
>           </select></td>
>           </tr>
>           </table>
>           <p><input type = "submit" value="Submit" name="B1">
>           <input type="reset" value="Reset"></p>
>           </form>
>   <?
>      }
>      ?>
>
>      </html>
>
> **DAN**

--
John Taylor-Johnston
-----------------------------------------------------------------------------
  ' ' '   Collge de Sherbrooke:
    http://www.collegesherbrooke.qc.ca/languesmodernes/
   -     Universit de Sherbrooke:
          http://compcanlit.ca/
          819-569-2064


--- End Message ---
--- Begin Message ---
I seem to be getting unexpected information from a mysql fetch field query.

My table has three fields- here is the schema-

CREATE TABLE template (
   id smallint(6) NOT NULL auto_increment,
   name mediumtext NOT NULL,
   multiple tinyint(4) DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE id (id)
);


Using the samplecode on php.net to output an object containing the
properties of eacj field I have been able to output the following

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - id
Not Null - 1
Numeric - 1
Primary Key - 1
Table - template
Type - int
Unique Key - 1
Unsigned - 0
ZeroFill - 0

Blob - 1
MaxLength - 7
Multiple Key - 0
Name - name
Not Null - 1
Numeric - 0
Primary Key - 0
Table - template
Type - blob
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - multiple
Not Null - 1
Numeric - 1
Primary Key - 0
Table - template
Type - unknown
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Which strange as the first field is specified as having a max length of 1
yet it is a small int with a length of 6.
Likewise the second field is specified as a blob with a maximum length of 7-
yet in my schema it is a medium text.
And again my third field is listed as havingan unkniwn typeyet in the schema
it is a tinyint

Here is my code

    $TableInfo = new DB;
    $TableInfoArray = $TableInfo ->MySqlGetTableInfo('SELECT * FROM
template');
    $a =-1;
    $b = -1;
    while (++$a < count($TableInfoArray)){
        $Content[++$b]  = "Blob - ".$TableInfoArray[$a][0]."<br>";
        $Content[++$b]  = "MaxLength - ".$TableInfoArray[$a][1]."<br>";
        $Content[++$b]  = "Multiple Key - ".$TableInfoArray[$a][2]."<br>";
        $Content[++$b]  = "Name - ".$TableInfoArray[$a][3]."<br>";
        $Content[++$b]  = "Not Null - ".$TableInfoArray[$a][4]."<br>";
        $Content[++$b]  = "Numeric - ".$TableInfoArray[$a][5]."<br>";
        $Content[++$b]  = "Primary Key - ".$TableInfoArray[$a][6]."<br>";
        $Content[++$b]  = "Table - ".$TableInfoArray[$a][7]."<br>";
        $Content[++$b]  = "Type - ".$TableInfoArray[$a][8]."<br>";
        $Content[++$b]  = "Unique Key - ".$TableInfoArray[$a][9]."<br>";
        $Content[++$b]  = "Unsigned - ".$TableInfoArray[$a][10]."<br>";
        $Content[++$b]  = "ZeroFill - ".$TableInfoArray[$a][11]."<br>";
        $Content[++$b]  = "<br>";
    }
    $Content = join('', $Content);
    return $Content;

--- End Message ---
--- Begin Message ---
Actually I've alreasdy worked it out- sorry

-----Original Message-----
From: caspar kennerdale [mailto:[EMAIL PROTECTED]]
Sent: 17 March 2002 10:31
To: [EMAIL PROTECTED]
Subject: [PHP] mysql fetch field


I seem to be getting unexpected information from a mysql fetch field query.

My table has three fields- here is the schema-

CREATE TABLE template (
   id smallint(6) NOT NULL auto_increment,
   name mediumtext NOT NULL,
   multiple tinyint(4) DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE id (id)
);


Using the samplecode on php.net to output an object containing the
properties of eacj field I have been able to output the following

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - id
Not Null - 1
Numeric - 1
Primary Key - 1
Table - template
Type - int
Unique Key - 1
Unsigned - 0
ZeroFill - 0

Blob - 1
MaxLength - 7
Multiple Key - 0
Name - name
Not Null - 1
Numeric - 0
Primary Key - 0
Table - template
Type - blob
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - multiple
Not Null - 1
Numeric - 1
Primary Key - 0
Table - template
Type - unknown
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Which strange as the first field is specified as having a max length of 1
yet it is a small int with a length of 6.
Likewise the second field is specified as a blob with a maximum length of 7-
yet in my schema it is a medium text.
And again my third field is listed as havingan unkniwn typeyet in the schema
it is a tinyint

Here is my code

    $TableInfo = new DB;
    $TableInfoArray = $TableInfo ->MySqlGetTableInfo('SELECT * FROM
template');
    $a =-1;
    $b = -1;
    while (++$a < count($TableInfoArray)){
        $Content[++$b]  = "Blob - ".$TableInfoArray[$a][0]."<br>";
        $Content[++$b]  = "MaxLength - ".$TableInfoArray[$a][1]."<br>";
        $Content[++$b]  = "Multiple Key - ".$TableInfoArray[$a][2]."<br>";
        $Content[++$b]  = "Name - ".$TableInfoArray[$a][3]."<br>";
        $Content[++$b]  = "Not Null - ".$TableInfoArray[$a][4]."<br>";
        $Content[++$b]  = "Numeric - ".$TableInfoArray[$a][5]."<br>";
        $Content[++$b]  = "Primary Key - ".$TableInfoArray[$a][6]."<br>";
        $Content[++$b]  = "Table - ".$TableInfoArray[$a][7]."<br>";
        $Content[++$b]  = "Type - ".$TableInfoArray[$a][8]."<br>";
        $Content[++$b]  = "Unique Key - ".$TableInfoArray[$a][9]."<br>";
        $Content[++$b]  = "Unsigned - ".$TableInfoArray[$a][10]."<br>";
        $Content[++$b]  = "ZeroFill - ".$TableInfoArray[$a][11]."<br>";
        $Content[++$b]  = "<br>";
    }
    $Content = join('', $Content);
    return $Content;


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

--- End Message ---
--- Begin Message ---
On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote:

> maybe you better use:
>
> session_unregister("counter");
>

        I've put that, but it doesn't run. As you can see in the URLs
below, my code is:

if ($id == "logout") { // the user wants logout :(
    session_unregister("counter");
  }
  else { // user is navigating through our links
    session_register("counter"); // why I recover the previous value here,
                                // even I've clicked logout?
    $counter++;
    print "counter: $counter<br/>\n";
  }
}

> > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
> > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
> > have the web page and the code, respectively.

        Tom says that I must create a new session with a different name
(now I only start a new session implicitly via session_register()).
Perhaps I am confused with the 'session' term. I thought that if I do
session_destroy() the session forget all the info, but if I check
session_id() before and after session_destroy() I see that the value is
the same.

        Thanks for your help,
                Carlos.

 _______Carlos Costa Portela_________________________________________________
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_____Tdalas persoas maiores foron nenos antes, pero poucas se lembran______|



--- End Message ---
--- Begin Message ---
hi
If you put:

<?
session_start();

as the first line on your page it will behave as you want I think.
Tom




At 08:41 PM 17/03/2002, Carlos Costa Portela wrote:
>On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote:
>
> > maybe you better use:
> >
> > session_unregister("counter");
> >
>
>         I've put that, but it doesn't run. As you can see in the URLs
>below, my code is:
>
>if ($id == "logout") { // the user wants logout :(
>     session_unregister("counter");
>   }
>   else { // user is navigating through our links
>     session_register("counter"); // why I recover the previous value here,
>                                 // even I've clicked logout?
>     $counter++;
>     print "counter: $counter<br/>\n";
>   }
>}
>
> > > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
> > > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
> > > have the web page and the code, respectively.
>
>         Tom says that I must create a new session with a different name
>(now I only start a new session implicitly via session_register()).
>Perhaps I am confused with the 'session' term. I thought that if I do
>session_destroy() the session forget all the info, but if I check
>session_id() before and after session_destroy() I see that the value is
>the same.
>
>         Thanks for your help,
>                 Carlos.
>
>  _______Carlos Costa Portela_________________________________________________
>| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
>|_____Tdalas persoas maiores foron nenos antes, pero poucas se lembran______|

--- End Message ---
--- Begin Message ---
On Sun, 17 Mar 2002, Tom Rogers wrote:

> hi
> If you put:
>
> <?
> session_start();
>
> as the first line on your page it will behave as you want I think.

        Thank you very much. It runs now ok :-). But I don't understand
why, if I call session_destroy(), the system remember the value of the
variable.

        The system running at...
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.


        Thank you very much,
                Carlos.

 _______Carlos Costa Portela_________________________________________________
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_____Tdalas persoas maiores foron nenos antes, pero poucas se lembran______|

--- End Message ---
--- Begin Message ---
Hi
As you had not started a session at that point there was none to destroy or 
unregister :)
Tom

At 11:53 PM 17/03/2002, Carlos Costa Portela wrote:
>On Sun, 17 Mar 2002, Tom Rogers wrote:
>
> > hi
> > If you put:
> >
> > <?
> > session_start();
> >
> > as the first line on your page it will behave as you want I think.
>
>         Thank you very much. It runs now ok :-). But I don't understand
>why, if I call session_destroy(), the system remember the value of the
>variable.
>
>         The system running at...
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
>have the web page and the code, respectively.
>
>
>         Thank you very much,
>                 Carlos.
>
>  _______Carlos Costa Portela_________________________________________________
>| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
>|_____Tdalas persoas maiores foron nenos antes, pero poucas se lembran______|

--- End Message ---
--- Begin Message ---
On Mon, 18 Mar 2002, Tom Rogers wrote:

> Hi
> As you had not started a session at that point there was none to destroy or
> unregister :)

        Ok!!!. Thank you very much,
                Carlos.

  http://www.tertulandia.com : sea cual sea tu tema... all est tu sitio!

 _______Carlos Costa Portela_________________________________________________
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_____Tdalas persoas maiores foron nenos antes, pero poucas se lembran______|

--- End Message ---
--- Begin Message ---
At 17.03.2002  00:45, you wrote:
>Hi,
>
>I'm wanting to retrieve a remote page and extract information from it to
>insert into my own page. I know that this can be done with fopen, however
>the page I am wishing to retrieve is generated with a POSTed form.
>
>Is there any way that I can retrieve a page that has been created by the
>filling in of a form (using the POST method)?
>
>Thanks for any help...
>
>-Andy
there are several ways,
you can use the snoopy class, look at sourceforge (easiest way)
you can use header, to post the vars, and curl to retireve the vars,
for me curl works better than fopen.
Look at the manual or even at the archive for more infromations.
HTH Oliver

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

I did put a password via htaccess on my website to hide my testing
environment from other users. Now I discovered, that PHP can't read
imagefile information via getimagesize because it does not get access to
this dir anymore.

How could I add php as a user with propper password ?

Thanx for any help,

Andy


--- End Message ---
--- Begin Message ---
At 17.03.2002  17:09, you wrote:

Hey folks, I read this with half of mind, but as I know, the function
date needs something to convert from.
> > $date = date ("MD");

for my opinion it should be called $date=date("MD",time());
or $date=date("MD",mktime(......));

then everything should work
$to_path = "c:\\ccl_www\\".$date."\\ccl_www\\";
or
$to_path = "c:\\ccl_www\\$date\\ccl_www\\";

HTH Oliver


--- End Message ---
--- Begin Message ---
At 17.03.2002  10:01, you wrote:
>
><?php
>class A
>{
>     function A($i)
>     {
>         $this->value = $i;
>         // try to figure out why we do not need a reference here
>         $this->b = new B($this);
>     }
>
>     function createRef()
>     {
>         $this->c = new B($this);
>     }
>
>     function echoValue()
>     {
>         echo "<br>","class ",get_class($this),': ',$this->value;
>     }
>}
>
>
>class B
>{
>     function B(&$a)
>     {
>         $this->a = &$a;
>     }
>
>     function echoValue()
>     {
>         echo "<br>","class ",get_class($this),': ',$this->a->value;
>     }
>}
>
>// try to undestand why using a simple copy here would yield
>// in an undesired result in the *-marked line
>$a =new A(10);
>$a->createRef();
>
>$a->echoValue();
>$a->b->echoValue();
>$a->c->echoValue();
>
>$a->value = 11;
>
>$a->echoValue();
>$a->b->echoValue(); // *
>$a->c->echoValue();
>
>?>
Even if I dont understand what your code does, shouldnt you
give any variable a place to be stored so it schould look like
class foo
{
         var $a;
         var $b;
function fooplus()
{
         $this -> a = foofoo;
and so on ??
}
}
HTH Oliver

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

I am wondering if it would be possible to replace all chars which are not
inbetween [a-z] with a valid asccii coresponding to it. I have a db with a
bunch of citynames and I would like to create valid filenames out of those.
The prob is, that I do not know all special chars. For example there was
one:   which I did not know. So maybe there are a lot others similar like
that.

The point is, how could I create a valid filename out of those citynames
which contains only the chars from a - z? I tryed erregrplc, but I do have
to know the char for that.

Thanx for any help,

andy


--- End Message ---
--- Begin Message ---

A good solution is to store the file under a random generated filename 
and store that name,
together with the real name, to the database.

bvr.

andy wrote:

>Hi there,
>
>I am wondering if it would be possible to replace all chars which are not
>inbetween [a-z] with a valid asccii coresponding to it. I have a db with a
>bunch of citynames and I would like to create valid filenames out of those.
>The prob is, that I do not know all special chars. For example there was
>one:   which I did not know. So maybe there are a lot others similar like
>that.
>
>The point is, how could I create a valid filename out of those citynames
>which contains only the chars from a - z? I tryed erregrplc, but I do have
>to know the char for that.
>
>Thanx for any help,
>
>andy
>
>
>



--- End Message ---
--- Begin Message ---
I don't agree. Under this circumstances no picture search engine is gonna
find this file. Thats why I am rewriting this module.

Thanx anyway.

Andy


"Bvr" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> A good solution is to store the file under a random generated filename
> and store that name,
> together with the real name, to the database.
>
> bvr.
>
> andy wrote:
>
> >Hi there,
> >
> >I am wondering if it would be possible to replace all chars which are not
> >inbetween [a-z] with a valid asccii coresponding to it. I have a db with
a
> >bunch of citynames and I would like to create valid filenames out of
those.
> >The prob is, that I do not know all special chars. For example there was
> >one:   which I did not know. So maybe there are a lot others similar
like
> >that.
> >
> >The point is, how could I create a valid filename out of those citynames
> >which contains only the chars from a - z? I tryed erregrplc, but I do
have
> >to know the char for that.
> >
> >Thanx for any help,
> >
> >andy
> >
> >
> >
>
>
>


--- End Message ---
--- Begin Message ---
At 02:31 PM 3/17/2002 +0100, andy wrote:
>Hi there,
>
>I am wondering if it would be possible to replace all chars which are not
>inbetween [a-z] with a valid asccii coresponding to it. I have a db with a
>bunch of citynames and I would like to create valid filenames out of those.
>The prob is, that I do not know all special chars. For example there was
>one:   which I did not know. So maybe there are a lot others similar like
>that.
>
>The point is, how could I create a valid filename out of those citynames
>which contains only the chars from a - z? I tryed erregrplc, but I do have
>to know the char for that.

I found this in the user contributed notes for the function strtr().  It looks
like what you need:

function removeaccents($string) {
   return strtr($string,
     "",
     "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
}



--- End Message ---
--- Begin Message ---
I have complied PHP with the enable trans id option....

However, when I start a session and go to a relivtive link , (./page.php) 
I do not get a session id in my URI.

Any Ideas?

Michael

--- End Message ---
--- Begin Message ---
When writing to a file several problems occur with this code:

<?php
$stuff = include ("news.txt");
$file = fopen ("news.txt", "w");
$newnews = include ("template.txt") . $stuff;
fwrite ($file, $newnews);
?>

However, this code works:

<?php
$file = fopen("template.txt", "w");
fwrite ($file, $temp);
fclose ($file);
?>

The problem with the first set of code is that it opens template.txt1, and
some letters that were in template.txt become a 1.


--- End Message ---
--- Begin Message ---
On Monday 18 March 2002 00:46, Ben Waldher wrote:
> When writing to a file several problems occur with this code:
>
> <?php
> $stuff = include ("news.txt");
> $file = fopen ("news.txt", "w");
> $newnews = include ("template.txt") . $stuff;
> fwrite ($file, $newnews);
> ?>
>
> However, this code works:
>
> <?php
> $file = fopen("template.txt", "w");
> fwrite ($file, $temp);
> fclose ($file);
> ?>
>
> The problem with the first set of code is that it opens template.txt1, and
> some letters that were in template.txt become a 1.

I've already replied to this before. The include() statement is NOT what you 
want. Have a look at the functions in the chapter "Filesystem functions".


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Please ignore previous fortune.
*/
--- End Message ---
--- Begin Message ---
Hi!

On my Server i can`t use the date("W") function, and on another it works.

How can i first run the script on the other server and then include it in a
script on my server so i can use the date("W") variable?

thanks,
Martin


--- End Message ---

Reply via email to