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




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] 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] printing in HTML or PHP

2002-03-18 Thread Oliver Heinisch

At 18.03.2002  16:57, you wrote:
>I would like to print the line bellow on my HTML generated by a PHP file.
>How can I do it?
>
>The line is:
>
>
>Thank you
>
>Daniel Ferreira Castro
Your line should be between  and 
the you could use
echo '';
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] PHP session ID not unique or session_register problems

2002-03-18 Thread Oliver Heinisch

At 18.03.2002  14:54, you wrote:

Even if I did´nt look closely at your code, I would suggest, that
you decrease the amount of data, diferent tables to one table.
You set an cookie, therfor you have the same effect as if you use sesssion 
vars.
So it´s easy to set and find the data, via cookie.
f.e.
table:
cookie   // here the initial cookie, you sent is stored
varname  // what kind of information should be stored
varval // the value of the varname.
timestamp // if you like
now you can save all desired informations according to cookie, have them all
in one place, and can select them to different conditions.
But, what if the user doesn´t allow cookies ??
>
>Hi!
>
>I am a kind of newbie in PHP programming, but I have found an interesting
>problem and some php guys I know were unable to help me to solve it. So I am
>coming here with my question...
>
>I have written a little more advanced counter, which should be included in
>other PHP scripts in website.
>It uses cookies, which expire in one year. That helps me to determine which
>users are coming back to the website. It also uses sessions (session
>cookies) to detect how one user is moving in the website in one session.
>Program uses three MySQL tables - table of cookies (cookie ID, number of
>visits), table of sessions (session ID, cookie ID, IP, browser,...) and
>table of visited subpages in the website (session ID, visited location).
>
>The program flow is simple:
>1. Check the cookies. If user do not have a cookie, send it to him. Else
>find cookie ID in the database (first table) and increase the counter.
>2. Check session ID. If session is not registered, register it and set
>'number of session visits counter' to 1, AND save session ID (+ cookie ID,
>IP,...) to the second MySQL table.
>If session is already registered, just increase the session visits counter.
>3. Save session ID and visited location (I use the $REQUEST_URI variable) to
>the third MySQL table.
>
>It seems OK, but see what happened.
>I explicitely said that if ($sess_visits == 1), variable $sessid is saved to
>the second table. That means that $sessid must be unique - it should appear
>in a table just once.
>But when I exported data from table, I found that some $sessid appeared
>twice or three times!
>
>What could be the problem???
>
>See a little bit of my code:
>
>   ini_set("session.cookie_lifetime", "0");
>
>   // Initialize session
>   session_start();
>
>   // Register session and set number of session visits variable to 1
>   if (!session_is_registered('sess_visits')) {
>   session_register('sess_visits');
>   $sess_visits = 1;
>   }
>   else {
> $sess_visits++;
>   }
>
>   if ($sess_visits == 1) {
>...
> // Save session, IP, etc. into database
> $sql = "INSERT INTO wc_sessionident SET sessid = '$sessid', ...";
>...
>   }
>
>bye, Matej
>
>
>--
>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] 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] 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] OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?

2002-03-17 Thread Oliver Heinisch

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


--
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] 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] 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] 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] 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] 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] 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] SERVER INFO

2002-03-15 Thread Oliver Heinisch

At 16.03.2002  01:41, you wrote:
>
>Hi all,
>
>I appologise if this is off topic but I don't know who to ask. I hope
>you guys don't mind.
>
>Does any body know where I can find information about the steps of
>setting up a server(LINUX) so that people can find a certain URL
>address?
>
>I want to sent up a small server for myself from home with my machine
>but I don't know how to make it so that the web pages that I put in
>my
>server accessable by other people around the world.
>
>do I have to connect my modem into my phone line (online) all the
>time
>or...???
It sounds, as you are a "newbe". Setting up a linuxbox is one thing,
getting it in the internet is another.
Better way is to look for a provider (maybe free, or free & php)
to put the pages there. That´s cheaper then having the linuxbox be connected
to the internet via a phone-line. (mh.. what about an IP ?)
If you want to do PHP, set up a linux server as described in the link (see 
th other reply)
test your stuff "locally" and when you´re ready put them on the provider´s 
machine.
You´ll save a lot of money and time.
look in the archive for "free php spaces".
HTH 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] Problems with TTF

