[PHP] Storing php-code in mysqlDB

2001-04-27 Thread heinisch

Hi folks,
I try to store phpcode in a mysql-database, to have them ready, when 
they´ll be needed
When I request these, it seems that they will not be parsed.
Any suggestion?
some code:

// the result comes from an object function
while ($obj -> Fetchinto(&$row)) // as long as there are results
{
$query=$row[0]; // now the query is in $row[0]

echo "QUERY $query"; // now you can see the query
// the query shown looks like this
// SELECT count(lfd) FROM $row[0] WHERE yy = $start_y AND mm = $start_m
// but there should be values instead of vars (BTW there are values in the 
vars)


Thanks in advance
Oliver


--
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] How to compile PDFLIB in FreeBSD 4.3

2001-05-01 Thread heinisch

At 11:25 02.05.01 +0800, you wrote:
>I try to use configure to config pdflib in FreeBSD
>when i make it, i got a error messages
>
>cd bind/php && make
>make: no target to make.
>*** Error code 2 (ignored)
>--
first you have to make the pdflib
then you have to make install
(the include and lib files have to be present in the path)
then you have to configure php "--with-pdflib" then make and so on
look in the manual -> installation
Oliver


-- 
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] IMAGE

2001-05-01 Thread heinisch

At 23:30 01.05.01 -0300, you wrote:
>Hy guys
>how can i know the width and height of an image?
>[ r a f a e l   f a r i a] _
>[EMAIL PROTECTED]
>WebMaster Universo Online - http://www.uol.com.br
try GetImageSize(string filename, array[imageinfo]);
oliver


-- 
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] Strange behaviour of mktime() in objects

2001-05-02 Thread heinisch

Hi folks,
I have to make several conversions from / to  timestamp (seconds in the 
UNIX-Epoche)
here you see two snippets of my code
File1 the testfile
 setTimeStamp($wert);
?>

File2 the Classfile

";
   }

   $this -> TS = mktime(12,00,00,$pieces[1],$pieces[3],$pieces[0]);
   echo "TIMESTAMP in Object = ".date("H:i:s-Y-m-d",$this -> TS)."";

}/* end function */
}/* end class */
?>

The output is :
TIMESTAMP[0] = 2001
TIMESTAMP[1] = 04
TIMESTAMP[2] = 20
TIMESTAMP in Object = 13:00:00-2001-03-31
As you can see, the output of the pieces is correct, but the reassembling 
to a date
gives a wrong date and time, (I would understand, if time is incorrect, but 
the date
is absolutely out of tune)
Any ideas what this could be??
Thanks in advance Oliver


-- 
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] textarea -- what happens to my new lines

2001-05-03 Thread heinisch

At 13:10 03.05.01 +0200, you wrote:
>
>I am making a e-card page, and I am having a problem with with my message
>box which is a  when I am previewing or saving/recalling the text
>all the newline characters are gone. Any good ideas!
>
>Thanks
>Lars Stampe

Try

this make "hard" LF´s

Oliver



--
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] textarea -- what happens to my new lines

2001-05-03 Thread heinisch

At 14:34 03.05.01 +0200, you wrote:

change wrap !

"physical means pyhsical" not HARD

echo nl2br($textfield); //turns your nl´s in ´s

That should work
Oliver


--
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] Maximum execution time of 30 seconds exceeded...

2001-05-03 Thread heinisch

At 08:32 03.05.01 -0500, you wrote:
>set_time_limit(n) where n is number of seconds (or 0 for no time limit)

but DO NOT SET 0 on production-servers, your ISP will, after he killed the
processes, kill you :-)

>-Original Message-
>From: Jon Haworth [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, May 03, 2001 5:53 AM
>To: 'Kraa de Simon'; Php-General (E-mail)
>Subject: RE: [PHP] Maximum execution time of 30 seconds exceeded...
>
>
>Change the max_execution_time setting in your php.ini file.
>
>You can also do it on a per-script basis but I can't remember how OTOH - a
>search on the manual should find it though.
>
>HTH
>Jon
>
>
>-Original Message-
>From: Kraa de Simon [mailto:[EMAIL PROTECTED]]
>Sent: 03 May 2001 11:48
>To: Php-General (E-mail)
>Subject: [PHP] Maximum execution time of 30 seconds exceeded...
>
>
>Hi,
>
>Any ideas how to get by the following error?
>
>Fatal error: Maximum execution time of 30 seconds exceeded in c:\program
>files\nusphere\apache\htdocs\test.php on line 8
>
> for($i=1;$i<=9;$i++)
> {
> $lines = join("",
>file('http://www.progress.com/services/support/cgi-bin/techweb-kbase.cgi/web
>kb.html?TAB=dsp&kbid=' . $i));
>
> $fp = fopen ($DOCUMENT_ROOT . "/" . $i . ".html", "w");
> fwrite($fp, $lines, strlen($lines));
> fclose($fp);
> }
>?>
>
>Met vriendelijke groet / With kind regards,
>
>Simon de Kraa
>ICL Logistic Systems
>mailto:[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] how?

2001-05-04 Thread heinisch

At 04.05.01  15:32, you wrote:
>// Read myfile.TXT into $lines,
The sentence in your textfile is
" I have to check my E-Mails $var unnecessary $var1"

$var="for";
$var1="Quotes";

$fp=fopen("filename","mode");
//open database connection
while(!feof($fp))
{
 $buffer=fgets($fp,"how many bytes");
 eval( "\$buffer = \"$buffer\";" );
 //Now you see a basic Sentence :-)
 writeToDatabase
}
//close Databaseconnetion
fclose($fp);
That works, or I (we) didn´t understand your question

Oliver


--
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] Search

2001-05-05 Thread heinisch

At 04.05.01  22:44, you wrote:
>
>I need some sciprt to search my site.  My site has about 700 pages.  Also
>all the pages are HTML Pages
Use grep
Oliver


-- 
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] Sorry, what is "PWS"

2001-05-05 Thread heinisch

It´s time for me to ask:
What is "PWS"? I wanna know what I´m reading about ;-)
TIA Oliver


--
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] Really easy question

2001-05-06 Thread heinisch

At 06.05.01  22:03, you wrote:
>
>Thanks very much for your help on this, turns out there wasnt anything
>"wrong" with it, I was trying to view the page with Netscape 4.7 on hte
>Linux machine and getting blank pages, if I viewed it with IE 5.5 on a
>windows machine then everything works fine...I have no idea why this is
>happening but at least it works and I am not going completely mad...
>
>Thanks again
>biscut
Hi biscut,
you are wise if you use NS to view your pages, because if you make a mistake
NS will show it, mostly nothing.
Look at the source (right mouse button) sometimes the wrong oart of code
will be shown blinking.
Otherwise check your code for missing endtags like .
These guys at MS couldn´t program a correct html - engine in their
Office packages, therfor they made their IE a little tolerant ;-)
Best is to check the code with tidy (http://www.w3c.com or something like this)
You will get all errors shown.
HTH Oliver


--
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] converting fields from a fixed length text file into an array

2001-05-06 Thread heinisch

At 06.05.01  23:28, you wrote:
>:Please forgive me for having posted this more than once.  I am trying to
>reword it here to make it more plain.
>---
>I have a fixed length text file I'm trying to import and send into MySQL.
>A record line is about 1600 characters long and includes many blank spaces.
>I thought by using file('FILENAME.TXT') I would have a nice neat array of
>each record in the file based on each line being a record.
>Here's an example txt file:
>ABCDEFG HIJ KLMNOP
>YASFSEFAFSAFSDFFDS
>(notice the 4 spaces after J and before K on line 1 of the above text file)
>So, I went on breaking up the line into fields by doing this:
>$ra=$recordArray=file('FILENAME.TXT');
>for($index=0;$index$FIELD_1[]=substr($ra[$index],0,18);
>$FIELD_2[]=substr($ra[$index],18,19);
>$FIELD_3[]=substr($ra[$index],19,20);
>}
>I expected that to give me 3 fields on line 1 that would have looked like
>this:
>FIELD 1 = ABCDEFG HIJKLM
>FIELD 2 = N
>FIELD 3 = OP
>Instead it gave me:
>FIELD 1 = ABCDEFG HIJ KLMOP
>FIELD 2 =
>FIELD 3 =
>because it stripped out the empty spaces along the way.
>Can you tell me how I might prevent that from happening?
>Thanks very much,
>Jay Lepore
>[EMAIL PROTECTED]
Hello Jay
I´m a little "old style" an read about file() the first time. I haven´t 
used file yet.
For your problem try this "old style method, which I use with success.
$fp=fopen("filename.txt","r")
while(! feof($fp))
{
 $buffer=fgets($fp,$qty_to_read);
 $part[1]=substr($buffer,0,18);
 $part[2]=substr($buffer,0,18);
 
}
fclose($fp);
You would like tohave an easier job with extracting your sentences(when the 
appear in a logical order)
if you use an array, where to chop them
$where_to_chop=array(18,25,36,72);
for ($i=0; $i < count($where_to_chop);$i++)
{
 $part[$i]=substr($buffer,$where_to_chop[$i],$where_to_chop[$i+1]);
 
 $i++;
}
HTH Oliver


--
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] Pattern matching and replacement!

2001-05-08 Thread heinisch

At 08.05.01  10:03, you wrote:
>
>Hello all,
>
>I have a slight problem.  I am storing an email template in a MySQL DB.
>Portions of the email have text that need to be replaced with variable
>values when run through the script
>ex:
>
>Sehr geehrte(r) Frau/Herr {%Last_Name%} ,
>Dies ist eine automatische Zusendung von ACNS Billing and Support Software.
>
>Ihre Zahlung von  DM {%Prev_Total%} fuer ihr ACNS Domain und/oder ihr
>Internet Flatrate

As you can see. I am using the {% and %} to delimit the parts that need to
>be replaced.  I can't get the replacements to work right though.  Can
>someone help?
why don´t you store something like:
Sehr geehrte(r) Frau/Herr $Last_Name ,
an then use the eval() function, to fill your vars? Otherwise you have to 
str_replace() this {%Last_Name%},
think that would be more work.
HTH Oliver


--
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] PHP + LIBPNG how?

2001-05-08 Thread heinisch

At 08.05.01  15:14, you wrote:
>I have compiled PHP with this options,
>
>./configure --with-zlib=/usr/local/src/zlib --with-png=/usr/local/src/libpng
>  --with-gd=/usr/local/src/gd --with-pgsql=/usr/local/pgsql --with-apache=../
>apache --enable-track-vars

mmh - sounds good, did you test the php-installation  with 
Try this:

supposing you have a non white test.php, you´ll see your picture
HTH Oliver


--
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] money print out with two digits after , e.g. 49,00

2001-05-08 Thread heinisch

At 08.05.01  16:34, you wrote:
>I want to changes 49.4  --->   49,4
> 49,4 > 49,40
Try this
";
?>
Oliver


-- 
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] progession bar

2001-05-08 Thread heinisch

At 09.05.01  12:32, you wrote:
>
>Hi all
>Does any one know how to do the progession bar to mesure the time out? 
>Like give it 1 minute for the bar to progress, I got some logic here but 
>something still unclear to me.
>The procedures I see are
>1. get curren time when the page is loaded
>2. add 60 seconds on that current time value to tell when to stop the bar
>3. make a table , 6 rows so each row repersent every 10 seconds
>4. This is the bit where I got stuck, how do I change the color of table 
>cell every 10 secs for 6 times.
>any help will be thankful
>Jack
>[EMAIL PROTECTED]
>"There is nothing more rewarding than reaching the goal you set for yourself"
Go to the Java or JavaScript pages, this problem is client-side, Remember 
the page you create with
php will be produced on the server. When it ist sent in the internet it´s 
out of servers control.
If you want to make a "fake bar" you can sent a http://your_server?x=N";>
this makes the browser ask again your server. If you send the page 
again(you can control behaviour and therefor the
progression bar with var x) you can sent several stages. But I think that´s 
not what you want ;-)
HTH Oliver


--
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] Weirdest error I've ever had....

2001-05-08 Thread heinisch

