[PHP] split/join error

2001-12-19 Thread mailing_list
Hi, I have saved an email as text-file, and want to get header and body out of the file! (header and body are seperated by the first empty line!) so I do: list($header,$body)=split(\n\n,join('',file($FILE)),2); then I need the body's lines as array: $body=split(\n,$body); but this line gives me

Re: [PHP] Math Inside Strings

2001-08-29 Thread mailing_list
echo input type='hidden' name='currentPosition' value='$currentPosition+1'; can anyone tell me how to get this to stop printing: input type='hidden' name='currentPosition' value='0+1' echo input type='hidden' name='currentPosition' value='.$currentPosition+1.'; hth michael -- GMX -

Re: [PHP] Passing an array to a C program from a php script??

2001-06-26 Thread mailing_list
Hi all, I have a big array (nearly 1000 lines) that I would like to pass to a C program. I don't want to create a temporary file to pass my array (If possible ?!?), and I don't think the command line will fit my needs. Is there a way to execute a program with a php string as the standard

Re: [PHP] Expand/parse variables in file

2001-06-26 Thread mailing_list
$a = whatever; $b = abc $a def; echo $b; but: $a = 'whatever; $b = 'abc $a def'; echo $b; doesn't do what you like (and this is more likely your problem!) this is the clue: $a = 'whatever; $b = 'abc $a def'; echo eval($b); michi -- GMX - Die Kommunikationsplattform im Internet.

Re: [PHP] Help with simple regular expression

2001-06-25 Thread mailing_list
That's because POSIX is greedy. Or Perl is greedy. Whatever. Perl is greedy. It *should* have worked with eregi... body.* Yes, Perl is greedy (there has to be some kind of default behaviour)! BUT it is SO easy to make it decent: /body.*?/ that's it!!! michi -- GMX - Die

RE: [PHP] SMTP/mail question

2001-06-22 Thread mailing_list
Hi! I did it! once again what I wanted to do: I wanted to send a mail, but use MAIL FROM: and RCPT TO: from the SMTP-Protocol and check, if the domain is accepted (nslookup MX)! I had a perl script, that does this trick. Unfortunately the php-mail() can't do a RCPT TO: and MAIL FROM: explicitly

[PHP] SMTP/mail question

2001-06-21 Thread mailing_list
Hi, I sent a message last day with subject perl2php - question - but I think I will describe the problem, I solved with perl, instead of asking for a perl2php-code: if I send a mail with the php-mail()-function, and the mail bounces (wrong address - server down ...), the sysadmin of my ISP will

Re: [PHP] protect source code

2001-06-21 Thread mailing_list
An alternative is to put some of your critical code into a PHP extension that you distribute as a shared library with your application. Compiled C code in the form of a .so is rather difficult to reverse engineer. how to do this? can you give an example? thanks michi -- GMX - Die

RE: [PHP] SMTP/mail question

2001-06-21 Thread mailing_list
I tried all possible headers (Return-Path, Error-To, Sender, ...) to redirect the bouncing mail to my address but nothing worked - all bouncing-mails go to root! this works for me: mail([EMAIL PROTECTED], Subject, Email body, Return-path: [EMAIL PROTECTED]\n); Maybe you

Re: [PHP] inserting a variable into a variable

2001-06-20 Thread mailing_list
I have come to a situation where i am having a variable inside another variable. for example. $rm_$cat_adt This works for me: ? $cat=def; ${abc_.$cat._ghi}=TEST; echo 'abc_.$cat._ghi = '.${abc_.$cat._ghi}.br\n; echo 'abc_def_ghi = '.$abc_def_ghi.br\n; ? michi -- GMX - Die

Re: [PHP] exec, backtics and co.

2001-06-20 Thread mailing_list
I have a problem with a php script which contains an exec (identical problem with backtics and similar operators) some programs are simply not executed for example, having a simple 'hello world' program in c++ will work fine, but having a program that writes 'hello world' to a file won't

Re: [PHP] Searching for array keys

2001-05-03 Thread mailing_list
What's the best way of finding out if a specific array key is in an array? I have an associative array which *may* look like (car =saab, house = mansion, countyW= A) but can equally well look like (boat = daycruiser, house = flat, county = B). I want to find out if the key car is in the

Re: [PHP] session variables

2001-04-11 Thread mailing_list
I tried using a cookie I still had the same problem that it worked first time but even if you stayed on the page and put a sencond entry in it would not work, then you: set the cookie incorrectly overwrite/delete the cookie by mistake your browser does not support cookies ... read

