[PHP] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread mydata

Hi,
I heard about JSP a lot recently though I doing PHP programing now.
somebody said jsp is most fastest in (asp , php , jsp).
I want to know if it is true . And if I use PHP + php cache , can I speed up
PHP as same as JSP as they said.

I just want to know which is the best solution ,(php + php cache) or jsp .



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session.auto_start = 1

2001-09-27 Thread mydata

Did you restart your web sever? If you using IIS ,you must use comand line
to restart server.

Yaroukh [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there

 I have set session.auto_start to 1, but without Session_Start() the
 session handling doesn't work. But I think it definetely should - am I
 wrong? /:o) Or what else should I change in PHP.INI to make this work
 properly.

 Bye
 Yaroukh






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_fetch_array() doesn't work

2001-09-27 Thread Jason G.


echo a href='$PHP_SELF?offset=$i*$step' target='_top'

Missing end quote and semicolon on this line may be the reason...

Try properly indenting and formatting your code.  Also take advantage of 
going in and out of php mode to seperate your code from your display of 
content...
Ex:
instead of this:
? echo(td align=\center\ width=\$nWidth\$sContent/td); ?
Try this:
td align=center width=? echo($nWidth); ?? echo($sContent); ?/td
Or even this:
td align=center width=?=$nWidth??=$sContent?/td

It makes it MUCH easier to read and maintain, and seperates the PHP code 
from the HTML content as much as possible.

Any questions, please ask me.

-Jason Garber
Lead Programmer - www.pulseaday.com
[EMAIL PROTECTED]

---

At 12:48 PM 9/27/2001 +0800, you wrote:
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]

What's the problem wiht mysql_fetch_array() or other?
What does the T_STRING' or `T_VARIABLE' or `T_NUM_STRING' mean?

THANKS
Mike


The full code below:


?
$link=mysql_connect(localhost,,);
if($link==false){
echo Failed linking to database.;
exit();
}
$handler=mysql_select_db(database1);
if($handler==false)
echo Failed linking to database.;
$query=selct count(*) from users where sign=1;
$res=mysql_query($query);
$row=mysql_fetch_row($res);
$all=$row[0];
$step=5;
$pages=ceil($all/$step);   /*the number of pages needed to listed */
if(empty($offset))
$offset=0;
$query=select user_id, user_name, time, status, comment from users
where sign=1
order by user_name
limit $offset, $step;
$res=mysql_query($query);
echo tabletd align=centerUser/td
td align=centerAdded time/tdtd align=centerStatus/td/tr;
$num=mysql_num_rows($res);
for($i=0; $i$num; $i++) {
$arr=mysql_fetch_array($res);   /* HERE is line where the error occurs!!!
*/
echo trtd align=centera href=\profile.php?id=$arr['user_id']\
target='_top'
$arr['user_name']/a/td;
echo td align=center$arr['time']/td;
echo td align=center$arr['status']/td/tr;
echo tr colspan=3td$arr['comment']/td/tr;
}

echo /tablebrbrbr;

echo tabletrtd align='center';  /* show others in multi-pages */
for($i=0; $i$pages; $i++){
echo a href='$PHP_SELF?offset=$i*$step' target='_top'
echo ($i+1)./a;
echo nbsp;nbsp;;
}
echo /td/tr/table;

?


-
create table users (
user_id int not null auto_increment primary key,
user_name varchar(30),
time datetime,
status tinyint(1),
comment text,
sign tinyint(1) default '1'
);







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



[PHP] Figuring out tree depth.

2001-09-27 Thread Kris Williams

Hiyas,

I've made the following script to build a tree style navigation from a 
table of sections for an image gallery. There are root nodes of the tree 
which can have children, and those children can have their own children and 
so on to an infinte depth. A root node has a parentID of 0 and a child node 
has a parentID of the row id you want the child to belong to. (I've faked 
the arrays that would be returned from MySQL for this example).

The script is rendering items in the correct order, but I can't keep track 
of how deep in the tree each item is so I can indent them properly. A root 
node should have a 0 depth, it's child should have 1, and it's child again 
should be 2, then the next child of the root should go back to 1.  It seems 
to be working right until it gets to rusted (see eg).

I can figure that I'm adding items to the lastNode array but not removing 
them properly nor am I decrementing $x which is what should be keeping 
partial track of how deep I am. I figure this is where I'm going wrong but 
can't for the life of me figure it out. The calling of huntChild within 
itself is killing me.

The script at the moment is:

?
// Results have to be ordered by parentID (3rd field)
  $roots = array();
   $roots[0] = array(1,skatey,0);
   $roots[1] = array(4,me,0);
   $roots[2] = array(5,friends,0);

  $children = array();
   $children[0] = array(2,parks,1);
   $children[1] = array(10,equipment,1);
   $children[2] = array(3,regular visits,2);
   $children[3] = array(7,regular stacks,2);
   $children[4] = array(12,regular zzz,2);
   $children[5] = array(14,concrete,3);
   $children[6] = array(15,metal,3);
   $children[7] = array(6,0-10 years old,4);
   $children[8] = array(8,10-20 years old,4);
   $children[9] = array(11,blood spills,7);
   $children[10] = array(13,guts everywhere,7);
   $children[11] = array(9,skeg phase,8);
   $children[12] = array(16,chipped,14);
   $children[13] = array(17,rusted,15);

  $lastNode = array();

  // Make sure the tree depth is set to 0, then hammer through the roots 
array, pull out the next root node and go check if it has any children.
   foreach ($roots as $key) {
$depth = 0;
echo brb . $depth .  -  . $key[1] . /bbr;
$lastNode = array();
array_unshift($lastNode,$key[0]);
huntChildren($children,$key[0]);
   }

  function huntChildren($childArray,$rootID) {
   global $depth;
   global $lastNode;
   $x = 0;

  for ($i = 0; $i  sizeof($childArray); $i++) {
   // Suck out the first child node into a new array.
$tmpChild = array_shift($childArray);

   // Check to see if the parentID in $tmpChild matches the id of the node 
passed ($rootID) when the function is called.
   // A match means that the child has the node as a parent.
if ($rootID == $tmpChild[2]) {
 if ($lastNode[0] != $tmpChild[2]) {
  $x++;
  array_unshift($lastNode,$tmpChild[2]);
 }

 if ($x  1) {
  $depth = sizeof($lastNode) - $x;
 } else {
  $depth = sizeof($lastNode);
 }

 echo $depth .  -  . $tmpChild[1] . br;

 // Go see if this child has children.
  huntChildren($childArray,$tmpChild[0]);
} else {
 // If there are no children to the node passed, put $tmpChild array 
back into the passed array of children for the next iteration.
  array_push($childArray,$tmpChild);
}
   }
  }
?

and should generate:

0 - skatey
1 - parks
2 - regular visits
3 - concrete
4 - chipped
3 - metal
4 - rusted
2 - regular stacks
3 - blood spills
3 - guts everywhere
2 - regular zzz
1 - equipment

0 - me
1 - 0-10 years old
1 - 10-20 years old
2 - skeg phase

0 - friends


Aside from the depth problem the script functions just the way I want it 
to, but if anyone wants to point out or fix any major problems as well as 
my depth one, it'd be much appreciated.

Apologies for any shoddy indenting and the massive post. Trying to give as 
much info as I can.

Thanks,
Kris.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_fetch_array() doesn't work

2001-09-27 Thread Naintara Jain

Hi Mike,

The query
$query=selct count(*) from users where sign=1;
should be select not selct

-and in future to know if there is any error in your queries you might want to check 
this way:
if(mysql_query($query)
{
--do statements--
}
else
-error msg-

or even the following would be a convenient way to get your recordset and check for 
invalid query.
just try this

$result = mysql_query (SELECT my_col FROM my_tbl)
or die (Invalid query);
  
IN YOUR CASE try:
$res=mysql_query($query) or die (Invalid query);

and let me know if you still have a problem.

-Naintara




- Original Message - 
From: Web user [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 27, 2001 10:18 AM
Subject: [PHP] mysql_fetch_array() doesn't work


System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]

What's the problem wiht mysql_fetch_array() or other?
What does the T_STRING' or `T_VARIABLE' or `T_NUM_STRING' mean?

