[PHP] Error message trying to include a file

2003-12-01 Thread Matthias Wulkow

Hi php-general,

I have an array filled with urls of javascript files and then I
include them one by one in a loop.

for( $i = 0 ; $i  sizeof($this-page-javascript) ; $i++ ){

 include($this-page-javascript[$i]);
 //This line above is line 52 shown on error warning
}

When I had only two files to include it worked. Now I added a third
and I get following error message:

Notice: Undefined offset: 2 in /usr/local/www/ViewPageClass.php on line 52

Warning: writehead() [function.writehead]:
Failed opening '' for inclusion (include_path='.:/usr/local/lib/php')
in /usr/local/www/ViewPageClass.php on line 52

I don't really know what to do,the function writehead doesn't seem to
exist... the javascript file is
http://pajhome.org.uk/crypt/md5/md5.js. I suppose it's free of
errors...

SvT

-- 
Who is the ennemy?

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



[PHP] Error message trying to include a file

2003-12-01 Thread Matthias Wulkow

Hi php-general,

sorry for the post before, forget the sentence about the writehead
function. It means writeHead() (error Warning doesn't seem to be case
sensitive...). It's the name of my method... :-(
But it has nothing to do with the error itself...

SvT

-- 
Who is the ennemy?

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



Re: [PHP] mail() php in message

2003-10-12 Thread Matthias Wulkow
Hallo Onno,

am Sonntag, 12. Oktober 2003 um 20:07 hast Du Folgendes gekritzelt:

OK Hi,

OK is there a way to create a mail (with the mail() function) that contains 
OK   php in the message.

OK Like:

OK ?php
OK $to  = [EMAIL PROTECTED];
OK $subject = a subject;
OK $message = 

OK I WANT TO PUT SOME PHP IN HERE TO CREATE A TABLE IN THE MESSAGE:

OK $columnbooks = mysql_list_fields($dbname,tmp,$mysql_link);
OK $sqlbooks = select isbn,books.title, writer, publisher from tmp,books 
OK where tmp.user=books.user;
OK $resultbooks = mysql_db_query($dbname,$sqlbooks);
?
OK table cellpadding=2 cellspacing=2 border=1 style=text-align: 
left; width: 100%;
OK ?php
OK while   ($valuebooks = mysql_fetch_array($resultbooks))
OK {   print tr bgcolor=#ccf504;
OK  for($i=0; $i 4; $i++ )
OK  {
OK  $gebruikerbooks=$valuebooks[$i];
OK  print td $gebruikerbooks /td;
OK  }
OK  print /tr;
OK }
OK mysql_free_result($resultbooks);

OK THIS SHOULD BE THE END OF THE MESSAGE
 

OK HERE I WILL DO THE MAILING

OK mail($to,$subject,$message);
?


You should know that php runs on a server, not on the client machine. So what do you 
want to
do with php-code in a mail? You could put html (generated by php for
example), so that the mail-reader can display a table.


SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



[PHP] Question about mail()

2003-08-28 Thread Matthias Wulkow

Hi php-general,


I have a question about the mail function. In the API I saw, that when
running on linux, I just need the binary sendmail, usually located on
/usr/sbin. Windows users need a running mail-server.
I have php working on a linux machine. Why do I need to have postfix running then to 
make it work? I posted
before, because no mails were sent. I had the sendmail-binary
(postfix) installed, but postfix was not running.
Maybe someone can explain it to me...

SvT


-- 
Who is the ennemy?

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



[PHP] mail() function

2003-08-27 Thread Matthias Wulkow

Hi php-general,

I have a question about the mail function. In the API I saw, that when
running on linux, I just need the binary sendmail, usually located on
/usr/sbin. Windows users need a running mail-server.
I have php working on a linux machine. Why do I need to have postfix running then to 
make it work? I posted
before, because no mails were sent. I had the sendmail-binary
(postfix) installed, but postfix was not running.
Maybe someone can explain it to me...

SvT

-- 
Who is the ennemy?

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



Re: [PHP] mail() question

2003-08-26 Thread Matthias Wulkow
Hallo Alister,

am Montag, 25. August 2003 um 03:27 hast Du Folgendes gekritzelt:


A Did you install postfix _after_ PHP?  Did you have a sendmail binary in
A place before you configured PHP?  If it's not there are configure time,
A it won't even compile the 'mail' function.

Yes and there was no sendmail binary before...

A I've had the same problem before - now that PHP can recognise it's got a
A way to send email, re-running ./configure / make / make install should
A work.  It did for me.

