Re: [PHP] Pushing array onto array

2003-08-03 Thread Hank TT
James,

My question had more to do with why the authors would give this usage when
array_push is not documented to behave so (as you correctly described).
Were they describing an earlier version of array_push?  A simple buggy
example?  A typo perhaps?

Since the authors Hughes and Zmievski are big names in PHP, though mortals
like you and me, I'm inclined to think they were thinking about something.




- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 03, 2003 1:27 AM
Subject: Re: [PHP] Pushing array onto array


 On Sunday 03 August 2003 13:02, Hank TT wrote:
  Well, I might have been more specific about their example, since not
  everyone has the book.  An excerpt below (so I don't need to retype all
the
  names of characters and foul creatures from the Lord of the Rings):
 
  ---
  $arr1 = array('G', 'R', 'Sr');
  $arr2 = array('N', 'Su', 'O');
 
  $arr3 = array_push($arr1, $arr2);
 
  print $arr3[3][1];
  //prints Su
  ---

 I don't see how your example could work. array_push() does NOT return an
 array. The results of array_push() is placed in the first argument -- in
this
 case $arr1.

  Weird usage

 Think of it like this -- it adds the 2nd array onto the 1st array.

 It does NOT add the *contents* of the 2nd array to the 1st array -- for
that
 you would probably use array_merge().

 Do a print_r($arr1), it might help you visualise what happens.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 It is now pitch dark.  If you proceed, you will likely fall into a pit.
 */


 --
 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: preg_match

2003-08-03 Thread Michael Temeschinko
Lee Doolan wrote:
Michael == Michael Temeschinko [EMAIL PROTECTED] writes:


Michael Hello,
Michael I would like to split a String containing ingredience with additional
Michael assigned footnotes...
Michael my problem I only get the first ingredience ($zutat at line 32 has
Michael only one times the awaited value) but the print on line 29 shows me
Michael that the value of $zutat is right at this point.
Michael what's wrong 

Michael1 ?php
Michael2
Michael3 $products_ingredience = 'Gersten-Grütze²*, Gerstenmehl²*,
Michael Haferflocken*, Gemüse 12 % (Lauch*, Möhren*, Zwiebeln*), Haferkleie*,
Michael Steinsalz, Petersilie*, Kartoffelstärke*, Hefeextrakt, Sellerieblatt*,
Michael Kurkuma*, Muskatnuß*, Pfeffer*, Liebstöckl*';
Michael4
Michael5 ArtikelZutaten ($products_ingredience);
Michael6
Michael7
Michael8 function ArtikelZutaten($products_ingredience) {
Michael9
Michael   10
Michael   11 print \n\n\n$products_ingredience);
Michael   12 $Zutaten = explode(,, $products_ingredience);
Michael   13
Michael   14 foreach ($Zutaten as $zutat) {
Michael   15 if (preg_match(/\²/, $zutat))
Michael   16 $FussnoteID = 2;
Michael   17 else
Michael   18 $FussnoteID = '';
Michael   19
Michael   20 if (preg_match(/¹/, $zutat))
Michael   21 $FussnoteID = 1;
Michael   22
Michael   23 if (preg_match(/\*/, $zutat))
Michael   24 $kbA = 1;
Michael   25 else
Michael   26 $kbA = 0;
Michael   27
Michael   28 preg_match(/\b.*\b/, $zutat, $matches);
Michael   29 print \n--$zutat;
Michael   30 $zutat = $matches[0];
Michael   31
Michael   32 print \nZutat $zutat FussnotenID $FussnoteID kbA $kbA;
Michael   33
Michael   34 }
Michael   35
Michael   36 }
Michael   37
Michael   38 ?
what do you get if you 
  print \nmatches matches...; var_dump($matches);

right after line 32?

Hi Lee,

additionaly I have switched the warnings on:

Gersten-Grütze²*, Gerstenmehl²*, Haferflocken*, Gemüse 12 % (Lauch*, 
Möhren*, Zwiebeln*), Haferkleie*, Steinsalz, Petersilie*, 
Kartoffelstärke*, Hefeextrakt, Sellerieblatt*, Kurkuma*, Muskatnuß*, 
Pfeffer*, Liebstöckl*)
--Gersten-Grütze²*
Zutat Gersten-Grütze FussnotenID 2 kbA 1
matches matches...array(1) {
  [0]=
  string(14) Gersten-Grütze
}

-- Gerstenmehl²*
Notice: Undefined offset:  0 in /home/mt/amorebio/dem1.php on line 30
Zutat  FussnotenID 2 kbA 1
matches matches...array(0) {
}
-- Haferflocken*
Notice: Undefined offset:  0 in /home/mt/amorebio/dem1.php on line 30
Zutat  FussnotenID  kbA 1
matches matches...array(0) {
}


 and so on

why does he matches only the first time ??

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


Re: [PHP] preg_match

2003-08-03 Thread Michael Temeschinko
Hank Tt wrote:
Either of these should work:

preg_match(/\b.*\b/, trim($zutat), $matches);
Thank you - that's the solution :-)

mfg - micha

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


[PHP] PHP SESSIONS and FRAMES

2003-08-03 Thread Ralph Guzman
I have a shopping cart with affiliate sales support. What's happening is
that some affiliates are using frames to use their domain while using
our shopping cart. So they are using a frameset like this:

frameset rows=1,* FRAMEBORDER=0 BORDER=0

   frame MARGINWIDTH=0 MARGINHEIGHT=0 
   name=board src=top.html

   frame MARGINWIDTH=0 MARGINHEIGHT=0 
   name=post src=http://www.domain.com/?store_id=15008;

/frameset

The problem I'm having is that sessions are not being passed properly or
are expiring. 

Anybody experience this kind of problem? If so can you provide any
advice on passing sessions through frames?

Thanks.




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



php-general Digest 3 Aug 2003 13:04:03 -0000 Issue 2214

2003-08-03 Thread php-general-digest-help

php-general Digest 3 Aug 2003 13:04:03 - Issue 2214

Topics (messages 158061 through 158072):

Re: Trouble with Session var
158061 by: Curt Zirzow

Re: subtracting dates...
158062 by: John Ryan

Re: Pushing array onto array
158063 by: Curt Zirzow
158065 by: Hank TT
158066 by: Jason Wong
158068 by: Hank TT