THANKS
Mike


The full code below:


?
$link=mysql_connect(localhost,,);
if($link==false){
echo Failed linking to database.;
exit();
}
$handler=mysql_select_db(database1);
if($handler==false)
echo Failed linking to database.;
$query=selct count(*) from users where sign=1;
$res=mysql_query($query);
$row=mysql_fetch_row($res);
$all=$row[0];
$step=5;
$pages=ceil($all/$step);   /*the number of pages needed to listed */
if(empty($offset))
$offset=0;
$query=select user_id, user_name, time, status, comment from users
where sign=1
order by user_name
limit $offset, $step;
$res=mysql_query($query);
echo tabletd align=centerUser/td
td align=centerAdded time/tdtd align=centerStatus/td/tr;
$num=mysql_num_rows($res);
for($i=0; $i$num; $i++) {
$arr=mysql_fetch_array($res);   /* HERE is line where the error occurs!!!
*/
echo trtd align=centera href=\profile.php?id=$arr['user_id']\
target='_top'
$arr['user_name']/a/td;
echo td align=center$arr['time']/td;
echo td align=center$arr['status']/td/tr;
echo tr colspan=3td$arr['comment']/td/tr;
}

echo /tablebrbrbr;

echo tabletrtd align='center';  /* show others in multi-pages */
for($i=0; $i$pages; $i++){
echo a href='$PHP_SELF?offset=$i*$step' target='_top'
echo ($i+1)./a;
echo nbsp;nbsp;;
}
echo /td/tr/table;

?


-
create table users (
user_id int not null auto_increment primary key,
user_name varchar(30),
time datetime,
status tinyint(1),
comment text,
sign tinyint(1) default '1'
);







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread Jason G.

A good question is:  Do you REALLY need the speed difference, or should you 
be asking which is the best language to do Dynamic Web Development 
in???  Which is better supported, which is most cost effective, which is 
Open Source, which is Better...

-Jason Garber
deltacron.com

At 02:48 PM 9/27/2001 +0800, mydata wrote:
Hi,
I heard about JSP a lot recently though I doing PHP programing now.
somebody said jsp is most fastest in (asp , php , jsp).
I want to know if it is true . And if I use PHP + php cache , can I speed up
PHP as same as JSP as they said.

I just want to know which is the best solution ,(php + php cache) or jsp .



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread mydata

I just want to know which is best solution , if my web site is heavy loaded.


mydata



Jason G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 A good question is:  Do you REALLY need the speed difference, or should
you
 be asking which is the best language to do Dynamic Web Development
 in???  Which is better supported, which is most cost effective, which is
 Open Source, which is Better...

 -Jason Garber
 deltacron.com

 At 02:48 PM 9/27/2001 +0800, mydata wrote:
 Hi,
 I heard about JSP a lot recently though I doing PHP programing now.
 somebody said jsp is most fastest in (asp , php , jsp).
 I want to know if it is true . And if I use PHP + php cache , can I speed
up
 PHP as same as JSP as they said.
 
 I just want to know which is the best solution ,(php + php cache) or jsp
.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] A kewl Script, for you someone to test, and show me the results

2001-09-27 Thread ReDucTor

Hey,
   I couldn't be bothered waiting for someone to show me a host that runs
php with GD, so i am just going to post the code here, and hope that someone
sees it, and checks it out, and shows the results

If you can't find a jpg file to test this on, just grab the php jpg one,
well i'll post the code now, so people can play with it, remember if you
test it place show the results :D

btw if you don't understand how to use it, you paste the code into a .php
file, and change imgname to the path of an jpg image, if you want to use an
png image, just change the im to ImageCreateFromPNG, ok, thats all...please
show the results