Re: [PHP] session variables

2001-04-10 Thread mailing_list
I am using a session to store a variable so when someone enters something into a field the persons username(which is stored in the session) is also entered into anoter field. The problem is that it only works the first time, so how can I make the session last for a required length of time,

Re: [PHP] online detection

2001-04-10 Thread mailing_list
Does anyone know how to detect when a user connects to the Internet similar to ICQ? I think you mean messages on pages like "321 user online"! As HTTP is a stateless protocol, you can't really know this!!! It's only an estimation - and you can use sessions to realize this (ask how many

Re: [PHP] URL w/o script name

2001-04-09 Thread mailing_list
Hello. I have no idea in Linux systems yet nor in Web Servers configurations and stuff, and now I wonder: www.php.net/asdfadasdasd who takes control if i didn't specify a script name in the url? the web-server if you access www.php.net/asdfadasdasd (and the directory DOES exist) the

Re: [PHP] Grab and print user IP address

2001-03-12 Thread mailing_list
Thanks, michi Just a question, what means the tag PRE? Commonly used for programing code! All between the tags is written AS IS!! try the below with and without pre: htmlbody pre My program BEGIN If event do something else dont do something fi END ; /pre

Re: [PHP] Hide Include-Files from the Web

2001-03-05 Thread mailing_list
Hi! As I wrote before, I don't have .htaccess nor access to the apache-conf!!! michi How bout an Apache redirect for .inc files to go to denied.htm or something? PHP scripts could get to them, but they wouldn't be accessible via http. At 08:01 PM 3/3/01 +0100, [EMAIL PROTECTED]

Re: [PHP] Hide Include-Files from the Web

2001-03-04 Thread mailing_list
Hi! I want my include-files not be seen from outside AND not be executed!!! I don't have access to a directory outside DOCUMENT_ROOT and I don't have .htaccess!!! I think about something like: 1. name: file.inc.php 2. add code: if ($PHP_SELF==MY_NAME) exit; as first

Re: [PHP] Help w/ sprintf

2001-03-03 Thread mailing_list
What are the directives for the sprintf function to format an integer with commas (e.g.: 1,250,560)? you don't mean commas but thousands' grouping??? if you want thousands' grouping it depends on your locale setting! --cut-- For some numeric conversion a radic character (`decimal

Re: [PHP] Hide Include-Files from the Web

2001-03-03 Thread mailing_list
Hi! as I wrote in my mail: 1. I won't name them ".inc" but ".inc.php" (so *I* know, it's an include file) 2. I don't even want them to be executable!!! and therefore my question was, if this (on top of every include-file) would be safe enough: if (substr($SCRIPT_URL,-8)==".inc.php") exit;

Re: [PHP] Inane ereg_replace question

2001-03-03 Thread mailing_list
this will work: ereg_replace(" *: *",":",$b); I don't know why you use an OR! If you only wanted to know WHY this doesn't work: the searchstrings overlap (abc is poisitioned BEFORE cde - so the parser only will see abc in abcdefghiabcdefghi but not cde in XdefghiXdefghi!! $a="abcdefghi"; $a.=$a;

[PHP] get html-page

2001-03-01 Thread mailing_list
Hi! I have a php-script, that gets a HTML-Page, parses it and print some information on this page! 'file("http:// ...")' doesn't work on my server, so I use 'fsockopen($host,$port)' which works fine! Now I migratet my scripts to another free-ISP, and there both methods fail! - What can I try

Re: [PHP] mail() question

2001-01-15 Thread mailing_list
I asked the same question some weeks ago! The problem is, my root installed the mail-function so that "nobody" is the owner of the send-process! I wanted the same thing as you want - At last I did a workaround (not bad for sending that small amount of mails I do): I configured .procmailrc, so

[PHP] fetch html-page without file()

2001-01-12 Thread mailing_list
Hi! Something strange: A script, that uses file("http://xyz.com") does work on one sever! Then I copied it to another server (physically more far away from the server from which I fetch the html-page with file()) - same PHP ... Now file() returns always an empty string (about in 1 try out of

[PHP] image through php

2001-01-11 Thread mailing_list
Hi! I want to use a code like: img src="./randomgif.php" I know, this is possible with perl, but with php? ... and it should be performant as well :-) !! thanks any hints appreciated witty -- Sent through GMX FreeMail - http://www.gmx.net -- PHP General Mailing List (http://www.php.net/)