Re: preg_match
158064 by: Lee Doolan
158067 by: Hank TT
158069 by: Michael Temeschinko
158070 by: Michael Temeschinko

PHP SESSIONS and FRAMES
158071 by: Ralph Guzman

Re: [PHP-DB] subtracting dates...
158072 by: Matthew McNicol

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---
* Thus wrote James Johnson ([EMAIL PROTECTED]):
 Hello,

hello james.

 
 Is there a limit or something to the number of Session vars that can be
 used? I've even tried setting a Session var called foo and that doesn't
 work.

None that php enforces, only the operating system's filesystem and
the sanity of passing around  2MB of session data :)


   $row_GetCatText= mysql_fetch_assoc($GetCatText);
   $HTTP_SESSION_VARS['sv_adCatText'] = $row_GetCatText['category'];
   if($HTTP_SESSION_VARS['sv_adCatText'] == Books){
   header(Location:  . CreateAdBook.php);
   exit;
   }else{
   header(Location:  . CreateAdNonBook.php);

These location headers should be using an absolute URI
(http://server/path/to/file.php)

As for your session problem, I'm not entirely sure but one
recommendation would be to ensure that a 'Connection: close' header
is sent to the client also. 


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.
---End Message---
---BeginMessage---
yeah, thats the code i wrote myself (nearly). it gets the job done.
thanks

Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 * Thus wrote John Ryan ([EMAIL PROTECTED]):
  Hi,
 
 hello ryan,

  In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
users
  date of births. I need to calculate in a PHP script, the users age from
this
  DOB. I get a PHP date in the same format as the mySQL and subtract,
which
  returns the year rounded off. ie, it doesnt matter if your birthdays in
june
  of 1983 and the date is januray 2003, your age is still returned as 20,
when
  it should be 19.
 
  Does anyone know how can i get the right age?

 To get a real age of someone you would use seconds, but since the actual
 count of seconds get messed up on leap years (through the convertion
 from seconds to years),  I approached it with the method most people
 calculate ages.

 Most people first look at the year and find the differnce, then if
 the month/day hasn't come around you subtract one; alas the common
 calculation for age.

 Here is the code to demonstrate that logic:


 $dob = split('-', '1980-12-1');
 $now = split('-', date('Y-m-d'));

 // we are either this age or one less
 $age = $now[0] - $dob[0];

 // have we gotten to the month of in dob?
 if ($now[1]  $dob[1]) {

// no, so we are technically a year less.
$age--;

 // If we're in the month,  has the day come yet?
 } elseif ($now[1] = $dob[1]  $now[2]  $now[3]) {

// no, still a few more days.
$age--;
 }

 // your age is proper, in day to day usage.

 /*
   Note:

   instead of the if () elseif() you can use
   if (mktime(0,0,0,$now[1],$now[2])  mktime(0,0,0,$dob[1],$dob[2])) {
 $age--;
   }

 */


 HTH,

 Curt
 --
 I used to think I was indecisive, but now I'm not so sure.


---End Message---
---BeginMessage---
* Thus wrote Andrew Brampton ([EMAIL PROTECTED]):
 No there is a difference...
 
 Take the example
 [ [a, b, c] , [ d, e, f] ]
 In a 2 dimensional array those values would be stored adjacent in memory...
 ie
 a b c d e f
 
 In a Array of Arrays, the first and 2nd elements would be pointers, to where
 the [a, b, c], and [d, e, f] arrays are actually kept... ie
 0 1 2 3 4 5 6 7
 2 3 a b c d e f
 but this can all depend on the compiler, and the language construct... But
 its best to recognise a difference even if its really small...

how they are aligned in memory doesn't make them different in what
they are. Either way you still have a 2 dimential matrix.

 
 and in PHP it can get even more confusing with its non strict typing, and
 un-fixed size arrays etc...

Some would argue this. PHP makes it easier for the programmer, so
he doesn't have to worry about type differences, memory allocation
and lower level access.  The programmer just needs to assign a
variable and poof... it is created.

 
 Andrew
 - Original Message -
 From: Curt Zirzow [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, August 02, 2003 11:06 PM
 Subject: Re: [PHP] Pushing array onto 

[PHP] Re: connecting access (*.mdb) database with PHP

2003-08-03 Thread Simon Fredriksson
Unless you can find some Access-Class I think ODBC is the way to go. No 
idea how you can solve it if you're using a *nix server though.

//Simon

Pehepe Php wrote:

how can I connect access database(*.mdb) with php?  what is the code?   
I will be happy if you write php code.

Thank you!

_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail



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


[PHP] Help with secure virtual host setup

2003-08-03 Thread Robert Mena
Hi all,

I host some virtual domains within my apache 1.3.x/php
4.3.x setup.

Those domains are mantained by the users via ftp and I
was wondering if I could secure the configuration a
little bit more.  I know that are limitations but the
requirements would be :

a) the user should not be able to access files outside
the DocumentRoot besides system libraries or temporary
files
b) I'd like to have a system wide repository where
common libraries, classes should be accessed without
having to copy and mantain individually
c) Since the user has some php thet perform a file
upload, those scripts must be able to move, rename,
delete files located under the document root

As a starting point the user has a ftp login and the
document root is owned by the login.apache so the user
and the apache can access and alter the contents.

Best regards.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Re: [PHP-DB] subtracting dates...

2003-08-03 Thread Matthew McNicol

 In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
users
 date of births. I need to calculate in a PHP script, the users age from
this
 DOB. I get a PHP date in the same format as the mySQL and subtract, which
 returns the year rounded off. ie, it doesnt matter if your birthdays in
june
 of 1983 and the date is januray 2003, your age is still returned as 20,
when
 it should be 19.

 Does anyone know how can i get the right age?


Okay, so you just want to know the age in years. Must you use php? Here is a
solution using mysql :

SELECT name, dob, CURDATE() as today,
( YEAR(CURDATE()) - YEAR(dob) ) +
LEAST( SIGN( DAYOFYEAR(CURDATE()) - DAYOFYEAR(dob) ), 0) as age_in_years
FROM test_age;

Here is the output :