html
body bgcolor=#00
?php
 $imgname = /path/to/a/jpeg/file;
$im = ImageCreateFromJPEG($imgname);
 $output =  ;
 for($x=0;$ximagesx($im);$x++)
 {
  for($y=0;$yimagesy($im);$y++)
  {
   $color = ImageColorsForIndex(ImageColorAt($im, $x, $y));
   echo font size=\1\ color=\#;
   echo dechex($color['red']);
   echo dechex($color['green']);
   echo dechex($color['blue']);
   echo \\$/font;
  }
  echo br\n;
 }
?
/body/html

 - James ReDucTor Mitchell


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread * RzE:

Original message
From: Joseph Bannon [EMAIL PROTECTED]
Date: Wed, Sep 26, 2001 at 11:09:39AM -0500
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] handling errors

 How do I turn off the error messages that appear at the top of the page?  I
 have this function below that if an image is not there for $url, it give a
 warning.
 
 $size = GetImageSize($url);
 
 
 
 Example error message below...
 
 Warning: getimagesize: Unable to open 'http://www.yahoo.com' for reading.
 line 28
 
 
 Joseph

/Original message

Reply

Ofcourse it might just be a strange idea stuck in my head for some
reason, but you know what helps? Writing code that doesn't produce
any errors or warnings. Supressing warnings by just not showing them
doesn't really make your code very reliable does it?!

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread Jason G.

Placing an @ symbol before the function name will suppress any errors.
@GetImageSize()

At 09:09 AM 9/27/2001 +0200, * RzE: wrote:
Original message
From: Joseph Bannon [EMAIL PROTECTED]
Date: Wed, Sep 26, 2001 at 11:09:39AM -0500
Message-ID: 
[EMAIL PROTECTED]
Subject: [PHP] handling errors

  How do I turn off the error messages that appear at the top of the page?  I
  have this function below that if an image is not there for $url, it give a
  warning.
 
  $size = GetImageSize($url);
 
 
 
  Example error message below...
 
  Warning: getimagesize: Unable to open 'http://www.yahoo.com' for reading.
  line 28
 
 
  Joseph

/Original message

Reply

Ofcourse it might just be a strange idea stuck in my head for some
reason, but you know what helps? Writing code that doesn't produce
any errors or warnings. Supressing warnings by just not showing them
doesn't really make your code very reliable does it?!

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread * RzE:

Original message
From: Jason G. [EMAIL PROTECTED]
Date: Thu, Sep 27, 2001 at 03:25:16AM -0400
Message-ID: [EMAIL PROTECTED]
Subject: Re: [PHP] handling errors

 Placing an @ symbol before the function name will suppress any errors.
 @GetImageSize()

/Original message

Reply

Yep, I know it does. Yet, it's still no good way of handling your
errors/warnings. Unless you made some real intensive errorchecking
yourself, you should not use that @-construction or lower the
errorreportinglevel. Reporting should be as high as possible
(E_ALL). And yes, indeed, it might then just be that you get a lot
of warnings (and/or errors). Then you have to fix your code, not
start using @ in order to supress them. Errors and warnings are not
reported without a reason you know. Even if your code works, when
there are warnings it can still happen that in some situation the
code will crash.

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] array

2001-09-27 Thread Jason G.

check out the serialize() and unserialize() functions in the manual.

replace this:
print(A HREF=new_page?arr=$array sort /a);

with this
a href=new_page.php?arr=? echo(urlencode(serialize($array))); ? sort /a

Excerpt from the manual:
http://www.php.net/manual/en/function.serialize.php

If you are passing serialized data between pages in hidden form
fields (or in a query string), you need to serialize() the data,
then *urlencode()* it, then put it in the hidden field.
When you get to the next page, urldecode() it, then unserialize().

-Jason Garber
www.deltacron.com



At 11:15 PM 9/26/2001 +0200, you wrote:
Hi,

I have an array witch I display in my browser. Now I want to create a button
sort which sorts the array.

Problem is how to pass the array?
I tried:

print(A HREF=new_page?arr=$array sort /a);

I know I can reload the page and insert a function sort but it would be
stupid because the array has to be filled twice.

Any suggestions?

Thanks!





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] handling errors

2001-09-27 Thread Jason G.

You are completely right.  Do intensive error checking.  In thousands and 
thousands of lines of code, I think i only used @ in 3 places -  in the 
functions that connect to the database - I have more robust error checking 
in place.

-Jason Garber
deltacron.com

At 09:26 AM 9/27/2001 +0200, * RzE: wrote:
Original message
From: Jason G. [EMAIL PROTECTED]
Date: Thu, Sep 27, 2001 at 03:25:16AM -0400
Message-ID: [EMAIL PROTECTED]
Subject: Re: [PHP] handling errors

  Placing an @ symbol before the function name will suppress any errors.
  @GetImageSize()

/Original message

Reply

Yep, I know it does. Yet, it's still no good way of handling your
errors/warnings. Unless you made some real intensive errorchecking
yourself, you should not use that @-construction or lower the
errorreportinglevel. Reporting should be as high as possible
(E_ALL). And yes, indeed, it might then just be that you get a lot
of warnings (and/or errors). Then you have to fix your code, not
start using @ in order to supress them. Errors and warnings are not
reported without a reason you know. Even if your code works, when
there are warnings it can still happen that in some situation the
code will crash.

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Variable declaration

2001-09-27 Thread Alberto

?  error_reporting(E_ALL);
 $Test=3;
 echo $Test;
?

And I get no warning about $Test not being declared before (like C
declaration).

Any1 has an example about forcing variable declaration?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable declaration

2001-09-27 Thread Rasmus Lerdorf

On Thu, 27 Sep 2001, it was written:

 ?  error_reporting(E_ALL);
  $Test=3;
  echo $Test;
 ?

 And I get no warning about $Test not being declared before (like C
 declaration).

 Any1 has an example about forcing variable declaration?

What do you mean force declaration?  That's what you are doing with this
line:

  $Test = 3;

