Re: [PHP] getaddrinfo failed: No address associated with hostname

2002-11-28 Thread Tony Earnshaw
tor, 2002-11-28 kl. 05:22 skrev Godzilla:

 Warning: php_network_getaddresses: getaddrinfo failed: No address associated
 with hostname

Your DNS doesn't work any more?

Best,

Tony

-- 

Tony Earnshaw

When all's said and done ...
there's nothing left to say or do.

e-post: [EMAIL PROTECTED]
www:http://www.billy.demon.nl




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




Re: [PHP] dynamic arraynames

2002-11-28 Thread Hugh Danaher
Floyd,
I thought about this some and started noodling out a solution for you, but
have a few questions before I go any farther on this.
1. The part about users inputting their own column headers is relatively
straight forward.  Something like this should work:

?php
if (!isset($start_button))
{
print form action=$PHP_SELF method=get;
print Input the following information;
 // these are your fixed cells
print Name: input type=text name=name size=20br;
print Temp: input type=text name=temp size=20br;
print Time: input type=text name=time size=20br;
print Offset: input type=text name=offset size=20br;
 // User inputs the number of additional cells needed
  print Input number of additional cells needed: input type=text
name=additional_cells size=20br;
  print input type=hidden name=start_button value=1;
  print input type=submit value=\ Hit it! \;
  print /form;
  }
if ($start_button==1)
 {
 print form action=$PHP_SELF method=get;
 print Input the following information;
 // these are your fixed cells and they now contain user input
   print Name: input type=text name=name value=\$name\ size=20br;
   print Temp: input type=text name=temp value=\$temp\ size=20br;
   print Time: input type=text name=time value=\$time\ size=20br;
   print Offset: input type=text name=offset value=\$offset\
size=20br;
 print Input the names of the desired additional cells in the spaces
provided.;
 // this is where your user will name the cells he asked to create
 for($i=1;$i=$additional_cells;$i++)
  {
  print $i input type=text name=user_added[$i] size=20br;
  }
 print input type=hidden name=additional_cells value=\$additional_cells\
;
 print input type=hidden name=start_button value=2;
 print input type=submit value=\ Hit it! \;
 print /form;
 }
if ($start_button==2)
   {
print $name.br.$temp.br.$time.br.$offset.br;
for($i=1;$i=$additional_cells;$i++)
{
print user cell .$i. .$user_added[$i].br;
}
}
?


2. Now comes the tricky part, and the part I'm unsure about.  You can
convert the user input in the above so that it becomes the names of the
input cells, or you can leave them in a numeric array.  Leaving them in a
numeric array will be easier to deal with later.
Also, other than the display of a table, what do you want the user input
for?  If you're planning on doing any data manipulation, then your coding
will get a bit hairy because you won't know what relation the user input
data has to your standard data (name, time, temp and offset).  Finally, if
you're planning on storing the data in a database table, each table will
need to be created on the fly--it can be done, but if you're struggling with
this, it'll take you some time to get the back end working.

Hope this helps,
Hugh

- Original Message -
From: Floyd Baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: 'Hugh Danaher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, November 27, 2002 5:24 PM
Subject: Re: [PHP] dynamic arraynames




 Well I might be in the wrong place.  I've also asked in the HTML list
 now too but I'm still stuck and need some help.

 This is pretty much as clear as I can make it.  I'm up against a
 mental block and even if it's as clear as glass to others I'm dead in
 the water and would appreciate some pointers.  I have a bunch of
 pieces but can't seem to string them together enough to make it work.

 Just trying to build an x-y array of data input fields and then send
 them recursive to be used further down the program.

 I can do this fine with a fixed number of columns and rows of user
 input but I cannot figure out how to make this happen using a variable
 number of columns.  I'm a complete array amateur and would appreciate
 a little assistance...

 I want it to look something like this:

 Name  Temp  Time  OffsetEtc.  As needed...
 process 1[input]   [input]   [input]   [input]   [inputs]
 process 2[input]   [input]   [input]   [input]   [inputs]
 process 3[input]   [input]   [input]   [input]   [inputs]
 process 4[input]   [input]   [input]   [input]   [inputs]

 Right now, for the three *basic* columns, I have the lines below in a
 'while' loop.

 INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
 MAXLENGTH='10'
 INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
 MAXLENGTH='10'
 INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
 MAXLENGTH='10'

 But when it comes to adding additional columns that a user
 determines are needed, I am lost.  Users might want to add 0, or 4, or
 10 additional items...  I would like only that number of usable
 input columns be on the input-form, identified for what they contain,
 and then be passed to the next page

 Again, many thanks in advance.

 Floyd






 On Sun, 24 Nov 2002 23:55:56 -0500, you wrote:

 I'm sorry, but I'm still confused. Can you show us a sample of the data
 in the database and what you want the resulting form to look like for
 that data? Maybe that'll help.
 
 ---John 

Re: [PHP] Password Script

2002-11-28 Thread Vicky
A 'guessing'/knowledge game ^_^

Basically I put a picture of a dog or cat up and they try to guess the
breeds. If they get it right then they go to a page where they can download
their prize!

Vicky


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




php-general Digest 28 Nov 2002 11:26:02 -0000 Issue 1731

2002-11-28 Thread php-general-digest-help

php-general Digest 28 Nov 2002 11:26:02 - Issue 1731

Topics (messages 126374 through 126397):

session problems again
126374 by: Jason Romero
126378 by: Rich Gray

Re: [PHP-DEV] Parse search string a la Google (Regular expression?)
126375 by: Ernest E Vogelsinger

Re: ignoring client supplied session data
126376 by: Justin French
126386 by: John W. Holmes
126387 by: John W. Holmes

Re: Password Script
126377 by: Justin French
126397 by: Vicky

PHP 4.3.0RC2 released
126379 by: Andrei Zmievski

Re: printing screen without the print dialog
126380 by: Justin French

Re: Parsing XML files, logic involved...
126381 by: Khalid El-Kary

Re: dynamic arraynames
126382 by: Floyd Baker
126383 by: Floyd Baker
126384 by: Floyd Baker
126396 by: Hugh Danaher

Re: Streaming audio
126385 by: olinux

Re: Show only user that variable musiccontain  pop
126388 by: John W. Holmes

Error in retrieving a BLOB from DB.
126389 by: Naif Al-Otaibi
126390 by: Faisal Abdullah

Re: sendmail problem!
126391 by: Manuel Lemos

getaddrinfo failed: No address associated with hostname
126392 by: Godzilla
126395 by: Tony Earnshaw

how to use openssl_x509_read.
126393 by: Richard Rojas

mcrypt 2.4.x - trouble with small data fields?
126394 by: Steve Yates

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---
--when using session registered variables
--i can only get them to save as session variables for one page
--then on the next page they are gone
--far as i can tell the variables are not getting written over or unset
--and the session is not gettting destroyed
--any other ideas what it might be?

i tried the seggestions you guys had
and i came up with one more question
does the session cookie.cookie_lifetime have anything to do with the amount
of time that session variables can be stored
the session.use_cookies is on and register.globals is turned on
however session.cookie_lifetime is set to 0
so would this affect the session variable lifetime?




---End Message---
---BeginMessage---
Jason

session.cookie_lifetime set to 0 means the session cookie persists until the
client browser is closed...

I'm not clear if you are still having session problems now or the advice you
got earlier sorted it?

Rich
-Original Message-
From: Jason Romero [mailto:[EMAIL PROTECTED]]
Sent: 27 November 2002 15:09
To: [EMAIL PROTECTED]
Subject: [PHP] session problems again


--when using session registered variables
--i can only get them to save as session variables for one page
--then on the next page they are gone
--far as i can tell the variables are not getting written over or unset
--and the session is not gettting destroyed
--any other ideas what it might be?

i tried the seggestions you guys had
and i came up with one more question
does the session cookie.cookie_lifetime have anything to do with the amount
of time that session variables can be stored
the session.use_cookies is on and register.globals is turned on
however session.cookie_lifetime is set to 0
so would this affect the session variable lifetime?




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




