Re: [PHP] Seating chart registration system?

2003-06-21 Thread Don Read

On 21-Jun-2003 Jay Fitzgerald wrote:
 I am writing a php event registration system for lanparties and I believe
 I have everything written that I need except for a seating selection
 chart.

snip
 
 As a person goes through the event registration system, they will come to
 a 
 page that displays 8 rows of 30 seats (240 seats total)...but in the
 future 
 I would like to have admin capability to increase or decrease this
 amount. 

snip


 Then when the next person decides to register, when they get to that
 page, one less seat will be available. I would like to have as much
 control as  possible and I do know a minor bit of php and mysql.
 
 Any help or guidance is appreciated.
 

programmer doodle

Couple of thoughts ...

Each 'event' is unique to time and place. 
So you'll need a 'event' table with datetime, interval, name,
description and a place (or 'forum' --see next paragraph).

table event (
  id int unsigned auto_inc primary key,
  idforum int unsigned,
  ebeg datetime not null, // begins
  eend datetime not null default '0', // ends
  emin int unsignd default 0, // how long in minutes 
  name varchar(64),
  descript text,
  index idx_b (ebeg),  // might be handy ...
  index idx_f (idforum)
)
 
Each place is (usually) limited to hosting one 'event' at any interval.
But some places can have several events at the same time. Consider a major
hotel and all the conference rooms --or a sports stadium with all the
owner, boxholder's, home-team,  visting-team parties ...

So 'place' is a poor term. I'll suggest using 'forum' as the locale to be
to attend a particular event.

Also you'll have to think about assigned seating and/or general admission
seating. 

Example:

At the downtown Hilton, the local Lions club might reserve the Omega room
w/ 5 seats per 4 tables, general admission. 
But a dinner with President Bush in the Omega room is gonna run like 6
seats @ 40 tables. And definitely assigned seating.

Same room name but clearly a different 'forum'.

It's a toss-up if this should be a field in the 'event' or in the
'forum' table. I go with forum.

So there's another table:

table forum (
  id int unsigned auto_inc primary,
  name varchar(16),
  descript text,
  ftype enum('A', 'G'), // assigned or general seating
  m_block int unsigned not null,// max # of seating blocks
  m_seats int unsigned not null,// seats per block
  block_type enum('row','table','section') not null default 'row',
 // what does m_block encompass?
  seat_limit int unsigned not null default 0,
 // maximum seats (m_block * m_seats where ftype='A')
  unique index (name)
)

Then there is seating. 

When each event/forum is scheduled your app adds m_block * m_seats to 
a seating table.

For general admission add block=x, seat=1 - seat_limit.

 --- 

The 'seating' table is where it gets tricky --and where it gets solved.

table seating (
  idforum int unsigned not null,  // link to forum description.
  block int unsigned not null,// a dinner table or stadium row
  seat int unsigned not null, // d'oh
  guest int unsigned not null default 0, // who has this seat ? 
  primary key (idforum, block, seat),
  INDEX idx_g (guest) // handy stuff.
)

Assigned seating:

As each guest reserves a [optional] seat:
UPDATE seating SET guest='$idguest' 
  WHERE idforum='$idforum' AND block='$idblock' [AND seat='$idseat']
  AND guest=0

General admission:

UPDATE seating SET guest='$idguest' 
  WHERE idforum='$idforum' AND block='$idblock'
  AND guest=0

/programmer doodle

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] Header, Directory, and SESSIONs

2003-06-21 Thread nabil
Hi all, wish u all a good weekend..
Guys I have a question as the following:

1- In my wwwroot I have two folders : folder1  and folder2 (actually I have
14 folders)
2- In the same two folders there are same PHP files do the same job, as db
jobs with different databases..
3- I log in the users by register a session, lab lab lab ... etc
4- the logging files in the two folders are different by registering a
different session value.
4- I want if any user jumped to the other directory and logged in with the
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED
automatically, so he can't be logged in in both at same time.. and keep only
the new.. and ofcourse have to re logging if he jumped back to the first
one...
 (the reason that every folder has different DB connection, and the
interface of the two section are identical.. so I need to split it .to avoid
any problems with many users )

5- what I m trying to do is , if there is a possibility to control the
header.. by if { /folder1 go } else { unregister session whatever}
if {/ folder2 .. } else {.} etc

6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the
first place..

I HOPE I WAS CLEAR, and thanks for your patient again...   :))
Regards
Nabil



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



[PHP] Header, Directory, and SESSIONs

2003-06-21 Thread nabil
Hi all, wish u all a good weekend..
Guys I have a question as the following:

1- In my wwwroot I have two folders : folder1  and folder2 (actually I have
14 folders)
2- In the same two folders there are same PHP files do the same job, as db
jobs with different databases..
3- I log in the users by register a session, lab lab lab ... etc
4- the logging files in the two folders are different by registering a
different session value.
4- I want if any user jumped to the other directory and logged in with the
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED
automatically, so he can't be logged in in both at same time.. and keep only
the new.. and ofcourse have to re logging if he jumped back to the first
one...
 (the reason that every folder has different DB connection, and the
interface of the two section are identical.. so I need to split it .to avoid
any problems with many users )

5- what I m trying to do is , if there is a possibility to control the
header.. by if { /folder1 go } else { unregister session whatever}
if {/ folder2 .. } else {.} etc

6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the
first place..

I HOPE I WAS CLEAR, and thanks for your patient again...   :))
Regards
Nabil



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



[PHP] MAIL( ) - Send mail using another SMTP

2003-06-21 Thread Chinmoy Barua
Hello Everybody,

I don't have sendmail/qmail on my web server where i
installed PHP. But I want to send mails from web
server using PHP. 

Can anybody tell me, how can i use another SMTP server
to send mails? I don't like to change php.ini on my
web server.

Thank You,
- Chinmoy


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP] Fw: Help

2003-06-21 Thread Tirnovanu Aurel
 Can anyone tell why this script:

  $query = INSERT INTO mos_articles (catid, title, content, date, author,
 approved, published) VALUES
('5','$title','$content','$data','$author','1','1');
 $result = mysql_query($query);

 add in title field array and not the input.



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



RE: [PHP] Fw: Help

2003-06-21 Thread Naintara Jain
You possibly have a select list box named 'title[]' remove the brackets []
and rename the list box 'title'. That should work.
-Naintara

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Behalf Of Tirnovanu Aurel
Sent: Saturday, June 21, 2003 12:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Fw: Help


 Can anyone tell why this script:

  $query = INSERT INTO mos_articles (catid, title, content, date, author,
 approved, published) VALUES
('5','$title','$content','$data','$author','1','1');
 $result = mysql_query($query);

 add in title field array and not the input.



--
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] saving TEXTAREA data into mysql database

2003-06-21 Thread Artoo
Hey,

How do you save the data from a TEXTAREA of a form into a mysql database so
that when you retrieve the data later you get the same format that the user
entered

EXAMPLE
user enters the following and cliks save

Line 1 testing
Line 2 TEST

Line 4 test

line 5 test

test

testing

result when displaying data

Line 1 testingLine 2 TESTLine 4 testline 5 testtesttesting


How do I get it so the format is the same?

Thanks



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



Re: [PHP] securing a graphic

2003-06-21 Thread Justin French
I'm with Steve on this.  Call them (the numerous hacks mentioned in this
thread) deterrents if you like, but there is NO WAY to secure images.

You can brand them with a big watermark, and make sure your copyright and
terms of use notice are prominent on the page, but the nature of the web is
that they ALREADY HAVE downloaded a copy.

Justin


on 20/06/03 8:17 AM, Steve Keller ([EMAIL PROTECTED]) wrote:
 
 No there is not a way. The way the web works is by sending your content to
 someone else' computer. Once it's there, they have a copy, whether it's in
 their cache or actually saved as a file. There's no way to prevent a
 determined user from stealing your images, trust me on this one, a good
 number of my photoshops are being sent around as anonymous funny emails.
 
 You can disable right-clicking with javascript, but this is pointless. In
 IE, the user can just drag your image up to the address bar and poof, your
 javascript is gone. And on browsers that can't do that, there's still the
 cache. Even if, by some scripting voodoo you manage to keep your images
 from ending up in the cache, what's the keep the user from just doing a
 screen capture?


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



[PHP] making image smaller with same aspect ratio

2003-06-21 Thread Artoo
Hey all,

How do you reduse an image while keeping the same aspect ratio so not to
distort the image

Thanks



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