This declares $Test to be an integer with the value 3.  Assignment and
declaration is done in one step.  There is no mechanism to do it in two.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A kewl Script, for you someone to test, and show me theresults

2001-09-27 Thread Rasmus Lerdorf

Oh, by the way, I modified your script a bit and made it load an indexed
PNG file instead.  This is the modified script:

http://www.php.net/~rasmus/reductor.phps

And here is the result: http://www.php.net/~rasmus/reductor.php

Not sure why you used a $ sign for the character.  It sort of throws off
the aspect ratio.  Try a # instead:
http://www.php.net/~rasmus/reductor.php?ch=%23

-Rasmus

On Thu, 27 Sep 2001, ReDucTor wrote:

 Hey,
I couldn't be bothered waiting for someone to show me a host that runs
 php with GD, so i am just going to post the code here, and hope that someone
 sees it, and checks it out, and shows the results

 If you can't find a jpg file to test this on, just grab the php jpg one,
 well i'll post the code now, so people can play with it, remember if you
 test it place show the results :D

 btw if you don't understand how to use it, you paste the code into a .php
 file, and change imgname to the path of an jpg image, if you want to use an
 png image, just change the im to ImageCreateFromPNG, ok, thats all...please
 show the results

 html
 body bgcolor=#00
 ?php
  $imgname = /path/to/a/jpeg/file;
 $im = ImageCreateFromJPEG($imgname);
  $output =  ;
  for($x=0;$ximagesx($im);$x++)
  {
   for($y=0;$yimagesy($im);$y++)
   {
$color = ImageColorsForIndex(ImageColorAt($im, $x, $y));
echo font size=\1\ color=\#;
echo dechex($color['red']);
echo dechex($color['green']);
echo dechex($color['blue']);
echo \\$/font;
   }
   echo br\n;
  }
 ?
 /body/html

  - James ReDucTor Mitchell





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A kewl Script, for you someone to test, and show me theresults

2001-09-27 Thread Rasmus Lerdorf

The imagecolorat() function doesn't work for truecolor images.  You will
need a an indexed image for this to work.  And worse, imagecolorat()
actually segfaults when run on a non-indexed image as far as I can tell.
Will commit a fix for that shortly.

-Rasmus

On Thu, 27 Sep 2001, ReDucTor wrote:

 Hey,
I couldn't be bothered waiting for someone to show me a host that runs
 php with GD, so i am just going to post the code here, and hope that someone
 sees it, and checks it out, and shows the results

 If you can't find a jpg file to test this on, just grab the php jpg one,
 well i'll post the code now, so people can play with it, remember if you
 test it place show the results :D

 btw if you don't understand how to use it, you paste the code into a .php
 file, and change imgname to the path of an jpg image, if you want to use an
 png image, just change the im to ImageCreateFromPNG, ok, thats all...please
 show the results

 html
 body bgcolor=#00
 ?php
  $imgname = /path/to/a/jpeg/file;
 $im = ImageCreateFromJPEG($imgname);
  $output =  ;
  for($x=0;$ximagesx($im);$x++)
  {
   for($y=0;$yimagesy($im);$y++)
   {
$color = ImageColorsForIndex(ImageColorAt($im, $x, $y));
echo font size=\1\ color=\#;
echo dechex($color['red']);
echo dechex($color['green']);
echo dechex($color['blue']);
echo \\$/font;
   }
   echo br\n;
  }
 ?
 /body/html

  - James ReDucTor Mitchell





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread Rasmus Lerdorf

Pretty much impossible to answer.  If you know what you are doing, you can
use just about anything to build a solution that will work on a heavily
loaded site.  JSP is typically not faster than PHP or even ASP though.

But chances are your scripting language won't be your limiting factor
anyway.  If your site relies on a database, chances are your database
speed will be the slowest part, or even more common, your pipe will be
your limiting factor.

Proper load balancing of your database and something like Squid as a
reverse proxy in front of your dynamic pages with proper cache-control
headers being generated, you can handle just about any load.

-Rasmus