At 06.05.01  12:00, you wrote:
>Alright I have a simple file writing script. Nothing special. in one
>part I use this code:
> $data[$x] = str_replace("","\n", $data[$x]);
>to replace break tags with page breaks. Problem is that for some
>reason it is adding wierd  tags to the file. It only does this
>on that server. What is that?
why don´t you use $data[$x]=nl2br($data[$x]);
smart n easy
HTH Oliver


--
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] how to bring selected rows to upper page

2001-05-08 Thread heinisch

At 09.05.01  09:28, you wrote:
>Hello friends,
>I want to prepare a page as attached. But main problem is how can I bring 
>the data to upper page when lower page's row is selected. I want to take 
>all data on selected row  to the upper pages fileds.
>please help me.
>Murat
If you sent a php-made page to the client, it is out of your(the servers) 
control. You could do something like Layer (doesn´t work on all browsers)
or some JavaScript(same as above), or have some selects on your page. You 
should redesing you page.
HTH Oliver


--
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] Variables in variable names

2001-05-09 Thread heinisch

At 09.05.01  23:08, you wrote:
>Hello,
>  I need some help (newbie).
>I have some variable names with the form:
>$name_1
>$name_2
>$name_3
>$name_4...
>I want to access them by doing something like this:
>$i=0
>$name_$i
>This doesn't work, how do I include another variable in the name of a
>variable?.
What you´re looking for is variable variables, Try this:
for ($i=0; $i < $max_var_count;$i++)
{
 $tmp="name_".$i;
 $show_var_name_content=$$tmp;
}
THT Oliver


--
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] calculating US holidays

2002-04-15 Thread heinisch

Oh, I love these 32 second answers ;-)
Just type it in google and zapp
http://php.resourceindex.com/Functions_and_Classes/Date_and_Time/
1st page, second answer !
G Oliver

At 15.04.2002  13:05, you wrote:
>
>That's fine for fixed dates, and I have that figured out, but presidents
>day, memorial day, labor day and thanksgiving fall on different days each
>year. Presidents day is the third monday of February. How do I calculate
>that?
>
> > From: "Tyler Longren" <[EMAIL PROTECTED]>
> > Organization: Captain Jack Communications
> > Date: Mon, 15 Apr 2002 14:48:15 -0500
> > To: "Tom Beidler" <[EMAIL PROTECTED]>, "php list"
> > <[EMAIL PROTECTED]>
> > Subject: Re: [PHP] calculating US holidays
> >
> >  > $month = date("m");
> > $day = date("d");
> > if ($month == "10" && $day == "31") {
> > print "It's Halloween!";
> > }
> > ?>
> >
> > you could do something similar to that.
> >
> > tyler
> >
> > - Original Message -
> > From: "Tom Beidler" <[EMAIL PROTECTED]>
> > To: "php list" <[EMAIL PROTECTED]>
> > Sent: Monday, April 15, 2002 2:17 PM
> > Subject: [PHP] calculating US holidays
> >
> >
> >> I need to calculate the date to see if it's a holiday, i.e. is today
> >> presidents day, which happens to be the third monday of february. Can
> >> someone point me to some code that can do that?
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] official statement about PHP file extensions?

2002-04-19 Thread heinisch

At 19.04.2002  13:32, you wrote:
>
>Hi,
>
>Is there any official statement (by php.net) about which file extension you
>should use when using PHP (1, 2, 3 or 4)? I know that's server related, but
>isn't there a standard?
>
>http://www.fatcow.com/help/php.shtml states when using PHP4, you should
>use .php4. But I have the feeling that's not true. I can remember the windows
>installation of PHP4 which said .phtml and .php3 were deprecated and .php
>was the only alternative.
>
>Thanks in advance


This only belongs to the settings your webserver allows.
f.e. I have configured, to parse every html file, so it looks like there were
static files, but they are php files. (not recommended on "real 
traffic/big" sites
Some ISP´s suggest that you use php3/4 extensions, as they have both versions
running.
Oliver


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




[PHP] 3dim Array problem

2002-04-19 Thread heinisch

Hi Folks,
I have a problem assigning an 3dim array, maybe I´m to tired today to see the
mistake, but PHP thinks, that it finds "Illegal string index" at the marked line.
could someone verify this, maybe find my mistake??
FYI getDbAns(), talk2DB are substitutions for DB - related routines, and the
produce the correct data. 
Sorry for the "overcommented" code, but I have syntax highlighting.
TIA Oliver

while( $res=$UDV -> getDbAns()) // fetch mains
{
if(strlen($res[0]) > 2) // if result is OK
{
   $menarr[$h]=$res[0]; // put them in array
   // get submenues
   $selchi="select chi from link where pa = '$res[0]'";
   $UDB ->  talk2DB($selchi);
   while($chia=$UDB -> getDbAns())
   {
  if(strlen($chia[0]) >3) // if result is OK
  {
 //echo "".$chia[0]."";
 // Youll get a <0x20> separated string
 $subp=explode(" ",$chia[0]); // explode it, to get single values
 if(is_array($subp)) // if there are more than one in it
 {
$maxs=count($subp); // check out how many
for($n=0; $n < $maxs ; $n++)// each child in main/sub/n
{
   // put the value in main/sub/n
error here  ->   $menarr[$h][$s][$n]=$subp[$n];
}
 }
 else // if there´s only one value
 {
 $menarr[$h][$s][0]=$chia[0];
 }
  }// end if sub
  $s++; // submenues plus one

   }// end while subs
}// end if main

$h++; // mainmenues plus one
}// end while mainmenues


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




Re: [PHP] official statement about PHP file extensions?

2002-04-19 Thread heinisch

At 19.04.2002  14:21, you wrote:

> > >Is there any official statement (by php.net) about which file 
> extension you
> > >should use when using PHP (1, 2, 3 or 4)? I know that's server 
> related, but
> > >isn't there a standard?

> > This only belongs to the settings your webserver allows.
> > f.e. I have configured, to parse every html file, so it looks like 
> there were
> > static files, but they are php files. (not recommended on "real
> > traffic/big" sites
> > Some ISP´s suggest that you use php3/4 extensions, as they have both 
> versions
> > running.
>
>I wonder why they do this? In my experience, php3 code runs fine on a
>php4 server and on the servers I manage, the apache configuration passes
>both .php3 and .phtml scripts to php4 for execution.
>8
>Andy
Maybe PHP3 scripts work fine on 4, but if you´ve 4th, you cannot run them on 3.
And which ISP can/will guarantee that 3s work fine on 4, even in the 
beginning of 4?
(BTW some of my 3 scripts don´t work on 4)
Oliver


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




Re: [PHP] 3dim Array problem ** SOLVED **

2002-04-20 Thread heinisch

I was too tired, but a coffee and a c* and everything woks fine :)
Just forgot to init the array correctly !
At 19.04.2002  15:24, you wrote:
>
>Hi Folks,
>I have a problem assigning an 3dim array, maybe I´m to tired today to see the
>mistake, but PHP thinks, that it finds "Illegal string index" at the 
>marked line.
>could someone verify this, maybe find my mistake??
>FYI getDbAns(), talk2DB are substitutions for DB - related routines, and the
>produce the correct data.
>Sorry for the "overcommented" code, but I have syntax highlighting.
>TIA Oliver
>
>while( $res=$UDV -> getDbAns()) // fetch mains
>{
> if(strlen($res[0]) > 2) // if result is OK
> {
>$menarr[$h]=$res[0]; // put them in array

should be $menarr[$h][0][0]=$res[0];

>// get submenues
>$selchi="select chi from link where pa = '$res[0]'";
>$UDB ->  talk2DB($selchi);
>while($chia=$UDB -> getDbAns())
>{
>   if(strlen($chia[0]) >3) // if result is OK
>   {
>  //echo "".$chia[0]."";
>  // Youll get a <0x20> separated string
>  $subp=explode(" ",$chia[0]); // explode it, to get single values
>  if(is_array($subp)) // if there are more than one in it
>  {
> $maxs=count($subp); // check out how many
> for($n=0; $n < $maxs ; $n++)// each child in main/sub/n
> {
>// put the value in main/sub/n
>error here  ->   $menarr[$h][$s][$n]=$subp[$n];
> }
>  }
>  else // if there´s only one value
>  {
>  $menarr[$h][$s][0]=$chia[0];
>  }
>   }// end if sub
>   $s++; // submenues plus one
>
>}// end while subs
> }// end if main
>
> $h++; // mainmenues plus one
>}// end while mainmenues
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] how to avoid executing whole script

2002-04-20 Thread heinisch