[PHP] Re: GD library update

2003-06-21 Thread Yury B .
Thank you the problem is solved, I just downloaded php_gd2.dll from 
gd site and inabled it in php.ini Now everything is working as it 
should.

Yury

On 19 Jun 2003 at 17:24, Andrei BEJENARU wrote:

 
 Yury B . [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi,
  I need to use function imagecreatetruecolor() in my script but it
  doesn't work on my local apache+php+mysql on XP server. It works fine
  on the real server though but i need to play with it around. What do
  I need to do to get it work? from docs I understand I need gd 2.0.1
  or higher, well how to get it and how to install?
 
  Thank you,
 
  Yury
 
 The gd library is shipped with the PHP distribution, so you should simply
 upgrade to version 4.3.1 or 4.3.2.
 You must download the big zip distribution, as it has all the needed
 libraries.
 Follow the instructions in the install readme file and you should have no
 problems.
 
 Andrei BEJENARU
 
 
 

God is our provider 
http://www.body-builders.org/


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



Re: [PHP] securing a graphic

2003-06-21 Thread Lars Torben Wilson
On Sat, 2003-06-21 at 00:51, Justin French wrote:
 I'm with Steve on this.  Call them (the numerous hacks mentioned in this
 thread) deterrents if you like, but there is NO WAY to secure images.
 
 You can brand them with a big watermark, and make sure your copyright and
 terms of use notice are prominent on the page, but the nature of the web is
 that they ALREADY HAVE downloaded a copy.
 
 Justin

Yup. If my computer can display it, I can save it.


-- 
 Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



php-general Digest 21 Jun 2003 10:29:11 -0000 Issue 2130

2003-06-21 Thread php-general-digest-help

php-general Digest 21 Jun 2003 10:29:11 - Issue 2130

Topics (messages 152352 through 152375):

Chomp, Chomp, Chomp
152352 by: Sparky Kopetzky
152353 by: Sparky Kopetzky
152354 by: Lars Torben Wilson
152356 by: Lars Torben Wilson
152357 by: Aaron Axelsen
152358 by: Lars Torben Wilson

Re: PHP Problem regarding updating through text boxes
152355 by: electroteque

Not incrementing?
152359 by: Kyle Babich
152360 by: Lars Torben Wilson

Seating chart registration system?
152361 by: Jay Fitzgerald
152365 by: Don Read

stream_wrapper_register
152362 by: Larry E. Masters

Re: Email Valadation
152363 by: Manuel Lemos

Re: Password generator
152364 by: Manuel Lemos

Header, Directory, and SESSIONs
152366 by: nabil
152367 by: nabil

MAIL( ) - Send mail using another SMTP
152368 by: Chinmoy Barua

Re: Help
152369 by: Tirnovanu Aurel
152370 by: Naintara Jain

saving TEXTAREA data into mysql database
152371 by: Artoo

Re: securing a graphic
152372 by: Justin French
152375 by: Lars Torben Wilson

making image smaller with same aspect ratio
152373 by: Artoo

Re: GD library update
152374 by: Yury B.

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---
Does anyone have a piece of code that emulates a Perl 'Chomp' function? I need one.

Thanks in advance!!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net

---End Message---
---BeginMessage---
I looked at the documentation on rtrim. It trims ALL whitespace characters
from the end, not just the '\n'. I need only the '\n' trimmed.

Sparky
- Original Message -
From: Lars Torben Wilson [EMAIL PROTECTED]
To: Sparky Kopetzky [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Friday, June 20, 2003 16:47
Subject: Re: [PHP] Chomp, Chomp, Chomp


 On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
  Does anyone have a piece of code that emulates a Perl 'Chomp' function?
I need one.
 
  Thanks in advance!!
 
  Robin E. Kopetzky
  Black Mesa Computers/Internet Services
  www.blackmesa-isp.net

 This should do it for you:  http://www.php.net/rtrim


 Good luck!


 Torben


 --
  Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
  http://www.hybrid17.com  http://www.themainonmain.com
  - Boycott Starbucks!  http://www.haidabuckscafe.com -




---End Message---
---BeginMessage---
On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
 Does anyone have a piece of code that emulates a Perl 'Chomp' function? I need one.
 
 Thanks in advance!!
 
 Robin E. Kopetzky
 Black Mesa Computers/Internet Services
 www.blackmesa-isp.net

This should do it for you:  http://www.php.net/rtrim


Good luck!


Torben


-- 
 Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -



---End Message---
---BeginMessage---
On Fri, 2003-06-20 at 15:47, Sparky Kopetzky wrote:
 I looked at the documentation on rtrim. It trims ALL whitespace characters
 from the end, not just the '\n'. I need only the '\n' trimmed.

Look again, but check out the second argument:

?php
error_reporting(E_ALL);
ini_set('display_errors', true);

$foo = bar \n;
$bar = rtrim($foo);
$baz = rtrim($foo, \n);
echo \$foo == '$foo'; \$bar == '$bar'; \$baz == '$baz'\n;
?


Good luck,

Torben


 Sparky
 - Original Message -
 From: Lars Torben Wilson [EMAIL PROTECTED]
 To: Sparky Kopetzky [EMAIL PROTECTED]
 Cc: PHP General [EMAIL PROTECTED]
 Sent: Friday, June 20, 2003 16:47
 Subject: Re: [PHP] Chomp, Chomp, Chomp
 
 
  On Fri, 2003-06-20 at 15:37, Sparky Kopetzky wrote:
   Does anyone have a piece of code that emulates a Perl 'Chomp' function?
 I need one.
  
   Thanks in advance!!
  
   Robin E. Kopetzky
   Black Mesa Computers/Internet Services
   www.blackmesa-isp.net
 
  This should do it for you:  http://www.php.net/rtrim
 
 
  Good luck!
 
 
  Torben
 
 
  --
   Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
   http://www.thebuttlesschaps.com  http://www.inflatableeye.com
   http://www.hybrid17.com  http://www.themainonmain.com
   - Boycott Starbucks!  http://www.haidabuckscafe.com -
 
 
 
-- 
 Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 

[PHP] Re: making image smaller with same aspect ratio

2003-06-21 Thread azero
 Hey all,

 How do you reduse an image while keeping the same aspect ratio so not to
 distort the image

 Thanks

Original image: x - 800 y - 600
New size: x1 -100 y1 - ?

y1 = 600*100/800 = 75

formula is: y1 = y*x1/x
the same if you want to find x1 when know y1.



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



[PHP] search-and-highlight issue (byt tes)

2003-06-21 Thread 457945
hello!

i have a problem with a search-and-highlight script (see code below):

a search for byt tes matches entries that contain bytes but only
highlights byt*.

*) because after the first search term (byt) is found the line is modified
into span class=highlightbyt/spanes and therefore the secound search
term (tes) can't be highlighted anymore.


1. general question

i'm not quite sure if a search like this should match entries that contain a
combination of both terms (bytes).
of course, the word bytes contains both search terms - but on the other
hand, a search for byt tes indicates that i'm looking for TWO terms (and
also for TWO ts).


2. how to do it anyway?

do you have an idea how to accomplish that this kind of search
- either: does NOT display entries that match bytes
- or: displays entries that contain bytes and highlights bytes

(because both solutions seem to be somehow logical it may depend on the
easiness of creation and/or the speed of processing.)


thanks a lot for your effort!!

best wishes

philipp
www.ipdraw.org


---
code

notes:
- the highlight/preg_replace part is built to skip html tags.
- if you have any other suggestions for improvements, please let me know.