On Thu, 27 Sep 2001, mydata wrote:

 I just want to know which is best solution , if my web site is heavy loaded.


 mydata



 Jason G. [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  A good question is:  Do you REALLY need the speed difference, or should
 you
  be asking which is the best language to do Dynamic Web Development
  in???  Which is better supported, which is most cost effective, which is
  Open Source, which is Better...
 
  -Jason Garber
  deltacron.com
 
  At 02:48 PM 9/27/2001 +0800, mydata wrote:
  Hi,
  I heard about JSP a lot recently though I doing PHP programing now.
  somebody said jsp is most fastest in (asp , php , jsp).
  I want to know if it is true . And if I use PHP + php cache , can I speed
 up
  PHP as same as JSP as they said.
  
  I just want to know which is the best solution ,(php + php cache) or jsp
 .
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable declaration

2001-09-27 Thread * RzE:

 What do you mean force declaration?  That's what you are doing with this
 line:
 
   $Test = 3;

Nop! This is just starting to use a variable. Something like:

   integer $Test;

is declaring a variable. But FAFAIK it's not possible in PHP :(

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable declaration

2001-09-27 Thread Rasmus Lerdorf

  What do you mean force declaration?  That's what you are doing with this
  line:
 
$Test = 3;

 Nop! This is just starting to use a variable. Something like:

integer $Test;

 is declaring a variable. But FAFAIK it's not possible in PHP :(

Like I said, that line does both.  It sets the type internally to an
integer and assigns the value.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A kewl Script, for you someone to test, and show me the results

2001-09-27 Thread ReDucTor

Thanks Ramus..

It appears to work nice...

I find the $ looks nicer, then an #

   - James ReDucTor Mitchell

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: ReDucTor [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, September 27, 2001 5:29 PM
Subject: Re: [PHP] A kewl Script, for you someone to test, and show me the
results


 The imagecolorat() function doesn't work for truecolor images.  You will
 need a an indexed image for this to work.  And worse, imagecolorat()
 actually segfaults when run on a non-indexed image as far as I can tell.
 Will commit a fix for that shortly.

 -Rasmus

 On Thu, 27 Sep 2001, ReDucTor wrote:

  Hey,
 I couldn't be bothered waiting for someone to show me a host that
runs
  php with GD, so i am just going to post the code here, and hope that
someone
  sees it, and checks it out, and shows the results
 
  If you can't find a jpg file to test this on, just grab the php jpg one,
  well i'll post the code now, so people can play with it, remember if you
  test it place show the results :D
 
  btw if you don't understand how to use it, you paste the code into a
.php
  file, and change imgname to the path of an jpg image, if you want to use
an
  png image, just change the im to ImageCreateFromPNG, ok, thats
all...please
  show the results
 
  html
  body bgcolor=#00
  ?php
   $imgname = /path/to/a/jpeg/file;
  $im = ImageCreateFromJPEG($imgname);
   $output =  ;
   for($x=0;$ximagesx($im);$x++)
   {
for($y=0;$yimagesy($im);$y++)
{
 $color = ImageColorsForIndex(ImageColorAt($im, $x, $y));
 echo font size=\1\ color=\#;
 echo dechex($color['red']);
 echo dechex($color['green']);
 echo dechex($color['blue']);
 echo \\$/font;
}
echo br\n;
   }
  ?
  /body/html
 
   - James ReDucTor Mitchell
 
 
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable declaration

2001-09-27 Thread Rasmus Lerdorf

That is the nature of a loosely typed scripting language.  If you prefer a
strongly typed compiled language, there are plenty of those available.

-Rasmus

On Thu, 27 Sep 2001, * RzE: wrote:

  Like I said, that line does both.  It sets the type internally to an
  integer and assigns the value.
 
  -Rasmus

 What he (Alberto) is looking for, and what I would prefer to, is to
 really explicitly declare a variable. There's a difference between a
 compiler that requires you to declare (integer $Test;) a variable
 _before_ you start using it ($Test = 3;). Ofcourse I know that PHP
 internally declares it, but it's not the same thing.

 When the compiler forces you to declare all variables you're gonna
 use it gives a better view of which variables are used in the
 script, and besides that it doesn't allow you to make any mistakes
 of using undefined variables like it does now.

 The PHP compiler doesn't really check your code intensively. You can
 use any variable without the compiler complaining. Only at the
 moment that it reaches the variable and finds out it isn't defined,
 it tells you. It would be better to explicitly have to declare the
 variable. When the compiler starts it then shouldn't execute the
 code when it contains any variable that is not explicitly declared.

 But like I said, FAFAIK explicitly declaring variables isn't
 supported by PHP :(




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable declaration

2001-09-27 Thread * RzE:

 That is the nature of a loosely typed scripting language.

I know.


 If you prefer a strongly typed compiled language, there are plenty
 of those available.

I know to. But those are not as powerful for building websites as
PHP. I mean... don't get me wrong here, I think PHP is great (or
even better). It's terrific actually. I just wish sometimes that the
compiler wouldn't allow so many things. It might just be a bit more
strict. Or at least a seperate option for being more strict. Eg
something like E_EXPLICIT_DECLARE ;)

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session-id in url, not in cookies

2001-09-27 Thread Martin Thoma

Hello!

How can I make the session-id ONLY be stored in the url, even if the
user has cookies enabled? I have no access to the php.ini-file.

Any ideas?

Martin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Incorrect output or RSYNC with exec();

2001-09-27 Thread Christian Sylvestre

Hello. I have a weird problem. I have apage where a user can see the
different files  directories between 2 servers using RSYNC.

However files deleted on the source server are not listed in the output of
exec() (I am using the --delete parameter with the RSYNC command). All of
the rest of the output is OK.

If I try the command direclty from the command line I will have the list of
files that need to be deleted (under Solaris 2.7).

And the funny thing is that rsync is working fine, i.e. it will sync and
delete the source and the target server but it will never output the list of
files to be deleted in the exec output...

Is there some kind of filetering on the word delete in the PHP exec command
output???

Any idea?

Cheers,

Christian

[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread Christian Reiniger

On Thursday 27 September 2001 09:09, * RzE: wrote:

  How do I turn off the error messages that appear at the top of the
  page?  I have this function below that if an image is not there for
  $url, it give a warning.
 
  $size = GetImageSize($url);
 
  Example error message below...
 
  Warning: getimagesize: Unable to open 'http://www.yahoo.com' for
  reading. line 28
 
 
  Joseph

 /Original message

 Reply

 Ofcourse it might just be a strange idea stuck in my head for some
 reason, but you know what helps? Writing code that doesn't produce
 any errors or warnings. Supressing warnings by just not showing them
 doesn't really make your code very reliable does it?!

Right in principle. But there are cases (common ones), like the one shown 
above, where errors are unavoidable and normal. For these cases the @ 
operator is the right thing. Generally you're right though - error 
reporting should be set to E_ALL and reasons of avoidable errors/warnings 
should be eliminated.

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

REALITY.SYS corrupted ... reboot Universe [Y,n]?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Error compiling PHP

2001-09-27 Thread Markus Bertheau

On Thu, 2001-09-27 at 10:56, Alberto wrote:
 /usr/bin/ld: cannot find -lpq
this is the PostgreSQL client library. It is needed when you configure
with --with-pgsql. If you don't need PostgreSQL Support remove it,
otherwise you have to install a package named sth like postgres-client
and postgres-client-devel

Markus Bertheau


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread * RzE:

 Right in principle. But there are cases (common ones), like the one shown 
 above, where errors are unavoidable and normal. For these cases the @ 
 operator is the right thing. Generally you're right though - error 
 reporting should be set to E_ALL and reasons of avoidable errors/warnings 
 should be eliminated.

Correct me if I'm wrong, but I saw some posts coming along on this
list yesterday (I think) telling that getImageSize can't handle
URL's. So... in that case... Don't use @, but check the syntax of
the variable you want to pass as parameter for getImageSize.

But you're right about the *very* few cases in which it is
unavoidable. Though, this isn't one of 'm.

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread Christian Reiniger

On Thursday 27 September 2001 12:00, * RzE: wrote:
  Right in principle. But there are cases (common ones), like the one
  shown above, where errors are unavoidable and normal. For these cases
  the @ operator is the right thing. Generally you're right though -
  error reporting should be set to E_ALL and reasons of avoidable
  errors/warnings should be eliminated.

 Correct me if I'm wrong, but I saw some posts coming along on this
 list yesterday (I think) telling that getImageSize can't handle
 URL's. So... in that case... Don't use @, but check the syntax of
 the variable you want to pass as parameter for getImageSize.

According to my docs (08 Sep 2001) it can.
And http://php.net/getimagesize says the same..

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

REALITY.SYS corrupted ... reboot Universe [Y,n]?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] The polymorph

2001-09-27 Thread ian

Wondered if you could contact me as I lost your address when formatting my
PC and I have found your help with PHP invaluable.

Ian.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread Maxim Maletsky \(PHPBeginner.com\)

Both will do good jobs, but is the site is very loaded PHP might take
less resources than jsp and asp from the server. Yet has to be well
configured. It all depends on how you use it.

PHP is a great solution for most heavy sites. I never had any problems
with it on a 4+ million pv/month site. Most of other developers will
probably agree with me.


Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: mydata [mailto:[EMAIL PROTECTED]] 
Sent: giovedì 27 settembre 2001 9.04
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Does PHP + PHP CACHE can vs JSP ?


I just want to know which is best solution , if my web site is heavy
loaded.


mydata



Jason G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 A good question is:  Do you REALLY need the speed difference, or 
 should
you
 be asking which is the best language to do Dynamic Web Development 
 in???  Which is better supported, which is most cost effective, which 
 is Open Source, which is Better...

 -Jason Garber
 deltacron.com

 At 02:48 PM 9/27/2001 +0800, mydata wrote:
 Hi,
 I heard about JSP a lot recently though I doing PHP programing now. 
 somebody said jsp is most fastest in (asp , php , jsp). I want to 
 know if it is true . And if I use PHP + php cache , can I speed
up
 PHP as same as JSP as they said.
 
 I just want to know which is the best solution ,(php + php cache) or 
 jsp
.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED] To 
 contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] handling errors