---End Message---
---BeginMessage---
At 23:11 27.11.2002, Ernest E Vogelsinger said:
[snip]
If I understand you correctly you want to isolate either quoted strings
(with or without whitespace), or tokens separated by whitespace, as array
elements?

For this you would first have to isolate the first quoted sentence, then
tokenize the part before, and loop this as long you're not done.

Should work something like that:

 [...]
Disclaimer: untested as usual. _Should_ behave like this:
[snip] 

I _should_ have tested. This script actually works the way you expect it to be:

code
xmp
?php

function tokenize_search($input) {
$re = '/\s*(.*?)\s*\s*([^]*?)\s*\s*(.*)/s';
/* look for 3 groups:
   a - prematch - anything up to the first quote
   b - match - anything until the next quote
   c - postmatch - rest of the string
*/
$tokens = array();
while (preg_match($re, $input, $aresult)) {
// aresult contains: [0]-total [1]-a [2]-b [3]-c
// tokenize the prematch
if ($aresult[1]) $tokens = array_merge($tokens, explode(' ',
$aresult[1]));
array_push($tokens, $aresult[2]);
$input = $aresult[3];
}
// $input has the rest of the line
if ($input) $tokens = array_merge($tokens, explode(' ', $input));
return $tokens;
}

$string = \search 

[PHP] rewrite urls with preg_replace

2002-11-28 Thread Dieter Koch
Hi to all the PHP-Fans out there,

i have a syntax-problem with the folowing preg_replace command:

$returnString = preg_replace(/(href=\)(.+?)(\)/is,
preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);

i'm trying to call my own function within a preg_replace function and it
won't work.
any ideas ? it seems to me, that the quoting is incorrect, but i'm not
shure, why it is incorrect,
especially because i use preg_quote() ...

thanks in advance for some hints !

best regards
[EMAIL PROTECTED]






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




Re: [PHP] controlling ownership on file uploads ...

2002-11-28 Thread Marek Kilimajer
Besides what was said before, you don't even need to delete it, it will 
be deleted when your script is done.
If you want to keep it, you have to move it elsewhere.

Kenn Murrah wrote:

Greetings.

I've written a simple form to allow my clients to upload files to me, and it
works fine EXCEPT that the uploaded file is owned by www and I while I can
read the file, I don't have the necessary permissions to delete it when done
...

Since this site is being hosted elsewhere, is there a way I can control
ownership so that I can delete the file?  I've written my ISP/web hoster and
received no response -- usually that's their subtle way of telling me I
should ask the PHP quiestion here :-)

Any and all help would be appreciated.

Thanks,

kenn



 



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




Re: [PHP] Bad File Mode?

2002-11-28 Thread Marek Kilimajer
You can stat (get filesize, modification time, permissions) only local 
files - download it first and then get its filesize if you need it.

Steve Keller wrote:

I'm still trying to get a file posted to another server, but I seem to 
have run across an odd snag, and I was hoping someone can point out 
where I've gone wrong. Here's the code:

?
$data = mtype=XMLDOCoutfile=true;
$dataFile = 
http://www.healthtvchannel.org/courses/pay/data/test.xml;;
$fileSize = filesize($dataFile);
$fp = fopen($dataFile, rb);
$strFile = fread($fp, $fileSize);
fclose($fp);

$osbURL=https://partners.netledger.com/SmbXml;;

$ch = curl_init();
$res = curl_setopt($ch, CURLOPT_POST, 1);
echo Set Post: .$res;
$res = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
echo br /Set Follow: .$res;
$res = curl_setopt($ch, CURLOPT_VERBOSE, 1);
echo br /Set Verbose: .$res;
$res = curl_setopt($ch, CURLOPT_URL, $osbURL);
echo br /Set URL: .$res;
$res = curl_setopt($ch, CURLOPT_POSTFIELDS, 
$data.mediafile=.$strFile);
echo br /Set Postfields: .$res;
$res = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo br /Set ReturnTransfer: .$res;

$result = curl_exec($ch);
curl_close($ch);
echo $result;
?

What I'm getting is

Warning: stat failed for 
http://www.healthtvchannel.org/courses/pay/data/test.xml (errno=2 - No 
such file or directory) in 
/usr/local/www/vhosts/healthtvchannel.org/htdocs/courses/pay/posttest.php 
on line 20

I'm positive the file exists, and if I cut and paste the URL from the 
error to a browser window, I can see the file. What am I doing wrong?
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org




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




Re: [PHP] **** Converting dynamic webpages into static HTML pages

2002-11-28 Thread Marek Kilimajer
Easy and intuitive are all the programs that allow you to download the 
whole website
http://download.com.com/3150-2071-0.html?tag=dir

Ron Stagg wrote:

I have an interesting challenge.  I have built an online product catalog
that is driven entirely by the contents of the product database (MySQL).
The entire catalog is implemented in a single PHP script (catalog.php).
The dynamic nature of this implementation allows the catalog script to
generate hundreds of product description pages.

Now, my client has requested that I give him the ability to generate a
static version of the catalog so that he can burn it onto a CD for
distribution at trade shows.  He wants the CD to be a snapshot of the
catalog.  Furthermore, he wants to be able to generate this snapshot
frequently so that pricing info on the CD will be current.  To
accommodate this, the process for generating the snapshot must be easy
and intuitive.

My plan of attack is to generate static HTML files by running the
catalog script once for each product in the database. Here is my
quandary; instead of echoing the output to a buffer for Apache to send
off to the client, I need the script to output to a file.  I do not want
to write a second version of catalog.php that writes everything to file.
There must be an easier way to do this.  Is there a way I can access the
output buffer that Apache sends to the client?

Any other ideas?

Thanks,

Ron

 



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




Re: [PHP] Bad File Mode?

2002-11-28 Thread Ernest E Vogelsinger
At 21:05 27.11.2002, Steve Keller spoke out and said:
[snip]
I'm still trying to get a file posted to another server, but I seem to have 
run across an odd snag, and I was hoping someone can point out where I've 
gone wrong. Here's the code:

?
 $data = mtype=XMLDOCoutfile=true;
 $dataFile = 
http://www.healthtvchannel.org/courses/pay/data/test.xml;;
 $fileSize = filesize($dataFile);
 $fp = fopen($dataFile, rb);
 $strFile = fread($fp, $fileSize);
 fclose($fp);
[snip] 

You can't stat() a remote file - filesize() only works with local filesystems.

However you do not need to know the size of the file to read it - simply do
it in chunks:
$dataFile = http://www.healthtvchannel.org/courses/pay/data/test.xml;;
$fp = fopen($dataFile, rb);
 $strFile = null;
 while ($chunk = fread($fp, 524288))  // 512 kB chunks modify as needed
  $strFile .= $chunk;
fclose($fp);

HTH,

-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] printing screen without the print dialog

2002-11-28 Thread Marek Kilimajer
No, this is not possible - security restrictions

Duky Yuen wrote:


I am having this problem, I want to print something directly to my printer
without having that print dialog. What to do know? Is this possible?

Duky



 



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




[PHP] Bizarreness with htmlentities() and other things

2002-11-28 Thread James Coates
Hello!