At 20.04.2002  15:06, you wrote:
>
>Hi,
>I'm new to php, I want to do the foll: in my code:
>display an array of names to the user,
>up, down, top and bottom buttons are provided so that the user can change
>the order of the names (e.g. if original array: "a, b, c, d, e and user
>selects e and presses top array should become e, a, b.
>
>I am able to achieve this functionality however since the whole script is
>executed each time the array gets redefined after each button press thus
>it remains a, b, c,d ...
>
>Finally I've a submit button, if this is pressed user should be able to go
>back and do whatever he was doing with the names.
>
>my code looks like this:
>define array
>html for presentation (form which goes to function changelayerorder())
>function changelayerorder (this func. detects which button and name was
>selected and changes order)
>
>I tried a while loop (while submit button not pressed) {do ...}
>but it results in the page never being able to load.
>CAN ANYONE ADVISE ME HOW TO AVOID REDEFINING THE ARRAY. THANKS,
>
>
>-Pushkar S. Pradhan
Just think, you send the page to the clients browser, you (PHP) don´t have 
control
what happens on the clients side!
Maybe you can split the functionality in separate, so if the client sends 
some vars,
only a part depending on if, else or switch is done by php.
Or (as last option) use JavaScript, which is client  side but not always 
available.

Best is to redesign your software, pages to avoid such conflicts.
And, if you want to include all users just use html-code wich will work on 
most browsers.

HTH Oliver


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




Re: [PHP] debugger

2002-04-20 Thread heinisch

At 20.04.2002  21:15, you wrote:
>Hi to all!!!
>Can anyone tell me how to debug in PHP?
>When I use ASP simply I write "stop" (VB) or "debugger" (JSCRIPT) to set a
>breakpoint and open the Microsoft Script Debugger.
>With PHP I can't find a way to do a similar thing.
>I downloaded the DBG PHP debugger but I don't understand how to use it like
>MSD.
>My config is:
>PHP 4.1.2 + IIS5 + WinXPpro
>
>I'm bored to use echo "$something" for debug :-(
>
>Thanks in advance for your help,
>Evan
I´m not shure, but ZEND offers some kind of IDE and nusphere has an IDE
which has a debugger built in , but who needs this??
Use an editor with macro functionality so u can set a macro which makes
something like if($debug){ echo something}, then you can set one var
to turn debugging on/off.
Are you shure you need PHP for your problems? Seems that you´re lucky
with M$ and their ek$pen$ive environments.

Oliver


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




Re: [PHP] mail() + attachement

2002-04-20 Thread heinisch

At 20.04.2002  22:44, you wrote:
>
>Is it possible to send with mail an attachment .. if yes, how ???
>
>Greetings
>wolf
Hi Wolf,
just ask google, or the archives there are a few classes and functions
which will do what you want.
If you like OOP you will find certains under http://www.phpclasses.org

HTH Oliver


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




Re: [PHP] Php and SQL Server 2000 - Help Needed

2002-04-22 Thread heinisch

At 22.04.2002  14:04, you wrote:
>
>Hi all of you
>I 'm desesperatly trying to connect to my MS SQL server 2000 demo version 
>using a php script (executed by a form), running Easyphp (apache) as Web 
>server, under Win 2000 Pro F Sp1.
>
>It says
>Warning: MS SQL message: Échec de la connexion de l'utilisateur 
>'Aurelien'. (severity 14) in c:\program files\easyphp\www\s.php on line 9
>
>Warning: MS SQL: Unable to connect to server: KOHAI in c:\program 
>files\easyphp\www\s.php on line 9
>
>KOHAI is my computeur name.. and aurelien my windows name.
>Even when i run the client tool, I have to use my windows Connection.
>
>Please I need some help
>
>Thanx
What is in s.php, specially on line 9 ??
And sorry about, but what´s the translation of the MS SQL message?

Oliver


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




RE: [PHP] security

2002-04-22 Thread heinisch

At 22.04.2002  15:17, you wrote:
>
>Search archives, as a tip I'd suggest to encrypt the Credit Card numbers
>with RC4 or some other algorithm.

Maxim,

I don´t agree your suggestion, as I mentioned earlier on the list, avoid 
storing CC numbers
unless it´s absolutely necessary, you´ve got a good insurance, and are your
own ISP knowing a lot of network security. Your suggestions may make
php-coder think that it is possible to store these data secure. But that´s 
not only
depending on php. If you store any data in an ISP-environment, you cannot be
shure that this is secure, as you don´t know how they set up their servers, 
firewalls ...

I wouldn´t give this suggestion without any word on this.

Oliver


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




Re: [PHP] If else question

2002-04-23 Thread heinisch

Aeh, sorry - but is the 1 you test for actual a number or is it a string?
I had made this mistakes earlier, so also try
if ( $quantity == "1")

Maybe I´m absolutely wrong, (PHP 3 knowledge) but

Oliver

At 23.04.2002  10:48, you wrote:
>Ok you asked for it.
>Don't say I didn't warn you.
>
>session_start();
>$query = "SELECT name FROM {$config["prefix"]}_users WHERE
>uid={$session["uid"]}";
>$ret = mysql_query($query);
>while($row = mysql_fetch_array($ret))
>{
>$user = $row['name'];
>$query = "SELECT uid, id, iname, image, quantity, type FROM
>{$config["prefix"]}_my_items WHERE uid={$session["uid"]} AND id = '$id'
>ORDER BY id";
>$ret = mysql_query($query);
>while($row = mysql_fetch_array($ret))
>{
>   $uiid = $row['uid'];
>  $iid = $row['id'];
>   $image = $row['image'];
>   $iname = $row['iname'];
>   $quantity = $row['quantity'];
>   $type = $row['type'];
>// this is the problem if statement. Please don't yell at me for my style.
>It is easy for me to read so I'm sorry if it's not for you.
>if($quantity < 1)
>{
>echo "Sorry I can't seem to locate this item";
>}
>else
>{
>session_register("uiid");
>session_register("iid");
>session_register("image");
>session_register("iname");
>session_register("quantity");
>session_register("type");
>   if($iid == $id)
>{
>
> $display_block .="2>$iname$quantity$type";
>
> echo "$display_block";
>
>   if($type == "food")
>   //if the item food is present then set an option and include in the
>form later
>   {
>$thisoption="Feed my pet\n";
>   }
>  else
> {
> //if book or weapon is present then set a blank
> $thisoption="";
>}
>   }
>}
>}
>}
>//check if form has been submitted
>if($submit)
>{
>
>}
>else
>{
>
>//if the form has not been submitted run the following
>
>
>echo "";
>echo "";
>echo "$thisoption";
>echo "Put in my shop";
>echo "Put into my Footlocker";
>echo "Discard this item";
>echo "Donate this item";
>echo "";
>echo "";
>echo "";
>}
>Jennifer


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




Re: [PHP] authentication

2002-04-23 Thread heinisch

At 23.04.2002  09:52, you wrote:
>
>I have one directory that is protected with an .htaccess file on my server
>where I store all member content. What I want to do is have a page where
>members can log in, and after they have entered there user name and password
>I what the php script to authenticate them against the .htaccess file. If
>they are authenticated I would like to keep track of that as one of there
>session variables, so that they do not have to re-authenticate when they try
>to access content in the protected directory. Essentially what I am trying
>to do is give them access to the .htaccess protected based from a "submit
>form". Instead of requiring that they get the standard user name and
>password pop up window that one gets when you try to access a directory that
>is password protected on Apache.


Why do you want to make such a hassle ??
If you auth via Apache, then it´s a secure thing, as these vals where put 
secure.
If you want people to access a hidden directory or a .htyccess closed dir,
you´ll send their user/pw combination plaintext, unless you use https.
Also, if they auth´ed one time, the browser will remember the data, until
it is closed. The auth-popup will be shown in the browsers language.

If you want apache, to get scripts or data from a "secured" directory, 
forget it
or include the apache user in the .htpasswd, but that´s not a good idea.

HTH Oliver


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




Re: [PHP] problem compiling Apche 2.0.35 and PHP 4.2.0

2002-04-23 Thread heinisch

My 2 eurocents,
Start compiling without mysql, esoob ( what´s that??) and see if it works.
- write a bug report
- try to get a rpm from redhat and see if this will work.
- check out which sources they used, maxbe there´s a difference
to the one you have. So you can try it with the sorces from the other version
- wait 6 weeks until they got it stable, and/or more informations are 
available ;-)
HTH Oliver

At 23.04.2002  11:55, you wrote:
>
>OS  :   Redhat 7.1
>
>apache compile option   :   --prefix=/path --enable-module=so
>php compile option  :   --with-apxs2=/path/bin/apxs
> --enable-force-cgi-redirect
> --with-pear
> --enable-ftp
> --enable-track-vars
> --with-esoob
> --with-gd
>
>error on php make   :
> /bin/sh /root/php-4.2.0/libtool --silent --mode=compile
>gcc  -I. -I/root/php-4.2.0/ext/mysql/libmysql -I/root/php-4.2.0/main -I/root
>/php-4.2.0 -
>
>I/usr/local/apache/include -I/root/php-4.2.0/Zend -I/root/php-4.2.0/ext/mysq
>l/libmysql -I/usr/local/easysoft/oob/client/include -I/root/php-
>
>4.2.0/ext/xml/expat  -D_REENTRANT -I/root/php-4.2.0/TSRM -DTHREAD=1 -g -O2 -
>pthread -DZTS -prefer-pic  -c thr_mutex.c
> In file included from /usr/include/math.h:82,
>  from /root/php-4.2.0/main/php_config.h:1902,
>  from my_config.h:5,
>  from global.h:33,
>  from thr_mutex.c:6:
> /usr/include/bits/mathcalls.h:176: Internal error: Segmentation 
> fault.
> Please submit a full bug report.
> See http://bugzilla.redhat.com/bugzilla/> for instructions.
> make[4]: *** [thr_mutex.lo] Error 1
> make[4]: Leaving directory `/root/php-4.2.0/ext/mysql/libmysql'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/root/php-4.2.0/ext/mysql/libmysql'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/root/php-4.2.0/ext/mysql'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/root/php-4.2.0/ext'
> make: *** [all-recursive] Error 1
>
>any thoughts/fixes would be appreciated.


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




Re: [PHP] comparing time

2002-04-24 Thread heinisch

At 24.04.2002  11:05, you wrote:
>Hello,
>
>How can I compare time? So I have to check a difference of 12 or 24 hours
>this mean I have to compare the time between the days too..
>
>How I can make this comparing
>just comparing hour with hou and then minute with minute or is possible
>all of them at the same time?
use mktime() to convert your dates in Unix-imestamps, then you can do 
whatever you like
to make them "human" readable used date().
Oliver


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




Re: [PHP] Removing Irregular characters

2002-04-24 Thread heinisch

At 24.04.2002  19:03, you wrote:
>
>Hello
>
>I have a form that is to entered into a MySQL database.
>A couple of the feilds must contain irregular characters, such as
>(/\+;]{'.,<:"?>}|_~`)
>
>What MySQL Field type should I use?
>varchar doesn't work.


Even this is a definitive mysql-question, try to addslashes() before you
insert your data in the DB, then varchar, text, mediumtext shall work.
Oliver


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





Re: [PHP] Multi language support

2002-04-24 Thread heinisch

At 24.04.2002  15:29, you wrote:
>
>Hi all,
>
>What needs to be done for multi language support in PHP.
>I am using redhat linux & new to HTML programming.
>I want to know the mechanism to make the output available in different
>languages.
>Thanks in advance for any help
>
>--Shailendra S. Mehta
>Senior Engineer (Design & Development),
>TATA Infotech Ltd,
>Mapusa-GOA.


If you want to do this, one suggestions is:
Have a db, where you store the text for each ouput, button, etc...
under a number (in mysql autonum is your friend)

copy this db, changing the textcontent in every desired language,
to a new name f.e db_english, db_french

now make an object, or function which requests the content of
number x and disply it where it´s needed.
like 

As a hint, when incrementing the number of the text, add 10, as later you´ll
need another text, and this will be put at the end of db.
When making the site-scripts, don´t forget to have the original text nearby 
as comment.
Otherwise you get mad, when you touch the code a second time.

HTH Oliver


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




Re: [PHP] Getting page with fopen

2002-04-25 Thread heinisch

At 25.04.2002  11:01, you wrote:
>
> > Google is probably trying to send you a cookie in which case you cannot use
> > fopen. You need to use curl or snoopy(?).
>
>Thanx, that could be the problem. Unfortunatly, curl is not compiled in my
>php-version, and what is snoopy?! ;-) Any other ideas/examples?
>
>Martin
snoopy is a class which lets you fetch pages from the web, like you want to do.
It supports cookies,https and some other stuff useful for fetching pages 
from the
web. Look at sourceforge to get the latest release. This is one of my 
favours ;-)
Oliver


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




Re: [PHP] Displaying dates

2002-04-25 Thread heinisch

At 25.04.2002  11:46, you wrote:
>How can i display a dynamic page showing last month and next month and the
>month before
>
>eg
>this moth is 
>how do i add 1 to the month or -1 to the month?

Several methods

mktime() where you put last month(s) via (date("m")  -1)
getting the actual day of the month, calculating its seconds +1
substracting this from the actual time(). Vice versa for adding one month.
but I think mktime makes it easier.
Any other suggestions ?
Oliver


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




Re: [PHP] GD: º becomes $

2002-04-25 Thread heinisch

At 25.04.2002  18:03, you wrote:
>   When I create an image, º becomes $. Actually a small $. (pratically
>half-sized). Maybe it's a "s" with a tail. I really have never seen this
>character before :-)
>
>   An example:
>
>$im = @ImageCreate (450, 500)
> or exit ("Cannot Initialize new GD image stream");
>$background_color = ImageColorAllocate ($im, 255, 255, 255);
>$text_color = ImageColorAllocate ($im, 0, 0, 0);
>$horizonte = 465;
>$vertical = 25;
>$pasta = 'Pasta Nº: ';
>ImageStringUp ($im, 5, $vertical, $horizonte,  $pasta, $text_color);
>ImagePng ($im,'etiqueta.png');
>
>   Outputs:
>
>Pasta N$:
Shouldn´t you load the font you want to uses, before you use it?
something like $font=imageTTFloadfont("yourfont.ttf") // untested, cannot 
find the manual right now
And is the char, you want to use, available in that font?

HTH Oliver


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




Re: [PHP] 1. ImageTTFBox not working and 2. System command

2002-04-27 Thread heinisch

At 27.04.2002  18:59, you wrote:
>Hi all,
>
>I have problem with TTF support on my vhost. PHP says it has no ttf support.
>The configure command is:
>
>  './configure' '--prefix=/opt/php' '--enable-exif' '--with-apxs'
> '--enable-memory-limit=yes' '--enable-track-vars' '--enable-trans-sid'
> '--enable-wddx' '--enable-ftp'
> '--with-gd=../gd' '--enable-gd-imgstrttf' '--with-jpeg-dir' '--with-ttf'
> '--enable-gd-native-ttf' '--with-t1lib=/usr/lib'
> '--with-mysql=/usr/' '--with-png-dir'
> '--with-config-file-path=/etc/opt/httpd/'
> '--with-zlib' '--with-mhash' '--with-pdflib=/usr/lib/'
> '--enable-sysvsem' '--enable-sysvshm' '--enable-memory-limit'
>
>and GD section of PHP Info looks like this:
>
> GD Support enabled
> GD Version 1.6.2 or higher
> T1Lib Support enabled
> JPG Support enabled
> PNG Support enabled
> WBMP Support enabled
>
>anyone could help? Admin says that on their website TTF functions work fine.

Maybe I´m wrong, but in the past you have to compile and install the gd and 
other libraries
first, before compiling php. Maybe this is the fault

>Additionally, i'm execute a shell command (to create thumbnail with
>ImageMagick) but it does not do anything. The command is OK as it works by
>SSH.

use system() or passthru to wath eventually appearing error messages.
Maybe the apache user has no rights to work with ImageMagic. But If you have
gd, there´s no need to use IM.

>Remek
Oliver


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