2001-09-27 Thread * RzE:

 According to my docs (08 Sep 2001) it can.
 And http://php.net/getimagesize says the same..

Okay! I never use the function. Yesterday that was a conversation
on this list in which they/he/she said it couldn't. But indeed if it
can there would be a reason to use @.

...

I've now made some test-page, and indeed it works like a charm;
getimagesize(URL). So now I don't understand what they were talking
about.

Anyway... So a @ is indeed in place _for_this_one_.

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTML table to MySQL table conversion

2001-09-27 Thread RNie

Hello there,

Anyone has done this before? Would like to see some sample code to build a
converter from HTML table to a MySql table. Someone put an enourmous amount
of data in HTML tables and now we would like to put it in MySQL database. We
would not like to do this manually.

Thank you!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PostgreSQL connection problems

2001-09-27 Thread Alberto

Warning: Unable to connect to PostgreSQL server: No pg_hba.conf entry for
host myhost, user myuser, database mydb in /path/to/principal.php on line 27

that's

 $bdConexion = pg_connect (host=.$bdHost. port=.$bdPuerto.
dbname=.$bdBD. user=.$bdLogin. password=.$bdPassword);


PHP is already compiled with PostgreSQL support. PostgreSQL is running on a
remote server.

Thnx in advance



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HTML table to MySQL table conversion

2001-09-27 Thread Maxim Maletsky \(PHPBeginner.com\)

Uff..  Don't envy you...

Anyway, if someone (hopefully) was cutingpasting the cells in you could
do a combination of fopen/explode/regex to split the data into
coma-separated values. For example, stripping out every HTML tag
replacing it with a coma and a space will create you a dump file.

Also, you could try using MS Excel or Access, if mr. Magic Microsoft
Excel allows you to import data from an HTML table you could then export
it from there as comma separated values and prepare yourself a dump file
this way.

There are ways, man. But be careful not to take more efforts for PHP
solution that what it would be getting an intern guy/girl pasting the
staff :-)


Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: RNie [mailto:[EMAIL PROTECTED]] 
Sent: giovedì 27 settembre 2001 12.53
To: [EMAIL PROTECTED]
Subject: [PHP] HTML table to MySQL table conversion


Hello there,

Anyone has done this before? Would like to see some sample code to build
a converter from HTML table to a MySql table. Someone put an enourmous
amount of data in HTML tables and now we would like to put it in MySQL
database. We would not like to do this manually.

Thank you!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Passing php variables to perl script

2001-09-27 Thread Bertrand TACHAGO

Please i want to know how to pass variables (such as $PHP_AUTH_USER and
$PHP_AUTH_PW) from php to Perl script which is in apache cgi-bin
directory.
Thanks in advance for help

-- 
Moise Bertrand TACHAGO
Computer scientist
Volunteer DBMS Specialist
SDNP Cameroon, 506 Hajal Center Building
Yaounde CAMEROON
(237)22 24 90
E_mail [EMAIL PROTECTED]
   [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] session not working

2001-09-27 Thread Krushna Kumar R

Hi,

I wrote a program where the session gets created, but on subsequent page the session 
does not work or i could not retrieve the value kindly help me, I have put the coding 
below

The operating system I use is Win98 and Personal Web Server, PHP version used is 4.0.6

File 1 : where the session is registered or created

?session_start();?
HTML
body bgcolor=#ff
?php

session_register(uname);
session_register(pwd);
print Username var is - . $username.br;
print Password var is - . $password.br;
$uname=$username;
$pwd=$password;
print Uname var is - . $uname.br;
print Pwd var is - . $pwd.br;

echo session_is_registered(uname);
echo session_name(uname);
 ?