I'm currently doing some work that requires a mySQL database of actor 
names. For all my actors, I have three columns; first_name, last_name and 
between_name. Because between_name can be written in many ways (Peter van 
Wibble or Fred d'Angelo), and the French have a habit of writing their 
surnames in capitals, I wrote a little function to prepare the actor names 
for output:

?
 function actor_name($last,$middle,$first) {
 // because we have so many different name combinations, write out a string
 // that does capitalisation and the like properly (hopefully)
 // ex: actor_name(ANGELO,d',Jean-Pierre) = Jean-Pierre d'Angelo

  // strtolower() everything because ucwords() doesn't work on mixed case
  $last=strtolower($last);
  $middle=strtolower($middle);
  $first=strtolower($first);

  // split hyphenated names so we can ucwords() them
  if (strpos($last,-)) {
   $lasthyphen=true;
   $last=ereg_replace(-, ,$last);
  } else { $lasthyphen=false; }

  if (strpos($first,-)) {
   $firsthyphen=true;
   $first=ereg_replace(-, ,$first);
  } else { $firsthyphen=false; }

  // if the middle name doesn't end with an apostrophe, add a space and
  // lowercase it just in case someone's mis-typed it
  if (!strrpos($middle,')) {
   $middle.= ;
  }

  $last=ucwords($last);
  $first=ucwords($first);

  if ($lasthyphen==true) { $last=ereg_replace( ,-,$last); }
  if ($firsthyphen==true) { $first=ereg_replace( ,-,$first); }

 return htmlentities($first $middle$last);

 }

?

Thing is, I'm getting bizarre behaviour where some characters become 
modified in a way I don't like - in particular, when the letter L follows 
an E with a diaresis (Raphaël, for example) it becomes upper case. 
Suggestions, anyone?

And if anyone wants to make that code shorter and more readable, I'd 
appreciate it greatly. :-)

James.
xx


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



Re: [PHP] session problems again

2002-11-28 Thread Marek Kilimajer
Check your session files (usually in /tmp) if they are what they are 
supposed to be

Jason Romero wrote:

--when using session registered variables
--i can only get them to save as session variables for one page
--then on the next page they are gone
--far as i can tell the variables are not getting written over or unset
--and the session is not gettting destroyed
--any other ideas what it might be?

i tried the seggestions you guys had
and i came up with one more question
does the session cookie.cookie_lifetime have anything to do with the amount
of time that session variables can be stored
the session.use_cookies is on and register.globals is turned on
however session.cookie_lifetime is set to 0
so would this affect the session variable lifetime?




 



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




Re: [PHP] editing .htaccess / .htpasswrd

2002-11-28 Thread Mika Tuupola
On Wed, 20 Nov 2002, Oliver Witt wrote:

 I'm looking for a script that enables users of password demanding web
 sites to change their password, in other words a script, that can write
 into the .htpsswrd file.

Answering to an old mail in here but noticed you didn't get
any replies yet. You should check File_HtAccess and File_Passwd
packages at PEAR:

http://pear.php.net/package-info.php?pacid=131
http://pear.php.net/package-info.php?pacid=128

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




Re: [PHP] editing .htaccess / .htpasswrd

2002-11-28 Thread James Coates
At 15:46 28/11/2002 +0200, Mika Tuupola wrote:


 into the .htpsswrd file.

Answering to an old mail in here but noticed you didn't get
any replies yet. You should check File_HtAccess and File_Passwd
packages at PEAR:



I quite like class.htpasswd - http://www.hotscripts.com/Detailed/3978.html

James.



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




[PHP] String function

2002-11-28 Thread Shaun
Hi,

Please can someone tell me how i can tell if a string contains a full stop?

thanks



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




Re: [PHP] String function

2002-11-28 Thread Marco Tabini
You can use strstr:

if (strstr ($str, '.'))
echo 'Full stop';
else
echo 'No full stop';

Marco

-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

On Thu, 2002-11-28 at 08:49, Shaun wrote:
 Hi,
 
 Please can someone tell me how i can tell if a string contains a full stop?
 
 thanks
 
 
 
 -- 
 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] Bizarreness with htmlentities() and other things

2002-11-28 Thread Rich Gray
Hi James
There is a bug in PHP for the capitalisation problem
http://bugs.php.net/bug.php?id=14655
If you check the link then a workaround was posted by someone.
HTH
Rich
-Original Message-
From: James Coates [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2002 13:11
To: [EMAIL PROTECTED]
Subject: [PHP] Bizarreness with htmlentities() and other things


Hello!

I'm currently doing some work that requires a mySQL database of actor
names. For all my actors, I have three columns; first_name, last_name and
between_name. Because between_name can be written in many ways (Peter van
Wibble or Fred d'Angelo), and the French have a habit of writing their
surnames in capitals, I wrote a little function to prepare the actor names
for output:

?
  function actor_name($last,$middle,$first) {
  // because we have so many different name combinations, write out a string
  // that does capitalisation and the like properly (hopefully)
  // ex: actor_name(ANGELO,d',Jean-Pierre) = Jean-Pierre d'Angelo

   // strtolower() everything because ucwords() doesn't work on mixed case
   $last=strtolower($last);
   $middle=strtolower($middle);
   $first=strtolower($first);

   // split hyphenated names so we can ucwords() them
   if (strpos($last,-)) {
$lasthyphen=true;
$last=ereg_replace(-, ,$last);
   } else { $lasthyphen=false; }

   if (strpos($first,-)) {
$firsthyphen=true;
$first=ereg_replace(-, ,$first);
   } else { $firsthyphen=false; }

   // if the middle name doesn't end with an apostrophe, add a space and
   // lowercase it just in case someone's mis-typed it
   if (!strrpos($middle,')) {
$middle.= ;
   }

   $last=ucwords($last);
   $first=ucwords($first);

   if ($lasthyphen==true) { $last=ereg_replace( ,-,$last); }
   if ($firsthyphen==true) { $first=ereg_replace( ,-,$first); }

  return htmlentities($first $middle$last);

  }

?

Thing is, I'm getting bizarre behaviour where some characters become
modified in a way I don't like - in particular, when the letter L follows
an E with a diaresis (Raphaël, for example) it becomes upper case.
Suggestions, anyone?

And if anyone wants to make that code shorter and more readable, I'd
appreciate it greatly. :-)

James.
xx


--
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] Bizarreness with htmlentities() and other things

2002-11-28 Thread James Coates
At 14:07 28/11/2002 +, Rich Gray wrote:


There is a bug in PHP for the capitalisation problem


Sounds like an internal Microsoft memo.  :-)


http://bugs.php.net/bug.php?id=14655
If you check the link then a workaround was posted by someone.


Cool. If I've got that right, it'll be fine on the production (Linux) 
server, so I have no need to worry. :-)

Many thanks,
James.


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



Re: [PHP] echo'ing array contents through reference variable ... why doesn't this work???

2002-11-28 Thread -[ Rene Brehmer ]-
Hi Ernest E Vogelsinger,

On Sat, 23 Nov 2002 17:07:50 +0100, you wrote about Re: [PHP] echo'ing
array contents through reference variable ... why doesn't this work???
something that looked like this:

At 16:50 23.11.2002, -[ Rene Brehmer ]- said:
[snip]
Shouldn't 
  echo($$pdag[$n]);
be able to pull the string contents of the array? Or is there some extra
needed when using referenced variable?
[snip] 

This is ambiguous: is it $$pdag indexed by [$n], or is it $pdag[$n]
dereferenced? If you're using an interim variable you'll get what you need
- either use (depends on your data layout which I don't know)
$temp = $pdag[$n];
echo $$temp;
or
$temp = $$pdag;
echo $temp[$n];

Not sure about the correct terms in English, sorry ...

But to answer your question:
$pdag = d.str_replace(-,,$premieredag[$i]);

where $premieredag is a date in form 2002-11-28.

So $n is then an index in the array that $pdag refers to.

But either way, writing echo(${$pdag}[$n]); got me the array contents as
desired ... so thank you. Now I can finally finish this thing ...

Thx


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




Re: [PHP] echo'ing array contents through reference variable

2002-11-28 Thread -[ Rene Brehmer ]-
Hi Tularis,

Thanks ... it totally did the trick ... if only I've had the time to
actually look at this before now ;-) ... 

thx

Rene

On Sat, 23 Nov 2002 19:20:02 +0100, you wrote about Re: [PHP] echo'ing
array contents through reference variable something that looked like
this:

echo ${$pdag[$n]}; // is also possible in case the [$n] is the index to 
pdag. Otherwise use this:
echo ${$pdag}[$n];


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





[PHP] mysql, php, checkbox