+--+++--+
| name | dob| today  | age_in_years |
+--+++--+
| jim  | 1990-08-02 | 2003-08-03 |   13 |
| paul | 1990-08-03 | 2003-08-03 |   13 |
| tom  | 1990-08-04 | 2003-08-03 |   12 |
| matt | 1990-09-01 | 2003-08-03 |   12 |
| sam  | 1990-12-31 | 2003-08-03 |   12 |
| sam  | 1991-01-01 | 2003-08-03 |   12 |
| sam  | 1991-07-02 | 2003-08-03 |   12 |
| sam  | 1991-08-02 | 2003-08-03 |   12 |
| sam  | 1991-09-02 | 2003-08-03 |   11 |
+--+++--+
9 rows in set (0.01 sec)

Here is how I generated my test data :

DROP TABLE IF EXISTS test_age;
CREATE TABLE test_age (
  id int(6) NOT NULL auto_increment,
  name varchar(20) default NULL,
  dob date default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

INSERT INTO test_age (id, name, dob) VALUES ('', 'jim', '1990-08-02');
INSERT INTO test_age (id, name, dob) VALUES ('', 'paul', '1990-08-03');
INSERT INTO test_age (id, name, dob) VALUES ('', 'tom', '1990-08-04');
INSERT INTO test_age (id, name, dob) VALUES ('', 'matt', '1990-09-01');
INSERT INTO test_age (id, name, dob) VALUES ('', 'sam', '1990-12-31');
INSERT INTO test_age (id, name, dob) VALUES ('', 'sam', '1991-01-01');
INSERT INTO test_age (id, name, dob) VALUES ('', 'sam', '1991-07-02');
INSERT INTO test_age (id, name, dob) VALUES ('', 'sam', '1991-08-02');
INSERT INTO test_age (id, name, dob) VALUES ('', 'sam', '1991-09-02');



 -Original Message-
 From: John Ryan [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 02, 2003 2:31 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP-DB] subtracting dates...


 Hi,

 In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
 users date of births. I need to calculate in a PHP script, the users age
 from this DOB. I get a PHP date in the same format as the mySQL and
 subtract, which returns the year rounded off. ie, it doesnt matter if
 your birthdays in june of 1983 and the date is januray 2003, your age is
 still returned as 20, when it should be 19.

 Does anyone know how can i get the right age?



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


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




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.506 / Virus Database: 303 - Release Date: 01/08/2003


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



[PHP] loop and write array

2003-08-03 Thread Micah Montoy
I'm having difficulty in trying to figure out a way to loop through a query
and extract the info from a single column into an array.  Here is what I am
looking for.  In the table, I have a column called keywords that has a
string of information that are separated with a comma.  I am looking for a
way to extract each keyword from the one cell and make a conditional on it.
Otherwise its like this:

Column keywords has in a single cell - TV,television,HDTV,projection
I want to loop through each row cell in the column keywords and write out
each keyword to its own placement to be compared to what the user submits.
I was thinking of something like this but this is as far as I've gotten.

$search_string = $_POST[search];
$search_string = strip_tags($search_string);
$search_string = strtolower($search_string);
$search_string = str_replace(\n, , $search_string);
$search_string = strip_chars($search_string); //calls a formula which strips
specific chars
$search_string = str_replace(,, , $search_string);
$search_string = explode( , $search_string);
$search_string = strip_words($search_string); //calls a formula which strips
specific words

$keywords = mssql_query(select keywords from category);

for ($i=0; i  mssql_num_rows($keywords); $i++) {

$keywords = mssql_result($keywords,0,keywords);  //this will assign
the full string to the variable keywords

if ($keywords == $search_string){
echo (keyword $keywords found);
}
}

I can't figure out how to separate each keyword by the comma and then write
that specific keyword to an array to be used.  Any and all help would be
appreciated.

thanks



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



Re: [PHP] .htaccess

2003-08-03 Thread Simone Levy
 Just one question, is there any way that when a person logs in via the
 htaccess popup that i can know via my php script...and can i also get
 his
 username?
 
Protect the directory you want with .htaccess
If authentication was successful, your code in index.php is executed:
if($REMOTE_USER==bill) {echo welcome Bill!;}
if($REMOTE_USER==hillary) {echo welcome Hillary!;}
 
 
 John Holmes, you really think you are being of any help writin':
 
 Have you read the chapter on HTTP Authentication? No. Read the very
 first paragraph:
 
 The HTTP Authentication hooks in PHP are only available when it is
 running as an Apache module and is hence not available in the CGI
 version. In an Apache module PHP script, it is possible to use the
 header() function to send an Authentication Required message to the
 client browser causing it to pop up a Username/Password input window.
 Once the user has filled in a username and a password, the URL
 containing the PHP script will be called again with the predefined
 variables PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE set to the user
 name, password and authentication type respectively. These predefined
 variables are found in the $_SERVER and $HTTP_SERVER_VARS arrays. Only
 Basic authentication is supported. See the header() function for more
 information.
 
 You're welcome.
 
 ---John Holmes...
 


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



Re: [PHP] loop and write array

2003-08-03 Thread Jason Wong
On Sunday 03 August 2003 21:50, Micah Montoy wrote:

 I can't figure out how to separate each keyword by the comma and then write
 that specific keyword to an array to be used.  Any and all help would be
 appreciated.

explode()

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Your car horn will always get stuck when your're behind a group of Hell's 
Angels
-- Murphy's Driving Laws n19
*/


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



[PHP] [Apache Newsletter Draft] News from PHP Project in July, 2003

2003-08-03 Thread Tetsuya Kitahata
Dear PHP General List Subscribers, 
(http://www.php.net/)


Hello,

I am now in the process of preparing the first all-Apache-wide newsletter.
http://www.apache.org/newsletter/
'The Apache Newsletter Issue 1' ... ASF-wide-newsletter of July 2003,
 which will be published in the middle of August 2003.

Please feel free to write statement/comment/article etc. to
the Apache Newsletter (Issue 1) using ApacheWiki
or in this mailing list. Hope to hear from you.
http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheNewsletterDrafts/Issue1

This 'The Apache Newsletter' will be published as a result of the outgrowth
of the previous 'Jakarta Newsletter' and 'Apache Newsletter' can now
cover all the projects under apache.org including infrastructure,
incubator, xml, webservice, PHP, et cetra.

== WHAT WAS JAKARTA NEWSLETTER?? - http://jakarta.apache.org/site/news/

'The Apache Newsletter Issue 1' will be appeared at
http://www.apache.org/newsletter/200307.html
and the editorial deadline will be 00:00 GMT, 9th August.

ApacheWiki (http://nagoya.apache.org/wiki/apachewiki.cgi) had
been already set up.
If you have anything to be added to the ApacheWiki, please go to
http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheNewsletterDrafts/Issue1
and fill up what you want to append in.
If there's nothing news-worthy on your project, then please write
something you *hope* (e.g. XX project will release FINAL version of
XX product in the middle of August, etc etc).

If you have been voted in warmly as a new committer in ASF the
last month (July) please add your name to the list on ApacheWiki.

If your project really want some 'ADVERTISEMENT' (to recruit
new comers, etc etc), please write nice and catchy blurb at the
'advertisement' section so that it will attract the readers'
attentions.

Probably, the former newsletter final draft and newsletter itself
(Jakarta Newsletter Issue 9)
will give you some hints in writing the articles.
cf.
http://nagoya.apache.org/wiki/apachewiki.cgi?JakartaNewsletterDrafts/Issue9
http://jakarta.apache.org/site/news/200305.html

If you have any questions about this, please send your messages to
[EMAIL PROTECTED] or this mailing list.

This Newsletter will be published as webpage and be announced
at [EMAIL PROTECTED] (the ASF-wide announcement list)
To subscribe to [EMAIL PROTECTED],
please follow this instruction:
http://www.apache.org/foundation/mailinglists.html#foundation-announce


Hope to hear from PHP Project!!
(If you feel hesitation in writing articles on ApacheWiki, please
write your memo in this mailing list or give me a note).
http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheNewsletterDrafts/Issue1

Note: PHP Project's Wikipage is here:
http://nagoya.apache.org/wiki/apachewiki.cgi?PHPProjectPages

Sincerely,

-- Tetsuya Kitahata ([EMAIL PROTECTED])

P.S. Contributions from anyone are cordially invited!!


-
Tetsuya Kitahata --  Terra-International, Inc.
E-mail: [EMAIL PROTECTED]
http://www.terra-intl.com/
(Apache Jakarta Translation, Japanese)
http://jakarta.terra-intl.com/


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



[PHP] Not sure of the best way to handle a problem

2003-08-03 Thread David Smith
Hi:
I have a slight problem that I'm not sure where to begin. I have
multiple files on another server other then my linux box that needs to
be renamed. These files are used under a particular software package and
I am trying to switch them to another software package which would
require them to be renamed. Now here is the catch. I really can't
install apache, php, or perl on the system (windows) or it will bog down
the software (which automates a radio station). What I need is to find
out if any of you have ever accessed a remote system (perhaps from the
command-line interface) and changed file names. I need to be able to
remove numbers a pluses. The numbers can be replaced with essentially
nothing. The pluses need to be replaced with spaces. Any ideas. I'm a
little new to PHP so I'm not sure if the best method would be to use the
command-line option or if I should find another solution altogether.
(I'm just more familar with php then perl and hate vb.)
David


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



[PHP] Why does virtual behave like it does?

2003-08-03 Thread DvDmanDT
Here's what I tried:

function buf($cmd)
{
ob_start();
preg_replace(#e#e,$cmd,e);
$ret=ob_get_contents();
ob_end_clean();
return $ret;
}
ob_start();
$contents=buf('virtual(/test/)');

I tried the buf() function with print() and it worked as expected... Now,
why does virtual teminate ob? I think it would be better with the
possibility to parse the output some... Why? Cause I access my Tomcat from
Apache and Tomcat must generate a XML page that would basicly need to be
parsed...

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]



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



[PHP] for the love of god, remove me

2003-08-03 Thread Joseph Bannon
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


This page is useless, you can't remove yourself.

J. 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] for the love of god, remove me

2003-08-03 Thread David Smith
It's not usless if you read the page. 
[EMAIL PROTECTED]
On Sun, 2003-08-03 at 13:45, Joseph Bannon wrote:
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 This page is useless, you can't remove yourself.
 
 J. 
 
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com


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



[PHP] how can I get errors to display in a browser?

2003-08-03 Thread jsWalter
I have a test script, with deliberate errors.

The broswer shows nothing, blank, empty.

It used to show errors, now it does not.

No idea what I did to turn it off.

Can someone tell me hoew to turn it back on?

In my php.ini file, it says...

 error_reporting  =  E_ALL

I thought that was what it needed.

I guess not.

Thanks

walter




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



RE: [PHP] how can I get errors to display in a browser?

2003-08-03 Thread Boaz Yahav
Try adding : 

error_reporting(2039); as the 1st line in your file.


Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com


-Original Message-
From: jsWalter [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 03, 2003 9:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how can I get errors to display in a browser?


I have a test script, with deliberate errors.

The broswer shows nothing, blank, empty.

It used to show errors, now it does not.

No idea what I did to turn it off.

Can someone tell me hoew to turn it back on?

In my php.ini file, it says...

 error_reporting  =  E_ALL

I thought that was what it needed.

I guess not.

Thanks

walter




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

2003-08-03 Thread Ryan A
Hi,
Will someone please remove this jackass from the list? everytime I write to
the list if its with a question or with an answer I get this message:

Transmit Report:

 To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])



According to what was said on the list a few days back he has been kicked
out from two other lists for spamming...will someone in charge please see to
this? its frustrating and irritating.

-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



[PHP] Re: how can I get errors to display in a browser?

2003-08-03 Thread Comex
display_errors

Jswalter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a test script, with deliberate errors.

 The broswer shows nothing, blank, empty.

 It used to show errors, now it does not.

 No idea what I did to turn it off.

 Can someone tell me hoew to turn it back on?

 In my php.ini file, it says...

  error_reporting  =  E_ALL

 I thought that was what it needed.

 I guess not.

 Thanks

 walter






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



Re: [PHP] for the love of god, remove me

2003-08-03 Thread Curt Zirzow
* Thus wrote Joseph Bannon ([EMAIL PROTECTED]):
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 This page is useless, you can't remove yourself.

Internet technology hasn't gotten far enough to read the minds of
users.

If maybe you actually read the page you might have figured out that
it tells how to unsubscribe to the list, several different ways if
i might add.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: how can I get errors to display in a browser?

2003-08-03 Thread jsWalter

Comex [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 display_errors

Bingo!

thanks

walter




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



Re: [PHP] Idiot problem

2003-08-03 Thread Curt Zirzow
* Thus wrote Ryan A ([EMAIL PROTECTED]):
 Hi,
 Will someone please remove this jackass from the list? everytime I write to
 the list if its with a question or with an answer I get this message:
 
 Transmit Report:
 
  To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])
Heh.. this is still happening?  I've got him to be filtered to
/dev/null.

 
 
 
 According to what was said on the list a few days back he has been kicked
 out from two other lists for spamming...will someone in charge please see to
 this? its frustrating and irritating.

If I recall the lists have a spam filtering system applied to the
system. Unfortantly this address seems to have slipped through the
cracks.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Idiot problem

2003-08-03 Thread Comex
[EMAIL PROTECTED]
Ryan A:
 everytime I
 write to the list if its with a question or with an answer I get this
 message: 

Can't you just set a message rule?

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



[PHP] [secure PHP] Error handling (again)

2003-08-03 Thread thierry lhomme
Hi !

I still have found no satisfying solution to my problem yet...

At home, when an error occurs in an script I got something like this :

Warning: unlink() failed (No such file or directory) in c:\program
files\easyphp\www\php_scripts\index.php on line 356

but my provider in the same case delivers this :

Warning: unlink() failed (No such file or directory) in index.php on line
347

... and that's much better, don't you think ?!

The question is : How do they do that ??

The answer is apparently NOT in the php.ini file...


My provider runs PHP 4.2.2
... and Apache/1.3.26 (Unix) Debian GNU/Linux mod_fastcgi/2.2.12
mod_perl/1.26


Thanx a lot for your ideas !!



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



Re: [PHP] [secure PHP] Error handling (again)

2003-08-03 Thread Curt Zirzow
* Thus wrote thierry lhomme ([EMAIL PROTECTED]):
 Hi !
 
 I still have found no satisfying solution to my problem yet...
 
 At home, when an error occurs in an script I got something like this :
 
 Warning: unlink() failed (No such file or directory) in c:\program
 files\easyphp\www\php_scripts\index.php on line 356
 
 but my provider in the same case delivers this :
 
 Warning: unlink() failed (No such file or directory) in index.php on line
 347
 
 ... and that's much better, don't you think ?!
 
 The question is : How do they do that ??

I don't think they are doing anything special, it might just be
system dependent.

You could create your custom error with:

http://php.net/set-error-handler


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] logging of mail() function?