[PHP] OOP-related question

2002-04-29 Thread heinisch

This is done on PHP 3.0.16
Hi folks,
I have a problem with these HTTP_ vars.
I have a mainpage, call it main. There is an include which carries several 
settings
and other includes like my abstract db-layer class.
I include this in my class-function, which works fine for the most 
variables but $SERVER_ADDR
It seems that I cannot get these variable in the function of my class so I 
have to pass them as
argument to the function. I have made an init() function where I pass these 
vars inside the object
But I don´t like to do this, vars like $SERVER_ADDR or *_NAME should be 
available inside the
objects-functions.
Is this behaviour normal, or are there any workarounds for it?

Hope someone could help.
TIA Oliver



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




Re: [PHP] image generation Problems (jpeg)

2002-04-29 Thread heinisch

At 29.04.2002  20:02, you wrote:
>=
>PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED]
>=

>hi, im having a few problems installing GD, ill start from the top:
>I need Jpeg support in my PHP installation, and unfortunatly, GD (the 
>verison i have) does not support them, so i figure, ill install it, 
>installing the libary jpeg-6b works easily
>however, i attempt to compile from there GD, but the following error is 
>produced:
>[root gd-1.8.4]# make
>gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 
>-I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c
>In file included from /usr/include/errno.h:36,
>   from gd_gd2.c:14:
>/usr/include/bits/errno.h:25: linux/errno.h: No such file or directory
>make: *** [gd_gd2.o] Error 1
>I also tried recompiling PHP and got a similar error, which is very 
>worrying, i think i might be missing some files
>Basically, waht i would really like, is a way to modify my CURRENT php 
>config or my CURRENT gd config to take advantage of my shiny new jpeg 
>libary, is there any method u can recommend to accomplish this?
>
>Thanks
>Peter
>=
>PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED]
>==
Check out the config file for gd, the path to the jpeg-6b must be included.
There´s some problem of the order of the files, but there are more info in 
the config file.
Also the path where the jpg libs are installed, is sometimes different, so 
you have to check
them too.
HTH Oliver


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




Re: [PHP] image generation Problems (jpeg)

2002-04-29 Thread heinisch

At 29.04.2002  15:24, you wrote:
>At 29.04.2002  20:02, you wrote:
>>=
>>PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED]
>>=
>
>>hi, im having a few problems installing GD, ill start from the top:
>>I need Jpeg support in my PHP installation, and unfortunatly, GD (the 
>>verison i have) does not support them, so i figure, ill install it, 
>>installing the libary jpeg-6b works easily
>>however, i attempt to compile from there GD, but the following error is 
>>produced:
>>[root gd-1.8.4]# make
>>gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 
>>-I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c
>>In file included from /usr/include/errno.h:36,
>>   from gd_gd2.c:14:
>>/usr/include/bits/errno.h:25: linux/errno.h: No such file or directory
>>make: *** [gd_gd2.o] Error 1
>>I also tried recompiling PHP and got a similar error, which is very 
>>worrying, i think i might be missing some files
>>Basically, waht i would really like, is a way to modify my CURRENT php 
>>config or my CURRENT gd config to take advantage of my shiny new jpeg 
>>libary, is there any method u can recommend to accomplish this?
>>
>>Thanks
>>Peter
>>=
>>PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED]
>>==
>Check out the config file for gd, the path to the jpeg-6b must be included.
>There´s some problem of the order of the files, but there are more info in 
>the config file.
>Also the path where the jpg libs are installed, is sometimes different, so 
>you have to check
>them too.
>HTH Oliver

TYPO
Oops I meant makefile for gd instead of config file


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




Re: [PHP] PHP "ignoring" dotfiles, permissions

2002-04-29 Thread heinisch

At 30.04.2002  00:01, you wrote:

>>Just a hunch: do you get the same permissions output for the dotfiles as
>>the normal ones?
>
>Thanks for the idea. I am not sure what you mean by "permissions output" 
>but it is same owner and an "ls -la" gives
>
>-rwxr-xr-x   1 frank  wheel   27 Apr 29 23:05 .mydotfile.php
>-rwxr-xr-x   1 frank  wheel0 Apr 29 23:08 myfile.php
>
>- - -
>
>I BTW forgot to tell that I am on PHP 4.1.1
>
>BTW - if I introduce syntax errors in .mydotfile they are ignored - it is 
>like PHP does not read the content at all. But take away the leading dot 
>and it is all as expected.

You know that "dot" files are hidden files ? I´m not shure, but I think 
they cannot be read by other users
then these, where the user id is smaller then 500. If you want to use them, 
try to fread() them.
If you try to hide a file for listing, set the approbiate filetype in the 
httpd.conf.
So just rename this to mydotfile.secret and avoid listing via:


 Order allow,deny
 Deny from all


then add this type to allow php to parse them
AddType application/x-httpd-php .secret

and include them as normal >include"mydotfile.secret"<

HTH Oliver


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




Re: [PHP] Pixel Length of text message

2002-04-29 Thread heinisch

At 29.04.2002  10:17, you wrote:
>
>In html/css you can set a font size in pixels -- in my experience this
>means a letter takes the same number of pixels, regardless of
>resolution. With php, can I use string length and font pixel size to
>determine the length of a given string on a screen? Does anyone know an
>algorithm for this that works for any/every font?



The chance that this works, even if you would have an algorithm is nearly null,
as you don´t know which fonts are installed on the client, nor which 
version they
have. Also what if the user disables JavaScript, then your nice css-stuff 
will not work either.

To have text output to a specified length, you have to make it using gd.
Then you are able to make a picture, containig the text you want .
 From this, you know it´s dimensions. but don´t forget the alt= attribute 
for people who
have "load graphics" set off, or are not able to see graphics.

HTH Oliver


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




Re: [PHP] Files sorted by date?

2002-04-30 Thread heinisch

At 30.04.2002  17:24, you wrote:
>
>Hi there,
>
>I got a number of files in the directory "/reviews/txt" which are reviews.
>They are submitted by people all over the world.
>
>Can someone please tell me what I need to do so that I can display them in
>date order, newest at the top on a webpage?
>
>Cheers, Ian.
>---
>Randum Ian
>DJ / Reviewer / Webmaster, DancePortal (UK) Limited
>[EMAIL PROTECTED]
>http://www.danceportal.co.uk
>DancePortal.co.uk - Global dance music media
exec("ls -lc reviews/txt/*",$result);
for($i=0;$i < count($result);$i++)
{
 if(($result[$i] ==".")||($result[$i] =="..")
 {} // do notjing
 else
 {
 do something with $result[$i];
 }
}
HTH Oliver


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




Re: [PHP] odd behavior

2002-05-01 Thread heinisch

At 30.04.2002  18:29, you wrote:
>
>When I run this the first time, file.txt contains value of 30. Then I add 15
>to it with following script and file now contains value of 45. I look at
>file.txt after write and it does indeed contain number 45. But when I run
>script 24 hours later via cron job, it still thinks file.txt is holding
>number 30. Is $file somehow retaining value of 30 and not getting new value
>of 45 when script runs second time? What is it called when this happens?
>
>
>$file = file('/usr/home/xyz/file.txt'); //file.txt contains value of 30
>
>$number = "15";
>
>$newnumber = $file + $number; //$newnumber now is 45
>
>$fp = fopen('/usr/home/xyz/file.txt','w');
>fputs($fp,"$newnumber"); // write value 45 to file.txt
>fclose($fp);
>
>?>
>
>Thanks
>
>Craig ><>
>[EMAIL PROTECTED]
Hi Craig,
you read the file in an array, therfore you have to add your number to 
$file[0];
Also look, if the rights are set correct.
BTW I just tried it, and all errors appeared.

HTH Oliver


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




Re: [PHP] Virus I-Worm/Klez.H (Someone does not like me)

2002-05-02 Thread heinisch

Sorry if this mail sounds like flame,
but "google" (49) is your friend, or if you like a lot of pages
use www.alltheweb.com (494).
Thats a good side of Opera 6, there are two fields, where
you can enter searchwords, one for google, one for alltheweb.
Makes it easier to search and one does it more often.

Oliver
(I like the word "dudettes" :) )
At 03.05.2002  04:08, you wrote:
>
>Hey all,
>In the last 14 days i got 9 emails with this virus "I-Worm/Klez.H", though
>my virus scanner detected it and told me to trash it, i am really curious
>can anybody tell me how destructive this virus is and what exactly does it
>do? also have any body else on this list recieved this?
>
>Please also note my apoligies for asking this on a PHP list, but other than
>being computer dudes and dudettes out there, you are also people, and I
>consider a lot of you my net pals, after all we all help each other out
>right? and isnt that what friends do?
>
>Cheers,
>- Ryan


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




Re: [PHP] Controlling Word Files (FDA Concern)

2002-05-03 Thread heinisch

At 03.05.2002  14:11, you wrote:
>Does anyone know of how to put a Word file on a web page without the user
>being able to save it to their hard drive? And also another issue of making
>it so they can't print it.
>
>Thanks, Gary
Aeh,
-If one could see the content on a webpage, it has it already on it´s machine.
Then it could make anything with it.


You could add a VBScript to it, which formats the users harddrive, so they 
cannot
save it, and cannot print it.


-for other options you should ask on the windowPHP list, maybe the have an idea
maybe there´s a special option with active.?*$x...

Oliver


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




[PHP] var-vars question

2002-05-07 Thread heinisch

Hi folks,
Linux, PHP3

I have the following problem:
I have an object, which creates a form, wherein there are selects, which
names accord to values in the database.

But I didn´t get it to have a variable var, I´m sure it´s just a small 
thing, but I cannot see it
Any suggestions ?
TIA Oliver

echo '';
// Already tried post, no difference
echo '';
while($da=$MKA -> getDbAns()) // This gives back an array named $da 
while there are answers
{

   $xwert=$da[1];

//  $da[1] contains "abc" the var  $xwert will be "abc" 

// now I´d like to see the value of $abc but there´s nothing in

   echo ' '.$$xwert.'';

// set the new select named "abc"
   echo '';

// forget the rest, just for understanding what while does
   for($i=0; $i < 11 ; $i++)
   {
  if(isset($$da[1])) // just for testing
  {
 echo "".$i."";
  }
  else
  {
 echo "".$i."";
  }
   } // end for
   echo '';
   echo '';
   echo ''.$da[1].'';
   echo ''.$da[2].'';
   echo ''.$da[3].' EUR';
   echo '';
} // end while
echo '';
echo '';
echo "";


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




[PHP] Direction to file-upload ?

2002-05-14 Thread heinisch

Hi Folks,
after studying and searching manual/archives,
I didn´t find the explanation to upload multiple files
from a "single ".
What I want is to let the user select multiple files
from the files-box appearing in the browser and let him/her
upload this selection.
If I put a second ''
then a second input appears. This works, but I want to have them upload their
selection at once.
Any suggestions ?

Oliver


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




Re: [PHP] can't upload files

2002-05-15 Thread heinisch

At 15.05.2002  12:33, you wrote:

>I am using this script: to upload a picture file and I get the error below:
>"Unable to create 'hgh6.gif': Permission denied in
>/home/vhtdocs/archipro/do_upload.php on line 13
>Couldn't copy the file!"  - What am I doing wrong
>
>
>
>File to Upload:
>
>
>
>
>
>upload file:
>
>// if $img_name isn't empty, try to copy the file

You files name is in the var $img1, your refering to $img1_name !!

>if ($img1_name != "") {
>
>copy("$img1", "/images/$img1_name")

you should use absolute pathes
copy("/tmp/".$img1,"/home/yourpath_to_virt_server/images/".$img_name)

>   or die("Couldn't copy the file!");
>
>} else {
>
>  // if $img_name was empty, die and let us know why
>  die("No input file specified");
>
>}
>
>?>
>
>Warning: Unable to create 'hgh6.gif': Permission denied in
>/home/vhtdocs/archipro/do_upload.php on line 13
>Couldn't copy the file!
HTH Oliver


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




Re: [PHP] How program automatic 'filler forms' robots?

2002-05-15 Thread heinisch