2002-11-28 Thread Adrian Partenie


Hello, 

I'm displaying the content of a mysql table with autoincrement index. I want to be 
able to select the each row from the table using the check boxes. In order to do that, 
i want to assign to each checkbox the name=index of selected row. 
I assign to the checkboxes the value of selected id, but I can't retreiveit later for 
further processing. My code looks like this

 $query = SELECT * FROM reclamatie;
$result = mysql_query($query) or die(Query failed);

/* Printing results in HTML */
 
 echo table border=1; 
echo trtd/tdtdID/tdtdSubject/tdtdOpen/tdtdClose/td/tr; 

 while($row = MySQL_fetch_array($result)) { 
 echo  trtdforminput type=\checkbox\ method=\post\ 
name=\{$row['id']}\/form/td; // ??
echo tda href=\lowerframe.php?id={$row['id']}\ 
target=\lowerframe\{$row['id']}/a/td; //for other purposes, it works fine
echo td{$row['subject']}/td; 
echo td{$row['open']}/td;
   echo td{$row['close']}/td/tr;
} 
echo /table; 

Any sugestions if i want to use forms, something like



form method=post action=selectare.php?id=$row['id']
input type=Submit  value=Trimite 
/form



Thanks, Adrian


RE: [PHP] mysql, php, checkbox

2002-11-28 Thread John W. Holmes
 I'm displaying the content of a mysql table with autoincrement index.
I
 want to be able to select the each row from the table using the check
 boxes. In order to do that, i want to assign to each checkbox the
 name=index of selected row.
 I assign to the checkboxes the value of selected id, but I can't
 retreiveit later for further processing. My code looks like this
 
  $query = SELECT * FROM reclamatie;
 $result = mysql_query($query) or die(Query failed);
 
 /* Printing results in HTML */
 
  echo table border=1;
 echo

trtd/tdtdID/tdtdSubject/tdtdOpen/tdtdClose/td/tr

 ;
 
  while($row = MySQL_fetch_array($result)) {
  echo  trtdforminput type=\checkbox\ method=\post\
 name=\{$row['id']}\/form/td; // ??

It looks like your naming it as a number, which won't work for PHP. You
want to name all of your checkboxes the same, with a [] on the name to
make the results an array in PHP.

... name=id[] value={$row['id']}

Then, you'll have $_POST['id'][x] as an array in PHP. Only the
checkboxes that were selected will be in the array, from zero to however
many were checked. The value of $_POST['id'][x] will be whatever was in
the value=... part of the HTML checkbox...

---John Holmes...



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




[PHP] Re: rewrite urls with preg_replace

2002-11-28 Thread liljim
Hi Dieter,

You need to use the 'e' modifier as well as 'is' in your pattern. Have a
look in the manual, here:

http://www.php.net/manual/en/pcre.pattern.modifiers.php

If this modifier is set, preg_replace() does normal substitution of
backreferences in the replacement string, evaluates it as PHP code, and uses
the result for replacing the search string.

Also look here:
http://www.php.net/manual/en/function.preg-replace.php

And check the Example 2. Using /e modifier part.

Hope that helps ;)

James


Dieter Koch [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi to all the PHP-Fans out there,

 i have a syntax-problem with the folowing preg_replace command:

 $returnString = preg_replace(/(href=\)(.+?)(\)/is,
 preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);

 i'm trying to call my own function within a preg_replace function and it
 won't work.
 any ideas ? it seems to me, that the quoting is incorrect, but i'm not
 shure, why it is incorrect,
 especially because i use preg_quote() ...

 thanks in advance for some hints !

 best regards
 [EMAIL PROTECTED]








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




RE: [PHP] rewrite urls with preg_replace

2002-11-28 Thread John W. Holmes
 Hi to all the PHP-Fans out there,
 
 i have a syntax-problem with the folowing preg_replace command:
 
 $returnString = preg_replace(/(href=\)(.+?)(\)/is,
 preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);
 
 i'm trying to call my own function within a preg_replace function and
it
 won't work.
 any ideas ? it seems to me, that the quoting is incorrect, but i'm not
 shure, why it is incorrect,
 especially because i use preg_quote() ...

Take a look at preg_replace_callback().

http://www.php.net/manual/en/function.preg-replace-callback.php

---John Holmes...



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




Re: [PHP] Password Script

2002-11-28 Thread Bobby Patel
If you have access to a database on your server then you can do the
following:
- user logs in to site (user enters unique username and password)
- once in they will be displayed with the 3-6 Questions
- after they answer the questions they hit submit which sends it to a PHP
script
- the PHP script will check a table in the database for the username and
increment a counter
- then if the counter is less than 10 then validate questions for right
answer, .then you understand the rest


Vicky [EMAIL PROTECTED] wrote in message
006401c296d0$e287a6a0$0200a8c0@omnibook">news:006401c296d0$e287a6a0$0200a8c0@omnibook...
 A 'guessing'/knowledge game ^_^

 Basically I put a picture of a dog or cat up and they try to guess the
 breeds. If they get it right then they go to a page where they can
download
 their prize!

 Vicky




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




[PHP] 2D Array

2002-11-28 Thread Khalid El-Kary
hi,
which is faster; filling two array elements with two values, or making a two 
dimensional array to handle the two values in one element ...

which is better for Memory usage as well ?

(considering that both of them serve well in my situation)

thanx in advance

Regards,
Khalid Al-Kary




_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



Re: [PHP] dynamic arraynames

2002-11-28 Thread Floyd Baker


The user's choice is made from a drop down list of available items,
prior to running the routine itself.  The choices are predetermined
and kept in a personal table to be called by the routine.  This part
is finished to the point of putting the needed column names at the top
of the input columns on the form.  The choices are fixed spellings to
match formula if-then's, etc.   The use is for data manipulation and
so proper tracking of name/data is important in that regard, but the
final output figures go to the same categories in all cases so those
tables are fixed.  

The personal list table is to be called on the action page for keeping
the arrays in their proper order and usage.  The original idea was
that the list would be used somehow for creating the required
$_request's etc. 

But as you say, the tricky part is the naming of the columns, as we do
with the 'basic' column arrays.  I don't know if this can be done.
Thought it might be possible with 'dot' adds of functions or some such
to command lines built on the fly but haven't been able to make it
happen.  

But putting together what you and others are saying is giving me good
thoughts. :-)   Although I am still not sure how to code all of this,
much less express it, I am getting the idea that all 'columns' would
have the same array name and that the position of the data within that
single array will be the determining factor as to where it is applied.

That is if we need 3 user columns and 4 rows we will end up with a
single array of 12 values...  The three columns' fields would be
arranged as 1-4-7-10, 2-5-8-11 and 3-6-9-12.  

That should work nicely.  The column name list determines the number
of fields per row and the rest is automatic.  Perhaps I was going off
the deep end before but this method seems much less involved.  Anyone
see a problem with doing it this way?  

Many thanks to all and I apologize for the verbosity.  

Floyd
  



On Thu, 28 Nov 2002 01:28:48 -0800, you wrote:

Floyd,
I thought about this some and started noodling out a solution for you, but
have a few questions before I go any farther on this.
1. The part about users inputting their own column headers is relatively
straight forward.  Something like this should work:

?php
if (!isset($start_button))
{
print form action=$PHP_SELF method=get;
print Input the following information;

 // these are your fixed cells
print Name: input type=text name=name size=20br;
print Temp: input type=text name=temp size=20br;
print Time: input type=text name=time size=20br;
print Offset: input type=text name=offset size=20br;

 // User inputs the number of additional cells needed
  print Input number of additional cells needed: input type=text
 name=additional_cells size=20br;
  print input type=hidden name=start_button value=1;
  print input type=submit value=\ Hit it! \;
  print /form;
  }