2003-08-03 Thread RiGe
Is there possible to log outgoing mails sent via mail() function? I need to
know, when, which script (can be path to php file on server) and receipt of
mail that was sent.

Is there possible?

Thanx.

RiGe



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



Re: [PHP] logging of mail() function?

2003-08-03 Thread John W. Holmes
RiGe wrote:
Is there possible to log outgoing mails sent via mail() function? I need to
know, when, which script (can be path to php file on server) and receipt of
mail that was sent.
Is there possible?
Not directly, unless your SMTP server is keeping a log.

Write your own wrapper function my_mail() that does the logging and also 
sends the mail.

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


[PHP] Forking PHP Processes on Unix (PHP4)

2003-08-03 Thread Damien G
Hi Readers,

Heres what i'm trying to achieve:

A script, that uses multiple fsockopen()'s and simltaniously get feedback
from each socket from fget()s. Now, since using a single fget() needs to be
in a loop then it's not possible to have more than one loop going at the
same time.

I was thinking of using a break command, then getting feedback from the
other loops, and breaking each of them inside a encapsulating loop -
however, this is VERY ineffective.

What I thought about doing was just using the same script launched multiple
times, so it has diffrent proccesses running and therefore would be able to
complete the task of having multiple loops running at the same time on the
same system.

The problem I've found out is that on Unix (the desired OS breed), PHP can't
be forked - so using a start.php script to execute multiple system() calls
wouldn't work becuase PHP waits till the system() function has finished
before carrying on with the rest of start.php.