a href=file2.phpclick here to go to next page/a
/body
/HTML


File 2 : Next page, the file where i check for the session variable's value

?session_start();
print uname is - .$uname.br;
echo Session is - .session_is_registered(uname).br;
echo session name is - . session_name(uname).br;
echo the session is $uname.br;
?
a href=last.phpclick here go to last page/a

Those are the coding i had used on the files i was trying to execute

Regards
Krushna Kumar



Re: [PHP] PostgreSQL connection problems

2001-09-27 Thread Marcela

You need to configure you database in the pg_hba.conf. The pg_hba.conf is in
your postgres directory.   Put one line like this in your pg_hba.conf

host yourdatabase yourhost 255.255.255.255   trust


- Original Message -
From: Alberto [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 27, 2001 7:51 AM
Subject: [PHP] PostgreSQL connection problems


 Warning: Unable to connect to PostgreSQL server: No pg_hba.conf entry for
 host myhost, user myuser, database mydb in /path/to/principal.php on line
27

 that's

  $bdConexion = pg_connect (host=.$bdHost. port=.$bdPuerto.
 dbname=.$bdBD. user=.$bdLogin. password=.$bdPassword);


 PHP is already compiled with PostgreSQL support. PostgreSQL is running on
a
 remote server.

 Thnx in advance



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session not working

2001-09-27 Thread Negrea Mihai


 echo session_is_registered(uname);
 echo session_name(uname);
  ?
 a href=file2.phpclick here to go to next page/a

try here: 
a href=file2.php??= sid;?click here to go to next page/a


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] session not working

2001-09-27 Thread Richard Baskett

try putting all your session_register's above any html and see if that
works.  I believe you need to do this before any html is output.  It's been
awhile since I've worked with sessions, but try it :)

Rick

 Hi,
 
 I wrote a program where the session gets created, but on subsequent page the
 session does not work or i could not retrieve the value kindly help me, I have
 put the coding below
 
 The operating system I use is Win98 and Personal Web Server, PHP version used
 is 4.0.6
 
 File 1 : where the session is registered or created
 
 ?session_start();?
 HTML
 body bgcolor=#ff
 ?php
 
 session_register(uname);
 session_register(pwd);
 print Username var is - . $username.br;
 print Password var is - . $password.br;
 $uname=$username;
 $pwd=$password;
 print Uname var is - . $uname.br;
 print Pwd var is - . $pwd.br;
 
 echo session_is_registered(uname);
 echo session_name(uname);
 ?
 a href=file2.phpclick here to go to next page/a
 /body
 /HTML
 
 
 File 2 : Next page, the file where i check for the session variable's value
 
 ?session_start();
 print uname is - .$uname.br;
 echo Session is - .session_is_registered(uname).br;
 echo session name is - . session_name(uname).br;
 echo the session is $uname.br;
 ?
 a href=last.phpclick here go to last page/a
 
 Those are the coding i had used on the files i was trying to execute
 
 Regards
 Krushna Kumar
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HTML table to MySQL table conversion

2001-09-27 Thread RNie

Well I don't have Access, nor Excel, but there is the Freeware Staroffice
that did it for me. Thank's for the tip. I thought of this myself, but your
message encouraged me to try it and it works.

Method I used:
- Open HTML with Staroffice
- Delete irregular header fields
- Select the whole table and  copy it
- Open a new spreadsheet
- Paste the table in the spreadsheet
- Save it as a comma delimited file.
- Create a table with for instance phpMyAdmin according to the data in the
HTML table
- import it into this new table with phpMyAdmin's utility called Insert
textfiles into table You have to take care here that you put the same field
delimiter as is used in your file.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] updating a database (mysql)

2001-09-27 Thread sagar N Chand

try using the die function. it might help out.

or u can use the mysql_affected_rows functions. check out.
http://www.php.net/manual/en/function.mysql-affected-rows.php

/sagar

  - Original Message - 
  From: Joseph Bannon 
  To: PHP (E-mail) 
  Sent: Thursday, September 27, 2001 1:17 AM
  Subject: [PHP] updating a database (mysql)


  When I update my mysql database, is there a way with PHP to know what or if
  any records where updated?

  Joseph



  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] session not working

2001-09-27 Thread sagar N Chand

session must be registered before any code is sent to the browser. so the syntax 
should be
?session_start();
session_register(uname);
session_register(pwd);
.


?
HTML
body bgcolor=#ff
html code here


/sagar

  - Original Message - 
  From: Krushna Kumar R 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, September 27, 2001 5:43 PM
  Subject: [PHP] session not working


  Hi,

  I wrote a program where the session gets created, but on subsequent page the session 
does not work or i could not retrieve the value kindly help me, I have put the coding 
below

  The operating system I use is Win98 and Personal Web Server, PHP version used is 
4.0.6

  File 1 : where the session is registered or created

  ?session_start();?
  HTML
  body bgcolor=#ff
  ?php

  session_register(uname);
  session_register(pwd);
  print Username var is - . $username.br;
  print Password var is - . $password.br;
  $uname=$username;
  $pwd=$password;
  print Uname var is - . $uname.br;
  print Pwd var is - . $pwd.br;

  echo session_is_registered(uname);
  echo session_name(uname);
   ?
  a href=file2.phpclick here to go to next page/a
  /body
  /HTML


  File 2 : Next page, the file where i check for the session variable's value

  ?session_start();
  print uname is - .$uname.br;
  echo Session is - .session_is_registered(uname).br;
  echo session name is - . session_name(uname).br;
  echo the session is $uname.br;
  ?
  a href=last.phpclick here go to last page/a

  Those are the coding i had used on the files i was trying to execute

  Regards
  Krushna Kumar




[PHP] php chat

2001-09-27 Thread sagar N Chand

i've seen many members seeking for a good php chat.
so my suggestion is use phpmychat. its the best php
chat i've ever come across. here is the site where u can
download your version. www.phpheaven.net
its also very easy to install and configure with good admin.