if ($start_button==1)
 {
 print form action=$PHP_SELF method=get;
 print Input the following information;
 // these are your fixed cells and they now contain user input
   print Name: input type=text name=name value=\$name\ size=20br;
   print Temp: input type=text name=temp value=\$temp\ size=20br;
   print Time: input type=text name=time value=\$time\ size=20br;
   print Offset: input type=text name=offset value=\$offset\
size=20br;
 print Input the names of the desired additional cells in the spaces
provided.;
 // this is where your user will name the cells he asked to create
 for($i=1;$i=$additional_cells;$i++)
  {
  print $i input type=text name=user_added[$i] size=20br;
  }
 print input type=hidden name=additional_cells value=\$additional_cells\
;
 print input type=hidden name=start_button value=2;
 print input type=submit value=\ Hit it! \;
 print /form;
 }
if ($start_button==2)
   {
print $name.br.$temp.br.$time.br.$offset.br;
for($i=1;$i=$additional_cells;$i++)
{
print user cell .$i. .$user_added[$i].br;
}
}
?


2. Now comes the tricky part, and the part I'm unsure about.  You can
convert the user input in the above so that it becomes the names of the
input cells, or you can leave them in a numeric array.  Leaving them in a
numeric array will be easier to deal with later.
Also, other than the display of a table, what do you want the user input
for?  If you're planning on doing any data manipulation, then your coding
will get a bit hairy because you won't know what relation the user input
data has to your standard data (name, time, temp and offset).  Finally, if
you're planning on storing the data in a database table, each table will
need to be created on the fly--it can be done, but if you're struggling with
this, it'll take you some time to get the back end working.

Hope this helps,
Hugh

- Original Message -
From: Floyd Baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: 'Hugh Danaher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, November 27, 2002 5:24 PM
Subject: Re: [PHP] dynamic arraynames




 Well I might be in 

[PHP] Multidimensional array

2002-11-28 Thread Mako Shark
(Thanks to all who've replied about the streaming
audio. Haven't had a chance to respond or anything
yet.)

Here is a problem I'm having similar to somethnig
someone just posted, but not quite the same. I'm not
too experienced with the intricacies and
complications of arrays, but I have a bunch of fields
like this for a magazine organizer (best way to put
it, I guess):

$issuenumber[]
$issueheadline[]
$issuewriters[]
$issuemonth[]
$issueyear[]
$issuedescription[]
among other fields.

I would like to store this all in one multidimensional
array, like
$issue-number[]
$issue-headline[]
etc.

What is the syntax? I'm bumbling around right now.
Also, if I sort() the array by number, would the rest
of the fields be properly sorted? I assume so, but
don't want to find out the hard way that it doesn't.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Hello ! How to write a programme in PHP which executes a routine at a given time ?

2002-11-28 Thread Jonathan
Dear all ,
 Hello ! I am a student and going to write a suit of programme . The
producers as follow

 producer 1.
 User A add an new appointment A ( open Winamp at 2:30 on computer B)
through IE in his local computer A .

 producer 2.
 Computer A send the message to server A through http . The Servlet /
ASP.net which locates on server A receives the message and send message to
computer B (IP or domain name of computer B is given , named
www.computerB.com) .

 producer 3.
 Computer B receives the message from server A through http at 1:01 . It is
expected to implement the new added appointment A ( open Winamp at 2:30 on
computer B ) at given time .

 I know what to implement the producer 1 and 2. However , I don't know how
to implement producer 3. Do you mind to tell me how to make a PHP programme
to execute a centian routine at a given time ? Thank you !



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




RE: [PHP] Hello ! How to write a programme in PHP which executes a routine at a given time ?

2002-11-28 Thread Jon Haworth
Hi Jonathan,

 Do you mind to tell me how to make a PHP programme
 to execute a centian routine at a given time ? Thank you !

PHP doesn't have anything built in that'll do this for you (at least,
nothing that I'm aware of). 

The best solution is to call your script from your OS's scheduler - cron
under unix/linux, or task scheduler in Windows. I usually trigger the script
with lynx and pipe it to /dev/null, but if you have PHP compiled as a
standalone instead of a server module, you could call it directly.

Cheers
Jon

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




[PHP] Detecting email bounces sent by the mail function?

2002-11-28 Thread Ade Smith
Hello

Is it possible to detect with PHP whether an email sent using the PHP
'mail' function has bounced back or has not been delivered?

I currently all ready check the email address using the 'ereg' function
before the mail function is called, but this only checks the format is
valid beforehand.

Ade


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




[PHP] Multidimensional arrays (more and more...)

2002-11-28 Thread Mako Shark
Wow. This goes way beyond simply printing
multidimensional arrays. Here's some sample data:

$issue[][number] = number;
$issue[][headline] = headling;
$issue[][writers] = writers;
$issue[][list] = list;
$issue[][senttosubscribers] = 0;
$issue[][month] = 05;
$issue[][year] = 2003;
$issue[][description] = description;

What I need to do now is count(), sort() by number,
and loop through this array.

I read that PHP is screwy when counting and sorting
multidimensional arrays, but they *have* to have come
up with a method, right?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Multidimensional arrays (more and more...)

2002-11-28 Thread Marek Kilimajer
if [$number] is unique, use it as the key:

// $issue[][number] = number; -- removed
$issue[$number][headline] = headling;
$issue[$number][writers] = writers;
$issue[$number][list] = list;
$issue[$number][senttosubscribers] = 0;
$issue[$number][month] = 05;
$issue[$number][year] = 2003;
$issue[$number][description] = description;

then sorting by the the number will be simple (ksort)

Mako Shark wrote:


Wow. This goes way beyond simply printing
multidimensional arrays. Here's some sample data:

$issue[][number] = number;
$issue[][headline] = headling;
$issue[][writers] = writers;
$issue[][list] = list;
$issue[][senttosubscribers] = 0;
$issue[][month] = 05;
$issue[][year] = 2003;
$issue[][description] = description;

What I need to do now is count(), sort() by number,
and loop through this array.

I read that PHP is screwy when counting and sorting
multidimensional arrays, but they *have* to have come
up with a method, right?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 



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




[PHP] File handling

2002-11-28 Thread Jeff
Quick one, how do i read a file for a key word, say TEXt, and the delete
the rest of the remaining file?





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




Re: [PHP] Detecting email bounces sent by the mail function?

2002-11-28 Thread DL Neil
Hello Ade,

 Is it possible to detect with PHP whether an email sent using the PHP
 'mail' function has bounced back or has not been delivered?

 I currently all ready check the email address using the 'ereg' function
 before the mail function is called, but this only checks the format is
 valid beforehand.


Yes, and No!

If you use the ReturnPath header SOME/most email servers will bounce msgs
that they can't deliver to an actual mailbox back to you (others drop such
msgs onto an Admin somewhere, lose them in the ether (the msgs not the
Admins...) etc, etc). Accordingly, use a distinct address for this/email
filing rules.

Opt-in email schemes which send a welcome/confirm email to new customers do
so for this reason - the only way to verify an email address is to use it
(and get some feedback from the addressee).

Of course, once you have 'located' a new user, you still have to cope with
those who close email accounts without advising you...

It's a wonderful world!
=dn




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




[PHP] Re: Multidimensional arrays (more and more...)

2002-11-28 Thread Mako Shark
Thanks to Paul and Marek for some ksort() advice. I'll
try that out as soon as I can count() these buggers.

A little more info on my count()ing.
I have $issue[0][number] to $issue[x][number] just
like any other multidimensional array (we'll call them
m-arrays for simplicity).

If I try to count($issue), I'll get all instances of
my array (instances?) mltipled by the number of
elements (don't know if this includes NULLs or not,
don't have NULLs). If I try to count($issue[]), it'll
give me the number of elements (8), which is also not
correct. If I try to count($issue[][number]) it says
I can't pass that to the count() function (which is
logical). But it leaves me with no way of count()ing
my instances.

My problem is I need to loop through these. So I can't
just assume that the count is count($issue[]) divided
by 8, because that won't work in a for loop. I suppose
I could just iterate through my for loop in jumps of
8, but that seems really hacky and unintuitive to
whomever has to figure out my code when I'm gone.