At 15.05.2002  15:20, you wrote:
>
>Hello, I am interested on some info - how do robots  work to fill web
>forms authomatically?
>Sometimes I notice a blurr code to be manually writen to avoid these
>robots when filling forms, but I am interested in programm just one of
>these machines. Is it necessary PHP of another script for this task?
>
>Thank for any info
>
>Mig
look for the snoopy class, this does all you need
http://sourceforge.net/projects/snoopy/

Oliver


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




Re: [PHP] unable to view .php files in browser

2002-03-15 Thread heinisch

At 15.03.2002  17:28, you wrote:
>
>
>
>I am using php,mysql,apache combination on a linux machine.
>
>I used the INSTALL file available in php-4.0.6.tar to install PHP in
>static mode.
>
>Compilations and Installation go on fine with no errors.
>
>But when a test.php script containing:
>
>is executed, only the HTML tags are interpreted. There is no output for
>phpinfo().
>The php.ini file is located in /usr/local/lib
>The httpd.conf is present in /www/conf
>The apache version used is apache_1.3.23

Check out, what filename you have, here´s an exerpt from my
httpd.conf.
maybe yours has not the correct endings defined
(As I work for several servers, nearly every ending will be parsed)

  
 AddType application/x-httpd-php3 .php3
 AddType application/x-httpd-php3-source .phps
 AddType application/x-httpd-php3 .phtml
 AddType application/x-httpd-php3 .htmls
 AddType application/x-httpd-php3 .html
 AddType application/x-httpd-php3 .php
 

 #
 # And for PHP 4.x, use:
 #
 
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php-source .phps
 
HTH Oliver


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




Re: [PHP] Formatting input text?

2002-03-16 Thread heinisch

At 16.03.2002  10:44, you wrote:
>
>I wonder whether this is possible?
>
>I would like to format a text input so that the first letter of the input (as
>the user is typing it in) would automatically be converted to Uppercase
>(capitals). Furthermore, if it is possible, I would like to pre-format the
>date "input type=text" so that only numbers or dashes could be entered. I
>really enjoyted this capablity in Paradox PAL language.
>
>Does anything exist that would allow me to do this in PHP?
>
>An example:
>
>Code
>Surname
>
>
>Screen (and into database)
>Surname: black   >> would be converted as they type to >> Surname: Black
>
>Any suggestions or advice would be greatly appreciated.
Suggestion:
a.)try this in JavaScript on the client side, you have to check if the 
valid chars/numbers are entered
otherwise the page will be not send.
b.) check the form, whem the page arrives on the server, and if the vals 
are not correct, send
the page back to be corrected by the user.
HTH Oliver


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




Re: [PHP] From: Newman, PHP on non PHP servers?

2002-03-16 Thread heinisch

At 17.03.2002  08:02, you wrote:
>
>Ok say I have a top ten list of something in a MySql db on server 
>lisa.philipnz.com which runs php scripts.  Is it possable to call, using a 
>javascript information from say
>
>http://www.geocities.com/philip_newman/ this list, will the PHP exacute on 
>lisa.philipnz.com when the script is requested from another server page.
why don´t you just



>http://www.geocities.com/philip_newman/ 
>your_script_page.php3?your_parameters

frameset could be just the whole page.
But there could be a better way

HTH Oliver




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




Re: [PHP] php.ini and fixing timeouts

2002-03-16 Thread heinisch

At 16.03.2002  20:59, you wrote:
>hi folks,
>
>I'm running a php script from a console - it includes quite a lot of heavy
>database queries - and takes a while to run.  Problem is that the the script
>keeps on timing out and I get
>
>Fatal error:  Maximum execution time of 30 seconds exceeded ...
>
>I've set the MAX EXECUTION time in php.ini to 3 - but php doesn't seem
>to be reading it..
>
>Any ideas?

 set_time_limit (int seconds);

from the manual:
When called, set_time_limit() restarts the timeout counter from zero. In 
other words, if the timeout is the default 30 seconds, and 25 seconds into 
script execution a call such as set_time_limit(20) is made, the script will 
run for a total of 45 seconds before timing out.

Note that set_time_limit() has no effect when PHP is running in safe mode. 
There is no workaround other than turning off safe mode or changing the 
time limit in the configuration file.
HTH Oliver


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




Re: [PHP] send fax

2002-03-17 Thread heinisch

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 ISP´s offer the sending of faxes via an special e-mail adress,
it´s forwarding a message to a fax.
HTH Oliver


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




Re: [PHP] retrieving remote web page

2002-03-17 Thread heinisch

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


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




Re: [PHP] Re: No Sense: [PHP] Update: [PHP] Weird?

2002-03-17 Thread heinisch

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



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




Re: [PHP] Copy *.*

2002-03-17 Thread heinisch

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 ?


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




Re: [PHP] Class Function Issue

2002-03-17 Thread heinisch

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 doesn´t work. Try to set the vars via an explicit function,
so that they´re 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




Re: [PHP] Class Function Issue

2002-03-17 Thread heinisch

At 17.03.2002  10:49, you wrote:
> > 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
I meant :
Main code
--
$FOO = new Yourclass
$sesvar = $HTTP_SESSION_VARS;
$FOO -> SetSVars($sesvar);
--
CLASS

yourlass
var insidesesvars;
{
function SetSVAR($sesvar)
{
 $this -> insidesesvars = $sesvars;
}
} // end Yourclass

There are often problems with so called globalvars like $HTTP_REFERER, 
$HTTP_SESSION_VARS ...
using inside Objects, don´t ask me why.

HTH Oliver

> >
> > 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 doesn´t work. Try to set the vars via an explicit
> > function,
> > so that they´re 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
> >
> >
> >
> >
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Saving data with cookies

2002-03-17 Thread heinisch

At 17.03.2002  18:21, you wrote:
>
>Hi list,
>
>I'm developing a system to store Resumes, since my form has a lot of fields,
>about 70, i'd like to have the ability to save the filled ones if my user
>wants to finish it later. Wha'ts the best way to implement this kind of
>feature. Maybe I could use cookies, right?!?!? If so, how can I store this,
>multiples cookies, one big cookie, like an array?? this is possible??
>
>Thank's in advance
>
>Rodrigo Peres
your form has (70?) inputs like
input type="text" name="name_of_var[]" <-- this is an arrayvaraible every 
field the same name !
the form will then submit an (one) array, which could be stored in your 
database
(For I´m not shure how it will be saved, I would save this array as an
"something" separated text.)
you send an cookie with a long lifetime to the client,
this cookie is also stored in your DB. So a user wants to continue his form,
you can select the users form via the cookie, and send an pre prepared form
to the client. I think that´s all. If this user sends it back, you update the
textfield, for his next continuation.
But take a look on sending cookies, I found out, that the major browsers want
different style cookies.
HTH Oliver


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




Re: [PHP] Two easy HTML/CSS questions

2002-03-18 Thread heinisch

At 18.03.2002  13:18, you wrote:
>
>I know I shouldn't be asking these questions on this mailing list but
>you guys are ALWAYS EXTREMELY helpful...
>
>1) I want a a text link to change color when the mouse is hovering over
>top of it.  How do I do this?  Im sure it's some CSS thingy.

You´re right, and as others mentioned earlier, this lsit is not
the right place.

>
>2) Is it possible to make a "text field" smaller when using forms.
>Let's say I'm using font size 1, I want the text field to be just as
>small as the rest of text.
>
>Thanks again

It can be done with CSS, but as a fast tip
if your text has font size="1" use font size="0" for your text input field.
Test also the variation of font size"+0" and "-0" sounds silly, but makes 
differences.
As general text field 1 step smaller makes a good job.
But as W3C recommends, try to start CSS, this makes designer´s life much 
easier ;)
HTH Oliver



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




Re: [PHP] apache, php user names

2002-03-19 Thread heinisch

At 18.03.2002  17:28, you wrote:
Even if I think you´ll not be able (should not be able) to put
files elswehere than /home/~myname:
>
>On a shared hosting provider, I have an account like:
>
>/home/~myname/www/
>and
>/home/~myname/resources/
>
>As far as I know, apache can only access what's in the www directory and
>below.

That depends on how the apache is configured but the place
/home/~myname/ could be a good place, as this couldn´t be listed by the
apache (means client). Mostly the documentroot for apache begins
in home/.../www/.

>However,
>php can include stuff from the resources directory. This is where it's
>recommended to keep the database passwords.
>
>How did the sysop, (not me), set this up?

(how does the world get made ;-) )

if your isp has not set the apache user explicit, it should be wwwrun/nogroup
but I hope he/she changed the user

>What user/group would apache run as?
>Also, what user/group would the php script be in, apache's?
Your script´s could be yourname/users (if apache belongs to users)

If you want to store passwords for mysql, check out if your ISP
supports the usage of .htaccess files in each directory, then
you can prevent the listing of the directory. Details can be found
www.apache.org  search the manual. Or you try to store these data
in /home/~myname/. If these files were not found, try an absolute path
when you include f.e. include "/home/~myname/passwords.inc":
HTH Oliver


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




Re: [PHP] How do I make tab spaces in a mail?

2002-03-19 Thread heinisch

At 19.03.2002  21:40, you wrote:
>
>Hi!
>I have read several tricks of how to remove white spaces but how to create
>them?
>
>I wan´t to build a normal textmail like this:
>$message="
>productitemspriceamount
>book22550
>cd-rom 31545";

take book\t2\t25\t50\n...
\t is TAB \n is LF (or CR\LF) depending on hosts os

>mail($recipient, $subject, $message, $headers);
>
>How do I write to get the tab spaces?
>--
HTH Oliver


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




Re: [PHP] Can anyone help me with this problem(uploads via a form)?

2002-03-19 Thread heinisch

At 19.03.2002  14:16, you wrote:
>
>I'm having a problem with file uploads via a HTML form. I've no luck getting
>it to work. After a bit of research I think I've determined that the problem
>lies with my host having safe mode enabled and setting a open_basedir that
>is outside my scope.

>
Hi Jack,
It´s important to know that the file will be stored in /tmp !

I have realized it with two pages
page a is a form where the client can enter the necessary data, like 
targetname
the page contains the following form tag

While uploading, the file will be stored  in /tmp/,
Page b (save_file.html)  renames it to @rename ($userfile,delete_me); 
$userfile is the filename, the user entered.
Now you have to move the file from /tmp/ to your desired directory

$scom="mv "./tmp/delete_me." where_to_move_to";
$ret=system($scom);

HTH Oliver



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




[PHP] How to parse db-stored code

2002-03-20 Thread heinisch

Hi Folks,
I have stored several selects in a mysql-db,
it is possible to parse the answer, but I couldn´t remember how.
f.e.
the answer on a query is:
select * from somewhere where foo='$foo' and foofoo='$foofoo'
this is a string, what is the method to make the $foo-vars
"real" vars?

TIA Oliver


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




[PHP] Re:SOLVED [PHP] How to parse db-stored code

2002-03-20 Thread heinisch

At 20.03.2002  12:17, you wrote:
SOLVED !
> > I have stored several selects in a mysql-db,
> > it is possible to parse the answer, but I couldn´t remember how.
> > f.e. > the answer on a query is:
> > select * from somewhere where foo='$foo' and foofoo='$foofoo'
> > this is a string, what is the method to make the $foo-vars
> > "real" vars?
>
>i would say, you can either do
>  $val = $$whatYouGotFromTheDB;
>or
>  eval ( "\$val=".$whatYouGotFromTheDB );
>where $whatYouGotFromTheDB = '$foo';
>should work either way, good luck

Thanks for the quick answer, I meant eval().

Oliver


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




Re: [PHP] HTMLnetscape issue

2002-03-20 Thread heinisch

At 20.03.2002  13:11, you wrote:
>
>Hi,
>
>Sorry for repeating myself, but am lost and still can't find a solution
>to the following problem, I need to specify a background image for 
>like the code below:
>
>
>   
>
>
>This code works EVERYWHERE (in all browsers) but Netscape Navigator 4.xx
>versions.
UNTESTED
Try an $nbsp; inside as:
 
HTH Oliver


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




RE: [PHP] HTMLnetscape issue

2002-03-20 Thread heinisch