2001-10-24 Thread Oliver Heinisch

At 24.10.01  12:37, you wrote:
>Warning: Could not find/open font in
>/sdr/httpd/Prisa/DATA/private/libs/graficos/intradia.php on line 57
>
>Line 57: ImageTTFText ($O_imagen, 11, 0, 10, 20, $O_colorValor,
>"arial.ttf",$s_Valor);
>
>arial.ttf is into the same dir.
>
>Any ideas?
I had the same problems while using postscriptfonts.
try this
$font=imagepsloadfont("YOUR.FONT");
you have to look for a substitution for imageepsloadfont maybe it´s 
imagettfloadfont();
- and you have to do this command TWO times. Don´t ask me why, but it works ?!
Hope this helps 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] str_replace binary safe??

2001-10-22 Thread Oliver Heinisch

At 22.10.01  21:36, you wrote:
>
> > Hi folks,
> > following problem appeared on PHP 3.0.16 on LINUX
> > I have a binary file, where I want to replace some letters
> > I do the following:
> > $filename = "xyz.sdc";
> > $fd = fopen( $filename, "r+b" ); // also tried "r"
> > $x=filesize( $filename ); // this shows the correct filesize 22528 byte
> > $contents = fread( $fd, $x );
> > fclose( $fd );
> > $y=strlen($contents); // The first mistake $y = 32956 byte
> > echo "BEFORE".$contents;
> > $contents=str_replace("UU","123456", $contents);
> > echo "AFTER".$contents;
> >
> > It seems, that php converts HEX 00 00  to HEX 5C 30 just when it reads the
> > data in
> > memory because at the BEFORE echo the data will be shown as \0 (hex 00 
> 00 ).
> > The filesize will be correct when I save the str_replaced text and the 
> text
> > will be cahnged
> > correct.
> > Any idea, where this comes from??
>Let's start with the fopen(), where the mode expression might be causing 
>problems - should it be "rb"?
>http://www.php.net/manual/en/function.fopen.php
>
>If the 'binary' component hasn't been recognised it might explain the 
>"first mistake".
>The ensuing problems may even stem from there...

Thanks DLNeil,
I tried "rb" "r" "r+b"(C-style) always the same :(
Any other suggestions ?


-- 
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] str_replace binary safe??

2001-10-22 Thread heinisch

Hi folks,
following problem appeared on PHP 3.0.16 on LINUX
I have a binary file, where I want to replace some letters
I do the following:
$filename = "xyz.sdc";
$fd = fopen( $filename, "r+b" ); // also tried "r"
$x=filesize( $filename );   // this shows the correct filesize 22528 byte
$contents = fread( $fd, $x );
fclose( $fd );
$y=strlen($contents);   // The first mistake $y = 32956 byte
echo "BEFORE".$contents;
$contents=str_replace("UU","123456", $contents);
echo "AFTER".$contents;

It seems, that php converts HEX 00 00  to HEX 5C 30 just when it reads the 
data in
memory because at the BEFORE echo the data will be shown as \0 (hex 00 00 ).
The filesize will be correct when I save the str_replaced text and the text 
will be cahnged
correct.
Any idea, where this comes from??

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




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




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] Working with numbers

2001-05-03 Thread Oliver Heinisch

At 01:39 04.05.01 -0400, you wrote:
Ok Jennifer lets do some "basics" ;-)
>I've done some searching on the php site for more info about
>double and float etc, but I don't really understand anything I
>found.  Can someone give me an explanation about the difference
>between decimal, float, double?

decimal is a straight number f.e 123456 the size/length of this number 
belongs to the used hardware/compiler (normally 64bit???)
it could be "signed" so it could be -123456 or +123456
float is a number like 123,456 or 0,123456 size/signed  see above
double is also a number like float but with the double size (normally 128 
bit ??)


>Should I be using decimal as my column type in the MySQL database
>or should I be using a different column type?

If you want to store float numbers like prices or so you could use 
float(M,D) where M ist the langth of all numbers
and D is the number of the fraction(is that word right) I mean what´s 
behind the "," .
Look in the manual of mysql "datatypes" to get more information about 
numbers and other interesting
datatypes.
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] 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] 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] 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]




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




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]




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




<    1   2