i.e. The following won't work:


PHP:
--
for ($i = 0; $i  5; $i++) {
  system (/path/to/php /path/to/script.php );
}


--

Basically, i'm asking if anyone has a work around, or alternativley a answer
to my problem?

I'd much appritiate it, or any help you can contribute.

Thanks in advance, or for atleast reading to this point

-Damien


begin 666 smile.gif
M1TE.#EA#P`/`+,.`+R[N\;%Q?+R\L' P/S\_.SL[,S+R]+1T??W]]_?W^;F
MYMG8V/___P```*2DI ```'Y! $```X`+ `/``\```16T$G9:IW85;Y
MQ0TACF,S-4BJKHBI4(%QPUL-D5Y6N-XJ@BL)([()+*R:#J?SLKAT)A:
BIU6JQF!H+_+B5 ME3(`9=FPZWU908#[_9#3F3 0`.P``
`
end


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



[PHP] payflow pro with php

2003-08-03 Thread Richard Baskett
Ok I am having some serious problems with payflow pro..  Has anybody else
had the problem that when you execute the test.sh script it works fine, but
when you do the exact same thing in php it gives you a failed to connect
response message?  If so what in the world did you do to get it to work?

Thanks!

Rick

A sense of humor can help you over look the unattractive, tolerate the
unpleasant, cope with the unexpected, and smile through the unbearable. -
Moshe Waldoks


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



[PHP] mail funciton

2003-08-03 Thread aculott
hope i am sending my problem to the right place
recently installed PHP with Apache , on Windows 2000 paltform,,all is well, but cnat 
seem to get the mail() fucntion working

i made the chagnes in php.ini
SMTP set to my outgoing email server, that i have with myu ISP
and
sendmail_from with my emai address
what else do i need?
andy


[PHP] Tracking Users via Cookies?

2003-08-03 Thread Jason Bourque
Hello,

I hope someone can answer this. I have a client that would like to track
their visitors if they go to other competitors websites after visiting their
own.

Is this possible? I think it is possible to track where they go in the site
visited. . .

I know that tracking isn't a good idea but I want to give my client an
informed answer on what is possible, then let them know the implications of
privacy invasion.

Thanks for any responses.

Jason Bourque


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



Re: [PHP] Tracking Users via Cookies?

2003-08-03 Thread Ryan A
Hey,
As far as i know you cant do that, you can see from where they have come
(ie. where they have visited before coming to you) but not after they leave
your site unless they return.

/*
I want to give my client an
 informed answer on what is possible, then let them know the implications
of
 privacy invasion.
*/
Yeah right, we belive you. :-D

Cheers,
-Ryan

We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com


- Original Message -
From: Jason Bourque [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 04, 2003 1:58 AM
Subject: [PHP] Tracking Users via Cookies?


 Hello,

 I hope someone can answer this. I have a client that would like to track
 their visitors if they go to other competitors websites after visiting
their
 own.

 Is this possible? I think it is possible to track where they go in the
site
 visited. . .

 I know that tracking isn't a good idea but I want to give my client an
 informed answer on what is possible, then let them know the implications
of
 privacy invasion.

 Thanks for any responses.

 Jason Bourque


 --
 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: mail funciton

2003-08-03 Thread Igor Konforti
Try weed

On Sun, 3 Aug 2003 13:06:33 -0700, [EMAIL PROTECTED] wrote:

hope i am sending my problem to the right place
recently installed PHP with Apache , on Windows 2000 paltform,,all is 
well, but cnat seem to get the mail() fucntion working

i made the chagnes in php.ini
SMTP set to my outgoing email server, that i have with myu ISP
and
sendmail_from with my emai address
what else do i need?
andy


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


php-general Digest 4 Aug 2003 01:23:49 -0000 Issue 2215

2003-08-03 Thread php-general-digest-help

php-general Digest 4 Aug 2003 01:23:49 - Issue 2215

Topics (messages 158073 through 158100):

Re: connecting access (*.mdb) database with PHP
158073 by: Simon Fredriksson

Help with secure virtual host setup
158074 by: Robert Mena

loop and write array
158075 by: Micah Montoy
158077 by: Jason Wong

Re: .htaccess
158076 by: Simone Levy

[Apache Newsletter Draft] News from PHP Project in July, 2003
158078 by: Tetsuya Kitahata

Not sure of the best way to handle a problem
158079 by: David Smith

Why does virtual behave like it does?
158080 by: DvDmanDT

for the love of god, remove me
158081 by: Joseph Bannon
158082 by: David Smith
158087 by: Curt Zirzow

how can I get errors to display in a browser?
158083 by: jsWalter
158084 by: Boaz Yahav
158086 by: Comex
158088 by: jsWalter

Idiot problem
158085 by: Ryan A
158089 by: Curt Zirzow
158090 by: Comex

[secure PHP] Error handling (again)
158091 by: thierry lhomme
158092 by: Curt Zirzow

logging of mail() function?
158093 by: RiGe
158094 by: John W. Holmes

Forking PHP Processes on Unix (PHP4)
158095 by: Damien G

payflow pro with php
158096 by: Richard Baskett

mail funciton
158097 by: aculott.attglobal.net
158100 by: Igor Konforti

Tracking Users via Cookies?
158098 by: Jason Bourque
158099 by: Ryan A

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---
Unless you can find some Access-Class I think ODBC is the way to go. No 
idea how you can solve it if you're using a *nix server though.

//Simon

Pehepe Php wrote:

how can I connect access database(*.mdb) with php?  what is the code?   
I will be happy if you write php code.

Thank you!

_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


---End Message---
---BeginMessage---
Hi all,

I host some virtual domains within my apache 1.3.x/php
4.3.x setup.

Those domains are mantained by the users via ftp and I
was wondering if I could secure the configuration a
little bit more.  I know that are limitations but the
requirements would be :

a) the user should not be able to access files outside
the DocumentRoot besides system libraries or temporary
files
b) I'd like to have a system wide repository where
common libraries, classes should be accessed without
having to copy and mantain individually
c) Since the user has some php thet perform a file
upload, those scripts must be able to move, rename,
delete files located under the document root

As a starting point the user has a ftp login and the
document root is owned by the login.apache so the user
and the apache can access and alter the contents.

Best regards.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
---End Message---
---BeginMessage---
I'm having difficulty in trying to figure out a way to loop through a query
and extract the info from a single column into an array.  Here is what I am
looking for.  In the table, I have a column called keywords that has a
string of information that are separated with a comma.  I am looking for a
way to extract each keyword from the one cell and make a conditional on it.
Otherwise its like this:

Column keywords has in a single cell - TV,television,HDTV,projection
I want to loop through each row cell in the column keywords and write out
each keyword to its own placement to be compared to what the user submits.
I was thinking of something like this but this is as far as I've gotten.

$search_string = $_POST[search];
$search_string = strip_tags($search_string);
$search_string = strtolower($search_string);
$search_string = str_replace(\n, , $search_string);
$search_string = strip_chars($search_string); //calls a formula which strips
specific chars
$search_string = str_replace(,, , $search_string);
$search_string = explode( , $search_string);
$search_string = strip_words($search_string); //calls a formula which strips
specific words

$keywords = mssql_query(select keywords from category);

for ($i=0; i  mssql_num_rows($keywords); $i++) {

$keywords = mssql_result($keywords,0,keywords);  //this will assign
the full string to the variable keywords

if ($keywords == $search_string){
echo (keyword $keywords found);
}
}

I can't figure out how to separate each keyword by the comma and then write
that specific keyword to an array to be used.  Any and all help would be
appreciated.

thanks


---End Message---
---BeginMessage---
On Sunday 03 

[PHP] Re: mail funciton

2003-08-03 Thread Igor Konforti
I'm sorry,i was just checking if outgoing server is working :P



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


[PHP] PHP / Oracle support (8/9) under Redhat 9

2003-08-03 Thread Robert Mena
Hi,

I am planning to migrate my current web server from
redhat 7.x to 9 and I am currently evaluating what may
go wrong or need special attention before I actually
replace it.

After searching the archives and other lists I still
have a couple of questions :

a) apache

It seems that apache + php does not work well under
heavy load so I should stick with 1.3.X right ?  Any
ideas where I can find a rpm package for redhat 9 ?

b) oracle support

For the current setup I've downloaded and installed
the oracle 8i (8.1.5) in a separate machine, tar.gz
the lib directory in order to compile and run php with
oracle 8i.

Is this the best approach for Redhat 9 or should I try
to install oracle 9 which hopefully may have a
devel-only option ?  Note that php needs to access
external oracle 8 servers which I do not mantain.

Regards.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: [PHP] Forking PHP Processes on Unix (PHP4)

2003-08-03 Thread Jason Sheets
PHP can fork on Unix, just not from a web environment.  So you need to 
execute the command from the command line or maybe an exec.

Take a look at: http://www.php.net/manual/en/ref.pcntl.php

Jason

Damien G wrote:

Hi Readers,

Heres what i'm trying to achieve:

A script, that uses multiple fsockopen()'s and simltaniously get feedback
from each socket from fget()s. Now, since using a single fget() needs to be
in a loop then it's not possible to have more than one loop going at the
same time.
I was thinking of using a break command, then getting feedback from the
other loops, and breaking each of them inside a encapsulating loop -
however, this is VERY ineffective.
What I thought about doing was just using the same script launched multiple
times, so it has diffrent proccesses running and therefore would be able to
complete the task of having multiple loops running at the same time on the
same system.
The problem I've found out is that on Unix (the desired OS breed), PHP can't
be forked - so using a start.php script to execute multiple system() calls
wouldn't work becuase PHP waits till the system() function has finished
before carrying on with the rest of start.php.
i.e. The following won't work:

PHP:
--
for ($i = 0; $i  5; $i++) {
 system (/path/to/php /path/to/script.php );
}

--
Basically, i'm asking if anyone has a work around, or alternativley a answer
to my problem?
I'd much appritiate it, or any help you can contribute.

Thanks in advance, or for atleast reading to this point

-Damien

 



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


Re: [PHP] logging of mail() function?

2003-08-03 Thread Jason Sheets
This is something you would probably do with your e-mail server, not 
with PHP.  You can log all of the emails sent by your scripts by writing 
a wrapper around mail though.  Basically check your SMTP daemon's 
documentation whether it be sendmail, qmail or something else and look 
for auditing or accounting.

Jason

RiGe wrote:

Is there possible to log outgoing mails sent via mail() function? I need to
know, when, which script (can be path to php file on server) and receipt of
mail that was sent.
Is there possible?

Thanx.

RiGe



 



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


[PHP] microtime alternative

2003-08-03 Thread Micah Montoy
Anyone have an alternative to microtime that works for a windows system?

thanks



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



[PHP] Invalid Characters, XML...

2003-08-03 Thread Russell P Jones
Im using PHP to write to XML files, but I am having some problems. A lot
of users are cutting and pasting content from text editors like word,
which uses odd quotation marks, dashes, etc. which PHP writes to the XML
file, and then the XML parser does not under stand. Is there a
stripslashes() or htmlspecialchars() equivalent that will convert this
kind of stuff to the correct ascii text?

Russ


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



Re: [PHP] PHP / Oracle support (8/9) under Redhat 9

2003-08-03 Thread Justin French
On Monday, August 4, 2003, at 11:33  AM, Robert Mena wrote:

a) apache

It seems that apache + php does not work well under
heavy load so I should stick with 1.3.X right ?  Any
ideas where I can find a rpm package for redhat 9 ?
I can't help with the Oracle question, but yes, stick with apache 1.3.x 
for the moment...

It would also pay to look at what version of PHP you're currently 
running (eg 4.1) and see what major changes you're likely to experience 
when upgrading to the latest stable version.

If your existing version is pre 4.1, the register globals will be an 
issue, for example.

Sorry, I have no idea what version of PHP was on RH 7

Justin

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


[PHP] mysql_real_escape_string

2003-08-03 Thread Anthony Ritter
The following function is from Larry Ullman's PHP and mySQL on page 217 -
script 6.8 - in which there is a connection to a mySQL database using PHP.

My question is that I'm not sure of the global variable $dbc.

If I am to understand...this made up function escape_data() will receive a
piece of data - say $_POST['first_name'] - and then check if
magic_quotes_gpc is turned on in the ini file.

If it returned true, then stripslashes will be applied to the data - if it
is not turned on, then slashes will be applied to the data variable.

What is the reason that the global variable $dbc is declared in the
function - I cannot find another instance of $dbc outside of the function in
script 6.8.

Thank you,
Tony Ritter
.


function escape_data($data)
{
global $dbc;
if (ini_get('magic_quotes_gpc'))
{
$data=stripslashes($data);
}
return mysql_real_escape_string($data,$dbc);
}
.
//check for a first name

if(empty($_POST['first_name']))
 {
   $fn=FALSE;
   $message='pYou forgot to enter you first name/p';
  }
else
 {
  $fn= escape_data($_POST['first_name']);   // calling the function
 }
..



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



Re: [PHP] mysql_real_escape_string

2003-08-03 Thread Jason Sheets
dbc looks like a MySQL Connection Resource, a connection returned from 
mysql_connect.  It looks like this function is using the mysql escape 
function to make sure the data is properly escaped for that particular 
database.  If you use a function other than mysql_real_escape_string you 
can remove the $dbc variable.

Jason

Anthony Ritter wrote:

The following function is from Larry Ullman's PHP and mySQL on page 217 -
script 6.8 - in which there is a connection to a mySQL database using PHP.
My question is that I'm not sure of the global variable $dbc.

If I am to understand...this made up function escape_data() will receive a
piece of data - say $_POST['first_name'] - and then check if
magic_quotes_gpc is turned on in the ini file.
If it returned true, then stripslashes will be applied to the data - if it
is not turned on, then slashes will be applied to the data variable.
What is the reason that the global variable $dbc is declared in the
function - I cannot find another instance of $dbc outside of the function in
script 6.8.
Thank you,
Tony Ritter
.
function escape_data($data)
{
global $dbc;
if (ini_get('magic_quotes_gpc'))
{
$data=stripslashes($data);
}
return mysql_real_escape_string($data,$dbc);
}
.
//check for a first name
if(empty($_POST['first_name']))
{
  $fn=FALSE;
  $message='pYou forgot to enter you first name/p';
 }
else
{
 $fn= escape_data($_POST['first_name']);   // calling the function
}
..


 



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


[PHP] Re: microtime alternative

2003-08-03 Thread Micah Montoy
scratch this.  I found an alternative.

Micah Montoy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Anyone have an alternative to microtime that works for a windows system?

 thanks





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



[PHP] grabbing variable from bottom to top

2003-08-03 Thread Micah Montoy
Anyone know of a way to use a variable that isn't defined until further down
the script at the top.  I have a counter and once everything runs through
the script, the count is complete, I need to display this at the top above
the displayed results.  I thought about and tried a function but I still run
into the same problem.

thanks



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



Re: [PHP] grabbing variable from bottom to top

2003-08-03 Thread Jason Sheets
You can't get the intended value from a variable that hasn't been 
defined yet, obviously because you haven't given the variable a value.  
If you are trying to make something like a counter you may consider one 
of the following:

1. Insert the value into a database like MySQL or PostgreSQL,
2. Write the variable to a text file
3. Use PHP Sessions to store the variable between requests.
Of these choices #1 is generally the best choice, #2 will not deal with 
concurrent requests well and may corrupt the information, #3 will only 
work for a single visitor.

If the values are in an array you might use count($array) that will tell 
you the number of elements in the array, if the values are a delimited 
string you can use count(explode('seperator', 'data')) or something like 
that.  The other thing you can do is run through the loop and instead of 
printing output put it into a variable, then at the end of the loop 
print the number, then print the variable containing the output, then 
print the end text.

Jason



Micah Montoy wrote:

Anyone know of a way to use a variable that isn't defined until further down
the script at the top.  I have a counter and once everything runs through
the script, the count is complete, I need to display this at the top above
the displayed results.  I thought about and tried a function but I still run
into the same problem.
thanks



 



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


Re: [PHP] grabbing variable from bottom to top

2003-08-03 Thread Justin French
Ok, this is completely off the top of my head, and there is more than 
likely a better way, but if you HAVE to do this, then I guess here's an 
option:

1. turn on ob (output buffering at the top of the script
2. where you want the counter to be, echo something unique like 
[EMAIL PROTECTED]@
3. once the script has ended flush the contents of OB into a variable 
like $obContents
4. do a str_replace('[EMAIL PROTECTED]@',$yourCounterValue, $obContents)
5. echo the $obContents to the screen

I think a smarter way would be to re-organise your code somehow so that 
it does what you want, but maybe that can't be done (no way to know 
without seeing the code).

Good luck,

Justin French



On Monday, August 4, 2003, at 01:04  PM, Micah Montoy wrote:

Anyone know of a way to use a variable that isn't defined until 
further down
the script at the top.  I have a counter and once everything runs 
through
the script, the count is complete, I need to display this at the top 
above
the displayed results.  I thought about and tried a function but I 
still run
into the same problem.

thanks


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


[PHP] cli file open problem

2003-08-03 Thread Gareth Thomas
Hi,

I am trying to write data to a text file on my Windows 2000 server using PHP
at the command line. I am running PHP 4.3.2, and the script uses the 'touch'
function to create the file (which works fine) but when I try and open the
file to write to it and errors. Anyone any idea? I have checked the security
and also IIS access.. I would assume however that if touch works then so
would fopen... I am stumped. Any help would be much appreciated.

G.



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



[PHP] splitting content into pages

2003-08-03 Thread daniel
thanks to the poster on the substr page i made a modification to it so it
now splits the content into pages lemme know anyone if this is useful

usage: page_content($content,15,$_GET['page']);

function page_content($content,$limit,$page)
{
$array = explode(\r\n, $content);
$maxline = count($array);
if ($maxline  $limit) {
$max = $maxline - 1;
$page ? $page = $page : $page = 1;
$page ? $next = $limit * ($page - 1) + 1 : $next =
1;
$s=$next+$limit;
for ($i=$next; $i$s; $i++) {
if ($array[$i]!=) $formatted_content .=
$array[$i].\n\n;
   //$dtrow = explode(|, $array[$i]);
   //$row = $dtrow[0];
   //$formatted_content .= $row.\n;
}
$p = 1;
$u = ceil($max/$limit);
for ($t=1; $t$u; $t++) {
   $t == $page ?
$formatted_content .= b$t/bnbsp;  : $formatted_content .= a
href=\.$_SERVER['PHP_SELF'].?.url
('page', page=$t).\$t/anbsp; ;
   $p=$p+$limit;
}
return $formatted_content;
}
return $content;
}



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



[PHP] Clarification..... UTF-8 Enccoding .....

2003-08-03 Thread Russell P Jones

Any idea on how to get rid of Windows chracters. I have paroblem with
users cutting and pasting out of Microsoft Word into textarea's and
input-boxes and the special characters like quotations and apostrophes
messing up the xml...


Thanks


Russ



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



Re: [PHP] Clarification..... UTF-8 Enccoding .....

2003-08-03 Thread Hank TT
I don't know how MS encodes its smart quotes but there are certainly
Unicode-compliant equivalents:
http://www.alanwood.net/unicode/general_punctuation.html

And XML is friendly to utf-8 (assuming you do want utf-8).


- Original Message -
From: Russell P Jones [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 04, 2003 12:03 AM
Subject: [PHP] Clarification. UTF-8 Enccoding .



 Any idea on how to get rid of Windows chracters. I have paroblem with
 users cutting and pasting out of Microsoft Word into textarea's and
 input-boxes and the special characters like quotations and apostrophes
 messing up the xml...


 Thanks


 Russ



 --
 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] Clarification..... UTF-8 Enccoding .....

2003-08-03 Thread Justin French
Identify common problematic characters, and develop a function (series 
of str_replace()'s) to convert them to suit.

Over time, you can always add to this function as you spot more 
problematic characters.

Also look at something like Tidy (see archives in the last week where 
it was discussed with the subject tags to lowercase).

Justin



On Monday, August 4, 2003, at 02:03  PM, Russell P Jones wrote:

Any idea on how to get rid of Windows chracters. I have paroblem with
users cutting and pasting out of Microsoft Word into textarea's and
input-boxes and the special characters like quotations and apostrophes
messing up the xml...


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


Re: [PHP] Clarification..... UTF-8 Enccoding .....

2003-08-03 Thread Tom Rogers
Hi,

Monday, August 4, 2003, 2:03:57 PM, you wrote:

RPJ Any idea on how to get rid of Windows chracters. I have paroblem with
RPJ users cutting and pasting out of Microsoft Word into textarea's and
RPJ input-boxes and the special characters like quotations and apostrophes
RPJ messing up the xml...


RPJ Thanks


RPJ Russ

I do this before feeding it to xml

$description = iconv(ISO-8859-1,UTF-8,$description);

-- 
regards,
Tom


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