At 20.03.2002  13:38, you wrote:
>STILL DOESN'T WORK :(
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: 20 ÂÅÒÅÚÎÑ 2002 Ò. 13:29
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] HTMLnetscape issue
>
>At 20.03.2002  13:11, you wrote:
> >
> >Hi,
> >
> >Sorry for repeating myself, but am lost and still can't find a solution
> >to the following problem, I need to specify a background image for 
> >like the code below:
> >
> >
> >   
> >
> >
> >This code works EVERYWHERE (in all browsers) but Netscape Navigator 4.xx
> >versions.
>UNTESTED
>Try an $nbsp; inside as:
> 
Look at the code at:
http://www.rudis-motorcycle-store.de/m5.html
there I did what you want to do, I just tested it with NS451 and it works!
Also in NS405. I think you have to have to set height & width and the put
an transparent gif over it, have a look at the code.

James is wrong with his mail, sorry

HTH Oliver


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




Re: [PHP] Assignment operator proposal

2002-03-20 Thread heinisch

At 21.03.2002  00:36, you wrote:
>Hi all!
>
>I'd like to hear from a single one of you who isn't tired of code similar to
>
>  if (!$whatever) {
>$whatever=something;
>  }
>?>
>
>or else
>
>  if ($whatever)
>  {
>$somethingelse=$whatever;
>  }
>?>
>
>How about a new asignment operator which would shut up all those Python 
>enthusiasts - let's say the new operator would be caret - and we could 
>replace the first example with
>
>  $whatever^=something;
>?>

I think this is a nice idea for php8 (or some release, I´ll never have to use)
The main thing in using php is that it is close to c.
As there are so many new functions, some of them are not really necessary,
I would not prefer shortcuts like these. Who should help these guys, which
use these kind of abbrevations. We will get code like these "real C-freaks" 
make
when they get mad in optimizing.
Its always a walk on a sharp edge, optimizimg and readability.
For "compatibility" reasons, I would not like this kind of stuff.
and also, where can you write your comments
"old style"
if($whatever) // this option must be true
{
 do something; // this operation does something
} // end of whatever

"new style"
$whatever^=something // this option must be true an then it does something

(guaranteed to be more then 80 chars, have fun when reading this command
under production pressure at 0:30 at the box using ed)
oops I just wanted to add a comment, I find myself writing a book ;-)
Oliver


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




Re: [PHP] something weird is going on...

2002-03-20 Thread heinisch

At 20.03.2002  16:28, you wrote:
>
>Sorry bringing Netscape issue up again but I seem to have found
>something...

>And to illustrate the problem, here's the file:
>http://kulchitski.com/problem/
Hi Val,
for me it looks OK, no fault to see. (NS405,451,475)
I´d suggest, that you enclose your width and height values
in parentesis , so that they look height="100" width="200"
also all other values. I had problems with the NS4<6 family on
this.
Also the vals >topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"<
added to the body tag, make your left side notes look more real, as ther´s 
a cutted
left side.
HTH Oliver 


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




Re: [PHP] Apache

2002-03-21 Thread heinisch

At 21.03.2002  03:18, you wrote:
>Errmm... i don't know any apache groups, but
>if you want to do what you ask, just read the
>documentation, it's easy :-)
>
>jtjohnston wrote:
>>Anyone know of a good apache group?
>>I want to hide the structure of a directory when there is no idex.html
>>present 
>>J


IndexIgnore *.*  # ignores all files that match *.*
InexIgnore ..  # ignores the parent directory
#other directives

HTH Oliver


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




Re: [PHP] Re: Tool to remove comments??

2002-03-23 Thread heinisch

At 23.03.2002  00:05, you wrote:
>
>there's also two tools called sed and grep that are available on any unix
>system. and probably easily gettable on windblows.
>
>That can probably remove most comments.

I know, and use these on LINUX, but I don´t want to spend time to develop 
something
which is already made and tested. This will take a minimum of 6 hours dev.
I´m now in a position, where I cannot spend this time

>Why you would want to remove comments, I don't know.
>They are very useful in the future when fixing something or changing
>something.
>Good Code == Commented Code
>Well, Good Code is at least a subset of commented code ;)

That´s right, there are two versions of code, one for development,
the other, cleaned is on the production (ISP)machine. As I write a lot of 
comments in a source,
(Good Code == Commented Code ;) ) It could make more than 50% of the code.
As you maybe have read the posts on speeding up the processing of code 
(last week),
every line which is not necessary shouldn´t be read by the PHP-parser. I 
also found
that if you remove the LF (CR/LF) combination, there´s a time reduce, even 
this practice
is dangerous, especially for JavaScripts.

>If you don't want a customer to see them, use the Zend Encoder and hide
>all your source.

This makes need of php4* on the ISP, and I don´t want to encrypt the code, 
just clean it.
To encrypt, Enrico suggested a link http://pobs.mywalhalla.net/ which does 
this, free of charge.

Any other suggestions out there?

Oliver





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




Re: [PHP] oracle exec

2002-03-25 Thread heinisch

At 25.03.2002  15:10, you wrote:
>
>
>hi.. is there any way to use the php oracle function to check to see if
>there are any records in the selected set before calling ora_fetch?
>ora_exec doesn't error if ther are no records, and ora_num_rows doesn't
>return the numbe of rows in the set.,
>
>thanks!
>matt
Seems that there´s no short way,
just have a 'select count(your_id_col) from footable where ...'
This will bring the number of records.
As a tip, use this var to get your results in an for() statement,
as there is no way tho catch errors if you use while(..).
(OCI functions, PHP3)

HTH Oliver


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




RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread heinisch