if (isset($src)) {

  if (preg_match(/[A-z]/, $src) | preg_match(/[0-9]/, $src)) {

  $src = stripslashes($src);
  $src = preg_replace(/\,/i,  , $src);
  $src = html_entity_decode($src);
  $src = preg_replace(/nbsp;/i,  , $src);
  $src = preg_replace(/[[:space:]]+/i,  , $src);
  $src = trim($src);

  $handle = fopen($entries, r);
  $i = 1;
  $results = 0;

  while ($i = $dbs_total) {
  $buffer = fgets($handle, 4096);
  $buffer_raw = strip_tags($buffer);
  $buffer_raw = preg_replace(/nbsp;/i,  , $buffer_raw);

  $words = explode(' ', $src);
  $t = 0;
  $test='return(';
  foreach($words as $word)
  {
  if($t0)$test.='  ';
  $test.='strstr($buffer_raw,\''.$word.'\')';
  $t++;
  }
  $test.=');';
  // 01:A
  if (eval($test)) {
  foreach($words as $word)
  {
  $wordreg = preg_replace('/([\.\*\+\(\)\[\]])/','\1',$word);
  $buffer = 
preg_replace('/()([^]*)('.($wordreg).')([^]*)()/sei','\\1'.preg_repla
ce('/'.(\$wordreg\).'/i','###','\\2\\3\\4').'\\5',stripslashes($buffer));
  $buffer = preg_replace('/('.$wordreg.')/si','span
class=highlight\\1/span',stripslashes($buffer));
  $buffer = preg_replace('/###/si',$word,$buffer);
  }
  echo $buffer;
  $results++;
  }
  $i++;
}
fclose ($handle);
  } else {
  $illegal_src = 1;
  }
}


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



[PHP] Re: saving TEXTAREA data into mysql database

2003-06-21 Thread Catalin Trifu
Hi,

See the manual nl2br() function.
http://www.php.net/manual/en/function.nl2br.php

Cheers,
Catalin


Artoo [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey,

 How do you save the data from a TEXTAREA of a form into a mysql database
so
 that when you retrieve the data later you get the same format that the
user
 entered

 EXAMPLE
 user enters the following and cliks save

 Line 1 testing
 Line 2 TEST

 Line 4 test

 line 5 test

 test

 testing

 result when displaying data

 Line 1 testingLine 2 TESTLine 4 testline 5 testtesttesting


 How do I get it so the format is the same?

 Thanks





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



Re: [PHP] search-and-highlight issue (byt tes)

2003-06-21 Thread Milan Reznicek
And what about highlighting the whole word which contains the searched term.


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, June 21, 2003 12:31 PM
Subject: [PHP] search-and-highlight issue (byt tes)


 hello!

 i have a problem with a search-and-highlight script (see code below):

 a search for byt tes matches entries that contain bytes but only
 highlights byt*.

 *) because after the first search term (byt) is found the line is
modified
 into span class=highlightbyt/spanes and therefore the secound search
 term (tes) can't be highlighted anymore.


 1. general question

 i'm not quite sure if a search like this should match entries that contain
a
 combination of both terms (bytes).
 of course, the word bytes contains both search terms - but on the other
 hand, a search for byt tes indicates that i'm looking for TWO terms (and
 also for TWO ts).


 2. how to do it anyway?

 do you have an idea how to accomplish that this kind of search
 - either: does NOT display entries that match bytes
 - or: displays entries that contain bytes and highlights bytes

 (because both solutions seem to be somehow logical it may depend on the
 easiness of creation and/or the speed of processing.)


 thanks a lot for your effort!!

 best wishes

 philipp
 www.ipdraw.org


 ---
 code

 notes:
 - the highlight/preg_replace part is built to skip html tags.
 - if you have any other suggestions for improvements, please let me know.


 if (isset($src)) {

   if (preg_match(/[A-z]/, $src) | preg_match(/[0-9]/, $src)) {

   $src = stripslashes($src);
   $src = preg_replace(/\,/i,  , $src);
   $src = html_entity_decode($src);
   $src = preg_replace(/nbsp;/i,  , $src);
   $src = preg_replace(/[[:space:]]+/i,  , $src);
   $src = trim($src);

   $handle = fopen($entries, r);
   $i = 1;
   $results = 0;

   while ($i = $dbs_total) {
   $buffer = fgets($handle, 4096);
   $buffer_raw = strip_tags($buffer);
   $buffer_raw = preg_replace(/nbsp;/i,  , $buffer_raw);

   $words = explode(' ', $src);
   $t = 0;
   $test='return(';
   foreach($words as $word)
   {
   if($t0)$test.='  ';
   $test.='strstr($buffer_raw,\''.$word.'\')';
   $t++;
   }
   $test.=');';
   // 01:A
   if (eval($test)) {
   foreach($words as $word)
   {
   $wordreg = preg_replace('/([\.\*\+\(\)\[\]])/','\1',$word);
   $buffer =

preg_replace('/()([^]*)('.($wordreg).')([^]*)()/sei','\\1'.preg_repla

ce('/'.(\$wordreg\).'/i','###','\\2\\3\\4').'\\5',stripslashes($buffer));
   $buffer = preg_replace('/('.$wordreg.')/si','span
 class=highlight\\1/span',stripslashes($buffer));
   $buffer = preg_replace('/###/si',$word,$buffer);
   }
   echo $buffer;
   $results++;
   }
   $i++;
 }
 fclose ($handle);
   } else {
   $illegal_src = 1;
   }
 }


 --
 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] Returning TWO variables from function

2003-06-21 Thread Roy W
Can someone let me know how to return TWO variables from a function
 
I tried:
 
return $var1, $var2;
 
But I get parse errors and other errors.
 
Thanks!


[PHP] Re: MAIL( ) - Send mail using another SMTP

2003-06-21 Thread Verdon Vaillancourt
I think you can do this with an .htaccess file instead of the php.ini file
:)


On 6/21/03 6:29 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 From: Chinmoy Barua [EMAIL PROTECTED]
 Date: Fri, 20 Jun 2003 23:46:06 -0700 (PDT)
 To: [EMAIL PROTECTED]
 Subject: MAIL( ) - Send mail using another SMTP
 
 Hello Everybody,
 
 I don't have sendmail/qmail on my web server where i
 installed PHP. But I want to send mails from web
 server using PHP.
 
 Can anybody tell me, how can i use another SMTP server
 to send mails? I don't like to change php.ini on my
 web server.
 
 Thank You,
 - Chinmoy


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



Re: [PHP] Re: MAIL( ) - Send mail using another SMTP

2003-06-21 Thread Verdon Vaillancourt
Something like this...

Add the following into a .htaccess file for your domain(s)

php_value SMTP  smtp.yourhost.com



On 6/21/03 7:51 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 how do you do this   please explain




[PHP] Re: saving TEXTAREA data into mysql database

2003-06-21 Thread Artoo
Thanks,

Is it better to use that function before the INSERT query and save it to the
database like that or use that nl2br() function while displaying the results
of the SELECT query,

Thanks agian.
Artoo