ejoy your chat server,

/sagar




Re: [PHP] Variable declaration

2001-09-27 Thread * RzE:

Original message
From: sagar N Chand [EMAIL PROTECTED]
Date: Thu, Sep 27, 2001 at 06:01:26PM +0530
Message-ID: 005101c14750$c3189b10$0101a8c0@inferno
Subject: Re: [PHP] Variable declaration

 its really a big headache with compilers like c bugging all the way just for 
declarations.
 its cl to have the freedom of using any variable at any place wherever v want in 
bet
 ween the code. chao of PHP. 
 
 /sagar

/Original message

Reply

I think it's just a matter of preference. I like this, you like
that. No harm to that. That's why I proposed the
E_EXPLICIT_DECLARATION. That way I can choose to use it, and you can
leave it for what it is. Kinda like what Perl does with use
strict;. If you don't like being forced to declare every variable
before you use it, you just don't type use strict; at the start of
your script. People like me, who do like to do that, _do_ use that
option. Everyone gets it his/her way and it bothers noone.

But anyway... I don't think they'll ever implement this, so (...)

NOTE:
PHP Rulz and this is just a small thing that doesn't change anything
to the superb power of PHP webbuilding! :)

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] History of PHP

2001-09-27 Thread Marco Fioretti

Hello,

This is just a curiosity, not a technical question, but (I hope) it's
interesting anyways..

Where is it possible to find something about the history of PHP?
(old announcements of the first releases, why it was born, which were
the major  changes between one major release and the next, etc...)

On the same track, where is the planned feature list for the next
releases of PHP?

TIA,
Marco Fioretti
-- 
People often find it easier to be a result of the past than a cause of
the future.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] buffers...

2001-09-27 Thread * RzE:

Original message
From: Nic Skitt [EMAIL PROTECTED]
Date: Thu, Sep 27, 2001 at 02:13:52PM +0100
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] buffers...

 Hi all,
 
 how do you flush the buffer in PHP?
 
 IE, running through code but wanting to output to the browser at specific
 points, in a while loop for instance.
 
 Cheers
 
 Nic

/Original message

Reply

It's in the manual:

void flush (void)
see: http://www.php.net/manual/en/function.flush.php

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] buffers ...

2001-09-27 Thread Mark Charette

Flush() is the right call, but please note (from the manual):
--
Note: flush() has no effect on the buffering scheme of your webserver or the
browser on the client side.
Several servers, especially on Win32, will still buffer the output from your
script until it terminates before transmitting the results to the browser.
Even the browser may buffer its input before displaying it. Netscape, for
example, buffers text until it receives an end-of-line or the beginning of a
tag, and it won't render tables until the /table tag of the outermost
table is seen.
---
Mark C.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] hello

2001-09-27 Thread AAustin

How might I post a ?bariable in the http stream using a javascript dynamic menu?
Do I need to turn it into a form to do this.
andrew



[PHP] multivalued entries outof LDAP

2001-09-27 Thread Tanja Winkelmann

Hello,

it's quite urgend, I need some help... I'm writing on a webinterface for
our LDAP-Server. I build an class which works with its advantages fine.
But i need to get the second entry from multivalued telephonenumber.
Below you see my code. Generally it works like this:

1) Instantiate an object: $user = new People(twi);
I put this object into a session. Whithin this session it's possible to
grap to all values of entries.

2) Getting values of entries :
print $user-getValues(givenname);
print $user-getValues(telephonenumber);
...

The first telephonenumber is allocated like this :

$this-telephonenumber = $info[0][telephonenumber][0];
print $user-getValues(telephonenumber); - ok

This doesn't work:

$this-telephonenumber1 = $info[0][telephonenumber][0];
print $user-getValues(telephonenumber1); - not

$this-telephonenumber2 = $info[0][telephonenumber][1];
print $user-getValues(telephonenumber1); - not


Can someone help me?

Thanks,

Tanja


### LDAP-Class:

include(LDAP.inc);

class People{

var  $LDAP_HOST;
var  $LDAP_BASE_DN;

var  $c;
...
var  $telephonenumber;
var  $telephonenumber1;
var  $telephonenumber2;
...

// Konstruktor
function People($uid){
$this-initEntries($uid);
}

function initEntries($uid){

global $LDAP_HOST, $LDAP_BASE_O, $LDAP_BASE_DN;

$attribut =
array(c,ou,o,uid,dn,cn,sn,givenname,displayname,

initials,title,jpegphoto,telephonenumber,

facsimiletelephonenumber,mobile,mail,homephone,l,

postaladdress,homepostaladdress,labeleduri,roomnumber,

userpassword,sheakadgrad,shedateofbirth,shehomemobile,

shehomefax,shehomemail,shemitarbeiterstatus);

$ds=ldap_connect($LDAP_HOST);

  if ($ds) {

  $r=ldap_bind($ds);


$result=ldap_search($ds,$LDAP_BASE_O,(uid=$uid),$attribut);
  $info = ldap_get_entries($ds, $result);
  ldap_close($ds);

  $this-c = $info[0][c][0];
  ...
  $this-telephonenumber = $info[0][telephonenumber][0];
  $this-telephonenumber1 = $info[0][telephonenumber][0];
  $this-telephonenumber2 = $info[0][telephonenumber][1];
 ...
  }else{
echo Verbindung zu $host nicht öglich!!! -
getSpecEntriesp\n;
}
} // ende initEntries()


function getValue($key){
return ($this-$key);
}

} // end Class People

--
Gruss Tanja
- DO IT RIGHT .SHE --
SHE Informationstechnologie AG
Tanja Winkelmann Fon:+49 621 5200-247
StudentinFax:+49 621 5200-551
Donnersbergweg 3 [EMAIL PROTECTED]
D-67059 Ludwigshafen   http://www.she.net
-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: buffers...

2001-09-27 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Nic Skitt) wrote:

 how do you flush the buffer in PHP?

http://www.php.net/manual/en/ref.outcontrol.php

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]