At 25.03.2002  14:26, you wrote:
>
>Perhaps it is how I am calling the $lines in a while loop.?  I have tried
>`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array),
>system(), shell_exec().  None of them let me capture the STDOUT from the
>program.  There has to be a way to do this.   Anyone?
>
>Thanx
>
>exec()
>
>
>I just realized why nothing I was trying for the regular expressions wasn't
>working.  The command I am running is a C program on the command line of a
>Linux box.  I can't capture the output, it just gets output onto the screen.
>I just echo'd $output after the command was run and it was empty.  Any
>ideas?

even if think your output must come to $output,
an alternative, whenever not so elegant is
exec("your_program_name > tmp.file");
the output will be redirected '>' to the file tmp.file.
then you can open the file using the known fopen(*) command,
and read, processed conventional.
HTH Oliver


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




Re: [PHP] Loading Images

2002-03-26 Thread heinisch

At 26.03.2002  12:47, you wrote:
>
>I don't have any code for this, but I'm hoping someone can point me in the
>right direction. I want to load images or navigation menus dynamically. Is
>it possible to build a database of images and then use php to display
>them? Or something along these lines. I know this must be possible,
>becuase I see sites that do something like this, and I cant seem to right
>click the image and save it. Does this make any sense?
>Thanks.
>-Chris
Storing images in a db is not a good idea. instead store them
in your filesystem an have a reference to them in your db.
Then you can make everything ;-)

Even there´s no real security for grabbing pics. If your client can see them,
they are on his/her machine. To prevent the right-click, you have to use
JavaScript, but that only works, if the user has it switched on.
A little more secure is putting the pics in flash-movies. But I think there are
already programs out, which allow to extract pictures and componenets.
HTH Oliver


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




Re: [PHP] Getting QUALITY text on an image

2002-03-27 Thread heinisch

At 26.03.2002  23:56, you wrote:
>
>Here's the situation.
>
>I run the website for a macintosh user folding@home team.
>
>We are providing certificates for users who have done a signifigant amount
>of work for the team.
>
>I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write
>the username of the user on the certificate.
>
>Some of the more "artistic" mac users have noticed some pixelation on the
>text.
>I'm looking for a way to clean that up.
>
>Is there a way to use Postscript fonts with php?
>I looked at the ImageMagik php extension, and it looks like it is still
>quite early in development.

Yes there is
$font=imagepsloadfont("HVB.PFB"); /* Helvetica */
$font=imagepsloadfont("HVB.PFB"); /* Helvetica */
// Attention I had to load the font twice to get it run, don´t know if
// it´s necessary to do this today
/* A case around the text to get correct center alignment */
$coord=ImagePSBBox($str,$font,$f_size,$spacing,$tightness,$angle);
/* claculate center*/

for($i=4;$i<4;$i++)
{
   echo "$i=$coord[$i]\n";
}

$xpos= ($piclen - $coord[2]) / 2;
//floor($xpos);
$ypos= ($pic_h - $f_size) / 2 + $f_size ;
//floor($ypos);

ImagePSText($im,$str,$font,$f_size,$foreground,$background,$xpos,$ypos 
- 2,$spacing,$tightness,$angle,$aalias);


>I haven't used ImageMagik much, but would an exec() call to the real
>ImageMagick and then have php display what it does be a solution to this?
>(yes- I know exec() isn't as good as pure php but hey-)
>
>If you want to see it for yourself, look at the images produced by the
>usernames with links at http://macaddict4life.dhs.org/walloffame.php
>
>The source to the image generation is at
>http://macaddict4life.dhs.org/Certs/certificate.phps
>
>I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux
>Apache DSO)

>-=-=-=-=-=-=-=-=-
>Different matter, is there a way to pass the username to the php script
>from a hyperlink w/o needing a ?name=blah in the link?
>
>It would be cool if the script could just end in .jpeg opposed to
>.jpeg?name=blah
>(in that directory apache handled .jpeg as if it was .php)
I´m not shure, but this is not possible, just a directory.
Try it with a .htacess in your path.  


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




[PHP] Question on eval()

2002-03-27 Thread heinisch

Hi Folks,
I save an ascii-sentence, representing my vars and their values in the db
after I request them, I try to eval them.
here is what I get back from the db
$scar=\"3\";$anrede=\"Herr\";$pf_name=\"wert\";$pf_kontem=\"tzrtzetrz\";$pf_kontel=\"zuoioopöl\";$zeit=\"\";$pf_wt=\"löjlköjklö\";$sto=\"2\";
 
(values are just typed in ;-) )
then I try to eval them with

$tmpeval=$vars[1]; // $vars[1] is where the data is in my answer-array
eval ("\$tmpeval = \"$tmpeval\";");

after this ther should each var have it´s values like
$scar should be 3
$anrede should be Herr

I also tried
$tmpeval=stripslashes($tmpeval);
but that doesn´t work either.
Can anybody see my mistake, or is there any length-limit in eval ??

TIA Oliver 


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




[PHP] Question on eval()

2002-03-27 Thread heinisch

Hi Folks,
I save an ascii-sentence, representing my vars and their values in the db
after I request them, I try to eval them.
here is what I get back from the db
$scar=\"3\";$anrede=\"Herr\";$pf_name=\"wert\";$pf_kontem=\"tzrtzetrz\";$pf_kontel=\"zuoioopöl\";$zeit=\"\";$pf_wt=\"löjlköjklö\";$sto=\"2\";
 
(values are just typed in ;-) )
then I try to eval them with

$tmpeval=$vars[1]; // $vars[1] is where the data is in my answer-array
eval ("\$tmpeval = \"$tmpeval\";");

after this ther should each var have it´s values like
$scar should be 3
$anrede should be Herr

I also tried
$tmpeval=stripslashes($tmpeval);
but that doesn´t work either.
Can anybody see my mistake, or is there any length-limit in eval ??

TIA Oliver


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




RE: [PHP] Question on eval() SOLVED

2002-03-27 Thread heinisch

At 27.03.2002  10:54, you wrote:
Rick thank you,
the problem wasn´t ' ', but stripslashes.
The data come from a database, so no ' s come with them.
That´s good to see, if you send selects via terminal directly to mysql.
Thanks again
Oliver
>
>Note that vars[1] is created with ' ' so that the $-names are not
>interpreted.  I assume that when the text is read from the file, it comes
>with the $s and the ending semi-colon (;).
>
>$vars[1] =
>'$scar=\"3\";$anrede=\"Herr\";$pf_name=\"wert\";$pf_kontem=\"tzrtzetrz\";$pf
>_kontel=\"zuoioopöl\";$zeit=\"\";$pf_wt=\"löjlköjklö\";$sto=\"2\";';
>print $vars[1]."\n\n";
>
>$xx = stripslashes($vars[1]);
>print $xx."\n\n";
>
>$tmpeval=$xx; // $vars[1] is where the data is in my answer-array
>eval ($tmpeval);
>print $scar;
>?>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, March 27, 2002 10:34 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Question on eval()
>
>
>Hi Folks,
>I save an ascii-sentence, representing my vars and their values in the db
>after I request them, I try to eval them.
>here is what I get back from the db
>$scar=\"3\";$anrede=\"Herr\";$pf_name=\"wert\";$pf_kontem=\"tzrtzetrz\";$pf_
>kontel=\"zuoioopöl\";$zeit=\"\";$pf_wt=\"löjlköjklö\";$sto=\"2\";
>(values are just typed in ;-) )
>then I try to eval them with
>
>$tmpeval=$vars[1]; // $vars[1] is where the data is in my answer-array
>eval ("\$tmpeval = \"$tmpeval\";");
>
>after this ther should each var have it´s values like
>$scar should be 3
>$anrede should be Herr
>
>I also tried
>$tmpeval=stripslashes($tmpeval);
>but that doesn´t work either.
>Can anybody see my mistake, or is there any length-limit in eval ??
>
>TIA Oliver
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Deleted Files

2002-03-27 Thread heinisch

At 27.03.2002  14:27, you wrote:
>
>It seems that in using the PHP delete file function, I have inadvertently
>deleted the root folder instead, waxing the majority of my PHP files.  Is
>there a recovery mechanism on Windows or am I getting burned by playing with
>fire?
>
>J
Look in your "wastebin" or how this is called in english, sould be on your 
Desktop,
If there are not the files you´re looking for, your burned.
But you have a backup ! Don´t you ?
HTH Oliver


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




Re: [PHP] HELP PLEASE!

2002-03-28 Thread heinisch

At 27.03.2002  21:20, you wrote:
Even if I didn´t read your code exactly, the fault is
the do while loop
replace it with something like this
while ($row = mysql_fetch_array($result))
{
 for($i=0,$i < count($row);$i++)
 { // add something to make it fancy like a table or so
 echo $row[$i];
 }
}
in php4* there is something like foreach, which I do not exactly know
HTH Oliver
>Hello,
>
>My problem is I have a form that submits it info to a mysql table, well 
>then I
>have a page that calls it from the mysql table and displays whatever is in 
>the
>mysql table. So, what script do I use to make it display multiple entrys?? 
>Here
>is the code:
>
>---
>
>$title = "Powder Basin Motocross, INC. | | Rider Profiles";
>include('header.php');
>$conn = @mysql_connect ("host", "un", "pw")
> or die("Coudn't connect to the MySQL server.");
>mysql_select_db (pbmi_riderprofiles)
> or die("Couldn't the select MySQL database.");
>?>
>
>:: Rider
>Profiles ::
>
>
>
>Add your profile
>
>
>
> First
>Name:
>mysql_query ("SELECT * FROM riderprofiles first_name"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["first_name"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
> Last
>Name:
>mysql_query ("SELECT * FROM riderprofiles last_name"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["last_name"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
> D.O.B:
>mysql_query ("SELECT * FROM riderprofiles dob"); if ($row = mysql_fetch_array
>($result)) { do { echo $row["dob"]; } while ($row = mysql_fetch_array
>($result)); } ?>
>
>
> City:
>mysql_query ("SELECT * FROM riderprofiles city"); if ($row = mysql_fetch_array
>($result)) { do { echo $row["city"]; } while ($row = mysql_fetch_array
>($result)); } ?>
>
>
> State:
>mysql_query ("SELECT * FROM riderprofiles state"); if ($row = 
>mysql_fetch_array
>($result)) { do { echo $row["state"]; } while ($row = mysql_fetch_array
>($result)); } ?>
>
>
> E-
>mail:
>riderprofiles email"); if ($row = mysql_fetch_array($result)) { do { echo $row
>["email"]; } while ($row = mysql_fetch_array($result)); } ?>
>
>
> Dirt
>Bike:
>mysql_query ("SELECT * FROM riderprofiles dirt_bike"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["dirt_bike"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
> Class:
>mysql_query ("SELECT * FROM riderprofiles race_class"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["race_class"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
> Years
>Riding:
>mysql_query ("SELECT * FROM riderprofiles yr"); if ($row = mysql_fetch_array
>($result)) { do { echo $row["yr"]; } while ($row = mysql_fetch_array
>($result)); } ?>
>
>
> Favorite
>Track:
>mysql_query ("SELECT * FROM riderprofiles favorite_track"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["favorite_track"]; } while 
>($row =
>mysql_fetch_array($result)); } ?>
>
>
> Sponsors:
>mysql_query ("SELECT * FROM riderprofiles sponsors"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["sponsors"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
> Injuries:
>mysql_query ("SELECT * FROM riderprofiles injuries"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["injuries"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
> Comments:
>mysql_query ("SELECT * FROM riderprofiles comments"); if ($row =
>mysql_fetch_array($result)) { do { echo $row["comments"]; } while ($row =
>mysql_fetch_array($result)); } ?>
>
>
>
>
>
>Add your profile
>
>
>
>include('footer.php');
>?>
>
>---
>That will only display one entry... how do i make it display all the entrys??
>Thanks!!
>
>
>-Sean
>Kennedy
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Need some help on security with php and mysql

2002-03-28 Thread heinisch

Did you restart mysql ?
could you see your entrances when using mysql on console
with master/masterpassword?
Oliver
At 28.03.2002  10:37, you wrote:
>Hello all,
>I am using php and mysql with phpmyadmin. I am trying to set up a username 
>and password in mysql so that when I use
>if(!$db_conn = mysql_connect('localhost', 'username', "password")) {
>  echo 'Could not connect to the Database Server';
>}
>with the correct username and password it will connect me. I used 
>phpmyadmin to add the user to the users table in the mysql database. I 
>used the following sql statement:
>INSERT INTO user (Host,User,Password) 
>VALUES('localhost','jeffrey',PASSWORD('biscuit'));
>and the record was created in the table.
>When I try to connect to the db via the php
>if(!$db_conn = mysql_connect('localhost', 'jeffrey', "biscuit")) {
>  echo 'Could not connect to the Database Server';
>}
>it tells me:
>Warning: Access denied for user: 'jeffrey@localhost' (Using password: YES) 
>in /home/httpd/htdocs/helpdesk/test.php
>
>What have I done wrong?
>cheers
>Hamish


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




Re: [PHP] Question about database-driven web sites.

2002-03-29 Thread heinisch

At 29.03.2002  10:22, you wrote:
>Hello,
>
>What will a database-driven web site do for? How does it releive stress on 
>me?
>What is it good for? Why should I learn it? Thanks,
Think of a template,
You set up a design , and put database data in it.
If you have any changes on your website, you´ll change some parameters in the
db and the whole site works with these new values.
Also If you develop for customers, you can have the final site in your db and
just switch on/off some "extras" on customers demand with just a few clicks.
There are a lot of reasons why to use it, but for me these are the main 
reasons.
Small work, big effort.
HTH Oliver


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




Re: [PHP] not about php... about server for php .. its apache question if anybody feelin like answering , thanks

2002-04-03 Thread heinisch

At 03.04.2002  01:59, you wrote:
>
>Hey [EMAIL PROTECTED],
>
>   Im new at this so i got some problems that i would like to solve.
>   First i have Linux Debian 2.2.19 version running on my poor server
>   :) and i installed apache web server...everything goes well... i can
>   access peoples websites like this Http://localhost/~user/ but
>   uploading is terrible. Because you have to send though SSH. I wanted
>   to do FTP server but i don't know how to do it.. i looked at some
>   manuals of apache and didn't fount how to do like this:
>
>   user goes to ftp://localhost/ then he writes his user name and
>   password and he can access his public_html folder to upload files or
>   delete them. How to do this thing? is there some tutorials that i
>   couldn't find? or anybody can help me directly? i would appreciate
>   it.
Did you install a ftp-server , and is it running?

If your clients are window based
If you do, you can use f.e. wincommander (www.ghisler.com)
to connect and send/receive/delete data.

Or you build a php page, which let the people store their webpages
inside the webserver.
About storing pages, there has been a thread, last week or so.

About ftp  you could look at www.xbill.org/sftp/ for a secure ftp.
But have a look first on linux.org or somewhere what about
security. Ftp on your server makes a big hole ;-)


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




Re: [PHP] Can't AddType .htm

2002-04-03 Thread heinisch

At 02.04.2002  23:44, you wrote:
>I run Linux, Apache and PHP4.06.
>I want PHP to parse .htm documents.
>I have done this before on other servers with no problem by editing the
>following line in my httpd.conf.
>
>AddType application/x-httpd-php .htm .php .php4 .php3
>
>But after restarting it doesn't do anything.
>.php files still work and .htm files don't work.
>If I try other suffixes other than .htm say ".dog" for example that works.
>So it seems something elsewhere is over riding it.
>Anyone got any suggestions.

should work, do you have something like .htaccess enabled which overrides 
these settings
My httpd.conf has every AddType on a separate line.
Are these .htm pages in a directory which is available to apache/php -> 
'rights'
HTH Oliver


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




Re: [PHP] auto submit

2002-04-03 Thread heinisch

At 03.04.2002  11:22, you wrote:
>
>Is the folowing possible to do?
>
>I fill in a form and press submit.
>Then I read a record from a database. With this data it submits to the 
>read submits url. After 10 seconds, it reads the next record and submits 
>that data. etc etc
>
>So I don't have to push submit each time I want to submit. After 10 
>seconds it read the next record and submits again.
>
>Could this be done? So yes, how?
>

You can do this, if your clients browser has JavaScript enabled.
Then you could use JavaScript -> www.javascript.com.

And again, PHP is on your server and is not able to push something to your 
client
except he/she asked for it (that´s why you have to use JavaScript).

To get your page refreshed (thi only askes about a new copy of your page)
you could use header() or a metatag  like

You can place this meta anywhere in your code (BUT that´s not html-conform, 
but works on the main
browsers, (don´t know about NS 6 and mozilla))
HTH Oliver


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




Re: [PHP] FAQ (again) ... we have a plan!

2002-04-03 Thread heinisch

At 03.04.2002  12:08, you wrote:
>I'm getting a bit interested in this; here's how I
>suggest we proceed.



>+ introduction to php.net
>   charter - the purpose of this newsgroup
>   posting guidelines and etiquette
> be specific
> be terse
> descriptive subject
> include exact error messages
> include code no more than N lines, else give URL
> be polite
> be thankful - no-one HAS to help you

look which OS you are using and choose the right list

> don't cross-post
> don't multi-post
> don't spam
>   how to subscribe / unsubscribe to the newsgroup
>   how to subscribe / unsubscribe to mailing lists
>   reference to archives
>   reference to php.net manual
>
>+ quick overview of the language
>   what is PHP, short history
>   most recent version
>   where to download
> refer to installation instructions
>   terminology/jargon?
>   refer to php.net manual
>   refer to tutorials
> http://www.zend.com/zend/art/intro.php
> http://hotwired.lycos.com/webmonkey/programming/php/

For Germans HTML -> http://selfhtml.teamone.de/
PHP -> http://www.selfphp.info/index.php
I think this pages are well made, I´m not affilated with one of the authors ;-)

>   what else I should learn
> HTML, JavaScript, CSS, SQL -> links
>
>+ installation, recompilation, configuration
>
>+ "name this function"

search code snippets to common problems

>   quick searchable function list with keywords, short
> descriptions,  maybe very short examples, and links
> to appropriate php.net manual page
>
>+ advanced language questions
>   what is a good development environment
>   page redirection
>   browser refresh / timeout
>   I keep getting "headers already sent"
>   how to print a number with leading zeros
>   how to interact with JavaScript
>   the difference between include() and require()
>   playing with arrays
>   playing with tables
>
>+ forms, sessions, user authentication, cookies
>   how to authenticate users
>   playing with forms
>   how to pass values from one script to another
>   how to initiate a session
>   how to terminate a session
>   counting current users
I think this should be a single point
+ dealing with sessions and/or cookies
... as you wrote above

>+ php+database
>   refer to mysql.com
>   how to query a database
>   how to get a limited number of rows
>
>+ email
>   how to validate an email address
> http://www.zend.com/zend/spotlight/ev12apr.php
>   sending email
> refer to RFCs
> plain text
> HTML
> multipart MIME
>   processing email ie w/ procmail

But this list shows the absolute structure ?!
Otherwise, there are too many points to scroll.

The method, Miguel suggested, getting on the list
with activly acknowling the FAQ, will be a good idea.

I´ll be onboard, if there´s any solution in sight,
giving my 2 cent (or what was the acronym?)

Oliver



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




Re: [PHP] Authorize.net

2002-04-04 Thread heinisch

At 04.04.2002  03:03, you wrote:
>I know that this is way off topic, but I was wondering if someone could help
>me. I couldn't think of anywhere else to look for info. So here are my
>questions. If someone could help me out or point me in the direction of a
>good resource I would be very grateful. But here goes.
>I just started setting everything up with Authorize.net. I've set it up to
>send all of the information correctly to Authorize.net, but I had some
>questions about the relay script that recieves the information. How am I
>supposed to handle the times when x_Response_Code doesn't equal 1?

I don´t know about authorized.net, only that I cannot access them ??
But that´s not the answer

>  How do I
>get it so that the input fields reappear? On most sites they pop back up if
>an invalid credit card number is entered or any other error, but on mine it
>doesn't.

If you only send some data to authorized.net
You have to store the data, your clients entered in some, connected by a 
cookie or session,
file, or db. When the data has to be showed again, you select the 
cookie/session
and take the data from file/db to show again. Your form looks like:

 echo '';
 }
 else
 {
 echo '>';
 }
 ... other fields


>Do I have to set up the fields myself or is there something I can
>do to make it reput them all back on the page? Also when it's approved and
>goes through the user can keep hitting refresh and it charges them multiple
>times and sends them an email each time. Is this just because I'm in test
>mode or is there something I can do to prevent this? Thanks a ton,

Look in the list, this questions was asked some times ago.
For a little help, store a value, which is connected to your clients pay-page.
if this f.e. hidden value is send again, the client clicked twice.

BTW I wouldn´t store any creditcardinformation in the file/db for sec. reasons.
And delete the other informations, after the deal is complete.

HTH Oliver



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




Re: [PHP] checkbox doesn't pass?

2002-04-04 Thread heinisch

At 04.04.2002  15:23, you wrote:
>
>
>I have a html form with some "text" (T1) and "checkbox" (C1) fields to pass
>it to a php script.
>
>Accessing "text" fields has no problem.
>
>There is a problem when I use
>$C1=$HTTP_POST_VARS['C1']
>to take the value of C1 (ON)
>If it is not checked, then it is not set at all. (??why??)
>So I use :
>if (!isset($C1)) { $C1="0" }
>but still I get an warning that C1 is not set, on my screen.
>That happens before the use  of isset function.
>How can I susspent this warning message?
Makis,
why do you use $HTTP_POST_VARS? Do I miss something?
if you have a form and send it, the vars have the same names as in your
form, will say if your checkbox name="foo" value="someval" will be transmitted,
then in the following page there´s a var named $foo. and the value will be 
"someval"
if the box is checked, otherwise there´s no (or NULL or FALSE ???) value in it.
I personally prefer put checkbox vars (if there are several) in an array 
f.e. $foo[]
In the following page I just scan the array and if there´s a value in a field
thats fine.
HTH Oliver


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




Re: [PHP] php_oci8 Lib on win32

2002-04-04 Thread heinisch

At 04.04.2002  18:05, you wrote:
>
>Hi all, I'm new to the list (and php too...)
>I noticed that using the binary distribution of php_oci8.dll with oracle
>8.0.5 leads to an error becouse of the lob functions (not supplied with
>8.0.5 oci or not implemented in oracle 8.0.5 ?), so that I had to recompile
>the lib putting somewhere in php_oci8.h
>#undef HAVE_OCI8_TEMP_LOB
>
>This manner I have an oci lib without lob functions (I don't know what they
>are (large object bxxx ???), so maybe I don't need them...).
>
>I'd like to know if I'm doing well or the oci lib are supported only using
>oracle 8.1.7 client. I didn't find anything in docs or src.
>Tx,
>andrea
Wrong List,
check out http://metalink.oracle.com
maybe they could help you. Or as everywhere noted "google is your friend"
Oliver 


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




RE: [PHP] session variables

2002-04-04 Thread heinisch

At 04.04.2002  13:18, you wrote:
>Apparently under the bug report database for bug number 16043, my
>exactly problem was described.  According to the PHP team, this
>windows/apache1.3.23/php4.1.2 session not writing to file bug has been
>fixed in the 4.2.0RC1 binaries.  I've patched my php4apache.dll with the
>ones from 4.2.0RC1 AND it still doesn't work!!!  Anyone who used
>4.2.0RC1 came across this problem and made it work?


>This isn't limited to windows 2000, I've seen it on nt and xp as well.
>I
>believe it is just a php on windows bug in general.  I've heard 4.1.1
>was
>not broken however 4.1.1 has a security hole, if you are just using
>windows
>as a test/development platform you may consider trying 4.1.1.


You´re on the wrong list, windowsPHPuser is the right one!
This is php-general.
HTH Oliver


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




Re: [PHP] Removing Properties from Word DOC

2002-04-04 Thread heinisch

At 04.04.2002  13:34, you wrote:
>
>I need to alter the document properties of Word DOCS that our users
>upload via php.  Does anyone know how to do this?  (I am running PHP on
>a Linux box).
>
>David
There´s a program out in the internet, which converts .doc to txt,
also .xls to txt you can download an install them,
"google will be your friend"
this can be called with exec(), system(), passthru()
HTH Oliver


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




Re: [PHP] PHP and mySQL...

2002-04-04 Thread heinisch

At 04.04.2002  18:39, you wrote:
>Using MS Windows 98, Apache, PHP and mySQL.
>
>I've installed Apache on my hard drive to test a database driven website
>using PHP and mySQL.
>
>Could somebody lead me through the steps if I want to continue using the
>mySQL database and PHP when the site goes live and the files are uploaded
>and published to my ISP's server?
>
>Is this possible?
I´m not shure what your question is,
but I suppose you mean "how do I get the data from the production machine
to my local server".
If this is what you want, easiest way is to install mysqladmin 
->http://phpwizard.net/projects/phpMyAdmin/
and make a datadump, which can be put in you local db using mysqladmin.
The other way could be:
make a page, where you select the content of the database, specially only 
new data (since you got it online)
create a .csv, pack it and send this file to your personal server, or your 
personal account, as attachment.
then you can do whatever you want with this file. Or change to LAMP and 
have some fun with scp,
if your ISP allows this.
HTH Oliver


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




Re: [PHP] Can I use php to " Print " a document?

2002-04-05 Thread heinisch

At 05.04.2002  14:26, you wrote:
>Is there any functions or command that I can print out a page or a document
>without using the browsers' print?
If you have compiled php as standalone (I think it´s called the cgi)
you can use the exec("lpd docname"), if you have a printer on your box, or 
in your
network.
If you want to do this on the clients(surfers) machine, you have to use the 
browser
and JavaScript, as you are 'only' sending a html-page.
HTH Oliver


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




RE: [PHP] mysql_fetch_array()

2002-04-05 Thread heinisch

At 05.04.2002  12:31, you wrote:
>
>Jason,
>
>This is for an events calendar, I want all the dates form the db but when I
>am generating the individual days for the calendar I need to know whether
>there is an event for that day, hence pulling out all the dates from the db.
>As I am looping through all the days in a month to dynamically create the
>calendar, I do not want to loop through the entire recordset to look for a
>date for that day in each iteration. Does your method find any row in the
>recordset with a given date?

As I understand your problem, I would suggest, that you just select the days
in the month, where there are events
f.e. select count(ref#) from DB where date 'inside your scope' and events 
'are there events'
this gives you the number of lines.
If there are any, you could ask more detailed, using the informations stored.
If there are no events, make the calendar as normal.
Thats also a good explanation for the column ref# (autoincrement, unique)

Even you only have to deal with one select, and can order your result, so 
that it makes
you no pain showing them


>I am at present exploring the possibility of creating individual arrays for
>each row in the recordset using the date as the name of the array, then
>testing to see if it exists. That way I can check for the existence of a
>given date at any point in my code and reference the associated values
>without looping through the recordset each time. My code is as follows...
>
>while ($row = mysql_fetch_assoc($events)) {
> $a = "date_" . $row["event_date"];
> $$a = array($row["event_id"], $row["event_title"]);
>}

Here the select could be
Assuming you have the DB´s 'event_ref ' where 'event date' and 'event 
reference number' put in
and 'event_content' where other useful informations are stored
selct a.event_title, from event_ref a, event_content b where b.ref = a.ref 
and a.date='2002-04-15'
No dealing with arrays and var_vars, just straight sql.

HTH Oliver

>if ($date_2002-04-15) { do_something(); }
>
>Any comments will be greatfully received.


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




Re: [PHP] regular expressions: HUGE speed differences

2002-04-06 Thread heinisch


PIII 400MHz, 512Mb, SuSe 6.4, 2.2.14 smp, php 3.0.16, Completed in 
0.76187908649445 seconds
PIII 350MHz, 256Mb, Suse 7.3, 2.4.9, php 4.0.6, Completed in 
2.6342689990997 seconds
File Size:28537kb,
But for "real tests", send the original file you use direct

BTW How the hell did you develop this monstrous eregi?
For better maintenance, I´d cut it in several pieces,
or first make the inputfile smaller using grep " a href" > to test.file , 
This will reduce
fileaccess a lot, and takes microseconds to proceed.
Oliver
At 06.04.2002  15:01, you wrote:
>
>Im using a regular expression, to get all urls from a file.
>When using it on the webserver, it processes a 25kb html file
>about 0.25 seconds (PIII 350, 128mb ram, linux 2.2.13-7mdk, php 3.0.12).
>
>When i try the same on my machine (Celeron 300A, 192mb ram.), it does it
>about 14-17 seconds, which is about 60-70 times slower.
>Tested it on:
>redhat 7.2, php 4.1.1 - 16 seconds
>windows 98, php 4.1.1 - 14 seconds
>windows 98, php 3.0.12 - 17 seconds.
>
>The machine speed differences arent that big, especially considering
>that other(simpler) regexps run at the almost the same speed (20-30%
>difference).
>
>Where can this enourmous speed difference come from


Anyone care to test it on there machine? Full code (20 lines) with
>timing function would be:
>function getmicrotime(){
> list($usec, $sec) = explode(" ",microtime());
> return ((float)$usec + (float)$sec);
> }
>//change to some html file around 25kb in size
>$lines = @file('test.html');
>if (is_array($lines))
> {
> while (list($id,$line) = each($lines))
>$file .= $line;
>}
>
>$start_time=getmicrotime();
>
>while
>(eregi("(]*src[[:blank:]]*=|href[[:blank:]]*=|http-equiv=['\"]refresh['\"]
>*content=['\"][0-9]+;url[[:blank:]]*=|window[.]location[[:blank:]]*=|window[.]open[[:blank:]]*[(])[[:blank:]]*[\'\"]?(([[a-z]{3,5}://(([.a-zA-Z0-9-])+(:[0-9]+)*))*([:%/?=&;\\,._a-zA-Z0-9-]*))(#[.a-zA-Z0-9-]*)?[\'\"
>]?",$file,$regexp))
>  {
>  print $regexp[2]."\n";
>  $file=str_replace($regexp[0], "", $file);
>  }
>$end_time = getmicrotime()- $start_time;
>print "Completed in ".$end_time." seconds";
>?>


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




Re: [PHP] F/U on Returned Mail

2002-04-06 Thread heinisch

At 06.04.2002  08:33, you wrote:
>In line 6 (below) I tried both "Return_Path:<[EMAIL PROTECTED]>" and 
>"[EMAIL PROTECTED]". I still don't get back the e-mail sent to a 
>non-existent address.
>
>Can you help?
>
>
>(1) (2) mail("[EMAIL PROTECTED]",
>(3) "Test",
>(4) "Test",
>(5) "From:SBW Research <[EMAIL PROTECTED]>\r\n".
>(6) "[EMAIL PROTECTED]\r\n");

try "Reply-To: [EMAIL PROTECTED]\r\n");

>(7) exit;
>(8) ?>
Maybe you should replace \r\n by a single \n (only a suggestion as I work 
on LAMP, never dealed
with \r\n, but never had probs)
HTH Oliver


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




  1   2   >