I did that, but I forgot to do 'make clean'... now it seems to work.
But I have still one question:
when sending mail with this sendmail binary, is it possible to pass
the mail to a local mail server instead of sending it directly to the
recipient? I ask, because I have a mail server in the network
(different machine than the one running the webserver), but I'd like
the mail not to go outside the network (I have no nameserver!)...

[10 minutes later...]

I don't get the error anymore, but no mail has been sent. No errors in
apache-logs... nothing. I'm trying to sniff the network data transfer
with ethereal, but I don't find any connection to any port 25...

In php.ini, I haven't uncomment the sendmail part (sendmail_path =
...) because there is written that default is sendmail -t -i which
should be ok...

SvT




-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



[PHP] mail() question

2003-08-25 Thread Matthias Wulkow

Hi php-general,

I have followig error reported:

Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on line 235

What is the trouble here?  If I would have trouble because of
delivery, normally mail would return false. But here...

I have php4.3.1 running on linux. I just installed postfix to have the
sendmail binary at the right place.

Thx for help

SvT

-- 
Who is the ennemy?

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



Re: [PHP] mail() question

2003-08-25 Thread Matthias Wulkow
Hallo Curt,

am Montag, 25. August 2003 um 01:35 hast Du Folgendes gekritzelt:

 I have followig error reported:
 
 Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on line 
 235
 
 What is the trouble here?  If I would have trouble because of
 delivery, normally mail would return false. But here...

CZ mail() wasn't compiled into php.

 
 I have php4.3.1 running on linux. I just installed postfix to have the
 sendmail binary at the right place.

CZ You'll have to recompile php. the first time you compiled it php it
CZ couldnt find sendmail, so it left it out in the binary.

Well, that makes sense to me. But I just recompiled the same way I did
it first time (config.nice), but I still get the same error reported.
I looked in ./configure --help to see if there are specific arguments
I need to add, but couldn't find any... and this time sendmail is
there (/usr/sbin/sendmail).

What's wrong?

Thx

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



[PHP] Content of Variable ist html code

2003-08-24 Thread Matthias Wulkow

Hi php-general,

I'm thinking of how I could store the content of a String-variable a) in a
Variable to be passed to other functions b) in a Database (MySQL) too . The content is 
html-code (with
tags and style code (css)).
The point is that I'm making myself a kind
of CMS, and I want to edit a page, enter html code, store it in the
database and then display it as content on a page. So, in the edit
menu, I have to be able to see the html tags, but on the target page,
the html entities have to be translated by the browser... and all that
has to be storable in MySQL...

How do I do that the best...?!?
addslahes, stripslahses, htmlentities, html_entity_decode are the only
functions I have found, which seem to be really useful. Are there
others I could need, or do you think I'm fine with that?

Thanx for answering

SvT

-- 
Who is the ennemy?

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



Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
Hallo Tom,

am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:


TR This should do it:

TR eval('${content.$databasepagename}[$i]();');

I'm afraid to say it, but it does not :-(

Yesterday I was also trying to find some manual pages about eval()
which would explain me the syntax. The example in the PHP-Manual is
not meaning much to me.

How can I print out what eval would evaluate, so I can see how to
compose the string?

Thx for answering again ;-)

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]


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



Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
Hallo Tom,

am Samstag, 23. August 2003 um 17:50 hast Du Folgendes gekritzelt:


TR This works for me, what error message do you get? Make sure you use
TR single quotes in the eval otherwise the string will get substituted
TR before eval gets a look at it.

TR ?php
TR $contentarray = array(1='testpage');
TR function testpage(){
TR echo 'Test succceeded br';
TR }
TR $i = 1;
TR $databasepagename = 'array';

TR eval('${content.$databasepagename}[$i]();');
?

That's the error I find in the apache-log. On the screen, I get
nothing but a white page. By the way I have error_reporting(E_ALL);
but I never get errors reported...

PHP Fatal error:  Call to undefined function:  () in 
/usr/local/www/showFunctions.php(77)

Your script is working. But mine not... is it because I'm on a output
buffer? I use ob_start() just before, because the real output is
produced by the function I want to call with the eval method...

Here the part of my script:

$query = SELECT pagename FROM pages;
$result = mysql_query($query);
$a = 0;
while($row = mysql_fetch_array($result, MYSQL_BOTH)){
  $page[$a] = $row[pagename];
  $fct[$a] = $page[$a];
  $fct[$a] = substr($fct[$a],1);
  $fct[$a] = str_replace(.php, , $fct[$a]);
  $fct[$a] = ucfirst($fct[$a]);
  $a++;
}
mysql_free_result($result);

ob_start();

for($b = 0; $b  sizeof($fct); $b++){
  if($_SERVER[PHP_SELF] == $page[$b])
eval('${content.$fct}[$b]();');
}