If there's a kcount(), I'm all for it. :)

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Detecting email bounces sent by the mail function?

2002-11-28 Thread Marek Kilimajer
Added to this: you won't receive the immediately, so you are not able to 
tell the user that sending
the mail has failed.

DL Neil wrote:

Hello Ade,

 

Is it possible to detect with PHP whether an email sent using the PHP
'mail' function has bounced back or has not been delivered?

I currently all ready check the email address using the 'ereg' function
before the mail function is called, but this only checks the format is
valid beforehand.
   



Yes, and No!

If you use the ReturnPath header SOME/most email servers will bounce msgs
that they can't deliver to an actual mailbox back to you (others drop such
msgs onto an Admin somewhere, lose them in the ether (the msgs not the
Admins...) etc, etc). Accordingly, use a distinct address for this/email
filing rules.

Opt-in email schemes which send a welcome/confirm email to new customers do
so for this reason - the only way to verify an email address is to use it
(and get some feedback from the addressee).

Of course, once you have 'located' a new user, you still have to cope with
those who close email accounts without advising you...

It's a wonderful world!
=dn




 



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




[PHP] Postnuke --- Meta keywords and title different for all the pages...

2002-11-28 Thread Manoj Nahar
Hi there,

I would like to know has anybody being able to do this.

Each page has its own meta keywords and title.

I have searched lot of information about it but no luck.

any help or pointer with this would be greatly appreciated.

Manoj 


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



Re: [PHP] Detecting email bounces sent by the mail function?

2002-11-28 Thread Michael Sims
On Thu, 28 Nov 2002 17:54:46 -, you wrote:

Hello

Is it possible to detect with PHP whether an email sent using the PHP
'mail' function has bounced back or has not been delivered?

Hi,

If you're using PHP on a unix/linux with sendmail you can set the
envelope sender via the 5th parameter to the mail function,
additional_parameters.  Normally the envelope sender is the username
that your web server process runs under (usually nobody if you're
using Apache), but you can set it to either your email address or an
email address you have setup specifically to catch bounces.  Example:

mail('[EMAIL PROTECTED]', 'Test email', 'This is a test', '',
'[EMAIL PROTECTED]');

Most MTA in existence will route DSNs to the envelope sender, not the
From: header.

Note that sendmail will add an X-Warning header if the user your web
server runs as isn't considered a sendmail trusted user.  The
quickest way to fix this (on Redhat machines anyway) is to put the
username in /etc/mail/trusted-users.  Other systems and sendmail
installations may differ, so YMMV.

HTH...

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




[PHP] Help with the PHP

2002-11-28 Thread Ted Frank
Hello,

I am trying to make my free home page and my friend told me to download the 
php because it is for the web and i want to make a web page. so i downloaded 
the php with the flash plugin and i put it on my desktop and nothing showed 
up - i just want to make the free home page but the php does not work - i 
double click and noting happens

i have the windows 95 with internet exploerer with a pentium 100 drive

what do i do?

Ted

_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



Re: [PHP] Re: [PHP-DEV] Parse search string a la Google (Regular expression?)

2002-11-28 Thread Benny Rasmussen
Works like a charm, thank you!

Benny

Ernest E Vogelsinger [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 23:11 27.11.2002, Ernest E Vogelsinger said:
 [snip]
 If I understand you correctly you want to isolate either quoted strings
 (with or without whitespace), or tokens separated by whitespace, as array
 elements?
 
 For this you would first have to isolate the first quoted sentence, then
 tokenize the part before, and loop this as long you're not done.
 
 Should work something like that:
 
  [...]
 Disclaimer: untested as usual. _Should_ behave like this:
 [snip]

 I _should_ have tested. This script actually works the way you expect it
to be:

 code
 xmp
 ?php

 function tokenize_search($input) {
 $re = '/\s*(.*?)\s*\s*([^]*?)\s*\s*(.*)/s';
 /* look for 3 groups:
a - prematch - anything up to the first quote
b - match - anything until the next quote
c - postmatch - rest of the string
 */
 $tokens = array();
 while (preg_match($re, $input, $aresult)) {
 // aresult contains: [0]-total [1]-a [2]-b [3]-c
 // tokenize the prematch
 if ($aresult[1]) $tokens = array_merge($tokens, explode(' ',
 $aresult[1]));
 array_push($tokens, $aresult[2]);
 $input = $aresult[3];
 }
 // $input has the rest of the line
 if ($input) $tokens = array_merge($tokens, explode(' ', $input));
 return $tokens;
 }

 $string = \search for this sentence\ -NotForThisWord
 ButDefinitelyForThisWord;
 $tokens = tokenize_search($string);
 print_r($tokens);

 ?
 /code

 The output of this script is:

 Array (
 [0] = search for this sentence
 [1] = -NotForThisWord
 [2] = ButDefinitelyForThisWord
 )


 --
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/





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




RE: [PHP] Detecting email bounces sent by the mail function?

2002-11-28 Thread scott
What would php run as on a cobalt raq4 so I don't get the x header
warning
Best regards

-Original Message-
From: Michael Sims [mailto:[EMAIL PROTECTED]] 
Sent: 28 November 2002 19:51
To: [EMAIL PROTECTED]
Cc: Ade Smith
Subject: Re: [PHP] Detecting email bounces sent by the mail function?


On Thu, 28 Nov 2002 17:54:46 -, you wrote:

Hello

Is it possible to detect with PHP whether an email sent using the PHP 
'mail' function has bounced back or has not been delivered?

Hi,

If you're using PHP on a unix/linux with sendmail you can set the
envelope sender via the 5th parameter to the mail function,
additional_parameters.  Normally the envelope sender is the username
that your web server process runs under (usually nobody if you're
using Apache), but you can set it to either your email address or an
email address you have setup specifically to catch bounces.  Example:

mail('[EMAIL PROTECTED]', 'Test email', 'This is a test', '',
'[EMAIL PROTECTED]');

Most MTA in existence will route DSNs to the envelope sender, not the
From: header.

Note that sendmail will add an X-Warning header if the user your web
server runs as isn't considered a sendmail trusted user.  The quickest
way to fix this (on Redhat machines anyway) is to put the username in
/etc/mail/trusted-users.  Other systems and sendmail installations may
differ, so YMMV.

HTH...

-- 
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] Help with the PHP

2002-11-28 Thread Hatem Ben
Welcome to the new world ;)

before clicking or asking start reading what is PHP (http://www.php.net),
and in what it could be usefull.
then you can getting started here :
http://www.php.net/manual/en/tutorial.php


- Original Message -
From: Ted Frank [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 28, 2002 8:47 PM
Subject: [PHP] Help with the PHP


 Hello,

 I am trying to make my free home page and my friend told me to download
the
 php because it is for the web and i want to make a web page. so i
downloaded
 the php with the flash plugin and i put it on my desktop and nothing
showed
 up - i just want to make the free home page but the php does not work - i
 double click and noting happens

 i have the windows 95 with internet exploerer with a pentium 100 drive

 what do i do?

 Ted

 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*.
 http://join.msn.com/?page=features/featuredemail


 --
 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] Multidimensional arrays (more and more...)

2002-11-28 Thread Mako Shark
if [$number] is unique, use it as the key:

Yeah, I'd thought of that except there's no guarantee
that it will be unique.

Plus, it makes it harder to go through with a simple
loop because $number really isn't guaranteed to be
numeric (okay, so I have to change the name). Plus, it
may not even start from 0, For instance, it doesn't
have to be from 1-10, it could be from 75-85.



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] RE: [PHP-DB] Help with date

2002-11-28 Thread Aaron Wolski
Well...

1 day = 60*60*24 = 86400

You figure it out from there :)

Just one example.

Aaron

-Original Message-
From: Dankshit [mailto:[EMAIL PROTECTED]] 
Sent: November 28, 2002 12:06 PM
To: PHP; PHP1
Subject: [PHP-DB] Help with date