Catalin Trifu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 See the manual nl2br() function.
 http://www.php.net/manual/en/function.nl2br.php

 Cheers,
 Catalin


 Artoo [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hey,
 
  How do you save the data from a TEXTAREA of a form into a mysql database
 so
  that when you retrieve the data later you get the same format that the
 user
  entered
 
  EXAMPLE
  user enters the following and cliks save
 
  Line 1 testing
  Line 2 TEST
 
  Line 4 test
 
  line 5 test
 
  test
 
  testing
 
  result when displaying data
 
  Line 1 testingLine 2 TESTLine 4 testline 5 testtesttesting
 
 
  How do I get it so the format is the same?
 
  Thanks
 
 





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



[PHP] Problem receiving notification emails to mails sent with php

2003-06-21 Thread czamora
Hi there,

I'm sending emails to the subscribers of my site using mail() with a fourth
parameter to specify the From: and Reply-To: headers. They seem to be sent
correctly and the users may reply to them and I get the replies in the
mailbox identified by these headers.
The problem is some email addresses I'm sending email to are incorrect, and
I should be receiving the email notification saying that the email could not
be delivered. But I'm not receiving these messages in my mailbox.
Any ideas why this could be so?

Thanks a lot for any hints.

I'm sending mails with:

mail($to, $subject, $body, $from);

where $from = [EMAIL PROTECTED]\nReply-To:
[EMAIL PROTECTED]: PHP/ . phpversion();

I've also tried using \r\n instead of \n



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



Re: [PHP] Problem receiving notification emails to mails sentwith php

2003-06-21 Thread Lowell Allen
 From: czamora [EMAIL PROTECTED]
 
 I'm sending emails to the subscribers of my site using mail() with a fourth
 parameter to specify the From: and Reply-To: headers. They seem to be sent
 correctly and the users may reply to them and I get the replies in the
 mailbox identified by these headers.
 The problem is some email addresses I'm sending email to are incorrect, and
 I should be receiving the email notification saying that the email could not
 be delivered. But I'm not receiving these messages in my mailbox.
 Any ideas why this could be so?
 
 Thanks a lot for any hints.
 
 I'm sending mails with:
 
 mail($to, $subject, $body, $from);
 
 where $from = [EMAIL PROTECTED]\nReply-To:
 [EMAIL PROTECTED]: PHP/ . phpversion();
 
 I've also tried using \r\n instead of \n

Send yourself an email using PHP and examine the Return-Path listed in the
source code. (The Return-Path is not the same as the From you're setting.)
If you're using a commercial host (shared hosting), then the Return-Path is
probably something like [EMAIL PROTECTED] My host provides
Horde for web-based email, and bounces go to the master user account.

HTH

--
Lowell Allen


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



[PHP] Re: MAIL( ) - Send mail using another SMTP

2003-06-21 Thread Joseph Szobody
Here is a class that you could use.

http://phpmailer.sourceforge.net/

Joseph

Chinmoy Barua [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Hello Everybody,
 
 I don't have sendmail/qmail on my web server where i
 installed PHP. But I want to send mails from web
 server using PHP. 
 
 Can anybody tell me, how can i use another SMTP server
 to send mails? I don't like to change php.ini on my
 web server.
 
 Thank You,
 - Chinmoy
 
 
 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com


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



[PHP] Coercing a date calc - problem - or am I just dumb tryin g it this way

2003-06-21 Thread George Pitcher
Hi all,

I've just written this function:

$term='Michaelmas';
function f_week($w,$t)
{
$P=7*($w-1);
if( $t == 'Michaelmas'){
$D = 06;
$M = 10;
$Y = 2003;
} else {
$D = 12;
$M = 01;
$Y = 2004;
}
$week=date(d/m/Y, mktime(0,0,0,$D+$P,$M,$Y));
return $week;
}
?
Michaelmas week 4 is ? echo f_week(4,$term) ?

But the date it shows is '10/03/2005 ' rather than '03/10/2003'.

Suggestions please.

George in Oxford



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



[PHP] Passing Variables

2003-06-21 Thread Jay Fitzgerald
I have been searching for an answer to this for a couple of hours now and 
cant find anything. I believe that there is a secure way of doing this but 
I think my brain is having a momentary lapse...

I have these variables:

$eventid = 1;
$age = 15;
Is there a way to pass these variables to the next page so I can continue 
using them without doing something like this:

A HREF=test.php?eventid=1age=15

I would rather not have the variables be seen or known to the end user for 
security reasons because they could change them in the URL. I know it has 
something to do with $_GET and $_POST because I do have register_globals 
set to OFF in my php file and I do not want to turn them on

TIA

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


[PHP] Re: Passing Variables

2003-06-21 Thread Thomas Seifert
If you don't want them seen anywhere, then you've got to use 
sessions.


Thomas

On Sat, 21 Jun 2003 08:53:12 -0500 [EMAIL PROTECTED] (Jay Fitzgerald) wrote:

 I have been searching for an answer to this for a couple of hours now and 
 cant find anything. I believe that there is a secure way of doing this but 
 I think my brain is having a momentary lapse...
 
 I have these variables:
 
 $eventid = 1;
 $age = 15;
 
 Is there a way to pass these variables to the next page so I can continue 
 using them without doing something like this:
 
 A HREF=test.php?eventid=1age=15
 
 I would rather not have the variables be seen or known to the end user for 
 security reasons because they could change them in the URL. I know it has 
 something to do with $_GET and $_POST because I do have register_globals 
 set to OFF in my php file and I do not want to turn them on
 
 TIA
 



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



[PHP] Re: Passing Variables

2003-06-21 Thread nabil
use hidden field (pure html) and then u have it as $yourhiddenfield on the
next page even u have the register global off..

Nabil


Jay Fitzgerald [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have been searching for an answer to this for a couple of hours now and
 cant find anything. I believe that there is a secure way of doing this but
 I think my brain is having a momentary lapse...

 I have these variables:

 $eventid = 1;
 $age = 15;

 Is there a way to pass these variables to the next page so I can continue
 using them without doing something like this:

 A HREF=test.php?eventid=1age=15

 I would rather not have the variables be seen or known to the end user for
 security reasons because they could change them in the URL. I know it has
 something to do with $_GET and $_POST because I do have register_globals
 set to OFF in my php file and I do not want to turn them on

 TIA




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



RE: [PHP] Re: Passing Variables

2003-06-21 Thread George Pitcher
Nabil,

That is one way but it means that Jay would have to use a form and not a
link.

You could set a cookie. That would work, but it relies on the user allowing
cookies.

George

 -Original Message-
 From: nabil [mailto:[EMAIL PROTECTED]
 Sent: 21 June 2003 2:58 pm
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Passing Variables


 use hidden field (pure html) and then u have it as $yourhiddenfield on the
 next page even u have the register global off..

 Nabil


 Jay Fitzgerald [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I have been searching for an answer to this for a couple of
 hours now and
  cant find anything. I believe that there is a secure way of
 doing this but
  I think my brain is having a momentary lapse...
 
  I have these variables:
 
  $eventid = 1;
  $age = 15;
 
  Is there a way to pass these variables to the next page so I
 can continue
  using them without doing something like this:
 
  A HREF=test.php?eventid=1age=15
 
  I would rather not have the variables be seen or known to the
 end user for
  security reasons because they could change them in the URL. I
 know it has
  something to do with $_GET and $_POST because I do have register_globals
  set to OFF in my php file and I do not want to turn them on
 
  TIA
 



 --
 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] Coercing a date calc - problem - or am I just dumb tryin g it this way SOLVED

2003-06-21 Thread George Pitcher
Yeah - just dumb!. I'd put my date vars into mktime in the european order.
Once I switched them it worked fine.

Chers

George

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]
 Sent: 21 June 2003 2:50 pm
 To: [EMAIL PROTECTED]
 Subject: [PHP] Coercing a date calc - problem - or am I just dumb tryin
 g it this way


 Hi all,

 I've just written this function:

 $term='Michaelmas';
 function f_week($w,$t)
 {
   $P=7*($w-1);
   if( $t == 'Michaelmas'){
   $D = 06;
   $M = 10;
   $Y = 2003;
   } else {
   $D = 12;
   $M = 01;
   $Y = 2004;
   }
   $week=date(d/m/Y, mktime(0,0,0,$D+$P,$M,$Y));
   return $week;
 }
 ?
 Michaelmas week 4 is ? echo f_week(4,$term) ?

 But the date it shows is '10/03/2005 ' rather than '03/10/2003'.

 Suggestions please.

 George in Oxford



 --
 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] Re: Passing Variables

2003-06-21 Thread Jay Fitzgerald
That was my thought too, George. But if the user does not have cookies 
enabled, then I believe, as Thomas pointed out, that a SESSION is the only 
way to handle the variables. I have never done a correct session so I am 
trying to learn how to do them without having a userid and password for 
each user. I have played with sessions but I don't know if I am doing them 
correctly or how to do sessions without authentication.

Jay



At 03:14 PM 6/21/2003 +0100, George Pitcher wrote:
Nabil,

That is one way but it means that Jay would have to use a form and not a
link.
You could set a cookie. That would work, but it relies on the user allowing
cookies.
George

 -Original Message-
 From: nabil [mailto:[EMAIL PROTECTED]
 Sent: 21 June 2003 2:58 pm
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Passing Variables


 use hidden field (pure html) and then u have it as $yourhiddenfield on the
 next page even u have the register global off..

 Nabil


 Jay Fitzgerald [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I have been searching for an answer to this for a couple of
 hours now and
  cant find anything. I believe that there is a secure way of
 doing this but
  I think my brain is having a momentary lapse...
 
  I have these variables:
 
  $eventid = 1;
  $age = 15;
 
  Is there a way to pass these variables to the next page so I
 can continue
  using them without doing something like this:
 
  A HREF=test.php?eventid=1age=15
 
  I would rather not have the variables be seen or known to the
 end user for
  security reasons because they could change them in the URL. I
 know it has
  something to do with $_GET and $_POST because I do have register_globals
  set to OFF in my php file and I do not want to turn them on
 
  TIA
 



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


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


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


[PHP] correct session format?

2003-06-21 Thread Jay Fitzgerald
is this the correct way to register variables via a session?

[code]
session_start ();
$_SESSION['eventid'] = 'arma2';
print_r ($_SESSION);
echo P $_SESSION;
[/code]
[result]
Array ( [eventid] = arma2 )
Array
[/result]
I apologize for the numerous questions, but I am trying to learn...If 
anyone would like to help off-list, my ICQ is 38823829

Jay

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


RE: [PHP] Re: Passing Variables

2003-06-21 Thread George Pitcher
Jay,

I've never ventured into 'sessions' (not ones without drinks) but I've a
feeling that if the user has turned cookies off then sessions are out as
well as they require a cookie being stored on the user's machine.

Someone will surely correct me if I am wrong.

I went to the PHP conference in Frankfurt about 18 months ago and Rasmus was
talking about 'clean' URLs (ithout the 'query' string. I never did find out
how though?

Cheers

George

 -Original Message-
 From: Jay Fitzgerald [mailto:[EMAIL PROTECTED]
 Sent: 21 June 2003 3:19 pm
 To: George Pitcher; nabil; [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Passing Variables


 That was my thought too, George. But if the user does not have cookies
 enabled, then I believe, as Thomas pointed out, that a SESSION is
 the only
 way to handle the variables. I have never done a correct
 session so I am
 trying to learn how to do them without having a userid and password for
 each user. I have played with sessions but I don't know if I am
 doing them
 correctly or how to do sessions without authentication.

 Jay



 At 03:14 PM 6/21/2003 +0100, George Pitcher wrote:
 Nabil,
 
 That is one way but it means that Jay would have to use a form and not a
 link.
 
 You could set a cookie. That would work, but it relies on the
 user allowing
 cookies.
 
 George
 
   -Original Message-
   From: nabil [mailto:[EMAIL PROTECTED]
   Sent: 21 June 2003 2:58 pm
   To: [EMAIL PROTECTED]
   Subject: [PHP] Re: Passing Variables
  
  
   use hidden field (pure html) and then u have it as
 $yourhiddenfield on the
   next page even u have the register global off..
  
   Nabil
  
  
   Jay Fitzgerald [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
I have been searching for an answer to this for a couple of
   hours now and
cant find anything. I believe that there is a secure way of
   doing this but
I think my brain is having a momentary lapse...
   
I have these variables:
   
$eventid = 1;
$age = 15;
   
Is there a way to pass these variables to the next page so I
   can continue
using them without doing something like this:
   
A HREF=test.php?eventid=1age=15
   
I would rather not have the variables be seen or known to the
   end user for
security reasons because they could change them in the URL. I
   know it has
something to do with $_GET and $_POST because I do have
 register_globals
set to OFF in my php file and I do not want to turn them on
   
TIA
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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



[PHP] Re: Returning TWO variables from function

2003-06-21 Thread Hugh Bothwell
Roy W [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Can someone let me know how to return TWO variables from a function

 I tried:

 return $var1, $var2;

 But I get parse errors and other errors.


function ReturnMultiValues($a, $b, $c, $d) {
return array($a, $b, $c, $d);
}


list($first, $second, $third, $fourth) = ReturnMultiValues(1, 2, 3, 4);


--
Hugh Bothwell [EMAIL PROTECTED] Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L+$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b DI+++ D-(++) G+ e(++) h-- r- y+




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



[PHP] Re: correct session format?

2003-06-21 Thread Thomas Seifert
yeah its the right way.
though I don't know what you'r trying to do with 
echo P $_SESSION;


Thomas
On Sat, 21 Jun 2003 09:22:39 -0500 [EMAIL PROTECTED] (Jay Fitzgerald) wrote:

 is this the correct way to register variables via a session?
 
 [code]
 session_start ();
 $_SESSION['eventid'] = 'arma2';
 
 print_r ($_SESSION);
 echo P $_SESSION;
 [/code]
 
 
 [result]
 Array ( [eventid] = arma2 )
 
 Array
 [/result]
 
 I apologize for the numerous questions, but I am trying to learn...If 
 anyone would like to help off-list, my ICQ is 38823829
 
 Jay
 



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



[PHP] PHP Code inside Zend_API

2003-06-21 Thread Suhas Pharkute
I have a custom extension for windows (dll which can be used in PHP).

I want to run some php code inside this dll module. I searched for Zend_API
Docs, but I could not find any way to run php code inside this API.

Any Ideas how to do this,

Please help!

Thanks
Suhas


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



Re: [PHP] Re: Passing Variables

2003-06-21 Thread Thomas Seifert
you can transfer the session-id (which is unique) through the url too.
but then its only the session-id and not the actual data and the session-id
can't be guessed that simple to reach another user's data.


Thomas

On Sat, 21 Jun 2003 15:31:56 +0100 [EMAIL PROTECTED] (George Pitcher) wrote:

 Jay,
 
 I've never ventured into 'sessions' (not ones without drinks) but I've a
 feeling that if the user has turned cookies off then sessions are out as
 well as they require a cookie being stored on the user's machine.
 
 Someone will surely correct me if I am wrong.
 
 I went to the PHP conference in Frankfurt about 18 months ago and Rasmus was
 talking about 'clean' URLs (ithout the 'query' string. I never did find out
 how though?
 
 Cheers
 
 George
 
  -Original Message-
  From: Jay Fitzgerald [mailto:[EMAIL PROTECTED]
  Sent: 21 June 2003 3:19 pm
  To: George Pitcher; nabil; [EMAIL PROTECTED]
  Subject: RE: [PHP] Re: Passing Variables
 
 
  That was my thought too, George. But if the user does not have cookies
  enabled, then I believe, as Thomas pointed out, that a SESSION is
  the only
  way to handle the variables. I have never done a correct
  session so I am
  trying to learn how to do them without having a userid and password for
  each user. I have played with sessions but I don't know if I am
  doing them
  correctly or how to do sessions without authentication.
 
  Jay
 
 
 
  At 03:14 PM 6/21/2003 +0100, George Pitcher wrote:
  Nabil,
  
  That is one way but it means that Jay would have to use a form and not a
  link.
  
  You could set a cookie. That would work, but it relies on the
  user allowing
  cookies.
  
  George
  
-Original Message-
From: nabil [mailto:[EMAIL PROTECTED]
Sent: 21 June 2003 2:58 pm
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Passing Variables
   
   
use hidden field (pure html) and then u have it as
  $yourhiddenfield on the
next page even u have the register global off..
   
Nabil
   
   
Jay Fitzgerald [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have been searching for an answer to this for a couple of
hours now and
 cant find anything. I believe that there is a secure way of
doing this but
 I think my brain is having a momentary lapse...

 I have these variables:

 $eventid = 1;
 $age = 15;

 Is there a way to pass these variables to the next page so I
can continue
 using them without doing something like this:

 A HREF=test.php?eventid=1age=15

 I would rather not have the variables be seen or known to the
end user for
 security reasons because they could change them in the URL. I
know it has
 something to do with $_GET and $_POST because I do have
  register_globals
 set to OFF in my php file and I do not want to turn them on

 TIA

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



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



[PHP] Text files vs other types

2003-06-21 Thread Sparky Kopetzky
If there an ability like Perl to determine if a file is a text file (-T) or any other 
type??

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net



[PHP] AOL

2003-06-21 Thread rml
I have recently created a site that has some PHP in it.  It works fine in
all browsers except AOL.  I can see some of the PHP page in AOL except the
one that fetches information from MySQL database.  I also host my own server
for this site.  Maybe this is a server setting or securtity issue.  Anyone
see this before?

Thanks.



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



[PHP] reference a function in a class from array_walk()

2003-06-21 Thread Thomas Hochstetter
Hi guys.
I want to call this generic echo function within a class, but have
trouble referencing the output function with $this- .
Any suggestions? Maybe there is a better solution to this?
 
This is within a class:
 
[snip]
# generic WALK functions
function walkit($array)
{
array_walk($array,$this-output); //not
working
}

function output($item,$key)
{
echo $key. $itembr /\n;
}
 
thomas


Re: [PHP] AOL

2003-06-21 Thread Michael Geier
How many times do people have to respond to your same email before you get a 
clue?

http://marc.theaimsgroup.com/?l=php-generalm=105621501902618w=2
http://marc.theaimsgroup.com/?l=php-generalm=105593686426998w=2
http://marc.theaimsgroup.com/?l=php-generalm=105556674131637w=2

PHP is server side.  MySQL is server side.  A client side browser (in this case 
AOL), has no bearing on the output produced by PHP/MySQL.

You have been told to check your HTML output at least twice for 
missing/unsupported tags.
http://webmaster.info.aol.com/compatibility.html

Quoting rml [EMAIL PROTECTED]:

 I have recently created a site that has some PHP in it.  It works fine in
 all browsers except AOL.  I can see some of the PHP page in AOL except the
 one that fetches information from MySQL database.  I also host my own server
 for this site.  Maybe this is a server setting or securtity issue.  Anyone
 see this before?
 
 Thanks.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


===
Michael Geier
CDM Sports, Inc. Systems Administration
   email: [EMAIL PROTECTED]
   phone: 314.692.3540

---
 This email sent using CDM Sports Webmail v3.1
  [ http://webmail.cdmsports.com ]

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



Re: [PHP] Passing Variables

2003-06-21 Thread John W. Holmes
Jay Fitzgerald wrote:
I have been searching for an answer to this for a couple of hours now 
and cant find anything. I believe that there is a secure way of doing 
this but I think my brain is having a momentary lapse...

I have these variables:

$eventid = 1;
$age = 15;
Is there a way to pass these variables to the next page so I can 
continue using them without doing something like this:

A HREF=test.php?eventid=1age=15

I would rather not have the variables be seen or known to the end user 
for security reasons because they could change them in the URL. I know 
it has something to do with $_GET and $_POST because I do have 
register_globals set to OFF in my php file and I do not want to turn 
them on
If you want to truly keep them away from the client then you need to 
use sessions. Only the session ID is passed in a cookie or URL and your 
data remains on the server. Using GET, POST, or COOKIE will allow the 
user to edit this data.

If the user does not allow cookies, then you must pass the SESSION ID in 
every URL that you want the session to persist.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP] Re: saving TEXTAREA data into mysql database

2003-06-21 Thread John W. Holmes
Artoo wrote:
Is it better to use that function before the INSERT query and save it to the
database like that or use that nl2br() function while displaying the results
of the SELECT query,
Use it while displaying. You generally want to save the data in the 
database exactly as it was entered. This will allow you to display it 
back to the user for editing without them wondering what all the br / 
are in their sentences and also use it in other places, like mail or 
files...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP] Re: saving TEXTAREA data into mysql database

2003-06-21 Thread Jeff Harris
On Jun 21, 2003, John W. Holmes claimed that:

|Artoo wrote:
| Is it better to use that function before the INSERT query and save it to the
| database like that or use that nl2br() function while displaying the results
| of the SELECT query,
|
|Use it while displaying. You generally want to save the data in the
|database exactly as it was entered. This will allow you to display it
|back to the user for editing without them wondering what all the br /
|are in their sentences and also use it in other places, like mail or
|files...
|

I believe, that alternatively, you can wrap the output within pre/pre
tags for the html out.

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] reference a function in a class from array_walk()

2003-06-21 Thread David Otton
On Sat, 21 Jun 2003 19:24:26 +0200, you wrote:

I want to call this generic echo function within a class, but have
trouble referencing the output function with $this- .
Any suggestions? Maybe there is a better solution to this?
 
This is within a class:
 
[snip]
# generic WALK functions
function walkit($array)
{
array_walk($array,$this-output); //not
working
}

function output($item,$key)
{
echo $key. $itembr /\n;
}

You want to apply a function that's wrapped in a class to a given array?

My first reaction is that your best approach is to invoke a function within
a class, without creating an instance of that class. See the :: operator.

The following code covers several ways of calling functions wrapped in
classes. You probably want the last two calls:

?

/* Class A has method B */
class A {
function B ($s = None) {
echo (pinput : $s/p);
}
}

/* $C is an instance of A */
$C = new A ();

/* $D is an array of strings */
$D = array('item 1', 'item 2', 'item 3', 'item 4');

/* invoke A::B */
A::B ('call 1');

/* invoke $C-B */
$C-B ('call 2');

/* invoke A::B via call_user_func() */
call_user_func (array('A', 'B'), 'call 3');

/* invoke $C-B via call_user_func() */
call_user_func (array($C, 'B'), 'call 4');

/* invoke A::B via call_user_func_array() */
call_user_func_array (array('A', 'B'), array('call 5'));

/* invoke $C-B via call_user_func_array() */
call_user_func_array (array($C, 'B'), array('call 6'));

/* apply A::B to $D via array_walk() */
array_walk ($D, array('A', 'B'));

/* apply $C-B to $D via array_walk() */
array_walk ($D, array($C, 'B'));

?


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



RE: [PHP] Re: Passing Variables

2003-06-21 Thread Jeff Harris
On Jun 21, 2003, George Pitcher claimed that:

|Jay,
|
|I've never ventured into 'sessions' (not ones without drinks) but I've a
|feeling that if the user has turned cookies off then sessions are out as
|well as they require a cookie being stored on the user's machine.
|
|Someone will surely correct me if I am wrong.
|
|I went to the PHP conference in Frankfurt about 18 months ago and Rasmus was
|talking about 'clean' URLs (ithout the 'query' string. I never did find out
|how though?
|
|Cheers
|
|George
|

http://marc.theaimsgroup.com/?l=php-generalm=105597453308214w=2

form name=myform method=POST action=validate.php
input type=hidden name=secret1 value=15
input type=hidden name=secret2 value=secret login code
a href=javascript:void(document.myform.submit())next page/a/form

If you really want to keep the values a secret, you will have to
substitute them with a reverable hash or some other method to keep prying
eyes away.

Jeff

-- 
Registered Linux user #304026.
lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



[PHP] Re: Header, Directory, and SESSIONs

2003-06-21 Thread Andrew Warner
At 9:43 AM +0300 6/21/03, nabil wrote:
4- I want if any user jumped to the other directory and logged in with the
correct requested password TO HAVE THE FIRST SESSION UNREGISTERED
automatically, so he can't be logged in in both at same time.. and keep only
the new.. and ofcourse have to re logging if he jumped back to the first
one...


If the user has the credentials to access both directories, why not 
let him be logged into both directories, provided he logs into both 
separately?
You can confine cookie containing session id to the site _and_ 
directory user logged into so that you have have separate sessions 
for both:

in your login routine in each  directory:

session_set_cookie_params (0, dirname($_SERVER['SCRIPT_NAME']).'/');
session_start();
Now when user logs into different directory,  php won't even know 
about session cookie from other directory.  This is my understanding, 
anyway.

andrew



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


[PHP] Is there a way to get rid of \' and \ ?

2003-06-21 Thread Dan Anderson
I have a form which feeds into an e-mail.  When I use the mail function
all 's turn into \'s and all s turn into \s.  I tried
set_magic_quotes_runtime(0) and it didn't do anything, neither did
urldecode().  Is there a function to strip escape charechters?

Thanks,

Dan


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



Re: [PHP] Is there a way to get rid of \' and \ ?

2003-06-21 Thread Brad Pauly
On Sat, 2003-06-21 at 16:00, Dan Anderson wrote:
 I have a form which feeds into an e-mail.  When I use the mail function
 all 's turn into \'s and all s turn into \s.  I tried
 set_magic_quotes_runtime(0) and it didn't do anything, neither did
 urldecode().  Is there a function to strip escape charechters?

I think you want stripslashes().

http://us4.php.net/manual/en/function.stripslashes.php

Brad

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



Re: [PHP] reference a function in a class from array_walk()

2003-06-21 Thread Leif K-Brooks
Thomas Hochstetter wrote:

Hi guys.
I want to call this generic echo function within a class, but have
trouble referencing the output function with $this- .
Any suggestions? Maybe there is a better solution to this?
This is within a class:

[snip]
# generic WALK functions
   function walkit($array)
   {
   array_walk($array,$this-output); //not
working
   }
   
   function output($item,$key)
   {
   echo $key. $itembr /\n;
   }

thomas

 

http://us3.php.net/manual/en/language.pseudo-types.php
A method of an instantiated object is passed as an array containing an 
object as the element with index 0 and a method name as the element with 
index 1.

function walkit($array){
   array_walk($array,array($this,'output'));
}
function output($item,$key){
   echo $key. $itembr /\n;
}
--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


php-general Digest 21 Jun 2003 22:55:26 -0000 Issue 2131

2003-06-21 Thread php-general-digest-help

php-general Digest 21 Jun 2003 22:55:26 - Issue 2131

Topics (messages 152376 through 152412):

Re: making image smaller with same aspect ratio
152376 by: azero

search-and-highlight issue (byt tes)
152377 by: 457945.gmx.ch
152379 by: Milan Reznicek

Re: saving TEXTAREA data into mysql database
152378 by: Catalin Trifu
152383 by: Artoo
152405 by: John W. Holmes
152406 by: Jeff Harris

Returning TWO variables from function
152380 by: Roy W
152396 by: Hugh Bothwell

Re: MAIL( ) - Send mail using another SMTP
152381 by: Verdon Vaillancourt
152382 by: Verdon Vaillancourt
152386 by: Joseph Szobody

Problem receiving notification emails to mails sent with php
152384 by: czamora
152385 by: Lowell Allen

Coercing a date calc - problem - or am I just dumb tryin g it this way
152387 by: George Pitcher

Passing Variables
152388 by: Jay Fitzgerald
152389 by: Thomas Seifert
152390 by: nabil
152391 by: George Pitcher
152393 by: Jay Fitzgerald
152395 by: George Pitcher
152399 by: Thomas Seifert
152404 by: John W. Holmes
152408 by: Jeff Harris

Re: Coercing a date calc - problem - or am I just dumb tryin g it this way SOLVED
152392 by: George Pitcher

correct session format?
152394 by: Jay Fitzgerald
152397 by: Thomas Seifert

PHP Code inside Zend_API
152398 by: Suhas Pharkute

Text files vs other types
152400 by: Sparky Kopetzky

AOL
152401 by: rml
152403 by: Michael Geier

reference a function in a class from array_walk()
152402 by: Thomas Hochstetter
152407 by: David Otton
152412 by: Leif K-Brooks

Re: Header, Directory, and SESSIONs
152409 by: Andrew Warner

Is there a way to get rid of \' and \ ?
152410 by: Dan Anderson
152411 by: Brad Pauly

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---
 Hey all,

 How do you reduse an image while keeping the same aspect ratio so not to
 distort the image

 Thanks

Original image: x - 800 y - 600
New size: x1 -100 y1 - ?

y1 = 600*100/800 = 75

formula is: y1 = y*x1/x
the same if you want to find x1 when know y1.


---End Message---
---BeginMessage---
hello!

i have a problem with a search-and-highlight script (see code below):

a search for byt tes matches entries that contain bytes but only
highlights byt*.

*) because after the first search term (byt) is found the line is modified
into span class=highlightbyt/spanes and therefore the secound search
term (tes) can't be highlighted anymore.


1. general question

i'm not quite sure if a search like this should match entries that contain a
combination of both terms (bytes).
of course, the word bytes contains both search terms - but on the other
hand, a search for byt tes indicates that i'm looking for TWO terms (and
also for TWO ts).


2. how to do it anyway?

do you have an idea how to accomplish that this kind of search
- either: does NOT display entries that match bytes
- or: displays entries that contain bytes and highlights bytes

(because both solutions seem to be somehow logical it may depend on the
easiness of creation and/or the speed of processing.)


thanks a lot for your effort!!

best wishes

philipp
www.ipdraw.org


---
code

notes:
- the highlight/preg_replace part is built to skip html tags.
- if you have any other suggestions for improvements, please let me know.


if (isset($src)) {

  if (preg_match(/[A-z]/, $src) | preg_match(/[0-9]/, $src)) {

  $src = stripslashes($src);
  $src = preg_replace(/\,/i,  , $src);
  $src = html_entity_decode($src);
  $src = preg_replace(/nbsp;/i,  , $src);
  $src = preg_replace(/[[:space:]]+/i,  , $src);
  $src = trim($src);

  $handle = fopen($entries, r);
  $i = 1;
  $results = 0;

  while ($i = $dbs_total) {
  $buffer = fgets($handle, 4096);
  $buffer_raw = strip_tags($buffer);
  $buffer_raw = preg_replace(/nbsp;/i,  , $buffer_raw);

  $words = explode(' ', $src);
  $t = 0;
  $test='return(';
  foreach($words as $word)
  {
  if($t0)$test.='  ';
  $test.='strstr($buffer_raw,\''.$word.'\')';
  $t++;
  }
  $test.=');';
  // 01:A
  if (eval($test)) {
  foreach($words as $word)
  {
  $wordreg = preg_replace('/([\.\*\+\(\)\[\]])/','\1',$word);
  $buffer = 
preg_replace('/()([^]*)('.($wordreg).')([^]*)()/sei','\\1'.preg_repla
ce('/'.(\$wordreg\).'/i','###','\\2\\3\\4').'\\5',stripslashes($buffer));
  $buffer = preg_replace('/('.$wordreg.')/si','span
class=highlight\\1/span',stripslashes($buffer));
  $buffer = preg_replace('/###/si',$word,$buffer);
   

[PHP] Now what's wrong with this?

2003-06-21 Thread Kyle Babich
The following code obtains lists of files from two different directories and reverse 
numerically sorts them.  Then bellow it takes one file and dumps the contents into an 
array, which works fine.  The problem is where it takes the entire content of the 
matching file from the second directory and tries to put it into $entry.  It returns a 
parse error on line 67, which is the line I marked.  What should I do to fix this?  

Thanks a lot to you guys by the way for help with all of my problems.  I'm a 16 
year-old trying to create a weblog system using PHP (a new language to me) over summer 
vacation for fun.

?php 

$postInfo = opendir('postInfo');
while (false !== ($filename = readdir($postInfo))) {
$infoFiles[] = $filename;
}
closedir($postInfo);
rsort($infoFiles, SORT_NUMERIC);
array_splice($infoFiles, 0, 2);

$postEntries = opendir('postEntries');
while (false !== ($filename = readdir($postEntries))) {
$entriesFiles[] = $filename;
}
closedir($postEntries);
rsort($entriesFiles, SORT_NUMERIC);
array_splice($entriesFiles, 0, 2);

$curr = 0;
foreach ($infoFiles as $infoIndex) {
foreach ($entriesFiles as $entriesIndex) {
$infoRaw = file(postInfo/{$infoindex});
$entryGet = fopen(postEntries/{$entriesIndex}, 'r');
$entry = fread($entryGet, filesize(postEntries/{$entriesIndex}); 
//67, line /w parse error
fclose($entryGet);
?


--
Kyle

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



Re: [PHP] Now what's wrong with this?

2003-06-21 Thread Brad Pauly
On Sat, 2003-06-21 at 16:59, Kyle Babich wrote:
   $entry = fread($entryGet, filesize(postEntries/{$entriesIndex}); //67, line /w 
 parse error

Missing a ')'

Brad 

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



[PHP] PHP on Microsoft Windows 2003 Server

2003-06-21 Thread Ben Johnston
How do i get PHP to work on my  Microsoft Windows Server 2003?


Re: [PHP] PHP on Microsoft Windows 2003 Server

2003-06-21 Thread John W. Holmes
Ben Johnston wrote:
How do i get PHP to work on my  Microsoft Windows Server 2003?
Read the installation instructions: http://www.php.net/

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP] search-and-highlight issue (byt tes)

2003-06-21 Thread 457945
 And what about highlighting the whole word which contains the searched term.

yes - like i said - this would be a solution:
 - or: displays entries that contain bytes and highlights bytes

do you have any idea how to manage it?


best wishes

philipp
www.ipdraw.org


am 21.06.2003 12:57 Uhr schrieb Milan Reznicek unter [EMAIL PROTECTED]:

 And what about highlighting the whole word which contains the searched term.
 
 
 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, June 21, 2003 12:31 PM
 Subject: [PHP] search-and-highlight issue (byt tes)
 
 
 hello!
 
 i have a problem with a search-and-highlight script (see code below):
 
 a search for byt tes matches entries that contain bytes but only
 highlights byt*.
 
 *) because after the first search term (byt) is found the line is
 modified
 into span class=highlightbyt/spanes and therefore the secound search
 term (tes) can't be highlighted anymore.
 
 
 1. general question
 
 i'm not quite sure if a search like this should match entries that contain
 a
 combination of both terms (bytes).
 of course, the word bytes contains both search terms - but on the other
 hand, a search for byt tes indicates that i'm looking for TWO terms (and
 also for TWO ts).
 
 
 2. how to do it anyway?
 
 do you have an idea how to accomplish that this kind of search
 - either: does NOT display entries that match bytes
 - or: displays entries that contain bytes and highlights bytes
 
 (because both solutions seem to be somehow logical it may depend on the
 easiness of creation and/or the speed of processing.)
 
 
 thanks a lot for your effort!!
 
 best wishes
 
 philipp
 www.ipdraw.org
 
 
 ---
 code
 
 notes:
 - the highlight/preg_replace part is built to skip html tags.
 - if you have any other suggestions for improvements, please let me know.
 
 
 if (isset($src)) {
 
 if (preg_match(/[A-z]/, $src) | preg_match(/[0-9]/, $src)) {
 
 $src = stripslashes($src);
 $src = preg_replace(/\,/i,  , $src);
 $src = html_entity_decode($src);
 $src = preg_replace(/nbsp;/i,  , $src);
 $src = preg_replace(/[[:space:]]+/i,  , $src);
 $src = trim($src);
 
 $handle = fopen($entries, r);
 $i = 1;
 $results = 0;
 
 while ($i = $dbs_total) {
 $buffer = fgets($handle, 4096);
 $buffer_raw = strip_tags($buffer);
 $buffer_raw = preg_replace(/nbsp;/i,  , $buffer_raw);
 
 $words = explode(' ', $src);
 $t = 0;
 $test='return(';
 foreach($words as $word)
 {
 if($t0)$test.='  ';
 $test.='strstr($buffer_raw,\''.$word.'\')';
 $t++;
 }
 $test.=');';
 // 01:A
 if (eval($test)) {
 foreach($words as $word)
 {
 $wordreg = preg_replace('/([\.\*\+\(\)\[\]])/','\1',$word);
 $buffer =
 
 preg_replace('/()([^]*)('.($wordreg).')([^]*)()/sei','\\1'.preg_repla
 
 ce('/'.(\$wordreg\).'/i','###','\\2\\3\\4').'\\5',stripslashes($buffer));
 $buffer = preg_replace('/('.$wordreg.')/si','span
 class=highlight\\1/span',stripslashes($buffer));
 $buffer = preg_replace('/###/si',$word,$buffer);
 }
 echo $buffer;
 $results++;
 }
 $i++;
 }
 fclose ($handle);
 } else {
 $illegal_src = 1;
 }
 }
 
 
 --
 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] Convert KB to MB?

2003-06-21 Thread Sævar Öfjörð
Actually, if we want too go into details, according to the international
standard for units, there is a big difference in 'M' and 'm'. 'M' means
Mega and 'm' means milli. You are probably aware of that Mega is 10 in
the power of 3 but milli is 10 in the power of -3. The difference is,
like, a million.

On the other hand, millibytes seems just absurd. I mean, 1/1000 of a
byte, what is that? So I guess nobody cares about wether they are typing
'M' or 'm'...

Sævar - Iceland

-Original Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED] 
Sent: 20. júní 2003 14:27
To: Ian Mantripp
Cc: Mike Migurski; MIKE YRABEDRA; PHP List
Subject: Re: [PHP] Convert KB to MB?

Again I say Ahhh. Are you mixing your bits and bytes then?
1MB =1024KB
1mb=1000kb

Although upper and lower case seem to have becoming interchangeable, 
even though technically they have different meaning. The simple formula 
is suddenly getting more complicated.

On Friday, June 20, 2003, at 04:41 AM, Ian Mantripp wrote:

 Ahhh, but then marketing gets involved and changes the 1024 to 1000 
 and
 ta da, you now have more MegaBytes. 1024 is the right number to use,
 but don't be surprised if it doesn't match with some numbers you
might
 compare it to.

 Not necessarily, in data storage 1mb = 1024kb but in data transfer 1mb

 =
 1000kb.
-- 
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


-- 
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] from a textfile/textarea to a mysql INSERT

2003-06-21 Thread Øystein Håland
From Excel you can save a table as a tab separated txt-file. I want to take
this and execute INSERT queries (by uploading the file or by copying the
content into a textarea). Anyone who has a script to do this? My platform is
Windows, but the script will be used on a Linux web server.



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



[PHP] Lel Bruce Peto updating more energy news...

2003-06-21 Thread info
Lel Bruce Peto updating more energy news...


S Korean SK Global's domestic creditors agree to keep firm
afloat
Domestic creditors of South Korean conglomerate SK group's
debt-ridden trading arm SK Global Tuesday voted in favor of
keeping the company afloat by rescheduling its debt and
converting some of the loans to equity. 

Volatile prices reduce UK gas for power sales
Volatile spot gas prices helped to reduce gas sales to UK
power stations in March, according to the latest Department
of Trade and Industry figures.
 
European energy companies to focus on services, not trade:
study; Energy trading companies across Europe are to focus on
services rather than pure trading in the foreseeable future,
according to a European-wide study.


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



[PHP] Small problem with date and location information?

2003-06-21 Thread Philip J. Newman
I run a website from New Zealand.  The problem is when ?php echo date(F j, Y, g:i 
a); ? it shows the time of the server, that just happens to be located in Dallas 
USA. Is there a way that I can change the time so it matchs New Zealand Time?

Re: [PHP] from a textfile/textarea to a mysql INSERT

2003-06-21 Thread John W. Holmes
ystein Hland wrote:
From Excel you can save a table as a tab separated txt-file. I want to take
this and execute INSERT queries (by uploading the file or by copying the
content into a textarea). Anyone who has a script to do this? My platform is
Windows, but the script will be used on a Linux web server.
Use the LOAD DATA INFILE command to load the entire file at once.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP] correct session format?

2003-06-21 Thread Jay Fitzgerald
what about for version 4.3.1??

Jay

At 01:41 PM 6/22/2003 +1000, you wrote:
Yes, for PHP = 4.1

Justin



on 22/06/03 12:22 AM, Jay Fitzgerald ([EMAIL PROTECTED]) wrote:

 is this the correct way to register variables via a session?

 [code]
 session_start ();
 $_SESSION['eventid'] = 'arma2';

 print_r ($_SESSION);
 echo P $_SESSION;
 [/code]


 [result]
 Array ( [eventid] = arma2 )

 Array
 [/result]

 I apologize for the numerous questions, but I am trying to learn...If
 anyone would like to help off-list, my ICQ is 38823829

 Jay



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


[PHP] return all non-tag characters

2003-06-21 Thread Matt Palermo
I want to be able to retrieve and return all character that are not
located in html tags.  For example:
 
font size=\3\ color=\#336699\1234567/font
or
marquee1234567/marquee
 
I would just like it to be equal to 1234567, but I would need it to work
with any tags and attributes.  Is there a way to just throw out
everything from the  to the  and just keep everything that is NOT
located inside any  characters?  Anyone have any ideas on how this can
be done?  Please let me know.
 
Thanks,
 
Matt


Re: [PHP] return all non-tag characters

2003-06-21 Thread Mike Migurski
I want to be able to retrieve and return all character that are not
located in html tags.  For example:

font size=\3\ color=\#336699\1234567/font
or
marquee1234567/marquee

I would just like it to be equal to 1234567, but I would need it to work
with any tags and attributes.

A good starting point might be preg_replace, search pattern '/[^]+/',
replace pattern ''.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



Re: [PHP] Small problem with date and location information?

2003-06-21 Thread Don Read

On 22-Jun-2003 Philip J. Newman wrote:
 I run a website from New Zealand.  The problem is when ?php echo date(F
 j, Y, g:i a); ? it shows the time of the server, that just happens to
 be located in Dallas USA. Is there a way that I can change the time so it
 matchs New Zealand Time?
?php
echo date('F j, Y, g:i a'), 'br';
putenv('TZ=PST8PDT');
echo date('F j, Y, g:i a'), 'br';
putenv('TZ=CHAST');
echo date('F j, Y, g:i a'), 'br';
?

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



Re: [PHP] Problem while retrieving data from cookie with unserialize

2003-06-21 Thread Tom Rogers
Hi,

Friday, June 20, 2003, 7:42:48 AM, you wrote:
SÖ Hi, I’m having this problem:

SÖ I set a cookie using this:

SÖ $sql = UPDATE member SET cookie=$cookie WHERE
SÖ .
SÖ   id = $this-id;
SÖ $this-mysql-query($sql);
SÖ $cookie =
SÖ urlencode(serialize(array($_SESSION['username'], $cookie)));
SÖ setcookie('auth', $cookie, time() + 31104000,
SÖ '/', 'www.reddast.is');

SÖ And then when I check the cookie using this:

SÖ list($username, $cookie) =
SÖ @unserialize(urldecode($cookie));


SÖ using this query:

SÖ SELECT * FROM member WHERE (username = $username) AND
SÖ (cookie = $cookie);

SÖ it looks like this when I debug the script and see the actual query that
SÖ is sent to Mysql:

SÖ SELECT * FROM member WHERE (username = 'ofjord') AND
SÖ (cookie = '\'86aa5f7e6469efe09a17089957f59b0f\'');


SÖ I hope someone has any answers on this.

SÖ Best regards,
SÖ Sævar Öfjörð Magnússon
SÖ [EMAIL PROTECTED]
SÖ ICELAND


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

Try base64 encoding/decoding it instead of urlencode

-- 
regards,
Tom


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