...

The pagename in the database is stored like /about.php so I change
it to About in the while-loop.

The eval method is there to replace my actual code (which is static):
if($_SERVER[PHP_SELF] == /login.php)
  contentLogin();
if($_SERVER[PHP_SELF] == /logout.php)
  contentLogout();

...

Using the if-cascade, it is working, for you to know that the
mistake is definitly in the eval()-method...

Thx for your time...

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]


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



Re: [PHP] eval function

2003-08-23 Thread Matthias Wulkow
Hallo Tom,

am Samstag, 23. August 2003 um 17:50 hast Du Folgendes gekritzelt:

TR Hi,

TR Saturday, August 23, 2003, 10:01:54 PM, you wrote:
MW Hallo Tom,

MW am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:

TR This should do it:

TR eval('${content.$databasepagename}[$i]();');

MW I'm afraid to say it, but it does not :-(

MW Yesterday I was also trying to find some manual pages about eval()
MW which would explain me the syntax. The example in the PHP-Manual is
MW not meaning much to me.

MW How can I print out what eval would evaluate, so I can see how to
MW compose the string?

MW Thx for answering again ;-)

MW SvT

TR This works for me, what error message do you get? Make sure you use
TR single quotes in the eval otherwise the string will get substituted
TR before eval gets a look at it.

TR ?php
TR $contentarray = array(1='testpage');
TR function testpage(){
TR echo 'Test succceeded br';
TR }
TR $i = 1;
TR $databasepagename = 'array';

TR eval('${content.$databasepagename}[$i]();');
?

Sorry, I got it to show errors...

here: (it's almost the same than in apache-log)

Notice: Undefined variable: contentArray in /usr/local/www/showFunctions.php(77) : 
eval()'d code on line 1

Fatal error: Call to undefined function: () in /usr/local/www/showFunctions.php(77) : 
eval()'d code on line 1

SvT

-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]


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



[PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hi ,

I try to upload a file with such an input type = 'file' field.
My form looks like:

echo form action = '. $_SERVER[PHP_SELF].' method = 'GET' enctype
= 'multipart/form-data'\n; 

...

echo tdinput type = 'file' name = 'newtextupload'
accept='text/*'/td\n; 

...

echo tdinput type = 'submit' name = 'submit' value =
'auml;ndern'/td\n;

echo /form\n;

After submition, I can't find the file on the server. Nowhere.
In php.ini, I have /tmp as upload-directory.

I'm using apache2 on linux.

Can somebody tell me why the file is not uploaded?

Thx for answering

SvT


-- 
Who is the ennemy?


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



Re: [PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hallo Jim,

am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:

JL when you are uploading files via a form, you must use the POST method.

well, I tried the example from 
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
and that doesn't work neither... no files are uploaded...


SvT

PS: In between I tried with POST and no success



-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



Re: [PHP] file upload problem

2003-08-23 Thread Matthias Wulkow
Hallo Jim,

am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:


JL how are you checking to see if the files are getting uploaded?

JL Jim Lucas


I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.

SvT



-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



[PHP] eval function

2003-08-22 Thread Matthias Wulkow
Hi php-general,

I have a question about eval();

I'm having multiple pagenames I store in a database. I also have a lot
of functions starting with content and then the name of the pages
taken from the database. Ex: pagenames = about,download functions =
contentAbout(), contentDownload().
Now I would like to have a loop of if to make the decision which
function to use, like:
for($i = 0; $i  sizeof($databasepagename);$i++){
  if($_SERVER[PHP_SELF] == $databasepagename[$i])
eval(content.$databasepagename[$i].(););
}
but that doesn't work...

How could I achieve that? Thanks for answering...

SvT

-- 
Who is the ennemy?


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



[PHP] directory listing

2003-08-19 Thread Matthias Wulkow
Hi php-general,

I'm reading through the filesystem function of php and I can't find
any function which will list me all the files which are in a certain
directory. Am I blind or do I have to create myself one?

Thanks for help

M. W.

-- 
Who is the ennemy?


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



[PHP] mail() function exchange

2003-06-10 Thread Matthias Wulkow
Hi php-general,

a friend of mine is trying to set up an automated mailing function.
The platform is Windows  he's using the last PHP release at this
time.
He asks me how to do it with Exchange, because it doesn't speak SMTP
or not correctly? What is the matter? Is that true? But that's not
really the question... could somebody point me to some documents where
I could find out, what has to be done to make it work?

Thanks

M.

PS: On the manual page of http://www.php.net I couldn't find anything
about php  exchange...


-- 
Who is the ennemy?


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