How can i add days to a date??




Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 




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




Re: [PHP] Multidimensional arrays (more and more...)

2002-11-28 Thread Matt Vos
You don't need sequential numbers as your key.
Take this example:

/*** define some values ***/
$fruits['apple']['color']=$color;
$fruits['apple']['diameter']=$x;
$fruits['orange']['color']=$color;
$fruits['orange']['diameter']=$x;
$fruits['grape']['color']=$color;
$fruits['grape']['diameter']=$x;

/*** Grab the keys ***/
$fruit_types = array_keys($fruits);
$count = 0;
while ($count  count($fruit_types))
{
$fruit = $fruit_types[$count];
$color = $fruits[$fruit]['color'];
$diameter = $fruits[$fruit]['diameter'];
}


Matt
- Original Message - 
From: Mako Shark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 28, 2002 3:45 PM
Subject: Re: [PHP] Multidimensional arrays (more and more...)


 if [$number] is unique, use it as the key:
 
 Yeah, I'd thought of that except there's no guarantee
 that it will be unique.
 
 Plus, it makes it harder to go through with a simple
 loop because $number really isn't guaranteed to be
 numeric (okay, so I have to change the name). Plus, it
 may not even start from 0, For instance, it doesn't
 have to be from 1-10, it could be from 75-85.
 
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 -- 
 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] session_name() - Question

2002-11-28 Thread Juerg Zgraggen
hi
i have the following script:

?php
 session_name(MySession);
 session_start();
 echo h1Session START/h1;
 $HTTP_SESSION_VARS[mctini] = parse_ini_file(mct.ini, true);;
 print_r($HTTP_SESSION_VARS[mctini]);
?

everytime i reload the page, a new session will be generated! i do not want
that! when i take out the session_name() and reload the page a few times, NO
new session will be generated an the old one will be detecded everytime like
i would like to have it! what does this function session_name() indicated
that everytime a new session is generated...? how do i use this function
correctly?

thanx for all answers
regards, jürg zgraggen





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




[PHP] help with session variables

2002-11-28 Thread Thomas Goeminne
? include ('./header.php');
$query=select prodid, title FROM fatbeats_prod;
$result= mysql_query($query);
$names= mysql_fetch_assoc($result);

$query1=select prodid, price from fatbeats_prod;
$result1=mysql_query($query1);
$prices= mysql_fetch_assoc($result1);

 while (list($key,$val) = each($qty)) {
 $shoppingCart[$key] = $val;
}
while (list($key,$val) = each($shoppingCart)) {
 $currentName = $names[$key];
 $currentPrice = $prices[$key];
 echo You added $val of $currentName to your cart, which costs
$currentPrice euro. BR;
}
 include ('./footer.php');
 ?

What i need is to declare the arrays $names and $prices
And select the prodid as key and the title as val how can I do this?

I tried select prodid as key, title as val
but that doesnt work.

thx for any help



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




php-general Digest 28 Nov 2002 23:44:52 -0000 Issue 1732

2002-11-28 Thread php-general-digest-help

php-general Digest 28 Nov 2002 23:44:52 - Issue 1732

Topics (messages 126398 through 126442):

rewrite urls with preg_replace
126398 by: Dieter Koch
126417 by: liljim
126418 by: John W. Holmes

Re: controlling ownership on file uploads ...
126399 by: Marek Kilimajer

Re: Bad File Mode?
126400 by: Marek Kilimajer
126402 by: Ernest E Vogelsinger

Re:  Converting dynamic webpages into static HTML pages
126401 by: Marek Kilimajer

Re: printing screen without the print dialog
126403 by: Marek Kilimajer

Bizarreness with htmlentities() and other things
126404 by: James Coates
126410 by: Rich Gray
126412 by: James Coates

Re: session problems again
126405 by: Marek Kilimajer

Re: editing .htaccess / .htpasswrd
126406 by: Mika Tuupola
126407 by: James Coates

String function
126408 by: Shaun
126409 by: Marco Tabini

Re: PHP 4.3.0RC2 released
126411 by: Vadim Tkachenko

Re: echo'ing array contents through reference variable ... why doesn't this work???
126413 by: -[ Rene Brehmer ]-

Re: echo'ing array contents through reference variable
126414 by: -[ Rene Brehmer ]-

mysql, php, checkbox
126415 by: Adrian Partenie
126416 by: John W. Holmes

Re: Password Script
126419 by: Bobby Patel

2D Array
126420 by: Khalid El-Kary

Re: dynamic arraynames
126421 by: Floyd Baker

Re: [PHP-DB] Help with date
126422 by: Aaron Wolski

Multidimensional array
126423 by: Mako Shark

Hello ! How to write a programme in PHP which executes a routine at a given time ?
126424 by: Jonathan
126425 by: Jon Haworth

Detecting email bounces sent by the mail function?
126426 by: Ade Smith
126430 by: DL Neil
126432 by: Marek Kilimajer
126434 by: Michael Sims
126437 by: scott

Multidimensional arrays (more and more...)
126427 by: Mako Shark
126428 by: Marek Kilimajer
126431 by: Mako Shark
126439 by: Mako Shark
126440 by: Matt Vos

File handling
126429 by: Jeff

Postnuke ---   Meta keywords and title different for all the pages...
126433 by: Manoj Nahar

Help with the PHP
126435 by: Ted Frank
126438 by: Hatem Ben

Re: [PHP-DEV] Parse search string a la Google  (Regular expression?)
126436 by: Benny Rasmussen

session_name() - Question
126441 by: Juerg Zgraggen

help with session variables
126442 by: Thomas Goeminne

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---
Hi to all the PHP-Fans out there,

i have a syntax-problem with the folowing preg_replace command:

$returnString = preg_replace(/(href=\)(.+?)(\)/is,
preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);

i'm trying to call my own function within a preg_replace function and it
won't work.
any ideas ? it seems to me, that the quoting is incorrect, but i'm not
shure, why it is incorrect,
especially because i use preg_quote() ...

thanks in advance for some hints !

best regards
[EMAIL PROTECTED]






---End Message---
---BeginMessage---
Hi Dieter,

You need to use the 'e' modifier as well as 'is' in your pattern. Have a
look in the manual, here:

http://www.php.net/manual/en/pcre.pattern.modifiers.php

If this modifier is set, preg_replace() does normal substitution of
backreferences in the replacement string, evaluates it as PHP code, and uses
the result for replacing the search string.

Also look here:
http://www.php.net/manual/en/function.preg-replace.php

And check the Example 2. Using /e modifier part.

Hope that helps ;)

James


Dieter Koch [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi to all the PHP-Fans out there,

 i have a syntax-problem with the folowing preg_replace command:

 $returnString = preg_replace(/(href=\)(.+?)(\)/is,
 preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);

 i'm trying to call my own function within a preg_replace function and it
 won't work.
 any ideas ? it seems to me, that the quoting is incorrect, but i'm not
 shure, why it is incorrect,
 especially because i use preg_quote() ...

 thanks in advance for some hints !

 best regards
 [EMAIL PROTECTED]








---End Message---
---BeginMessage---
 Hi to all the PHP-Fans out there,
 
 i have a syntax-problem with the folowing preg_replace command:
 
 $returnString = preg_replace(/(href=\)(.+?)(\)/is,
 preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);
 
 i'm trying to call my own function within a preg_replace function and
it
 won't work.
 any ideas ? it seems to me, that the quoting is incorrect, but i'm not
 shure, why it is incorrect,
 especially 

[PHP] Werid problemswith mail() command: From address on sent messages

2002-11-28 Thread C.F. Scheidecker Antunes
Hello All,

I wonder if is there anyone who ever had the same problem and know how to solve it.

I have a web site that does send e-mail to some users based on requests. The problem 
is that although I pass the right user/from address on the mail function, the message 
source shows From as beeing apache@localhost and therefore some messages bouce back 
due to anti spam filters.

This server is a Red Hat Linux 7.2 and it does not have apache 2.0 but 1.3. It does 
not have sendmail runnig or installed but another server on the same network does have 
it.

The problem is that I do not want and cannot have my message headers with a From: 
Apache@LocalHost as this copy bellow shows:

I've changed the header variable and put a From in it so it does displays the right 
FROM: address as bellow. But as you can see, the Received: (from apache@localhost) by 
servername, etc is there so the spam filters filter it.

Return-Path: apache
Received: (from apache@localhost)
 by ns1.nando.net (8.11.2/8.11.2) id gASLtQM27458;
 Thu, 28 Nov 2002 19:55:26 -0200
Date: Thu, 28 Nov 2002 19:55:26 -0200
Message-Id: [EMAIL PROTECTED]
To: [EMAIL PROTECTED] 
Subject: Order # 603 (511066220021128194052)
Content-Type: text/html
From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
X-Mailer: PHP/

My php.ini has an smtp entry but no sendmail is running on the local machine. Do I 
have to have one running? I wish I did not have to do it. Any other way to fix this 
issue?




Carlos Fernando Scheidecker Antunes
Linux User #207984



[PHP] Suppressing X-Return-Path

2002-11-28 Thread Darren Fehrmann
Has anyone had experience with PHP or a mail server setting the X-Return-Path header 
on mail sent using PHP's mail() command?  
Our tests indicate the X-Return-Path is being set to the sendmail_from address found 
in php.ini.  Our code definately isn't doing it, as a hello-world mail() example 
proved.  

The system is running Win 2K, all current service packs and hot fixes, IIS 5, php 
4.2.3 (running as a CGI),  and the Zend optimizer 2.0.1.  The mail server is Microsoft 
Exhange Server.  

Does anyone know why the webserver or mail server would set the X-Return-Path, and if 
it can be suppressed?

Regards,

Darren Fehrmann
Storefront.com

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




Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?

2002-11-28 Thread Axis Computers
Thanks for replying,

Now I know it's possible to do it, but I still don't know how can I develop
such interface, I will do it in php and mysql, but I need a little guidance
with the way to do it I just can't figure out how ...

Thank you

Ricardo Fitzgerald

- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Wednesday, November 27, 2002 10:34 AM
Subject: Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?


 Using javascript you can change the src of image. So you start with
 blank image, and if onchange
 event handler finds out the input field has two chars, changes the src
 of the image to say show_image.php?id=input.value

 Axis Computers wrote:

 Hi,
 
 I was wondering if this is possible to in PHP ... I am developing an
 application for a pizza place, where touch typing interface is much
faster
 than using the mouse, so I was wondering if I can develop an interface
with
 a calculator style keypad, and the codes entered (using something like
STDIN
 in Perl), are automatically compared to the MySQL database to provide
 realtime feedback to the user, such as code 32 is hawaian pizza, and
after
 the user enters code 32 Hawaian pizza get's displayed as feedback ... and
 then awaits for some other input such as size, etc...
 
 i.e.
 
 x-
 32 Hawaian pizza14 $ 12
 xx xxx  
 
 Total = 
 
 
 Thanks in advance,
 
 Ricardo Fitzgerald
 AXIS  Computers
 Web development
 
 
 __ Omni
 ICQ#: 37031810 Current ICQ status: + More ways to contact me
 __
 
 
 
 


 --
 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] file creation date

2002-11-28 Thread Research and Development
Is it possible to get the creation date of a file that is going to be 
uploaded? I saw a function that returns the file creation date once on 
the server, but is it possible to get that information from a file that 
is not yet on the server?

Thanks in advance.


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



RE: [PHP] Postnuke --- Meta keywords and title different for all the pages...

2002-11-28 Thread Peter Houchin
Howdy,

um what exactly do you want to do? add meta tag's to each individual
page?

 -Original Message-
 From: Manoj Nahar [mailto:[EMAIL PROTECTED]]
 Sent: Friday, 29 November 2002 5:26 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Postnuke --- Meta keywords and title different for all
 the pages...


 Hi there,

 I would like to know has anybody being able to do this.

 Each page has its own meta keywords and title.

 I have searched lot of information about it but no luck.

 any help or pointer with this would be greatly appreciated.

 Manoj


 --
 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] Re: PHP 4.3.0RC2 released

2002-11-28 Thread Vadim Tkachenko
Archive php-4.3.0RC2.tar.gz contain directory autom4te-2.53.cache.
With this directory I can't build my own extension, because buildconf can't
find their.

Vadim Tkachenko.


Andrei Zmievski [EMAIL PROTECTED] ???/ ? 
?: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The second release candidate of the inimitably fabulous PHP version 4.3.0
is
 out. It can be downloaded from http://qa.php.net. Give it a good testing!

 -Andrei




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




Re: [PHP] File handling

2002-11-28 Thread Justin French
 Quick one, how do i read a file for a key word, say TEXt, and the delete
 the rest of the remaining file?


Do you mean:

a) how do i make sure a word (eg foo) is in a file, and if it is, delete
all contents of the file except the word foo OR

b) how do i search a file for the word foo, and delete everything in the
file AFTER the word foo

??


Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




[PHP] Help with login/redirect/insert to dbase

2002-11-28 Thread Karl James
Hello guys
 
Happy thanksgiving!!!
 
My question is 
I'm Trying to apply this code to what I have done already on my site
http://robouk.mchost.com/tuts/tutorial.php?tutorial=login1
 
 
my site is this.
http://www.ultimatefootballleague.com
http://www.ultimatefootballleague.com/ 
 
Im trying to do with login and if login is good 
It takes you to the team page.
 
But I have some questions on this and need to talk to someone online
If possible, I can meet via MSN and IRC 
 
Please email if interested in helping.
 
 



RE: [PHP] file creation date

2002-11-28 Thread John W. Holmes
 Is it possible to get the creation date of a file that is going to be
 uploaded? I saw a function that returns the file creation date once on
 the server, but is it possible to get that information from a file
that
 is not yet on the server?

Not with PHP.

---John Holmes...



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




[PHP] IRCG/PHP and Apache 1.3

2002-11-28 Thread Sascha Schumann
Hi!

For all of you who are interested in running IRCG together
with Apache 1.3, I suggest you have a look at this page.

URL:http://schumann.cx/ircg/ircg4.php

Spoiler: IRCG 4 will run inside Apache 1.3.

--
About IRCG

IRCG is a revolutionary way for dispatching messages to huge
groups of users over an arbitrary number of separate
communication channels in real-time. IRCG provides message
streams over persistent HTTP connections and can interface
with a subsystem to produce static file snippets. All aspects
of IRCG are scriptable using PHP. IRCG is format and content
agnostic, and can produce any output format you require,
including XML, XHTML/HTML, and WML.

Typical applications of IRCG include online gaming/gambling
sites and web chat systems.

- Sascha

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




[PHP] Logging out and session ids

2002-11-28 Thread Gerard Samuel
I was just going through the archive.  Seems this comes up enough for me 
to think I have something wrong.
A simplistic code flow of events...
?php
session_start();

// user successfully logs in, set a session variable
$_SESSION['user_id'];

// when the user logs out, destroy session and redirect to top
$_SESSION = array();
setcookie(session_name(), '', time() - 3600);
session_destroy();

header('location: back_to_top');

?

Ok, so when the user logs in, a session id is assigned to them.
When they log out and are redirected to the beginning, the session id is 
the same (verified by the file name in /tmp and cookie manager in mozilla).
My question is, even though the session contains no data after its 
destroyed, should the session id remain the same, after logging out,
or should another be assigned when session_start() is called after the 
redirect???

Thanks

--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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



[PHP] how to use mssql_connect()?

2002-11-28 Thread Kim
when i using mssql_connect() function,that's show Fatal error: Call to
undefined function: mssql_connect() on php page,i don't know why that it
is!
php 4.2.3
sql server 2000
apache 1.3.19
windows 2000 pro

php.ini had configurated ok.




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