Re: [PHP] Owner

2002-09-26 Thread John Taylor-Johnston

Justin,

 Best advice is to post strictly to the newsgroup with a dud email address,

Unfortunately, that doesn't work. I had a hotmail address, but not acceptable. Someone 
did not put it on the accepted' list. Someone back there needs to accept that address 
to allow that poster to post when using news://news.php.net/php.general. Been through 
that. That's what I want to do now. Who is he? I would like to work something out with 
him.

 filter out anything to that address which doesn't have [PHP] in the subject

I've been filtering :)

 Using 'nospam' in your address' prolly doesn't help as much as it used to,

True, But I could work around that too, when I talk with the chap in charge :)

 Fun huh?

Giggle loads :p

Thanks,
John



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




RE: [PHP] Looking for a forum

2002-09-26 Thread Michael Egan

There are a huge number of forums at php.resourceindex.com

These range from fairly basic forums such as venomboard to more complex forums such as 
phpbb

Michael Egan



-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
Sent: 26 September 2002 06:26
To: [EMAIL PROTECTED]
Subject: [PHP] Looking for a forum


Hi,
I'm looking for some forum script, a bit like this:
http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi
Can anyone post a link to something useful?
John


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

2002-09-26 Thread Meltem Demirkus

hi,
can anybody help me with cookies..I read the manual of  php but it came
complicated..Any basic tutorial or other something helps alot..I am trying
to make a cookie to kkep the user id in it...

thanks

meltem


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




[PHP] Extreme Sports

2002-09-26 Thread Michael Egan

This probably breaks the rules of the forum in that it's not really a PHP question but 
I thought it might cause some amusement.

I heard a discussion on the radio last night which mentioned the new 'sport' of 
extreme ironing! Sure enough they've got a web site at www.extremeironing.com 

It's not a bad looking web site and, needless to say, is done with PHP :-)

Michael Egan

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




[PHP] Re: cookie

2002-09-26 Thread Bsantos PHP

Why don't you keep you mind ahead and use session auth

bsantos

Meltem Demirkus [EMAIL PROTECTED] wrote in message
001701c26532$ba7c8c90$5583@hiborya">news:001701c26532$ba7c8c90$5583@hiborya...
 hi,
 can anybody help me with cookies..I read the manual of  php but it came
 complicated..Any basic tutorial or other something helps alot..I am trying
 to make a cookie to kkep the user id in it...

 thanks

 meltem




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





[PHP] local resource variables

2002-09-26 Thread lallous

Hello,


I was wondering if i do:

function test()
{
  $result = mysql_query(SELECT * FROM bigbigtable);
}

after calling test() will  $result be freed as if calling
mysql_free_result()?


Elias



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




[PHP] Re: Example script : Employee schedule

2002-09-26 Thread lallous

look for an application called: TimeWebSheet



Elias,

Faisal Abdullah [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi people.
 Does anyone happen to know whether there is a sample script/application
out
 there which can tell me (and everyone else in the organisation) of what
 john doe
 is doing, and where  when he's doing it?

 I don't know a proper name for this type of application, therefor I
haven't
 found anything in google.
 Thanks.

 Sincerely,
 Faisal

 __




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




[PHP] Re: XSLT and PHP

2002-09-26 Thread Alexandru COSTIN

Hello,

As far as I've seen from your requirements, you are searching for a platform 
like Krysalis is.

Krysalis does exactly this, allows you to define a sitemap to associate XSL 
presentation files to dynamic XML files, in a Model-View-Controller 
approach.

http://www.interakt.ro/products/

Alexandru

 I have been impressed with using the xslt functions in php in that it
 gives you the ability to separate content from presentation. Now I am
 looking to streamline this technique.
 
 Typically I either take xml that is in a file or generated by a class
 from a sql query and transform it with an xsl file.
 
 The great part is anything to do with content or code is completely
 separate from presentation. However, if I ever need to change the
 presentation (xsl files) I still have one xsl file for every page on
 the site to edit.
 
 I have tried to make xsl files use includes (php includes) without much
 success. I am looking into xsl includes.
 
 What I am looking for is either a way to use includes in xsl stylesheets
 or something like Fusebox layouts for xml/xsl. Thank you


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




[PHP] Template based generated website project.

2002-09-26 Thread Tony Burgess

Hi All,

I'm really just looking for some advice!

I am looking to build a website which users will be able to logon and have a
template based website generated for them, the output will have to be HTML
so that these sites can be indexed by search engines, it will also have to
change Apache conf files and DNS records.

Perhaps someone knows of a similar open source project or could point me in
the right direction.

My idea is to create the site using PHP, making use of a number of different
templates which will be PHP pages that have the same includes i.e
Navigation, Header, Footer, Content etc. Once the pages have been generated
(view source) all you have is the HTML, this is what I would like to
achieve, but I'm unsure how to pass the pages to give me only HTML from the
databases.

Any help or advice would be greatly appreciated.
--
Tony Burgess




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




[PHP] shouldn't $_SERVER['PHP_SELF'] include the get info?

2002-09-26 Thread Noodle Snacks

I was using a redirect using $_SERVER['PHP_SELF'] from the previous page (a
login for a site) and it didn't include this from the url: ?aid=12.

shouldn't it? It caused a SQL error. (which I have included a catch for so
the error will be friendly)

instead of the variable to be: /co2_busters_mk2/full_article.php I want it
to be: /co2_busters_mk2/full_article.php?aid=12.  (like it would appear in
the address bar).

is it sposed to be like that or is it a bug? Also what is the best way to
include all get data in the url?

Thanks,


--
JJ Harrison
[EMAIL PROTECTED]



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




[PHP] Re: shouldn't $_SERVER['PHP_SELF'] include the get info?

2002-09-26 Thread Erwin

Noodle Snacks wrote:
 I was using a redirect using $_SERVER['PHP_SELF'] from the previous
 page (a login for a site) and it didn't include this from the url:
?aid=12.

 shouldn't it? It caused a SQL error. (which I have included a catch
 for so the error will be friendly)

 instead of the variable to be: /co2_busters_mk2/full_article.php I
 want it to be: /co2_busters_mk2/full_article.php?aid=12.  (like it
 would appear in the address bar).

 is it sposed to be like that or is it a bug? Also what is the best
 way to include all get data in the url?

It is supposed to be like that...the PHP_SELF points to this file, and the
filename has no arguments, thus the PHP_SELF variable don't have them
either.

You will have to use the $_GET array for the aid=12 part.

Grtz Erwin


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




[PHP] Including variables

2002-09-26 Thread Matt Browne

Morning!

I'm having quite a dumb problem with PHP... It's probably more a result
of brain freeze than anything else, but if anyone could help it'd be
very much appreciated.

Basically, I need to include() the contents of a variable. Saving the
contents to a temporary file and then using include() would be
inconvenient.

What I mean is that I need PHP to display the contents of a variable,
parsing it as if it's in HTML mode - ie the variable could contain:

pSome text here./p
?php print(pSome more text./p); ?
pThe last bit of text./p

... and the output would be:
pSome text here./p
pSome more text./p
pThe last bit of text./p

What the best way of doing this?

Cheers in anticipation!


-- 
Matt Browne [EMAIL PROTECTED]

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




[PHP] Tar Files and send back to browser

2002-09-26 Thread Sascha Braun

Hi,

I want to make some people download files the server tar's on demand.

But i don't know really how to send the files back to the browser.

I used the following command for taring the file:

? 
$command = 'tar -c '.$arrResult['name'].'.tgz ../images/'.$arrResult['image'];
system($command);
?

This command starts taring, I think, but fills the browser window with the pure code 
of the tar file I belive. How can I make it behave different. When I search for the 
tar on the webserver I can't find it anywhere.

Please Help

Sascha



[PHP] Re: Including variables

2002-09-26 Thread Erwin

 I'm having quite a dumb problem with PHP... It's probably more a
 result
 of brain freeze than anything else, but if anyone could help it'd be
 very much appreciated.

 Basically, I need to include() the contents of a variable. Saving the
 contents to a temporary file and then using include() would be
 inconvenient.

Try using eval (http://www.php.net/eval),

You could also write the contents to a file generated in a tempfile.
Generate the filename with tempnam (http://www.php.net/tempnam), open it,
fill it with the contents of the variable, close it, include it and delete
it (with unlink, http://www.php.net/unlink).

HTH
Erwin


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




[PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Erwin

Sascha Braun wrote:
 Hi,

 I want to make some people download files the server tar's on demand.

 But i don't know really how to send the files back to the browser.

 I used the following command for taring the file:

 ?
 $command = 'tar -c '.$arrResult['name'].'.tgz
 ../images/'.$arrResult['image'];
 system($command);
 ?

 This command starts taring, I think, but fills the browser window
 with the pure code of the tar file I belive. How can I make it behave
 different. When I search for the tar on the webserver I can't find it
 anywhere.

You have to send the appropriate headers to the browser, or PHP will send
the default (text/plain) header. For a tar file the correct header is
application/x-tar, send it with

Header( 'Content-Type: application/x-tar' );

HTH
Erwin


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




[PHP] Re: shouldn't $_SERVER['PHP_SELF'] include the get info?

2002-09-26 Thread Noodle Snacks


Erwin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Noodle Snacks wrote:

[snipped]


 It is supposed to be like that...the PHP_SELF points to this file, and the
 filename has no arguments, thus the PHP_SELF variable don't have them
 either.

 You will have to use the $_GET array for the aid=12 part.

yeh, I figured that. But is there some easy way to print *all* of the get
data parsed? (In this case, the variable names, number of vars etc varies
alot. And this has rissen from a bug in a 250kb+ source plus project.

I am wondering if there is a smart way. or do I have to examine the $_GET
array for all vars and pass them on manually?


--
JJ Harrison
[EMAIL PROTECTED]



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




[PHP] Finding out when a Web page has changed

2002-09-26 Thread Vikram Vaswani

Hi all,

I need to write an application that accepts a list of URLs and checks them
on a daily basis (via cron) to see if the pages have changed in the past day.

I need some help with this. Does anyone know the most optimal way to find
out when a particular Web page has been modified? I am thinking about using
the Last-Modified: HTTP header - however, all servers do not return this
header - any ideas on what the fallback should be?

TIA,

Vikram
--
I find your lack of faith disturbing. 
--Darth Vader 

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




[PHP] Re: shouldn't $_SERVER['PHP_SELF'] include the get info?

2002-09-26 Thread Erwin

Noodle Snacks wrote:
 Erwin [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Noodle Snacks wrote:

 [snipped]


 It is supposed to be like that...the PHP_SELF points to this file,
 and the filename has no arguments, thus the PHP_SELF variable don't
 have them either.

 You will have to use the $_GET array for the aid=12 part.

 yeh, I figured that. But is there some easy way to print *all* of the
 get data parsed? (In this case, the variable names, number of vars
 etc varies alot. And this has rissen from a bug in a 250kb+ source
 plus project.

 I am wondering if there is a smart way. or do I have to examine the
 $_GET array for all vars and pass them on manually?

Ah, I didn't understand your question (my mistake). Answer to your question
(I hope): there is a smart way: $_SERVER['QUERY_STRING']

HTH Erwin


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




[PHP] Re: shouldn't $_SERVER['PHP_SELF'] include the get info?

2002-09-26 Thread Noodle Snacks


Erwin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Noodle Snacks wrote:
  Erwin [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Noodle Snacks wrote:
 
  [snipped]
 
 
  It is supposed to be like that...the PHP_SELF points to this file,
  and the filename has no arguments, thus the PHP_SELF variable don't
  have them either.
 
  You will have to use the $_GET array for the aid=12 part.
 
  yeh, I figured that. But is there some easy way to print *all* of the
  get data parsed? (In this case, the variable names, number of vars
  etc varies alot. And this has rissen from a bug in a 250kb+ source
  plus project.
 
  I am wondering if there is a smart way. or do I have to examine the
  $_GET array for all vars and pass them on manually?

 Ah, I didn't understand your question (my mistake). Answer to your
question
 (I hope): there is a smart way: $_SERVER['QUERY_STRING']

thanks.



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




Re: [PHP] Looking for a forum

2002-09-26 Thread Paul Nicholson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,
http://www.ibforums.com/
~Pauly

On Thursday 26 September 2002 01:26 am, John Taylor-Johnston wrote:
 Hi,
 I'm looking for some forum script, a bit like this:
 http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi
 Can anyone post a link to something useful?
 John

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
The webthe way you want it!
[EMAIL PROTECTED]

It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9ku11DyXNIUN3+UQRAvs9AJ4jGZ9X4QKEXQDhKYXBLAjTXzO/ygCcCHXw
aT5wk0Z0Lc97xlqpIgQQaHs=
=po2u
-END PGP SIGNATURE-

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




[PHP] Help with PHP and HTML

2002-09-26 Thread Ken

I have a HTML form that has a session variable called $cost. Now I want to
set the value to this table data input field. Anyone know how this is
accomplished?

tdinput value=$cost name=txtSubTotalAmount size=40 readonly/td

Thanks in advance!




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




Re: [PHP] Re: PEAR or not PEAR

2002-09-26 Thread Manuel Lemos

Hello,

On 09/26/2002 02:11 AM, Rasmus Lerdorf wrote:
 No DB abstraction layer, including MetaBase offers true database
 abstraction.  No layer will make stored procedures portable.  No layer

Not that you know, of course.


 will make your fancy Oracle DECODE() query portable.  No layer will
 magically make your MS-SQL triggers work anywhere else.

If you intentionally use database specific resources that can't be 
mapped to any other database, obviously your applications will never be 
portable no matter what.


 For any moderately complex database work, you are going to have to write
 database-specific code and if you are doing that you might as well cut out
 the middle-man and use the faster direct DB calls.

This is not true. You do not have to write database specific code for 
complex database work.

Have you ever heard of Siebel? Yes, the CRM (and other things) suite, 
probably the best in the market. FYI, it does not use any things like 
stored procedures or triggers. All the business logic is handled off the 
database server.



 My standard approach is to do functionality abstraction.  Stuff like,
 get_user_record(), update_scores(), etc.  Implement these functions for
 each database you wish to support and stick them in separate include
 files.  Then include the appropriate set based on a config setting so the
 user can switch the app between the supported databases.

Nobody stops you from doing that with any underlying database 
abstraction . The problem if that if you are going to write your data 
layer functions in a middle to large size application and optimize them 
for each database, your will take an absurd amount of time that it is 
not realistic to wait for and your projects obviously will fail missing 
any acceptable deadlines.

In the real world, data type abstraction like Metabase and JDBC do, or 
auto-incremented sequence abstraction like Metabase does and JDBC 
doesn't are highly desirable features by many developers in database 
abstraction layers that really speed up their work with acceptable 
performance compromises.

Either Metabase or JDBC let you use database specific SQL but then it is 
up to you handle portability in your application. As a matter of fact, 
people that want to take the absolute best of database applications, do 
not use SQL at all, they use flat file databases, like many search 
engines do. So, whoever resorts to SQL is already assuming some 
performance compromises.

Regards,
Manuel Lemos

 
 
 -Rasmus
 
 On Thu, 26 Sep 2002, Manuel Lemos wrote:
 
 
Hello,

On 09/24/2002 11:15 AM, Joshua E Minnie wrote:

I was reading an article at PHPBuilder.com (not very recent, 01/15/2001)
about PEAR DB, and was wondering if anyone had any experience using PEAR
rather than the functions dedicated specifically to each type of DB (i.e.
mysql_, mssql_, pg_, msql_, etc.).  Also, if anyone has any reasons why to
go with one or the other.

The reason I ask, is because I recently downloaded QuerySim so I could
simulate my db info while the db is still in development and not have to
slow down the process.  QuerySim uses PEAR DB functions, and after the db
development is finished it is an easy conversion.  Simply change the line
that tells which db is being accessed.

[code snippet]
$db = DB::connect( mssql://$dbuser:$dbpass@$dbhost/$dbname ); // for MSSQL
$db = DB::connect( mysql://$dbuser:$dbpass@$dbhost/$dbname ); // for MySQL
//instead of

$conn = DB::connect('querysim');
[/code snippet]

And my querys would still remain relatively the same.  I hope you can shed
some light on this because I am not really sure which one to use.

No PEAR-DB does not guarantee true database portability. Among other
things, think about for instance date and time fields that are formatted
differently between databases. PEAR-DB does not assure that you only
deal with a single format, so you would always have to handle eventual
differences in format representation in your application which is what
you want to avoid.

If you are looking for true database portability, you may want to look
at Metabase which is a much more mature database abstraction package
that not only deals with data type representation format differences to
make your database applications really portable, but it also manages
your database schemas so you don't have to write database specific SQL
scripts to create tables and other database objects.

All you need to do is to specify a schema in a database independent
format based on XML and Metabase creates any tables, fields, indexes,
sequences for you.

Metabase is Open Source and you may find it here:

http://www.phpclasses.org/metabase


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




RE: [PHP] Help with PHP and HTML

2002-09-26 Thread Jay Blanchard

[snip]
I have a HTML form that has a session variable called $cost. Now I want to
set the value to this table data input field. Anyone know how this is
accomplished?

tdinput value=$cost name=txtSubTotalAmount size=40 readonly/td
[/snip]


Ken,

You question is not too clear, but I will try to help. You want the form
element to reflect the value of $cost?

tdinput value=?php print($cost); ? name=txtSubTotalAmount size=40
readonly/td

I apologize if this is not what you are asking.

Jay

Errors have been made. Others will be blamed.

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort  Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*




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




[PHP] Re: Finding out when a Web page has changed

2002-09-26 Thread lallous

I was about to tell you to use Last-Modified Header! ;)

Well then...try to fetch the page's size and compare with last time, if
changes then regrab the page.

Elias,
Vikram Vaswani [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I need to write an application that accepts a list of URLs and checks them
 on a daily basis (via cron) to see if the pages have changed in the past
day.

 I need some help with this. Does anyone know the most optimal way to find
 out when a particular Web page has been modified? I am thinking about
using
 the Last-Modified: HTTP header - however, all servers do not return this
 header - any ideas on what the fallback should be?

 TIA,

 Vikram
 --
 I find your lack of faith disturbing.
 --Darth Vader



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




Re: [PHP] Help with PHP and HTML

2002-09-26 Thread skitum

hey folks, don't forget quotes  ;o)

tdinput value=? echo $cost; ? name=txtSubTotalAmount size=40
readonly/td

I use one like this:
input name=cliemail type=text size=48 value=?echo $clil; ?
readonly
and it works ok.

Peace  Love
skitum

- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: 'Ken' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 1:46 PM
Subject: RE: [PHP] Help with PHP and HTML


 [snip]
 I have a HTML form that has a session variable called $cost. Now I want to
 set the value to this table data input field. Anyone know how this is
 accomplished?

 tdinput value=$cost name=txtSubTotalAmount size=40 readonly/td
 [/snip]


 Ken,

 You question is not too clear, but I will try to help. You want the form
 element to reflect the value of $cost?

 tdinput value=?php print($cost); ? name=txtSubTotalAmount size=40
 readonly/td

 I apologize if this is not what you are asking.

 Jay

 Errors have been made. Others will be blamed.

 *
 * Texas PHP Developers Conf  Spring 2003*
 * T Bar M Resort  Conference Center*
 * New Braunfels, Texas  *
 * Contact [EMAIL PROTECTED]   *
 *   *
 * Want to present a paper or workshop? Contact now! *
 *




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

2002-09-26 Thread Justin French

Why can't you post to the newsgroup with [EMAIL PROTECTED]

(not that i've tried)

Justin


on 26/09/02 4:38 PM, John Taylor-Johnston ([EMAIL PROTECTED])
wrote:

 Justin,
 
 Best advice is to post strictly to the newsgroup with a dud email address,
 
 Unfortunately, that doesn't work. I had a hotmail address, but not acceptable.
 Someone did not put it on the accepted' list. Someone back there needs to
 accept that address to allow that poster to post when using
 news://news.php.net/php.general. Been through that. That's what I want to do
 now. Who is he? I would like to work something out with him.
 
 filter out anything to that address which doesn't have [PHP] in the subject
 
 I've been filtering :)
 
 Using 'nospam' in your address' prolly doesn't help as much as it used to,
 
 True, But I could work around that too, when I talk with the chap in charge :)
 
 Fun huh?
 
 Giggle loads :p
 
 Thanks,
 John
 
 


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




[PHP] Very easy question

2002-09-26 Thread Neil Laker

Have installed PHP v4 on IIS 5 server, all the connectivity works fine as
for the sending but the main text variables will not come through.  I think
there must be a setting I have missed somewhere? I have checked the
permissions and are set ok for the IGA can anyone help?

Thanks in advance



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




Re: [PHP] where's waldo

2002-09-26 Thread Joshua E Minnie

You could always use the GD image library to create an image and use
javascript to send back the coordinates of the mouse click.  From the mouse
click, the javascript variables would be sent back to the server to
interpret and check for correctness.

This way they can't look at the code to find where waldo is at. Not sure
how easy this would be but HTH.

--
Joshua E Minnie
Advantage Computer Services, LLC
Senior Project Manager
[EMAIL PROTECTED]
Phone: 269.276.9690
Fax: 269.342.8750

Don't work for recognition, but always do work worthy of recognition.

Kenneth Love [EMAIL PROTECTED] wrote:
: about the peeking at the code...
: yes, you could, unless the images were coded somehow. perhaps just
numbers,
: not names. after a few tries they'd find waldo easily enough, but not at
: first.
:
: and besides. i'd like to give people credit for being more honest than
that.
:
:
: @ Edwin [EMAIL PROTECTED] wrote:
:  True. Perhaps.
: 
:  But, I think, you can actually do something like that WITH php. Say
:  PHP+Flash or PHP+Javascript...
: 
:  Of course, if you're able to do something like this just by using
:  PHP+Javascript (and HTML only), most probably, you can just take a peek
at
:  the code and find out where waldo is... ;)
: 
:  - E
: 
:  On Thursday, September 26, 2002 12:12 AM
:  Marek Kilimajer wrote:
: 
:   This is for java, javascript, or flash, not much to do for php.
:  
:   Kenneth Love wrote:
:  
:   hi all.
:   
:   i'm interested in creating a php game that generates a page of random
:  (ish)
:   images, one of which is waldo (or the like). when the player clicks
on
:   waldo, they're taken to the next, slightly harder level.
:   
:   anyone think that sounds fun?
:   any pointers, tips, advice, criticisms?
:   
:   --
:   -- http://kennethlove.onewingedangel.com --



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




Re: [PHP] Very easy question

2002-09-26 Thread Justin French

Do you mean when POSTing a form?

Justin French


on 26/09/02 10:14 PM, Neil Laker ([EMAIL PROTECTED]) wrote:

 Have installed PHP v4 on IIS 5 server, all the connectivity works fine as
 for the sending but the main text variables will not come through.  I think
 there must be a setting I have missed somewhere? I have checked the
 permissions and are set ok for the IGA can anyone help?
 
 Thanks in advance
 
 


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




Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Sascha Braun

Now I tried to use your script:

$_REQUEST['image'] is =
'../images/2002/09/jpg/ls006022_pettersson_johan.jpg';

?
Header('Content-Type: application/x-gzip');
$command = 'tar -cf - ../images/' . $_REQUEST['image'] . ' | gzip -cf';
system( $command );
?

It opens the download dialog again and lets me download the archive, but
it's named
download.gz (How can I change it to ls006022_pettersson_johan.gz?)

And if I open it with winrar it says, the content is named 'download' Size
is about
160 bytes, seems to be correct. when I try to extract the files there
pops up
an error message which says: Unexpected end of archive.

Have you got a sollution on that?

Grettings

Sascha


  Hi Erwin,

 Hi Sascha,

 
  I tried to put the Header at top of the page. After this it opens an
  download window
  in the browser. But the download seems to be damaged. What can I do
  about this?
 
  My commandline looks like this:
 
  ?
  Header( 'Content-Type: application/x-tar' );
  $command = 'tar -c '.$arrResult['name'].'.tgz
  ../images/'.$arrResult['image'];
  system($command);
  ?

 Ah...well...you are creating a tar file, named $arrResult['name'], with
 $arrResult['image'] as contents.
 You're creating this .tar file with the extension .tar.gz...which is
wrong,
 because that has to be .tar

 After that you are using the system() function to print the output to a
 user...the output from the tar -c command will NOT be a tarred archive,
but
 probably will return nothing...

 Try the following:

 ?
 Header( 'Content-Type: application/x-gzip); // CHANGED!!!
 $command = 'tar -cf - ../images/' . $arrResult['image'] . ' | gzip -cf'
 system( $command );
 ?

 Step by step:
 tar -cf - filename | gzip -cf

 The first part: tar -cf - filename. With the -c argument, you'll create
a
 new archive. The -f option specifies the output. In this case, the output
is
 '-', which is STDOUT.
 The second part: gzip -cf. The -c options will print the output of the
gzip
 command to STDOUT, the -f option will force the output

 Between those two commands is a pipe (|). This character pipes the output
 from the first program to the second, so the output of the tar command
will
 be given to gzip, which will create a .tar.gz ( or .tgz) file for you!

 Also, if the arrResult['image'] file is given by a user, take a good look
at
 http://www.php.net/escapeshellarg. If you get this value from a database,
 which is secure (e.g. only contains items which you inserted), then you
 don't have to worry about that...

 I hope this helps?

 Greetz,
 Erwin




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




Re: [PHP] Encrypt data...

2002-09-26 Thread Scott Fletcher

Aww!  Neat!  That look better than the one I came up with.  Thanks for your
time on this one.

Thanks,
  FletchSOD

Tom Rogers [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Thursday, September 26, 2002, 4:45:04 AM, you wrote:
 SF How do I encrypt the data and decrypt it back using PHP?  I do know
that hte
 SF random number can not be used becuase it will make it impossible to
decrypt
 SF it.

 SF Thanks!

 Here is a simple class for encoding and decoding:

 class encrypt_class{
 var $secret;
 function encrypt_class(){
 $this-secret = 'this is a very long key, even too long
for the cipher';
 }
 Function encode($id){
 $eid = $iv = 0;
 $len = strlen($id);
 $id = $len.'-'.$id;
 $td = mcrypt_module_open(MCRYPT_TripleDES, ,
MCRYPT_MODE_ECB, );
 $key = substr($this-secret, 0, mcrypt_enc_get_key_size
($td));
 $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
 mcrypt_generic_init ($td, $key, $iv);
 $eid = base64_encode(mcrypt_generic ($td, $id));
 mcrypt_generic_deinit($td);
   return $eid;
 }
 Function decode($eid){
 $id = $iv = 0;
 $td = mcrypt_module_open (MCRYPT_TripleDES, ,
MCRYPT_MODE_ECB, );
 $key = substr($this-secret, 0, mcrypt_enc_get_key_size
($td));
 $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
 mcrypt_generic_init ($td, $key, $iv);
 $id = mdecrypt_generic ($td, base64_decode($eid));
 $len = strtok($id,'-');
 $id = substr($id,(strlen($len)+1),$len);
 mcrypt_generic_deinit($td);
 return $id;
 }
 }


 Usage

 ?
 $word = 'Hello';
 $e = new encrypt_class();
 $encrypted = $e-encode($word);
 echo encrypted = $encrypted br;
 $decrypted = $e-decode($encrypted);
 echo decrypted = $decrypted br;
 if($word == $decrypted){
 echo They match br;
 }
 else{
 echo Oops they don't match br;
 }
 ?
 --
 regards,
 Tom




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




Re: [PHP] Re: Including variables

2002-09-26 Thread Marek Kilimajer

Just dont forget that eval assumes php code, so escape from it first 
using ?

Erwin wrote:

I'm having quite a dumb problem with PHP... It's probably more a
result
of brain freeze than anything else, but if anyone could help it'd be
very much appreciated.

Basically, I need to include() the contents of a variable. Saving the
contents to a temporary file and then using include() would be
inconvenient.



Try using eval (http://www.php.net/eval),

You could also write the contents to a file generated in a tempfile.
Generate the filename with tempnam (http://www.php.net/tempnam), open it,
fill it with the contents of the variable, close it, include it and delete
it (with unlink, http://www.php.net/unlink).

HTH
Erwin


  



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




RE: [PHP] Finding out when a Web page has changed

2002-09-26 Thread John Holmes

You could cache/save the actual contents of the file, then when you read
it next time, compare it to what you saved and see if it changed. You
may want to filter out everything but what's between body and /body,
so you're not thinking it changed just b/c of something in the
headers...

---John Holmes...

 -Original Message-
 From: Vikram Vaswani [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 26, 2002 7:04 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Finding out when a Web page has changed
 
 Hi all,
 
 I need to write an application that accepts a list of URLs and checks
them
 on a daily basis (via cron) to see if the pages have changed in the
past
 day.
 
 I need some help with this. Does anyone know the most optimal way to
find
 out when a particular Web page has been modified? I am thinking about
 using
 the Last-Modified: HTTP header - however, all servers do not return
this
 header - any ideas on what the fallback should be?
 
 TIA,
 
 Vikram
 --
 I find your lack of faith disturbing.
   --Darth Vader
 
 --
 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] Who is online script example

2002-09-26 Thread Marek Kilimajer

Look at phpnuke, or any other website management project

Research and Development wrote:

 Hello. Has anyone noticed that some sites can display a list of users 
 currently looking at their site? I would like to see the code to do 
 such things.

 Thanks in advance.




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




Re: [PHP] Calling an external C function under Unix

2002-09-26 Thread Marek Kilimajer

Simply make your own php module.

Anna Sotnichenko wrote:

Hello All!

I want to transfer a PHP script with minimum changes from IIS under Win2000
to Unix. My ISAPI PHP script calls some external C-functions through PHP
W32api extension.
Is there a way to call external C-function from PHP-script under UNIX?

Thanks in advance.



  



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




Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Erwin

 Now I tried to use your script:

 $_REQUEST['image'] is =
 '../images/2002/09/jpg/ls006022_pettersson_johan.jpg';

 ?
 Header('Content-Type: application/x-gzip');
 $command = 'tar -cf - ../images/' . $_REQUEST['image'] . ' | gzip -
 cf'; system( $command );
 ?

 It opens the download dialog again and lets me download the archive,
 but it's named
 download.gz (How can I change it to ls006022_pettersson_johan.gz?)

Add another header (another one???) ;-))
Header( 'Content-Disposition: attachment;
filename=ls006022_pettersson_johan.gz' );

 And if I open it with winrar it says, the content is named 'download'
 Size is about
 160 bytes, seems to be correct. when I try to extract the files
 there pops up
 an error message which says: Unexpected end of archive.

 Have you got a sollution on that?

Yes...my mistake, use passthru( $command ) instead of system( $command )

Grtz Erwin



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




Re: [PHP] listing of directories into links

2002-09-26 Thread Marek Kilimajer

$d=opendir('/home/');
while($u=readdir($d)) {
if($u!='.'  $u!='..'  
(fileexists('/home/'.$u.'/public_html/index.html') || 
fileexists('/home/'.$u.'/public_html/index.php') ... more index files)) {
echo  ..link..;
}
}

untested

Bryan Koschmann - GKT wrote:

Hi,

I need to do something where my page is a generated list of directories.
Say, I want to easily make links to all user pages
(/home/user1/public_html, /home/user2/public_html, and so on).

Can anyone give me any ideas?

Thanks,

   Bryan


  



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




Re: [PHP] Finding out when a Web page has changed

2002-09-26 Thread Marek Kilimajer

Hope the sites have no banners :),  they change all the time

John Holmes wrote:

You could cache/save the actual contents of the file, then when you read
it next time, compare it to what you saved and see if it changed. You
may want to filter out everything but what's between body and /body,
so you're not thinking it changed just b/c of something in the
headers...

---John Holmes...

  

-Original Message-
From: Vikram Vaswani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 7:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Finding out when a Web page has changed

Hi all,

I need to write an application that accepts a list of URLs and checks


them
  

on a daily basis (via cron) to see if the pages have changed in the


past
  

day.

I need some help with this. Does anyone know the most optimal way to


find
  

out when a particular Web page has been modified? I am thinking about
using
the Last-Modified: HTTP header - however, all servers do not return


this
  

header - any ideas on what the fallback should be?

TIA,

Vikram
--
I find your lack of faith disturbing.
  --Darth Vader

--
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] Finding out when a Web page has changed

2002-09-26 Thread Erwin

Marek Kilimajer wrote:
 Hope the sites have no banners :),  they change all the time

But the URL to the banners will be the same, so that's no change in the HTML
code ;-))

 [SNIP]


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




Re: [PHP] Help with PHP and HTML

2002-09-26 Thread Marek Kilimajer

When we are at it let's don't forget htmlspecialchars

input name=cliemail type=text size=48 value=?echo htmlspecialchars($clil); ?
readonly


skitum wrote:

hey folks, don't forget quotes  ;o)

tdinput value=? echo $cost; ? name=txtSubTotalAmount size=40
readonly/td

I use one like this:
input name=cliemail type=text size=48 value=?echo htmlspecialchars($clil); 
?
readonly
and it works ok.

Peace  Love
skitum

- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: 'Ken' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 1:46 PM
Subject: RE: [PHP] Help with PHP and HTML


  

[snip]
I have a HTML form that has a session variable called $cost. Now I want to
set the value to this table data input field. Anyone know how this is
accomplished?

tdinput value=$cost name=txtSubTotalAmount size=40 readonly/td
[/snip]


Ken,

You question is not too clear, but I will try to help. You want the form
element to reflect the value of $cost?

tdinput value=?php print($cost); ? name=txtSubTotalAmount size=40
readonly/td

I apologize if this is not what you are asking.

Jay

Errors have been made. Others will be blamed.

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort  Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*




--
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] Create Thumbnails from image

2002-09-26 Thread Julien Bonastre

Yeah sorry about that.. It happens where I just hit reply and forget to add
the mail list address :-(

Oops.. hehe
--oOo---oOo--

 Julien Bonastre [The_RadiX]
 The-Spectrum Network CEO
 [EMAIL PROTECTED]
 www.the-spectrum.org

--oOo---oOo--
- Original Message -
From: Kjell Hansen [EMAIL PROTECTED]
To: -=| Julien Bonastre |=- [EMAIL PROTECTED]
Sent: Tuesday, September 24, 2002 1:55 AM
Subject: Re: [PHP] Create Thumbnails from image


Hey Julien!
Thanx for the code! Your posting from yesterday helped me out. Actually I
was on the right path all along but hadn't activated the GD-extension in my
php.ini and so I just got errors and grew _pretty_ annoyed by it. Then after
I got your message from yesterday giving med the same errors I realized that
there were somethin' cookin'. After activating the GD-extension and
restarted Apache your snippet worked fine and eventually mine too.

Thanx again for your effort, it would have been better though if we all had
sent this to the newsgroup. More people would have had a chance to see it
there...

Have fun
Regards
Kjell

- Original Message -
From: -=| Julien Bonastre |=- [EMAIL PROTECTED]
To: Kjell Hansen [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 4:20 PM
Subject: Re: [PHP] Create Thumbnails from image


 OMG..

 This is the second question tonight I answer that I was just working on
 today :-p

 hah..


 Ok.. simple.. here's my code I used today for
www.operation-scifi.com/lobby


 Thing is.. It's about as understandable to other's as hieroglyphics..

 Therefore.. a simple solution..

 do this:

 ?
 header(Content-type: image/jpeg);
 $img=imagecreatefromxxx(../dir/img.ext); //where xxx = jpeg | png | gif
 etc..
 $img2=imagecreate(150,100);
 $imgsize=getimagesize(../dir/img.ext);
 imagecopyresized($img2,$img,0,0,0,0,150,100,$size[0],$size[1]);
 imagexxx($img2);
 ?

 Substitute the filepath etc.. and also the 150/100 dimension sizes..

 xxx denotes the image type which depending on your GD version .. jpeg has
 always been supported.. GIF has been removed as of 1.6 I think due to the
 LZW compression patent by Unisys.. and now they have PNG which my site
uses
 due to it's much better file format and flexibility..

 Also BTW.. this script is designed to be a seperate file.. ie image.php

 perhaps even do what I did and make the filename actually a $_GET param..

 As in.. you call: ./image.php?im=whatever.jpg

 and it generates a thumbnailed version..

 if your using JPEG format you can also use this param in the
 imagejpeg($img2); function:

 imagejpeg($img2,,80); whereby the output quality is no 80%.. that means
 lower qual thumbnail..

 There is a lot of fun things that can be done just with the core graphics
 module of PHP without GD.

 but GD is soo great it can do much more exciting things..

 Like for instance today I wanted to resize these big pics.. That's all
 good.. But they are somewhat pixellised from the large downshrink. Now..
the
 function imagecopyresample() would be great..

 but's a GD2+ thing.. I don't use GD plus yet.. [downloading the bin as I
 write this] but that's just one great func. taht allows for resize and
 interpolation of near pixels (ie smoothing)..

 w00tage eh??


 Anyways.. enough said. rambling on now.. HIH



 /* IMAGE HANDLING ROUTINE */

   $errmsg=Array();
   if(strlen($_GET[d])1) {
 $errmsg[]=Invalid GET params sent:;
 $errmsg[]=Must send valid data_id to script!;


$fwidth=(strlen($errmsg[count($errmsg)-1])$fwidth?strlen($errmsg[count($err
 msg)-1]):$fwidth);
   } else {
 $sql=mysql_query(SELECT * FROM opscifi_news_data WHERE data_id =
 .$_GET[d],$DB);
 if(mysql_num_rows($sql)0 AND $ditem=@mysql_fetch_array($sql)) {


if(!file_exists(./news/n.$ditem[news_id].d.$ditem[data_id]...subst

r($ditem[filename],strpos($ditem[filename],.,0)+1,strlen($ditem[filen
 ame])-(strpos(fname,.,0)+1 {
 $errmsg[]=Invalid file request:;
 $errmsg[]=File

./news/n.$ditem[news_id].d.$ditem[data_id]...substr($ditem[filenam

e],strpos($ditem[filename],.,0)+1,strlen($ditem[filename])-(strpos(fn
 ame,.,0)+1)). does not exist!;


$fwidth=(strlen($errmsg[count($errmsg)-1])$fwidth?strlen($errmsg[count($err
 msg)-1]):$fwidth);
   } elseif(!preg_match(/(jpg|jpeg|jpe)/i,$ditem[filename])) {
 $errmsg[]=Invalid image type request:;
 $errmsg[]=Script can only process image/jpeg files!;


$fwidth=(strlen($errmsg[count($errmsg)-1])$fwidth?strlen($errmsg[count($err
 msg)-1]):$fwidth);
   } else {
   // Spit out required [standard] MIME-type header
 header(Content-type: image/jpeg);
   // Fetch the original friendly filename
 $row=mysql_fetch_array(mysql_query(SELECT filename FROM
 opscifi_news_data WHERE data_id = .$_GET[d],$DB));
 $ditem[filename]=$row[0];
 header(Content-Disposition: image;
filename=.$ditem[filename]);

   // Update request field in images data element
 

Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Sascha Braun


Seems to work not that bad, but I got another Question.

Why isn't there anything in the archive?

This is my code yet:

?
Header('Content-Type: application/x-tar');
Header(Content-disposition: attachment;
filename=.$_REQUEST['name']..tar);
$command = 'tar -cf - ../images/' . $_REQUEST['image'];
passthru($command);
?

I did put away the gzip routine couse I find it a little nerving if i always
have to open
two files ;)

The source pictures size is 406 KB, the download is about 340 KB in size,
isn't it wrong a bit?

Greetings

Sascha

PS.: Isn't it wrong, when I write greetings in english? Sounds so german,
what could i write else? Thank you very much.



  Now I tried to use your script:
 
  $_REQUEST['image'] is =
  '../images/2002/09/jpg/ls006022_pettersson_johan.jpg';
 
  ?
  Header('Content-Type: application/x-gzip');
  $command = 'tar -cf - ../images/' . $_REQUEST['image'] . ' | gzip -
  cf'; system( $command );
  ?
 
  It opens the download dialog again and lets me download the archive,
  but it's named
  download.gz (How can I change it to ls006022_pettersson_johan.gz?)

 Add another header (another one???) ;-))
 Header( 'Content-Disposition: attachment;
 filename=ls006022_pettersson_johan.gz' );

  And if I open it with winrar it says, the content is named 'download'
  Size is about
  160 bytes, seems to be correct. when I try to extract the files
  there pops up
  an error message which says: Unexpected end of archive.
 
  Have you got a sollution on that?

 Yes...my mistake, use passthru( $command ) instead of system( $command )

 Grtz Erwin



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



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




RE: [PHP] Help with PHP and HTML

2002-09-26 Thread Jay Blanchard

[snip]
When we are at it let's don't forget htmlspecialchars

input name=cliemail type=text size=48 value=?echo
htmlspecialchars($clil); ?
readonly

skitum wrote:

hey folks, don't forget quotes  ;o)

tdinput value=? echo $cost; ? name=txtSubTotalAmount size=40
readonly/td
[/snip]

Well now we have gone too far! :^] In the original post the variable was
$cost. But let's not forget addslashes() or stripslashes(), unless, of
course, magicquotes is on, and then if register_globals is off then;

input name=cliemail type=text size=48 value=?echo
htmlspecialchars($_POST['clil']); ?
readonly

or

input name=cliemail type=text size=48 value=?echo
htmlspecialchars($_GET['clil']); ?
readonly

:^]

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort  Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




RE: [PHP] Re: Cronjob

2002-09-26 Thread Ford, Mike [LSS]

 -Original Message-
 From: Daren Cotter [mailto:[EMAIL PROTECTED]]
 Sent: 25 September 2002 20:11

I know your real problem has been solved, but this might save you from wasting time 
inspecting the wrong line of code one day:
 
 There isn't even a line 3 in the script:

Errr...
 
  1 ?php
  2 var_dump($argv);
  3 var_dump($GLOBALS);
  4 ?

The error you got is because the $GLOBALS array is itself global, so contains a 
reference to itself, which could cause infinite looping if PHP didn't detect it and 
throw that error!

Incidentally, both var_dump() and print_r() output useful information about what's in 
a variable, but in both cases the output is formatted using regular newlines and 
spaces, with no HTML layout, so for large arrays such as $GLOBALS it's best to do 
something like:

  echo pre;
  print_r($GLOBALS);
  echo /pre;

The output from this is actually formatted rather nicely, and is quite easy to read 
(and can be very informative!).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Erwin

Sascha Braun wrote:
 Seems to work not that bad, but I got another Question.

 Why isn't there anything in the archive?

It works in here (just tested it), I don't know why it's empty (don't stop
reading here!!! :-) )


 This is my code yet:

 ?
 Header('Content-Type: application/x-tar');
 Header(Content-disposition: attachment;
 filename=.$_REQUEST['name']..tar);
 $command = 'tar -cf - ../images/' . $_REQUEST['image'];
 passthru($command);
 ?

Nothing wrong with this...

By the way, make sure there is no newline in the second Header:

Header(Content-Disposition: attachment;
filename=.$_REQUEST['name']..tar);

I don't know if the mailingprogram breaks this line, but it's one line (just
in case).

 I did put away the gzip routine couse I find it a little nerving if i
 always have to open
 two files ;)

;-))

 The source pictures size is 406 KB, the download is about 340 KB in
 size, isn't it wrong a bit?

That's wrong...tar doesn't compress...a tar archive does have a small
footprint (about 1k-2k with one file), so the tar file should ALWAYS be
bigger than the source file(s)...

H...thinking about this...I'm sure you would like compression instead of
archiving. Use gzip only instead of tar:

- Set the header back to application/x-gzip
- Change the command to gzip -c filename

I'm very curious if you get any (correct) output then...

 Greetings

 Sascha

Greets back :)
Erwin

 PS.: Isn't it wrong, when I write greetings in english? Sounds so
 german, what could i write else? Thank you very much.

Try Greets or Thanks in advance ;-))
Greetings sounds (to me) more like what you say at the start of a
conversation.


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




Re: [PHP] Very easy question

2002-09-26 Thread Neil

Yes in Flash 5, basic variables for the input text fields and the correct
script in the .php file, I just don't know what it could be at the moment.

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Do you mean when POSTing a form?

 Justin French


 on 26/09/02 10:14 PM, Neil Laker ([EMAIL PROTECTED]) wrote:

  Have installed PHP v4 on IIS 5 server, all the connectivity works fine
as
  for the sending but the main text variables will not come through.  I
think
  there must be a setting I have missed somewhere? I have checked the
  permissions and are set ok for the IGA can anyone help?
 
  Thanks in advance
 
 




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




[PHP] ldap connection via SSL

2002-09-26 Thread Vazquez, Juan

Hi all,

I am new here and I would be really happy if someone could have a look =
on the following question:

I have a question concerning a connection with a LDAP server via SSL.

What I=B4ve found is:

To use ldap_connect to connect via SSL to your LDAP server, you must use 
the following:

ldap_connect( ldaps://server.domain.com/, 636 );

server.domain.com must be the exact name of the server your issued 
your certificate to (with OpenLDAP, using openssl).


My question here is if it is possible to use this ldap connection with 
any LDAP server ( not only an OpenLDAP one ), I have been searching for =
information but I have not found anything.

Thanks a lot in advance for your help.

Juan


_
PENTASYS
Gesellschaft fuer Informationstechnologie mbH
Rüdesheimer Strasse 9
80686 Muenchen
Tel. 089/5 79 52-0
Fax. 089/5 79 52-399
http://www.pentasys.de
E-Mail: [EMAIL PROTECTED]
__


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




Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Sascha Braun

Ok, somebody told me, the archive contains the Image, only winrar seems not
to show the image, grrr.

I tried the gzip method and it did not work that fine for me.


 Sascha Braun wrote:
  Seems to work not that bad, but I got another Question.
 
  Why isn't there anything in the archive?

 It works in here (just tested it), I don't know why it's empty (don't stop
 reading here!!! :-) )

 
  This is my code yet:
 
  ?
  Header('Content-Type: application/x-tar');
  Header(Content-disposition: attachment;
  filename=.$_REQUEST['name']..tar);
  $command = 'tar -cf - ../images/' . $_REQUEST['image'];
  passthru($command);
  ?

 Nothing wrong with this...

 By the way, make sure there is no newline in the second Header:

 Header(Content-Disposition: attachment;
 filename=.$_REQUEST['name']..tar);

 I don't know if the mailingprogram breaks this line, but it's one line
(just
 in case).

  I did put away the gzip routine couse I find it a little nerving if i
  always have to open
  two files ;)

 ;-))

  The source pictures size is 406 KB, the download is about 340 KB in
  size, isn't it wrong a bit?

 That's wrong...tar doesn't compress...a tar archive does have a small
 footprint (about 1k-2k with one file), so the tar file should ALWAYS be
 bigger than the source file(s)...

 H...thinking about this...I'm sure you would like compression instead
of
 archiving. Use gzip only instead of tar:

 - Set the header back to application/x-gzip
 - Change the command to gzip -c filename

 I'm very curious if you get any (correct) output then...

  Greetings
 
  Sascha

 Greets back :)
 Erwin

  PS.: Isn't it wrong, when I write greetings in english? Sounds so
  german, what could i write else? Thank you very much.

 Try Greets or Thanks in advance ;-))
 Greetings sounds (to me) more like what you say at the start of a
 conversation.


 --
 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: Tar Files and send back to browser

2002-09-26 Thread Erwin

Sascha Braun wrote:
 Ok, somebody told me, the archive contains the Image, only winrar
 seems not to show the image, grrr.

;-))
That's why...i did see the image too!

 I tried the gzip method and it did not work that fine for me.

Hmz...too bad, because you will get smaller downloads then (use Winzip ;-) )

Grtz Erwin


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




Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Sascha Braun

Do you know how to exclude the path informations in the tar archive?


 Sascha Braun wrote:
  Ok, somebody told me, the archive contains the Image, only winrar
  seems not to show the image, grrr.

 ;-))
 That's why...i did see the image too!

  I tried the gzip method and it did not work that fine for me.

 Hmz...too bad, because you will get smaller downloads then (use Winzip
;-) )

 Grtz Erwin


 --
 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: Tar Files and send back to browser

2002-09-26 Thread Erwin

Sascha Braun wrote:
 Do you know how to exclude the path informations in the tar archive?

Yes, first chdir to the ../images directory
http://www.php.net/getcwd
http://www.php.net/chdir

Grtz Erwin

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




Re: [PHP] Explorer-like drill down interface

2002-09-26 Thread Bill Farrell

Y'know?  I started fiddling with the drill-down I had
made and found that the thing only worked on the
latest Mozilla.  Seems the developers made the same
mistake I did in what input type=image ... is
supposed to do.  Looks great on one browser :-)

I wound up with another alternative:  a folder view
with wayback's to ascend in the tree.  The code that
works better on all browsers can be seen on
http://www.jwfarrell.com/listtree.php.  I'll make the
code and support files available to anyone who wants a
copy.  Apologies for the pretty (but ineffectual)
version 1.

:-)
Bill


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

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




Re: [PHP] Very easy question

2002-09-26 Thread Justin French

I'd start by making sure you can get a standard HTML for to POST to a PHP
script, rather than making issues complex with Flash.

If that works, then you know it's not an issue with the installation, in
theory.


Justin


on 26/09/02 11:30 PM, Neil ([EMAIL PROTECTED]) wrote:

 Yes in Flash 5, basic variables for the input text fields and the correct
 script in the .php file, I just don't know what it could be at the moment.
 
 Justin French [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Do you mean when POSTing a form?
 
 Justin French
 
 
 on 26/09/02 10:14 PM, Neil Laker ([EMAIL PROTECTED]) wrote:
 
 Have installed PHP v4 on IIS 5 server, all the connectivity works fine
 as
 for the sending but the main text variables will not come through.  I
 think
 there must be a setting I have missed somewhere? I have checked the
 permissions and are set ok for the IGA can anyone help?
 
 Thanks in advance
 
 
 
 
 


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




Re: [PHP] Finding out when a Web page has changed

2002-09-26 Thread Justin French

Same with sites that have negligible daily changes (like today's date
dynamically inserted), or random changes (a random quote, tip, stock quote,
product, image, etc etc would all screw that up).

Justin


on 26/09/02 11:03 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:

 Hope the sites have no banners :),  they change all the time
 
 John Holmes wrote:
 
 You could cache/save the actual contents of the file, then when you read
 it next time, compare it to what you saved and see if it changed. You
 may want to filter out everything but what's between body and /body,
 so you're not thinking it changed just b/c of something in the
 headers...
 
 ---John Holmes...
 
 
 
 -Original Message-
 From: Vikram Vaswani [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 26, 2002 7:04 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Finding out when a Web page has changed
 
 Hi all,
 
 I need to write an application that accepts a list of URLs and checks
 
 
 them
 
 
 on a daily basis (via cron) to see if the pages have changed in the
 
 
 past
 
 
 day.
 
 I need some help with this. Does anyone know the most optimal way to
 
 
 find
 
 
 out when a particular Web page has been modified? I am thinking about
 using
 the Last-Modified: HTTP header - however, all servers do not return
 
 
 this
 
 
 header - any ideas on what the fallback should be?
 
 TIA,
 
 Vikram
 --
 I find your lack of faith disturbing.
 --Darth Vader
 
 --
 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 Digest 26 Sep 2002 14:24:04 -0000 Issue 1608

2002-09-26 Thread php-general-digest-help


php-general Digest 26 Sep 2002 14:24:04 - Issue 1608

Topics (messages 117665 through 117728):

Re: replacing literal  in string
117665 by: Tom Rogers

Re: Configure php for windows
117666 by: Uma Shankari T.
117668 by: Khalid El-Kary

Example script : Employee schedule
117667 by: Faisal Abdullah
117681 by: lallous

Re: Mail() and Attachments
117669 by: Manuel Lemos

Re: PEAR or not PEAR
117670 by: Manuel Lemos
117671 by: Rasmus Lerdorf
117696 by: Manuel Lemos

Looking for a forum
117672 by: John Taylor-Johnston
117676 by: Michael Egan
117694 by: Paul Nicholson

Owner
117673 by: John Taylor-Johnston
117674 by: Justin French
117675 by: John Taylor-Johnston
117700 by: Justin French

cookie
117677 by: Meltem Demirkus
117679 by: Bsantos PHP

Extreme Sports
117678 by: Michael Egan

local resource variables
117680 by: lallous

Re: XSLT and PHP
117682 by: Alexandru COSTIN

Template based generated website project.
117683 by: Tony Burgess

shouldn't $_SERVER['PHP_SELF'] include the get info?
117684 by: Noodle Snacks
117685 by: Erwin
117690 by: Noodle Snacks
117692 by: Erwin
117693 by: Noodle Snacks

Including variables
117686 by: Matt Browne
117688 by: Erwin
117706 by: Marek Kilimajer

Tar Files and send back to browser
117687 by: Sascha Braun
117689 by: Erwin
117704 by: Sascha Braun
117710 by: Erwin
117716 by: Sascha Braun
117719 by: Erwin
117722 by: Sascha Braun
117723 by: Erwin
117724 by: Sascha Braun
117725 by: Erwin

Finding out when a Web page has changed
117691 by: Vikram Vaswani
117698 by: lallous
117707 by: John Holmes
117712 by: Marek Kilimajer
117713 by: Erwin
117728 by: Justin French

Help with PHP and HTML
117695 by: Ken
117697 by: Jay Blanchard
117699 by: skitum
117714 by: Marek Kilimajer
117717 by: Jay Blanchard

Very easy question
117701 by: Neil Laker
117703 by: Justin French
117720 by: Neil Laker
117727 by: Justin French

Re: where's waldo
117702 by: Joshua E Minnie

Re: Encrypt data...
117705 by: Scott Fletcher

Re: Who is online script example
117708 by: Marek Kilimajer

Re: Calling an external C function under Unix
117709 by: Marek Kilimajer

Re: listing of directories into links
117711 by: Marek Kilimajer

Re: Create Thumbnails from image
117715 by: Julien Bonastre

Re: Cronjob
117718 by: Ford, Mike   [LSS]

ldap connection via SSL
117721 by: Vazquez, Juan

Re: Explorer-like drill down interface
117726 by: Bill Farrell

Administrivia:

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

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

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


--

---BeginMessage---

Hi,

Thursday, September 26, 2002, 12:02:29 AM, you wrote:
RM Could somebody help me with the correct syntax for an ereg_replace to
RM replace literal occurences of the quote character in a string.  I can't
RM seem to get it right.

RM In other words, I have a form input variable -- that literally may look
RM like this:  some_value, and I want it to literally look like this:
RM some_value.

RM I tried:
RM $key=str_replace (\, , $key);
RM and other variations but can't get it to work.

RM What am I missing?

RM Thanks!


try $key = str_replace('', '', $key);

-- 
regards,
Tom


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





On Thu, 26 Sep 2002, Justin French wrote:

JFWhat test are you running?
JF
JFJustin

I am running this code only..

? phpinfo() ?


Regards,
Uma


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

hi,

please tell me about your Apache version, PHP version, the changes you made 
to the httpd.conf and error messages of returned

thanx




_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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

Hi people.
Does anyone happen to know whether there is a sample script/application out
there which can tell me (and everyone else in the organisation) of what
john doe
is doing, and where  when he's doing it?

I don't know a proper name for this type of application, therefor I haven't
found anything in google.
Thanks.

Sincerely,
Faisal

__


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

look for an application called: TimeWebSheet



Elias,

Faisal Abdullah [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi people.
 Does anyone happen to know whether there is a sample script/application

Re: [PHP] Re: Tar Files and send back to browser

2002-09-26 Thread Sascha Braun

IT'S WORKING, GOOD DAMN, IT'S WORKING!

Yo, this was a really hard Job, if I look at the working snipped below!

?
Header('Content-Type: application/x-tar');
Header(Content-disposition: filename=.$_REQUEST['name']..tar);
$dir = explode(/, $_REQUEST['image']);
chdir('../images/'.$dir['0']./.$dir['1']./.$dir['2']./);
$command = 'tar -cf - '.$_REQUEST['name'].'.jpg';
passthru($command);
?

Ey man, this was the second Time you helped me out,

Thanks alot. You are really a great PHP Guru I believe.

So, if my page is finished you will be one of the first Persons
to watch it.

I'm really glad, that you are such an helpfull guy.

So, stay helpfull! - Untill next time.

Thanks really a lot!

Sascha


 Sascha Braun wrote:
  Do you know how to exclude the path informations in the tar archive?
 
 Yes, first chdir to the ../images directory
 http://www.php.net/getcwd
 http://www.php.net/chdir
 
 Grtz Erwin
 
 -- 
 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: local resource variables

2002-09-26 Thread Tim Ward

to test this try returning $result from the function
e.g.
function test()
{
   $result = mysql_query(SELECT * FROM bigbigtable);
   return $result;
}
echo(mysql_numrows(test()))

remember $result holds a number that is a pointer to the result set
resource, it isn't the actual result data set, if the memory hasn't been
freed you should still be able to get to it ... I think

Tim
www.chessish.com

 -Original Message-
 From: lallous [mailto:[EMAIL PROTECTED]]
 Sent: 26 September 2002 11:20
 To: [EMAIL PROTECTED]
 Subject: local resource variables
 
 
 Hello,
 
 
 I was wondering if i do:
 
 function test()
 {
   $result = mysql_query(SELECT * FROM bigbigtable);
 }
 
 after calling test() will  $result be freed as if calling
 mysql_free_result()?
 
 
 Elias
 
 
 

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




[PHP] Getting started with PHP

2002-09-26 Thread Sauron

Hi all

I am brand new to PHP, I have a friend that develops in it and I'm
interested in learning more about it. I am familiar with VB at the moment
and that's about it, but I'm always willing to learn!!

What do I need to get developing using PHP? I want to develop completely on
my machine rather than upload files to a web server. I have W2K installed.

Any help is much appreciated,

Regards,

Steve.




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




RE: [PHP] Getting started with PHP

2002-09-26 Thread Steve Bradwell

Welcome Steve,

You'll need to do two things to get started, download apache and php for
windows, and configure 2 files - httpd.conf (apache), and php.ini. A good
tutorial can be found here :

http://softwaredev.earthweb.com/script/article/0,,12014_912381,00.html

After that create a .php file in apache's /htdocs dir (which is where you
will put your pages), the file should look like this:

?
phpinfo();
?

This will show you all of php's configuration settings.

From there the world is your oyster ;)

HTH,
Steve.

-Original Message-
From: Sauron [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting started with PHP


Hi all

I am brand new to PHP, I have a friend that develops in it and I'm
interested in learning more about it. I am familiar with VB at the moment
and that's about it, but I'm always willing to learn!!

What do I need to get developing using PHP? I want to develop completely on
my machine rather than upload files to a web server. I have W2K installed.

Any help is much appreciated,

Regards,

Steve.




-- 
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] Getting started with PHP

2002-09-26 Thread Adam Williams

read the install section of the PHP manual at www.php.net and then read
the tutorial.

Adam

On Wed, 25 Sep 2002, Sauron wrote:

 Hi all

 I am brand new to PHP, I have a friend that develops in it and I'm
 interested in learning more about it. I am familiar with VB at the moment
 and that's about it, but I'm always willing to learn!!

 What do I need to get developing using PHP? I want to develop completely on
 my machine rather than upload files to a web server. I have W2K installed.

 Any help is much appreciated,

 Regards,

 Steve.







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




RE: [PHP] Looking for a forum

2002-09-26 Thread Sear, Mick

I went through a load of forum systems recently that I found on
www.hotscripts.com, but none of them had what I wanted - In the end, I used
the bare-bones forum system in 'PHP  MySQL Web Development' by Welling and
Thomson and added:

- My own existing login system (I was integrating forums into a larger
project)
- My own templating system
- Separate forums
- A bunch of other functions such as 'who's online', #topics, #posts, last
post, last user to post, etc.

In the end, after spending nearly 2 weeks fiddling around trying to work out
why people use variables like $a, $b and $c and never comment their code, I
managed to get my system running smoothly with no 'workarounds' to
incorporate complex systems.  I'm really happy with the end result, and I'd
recommend starting from the bottom up rather than stripping out the
unnecessary code from other projects.  

If you only need a forum and want a fully-featured solution, I'd recommend
phpBB from those I looked at.

Mick

-Original Message-
From: Paul Nicholson [mailto:[EMAIL PROTECTED]]
Sent: 26 September 2002 12:20
To: [EMAIL PROTECTED]; John Taylor-Johnston;
[EMAIL PROTECTED]
Subject: Re: [PHP] Looking for a forum


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,
http://www.ibforums.com/
~Pauly

On Thursday 26 September 2002 01:26 am, John Taylor-Johnston wrote:
 Hi,
 I'm looking for some forum script, a bit like this:
 http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi
 Can anyone post a link to something useful?
 John

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
The webthe way you want it!
[EMAIL PROTECTED]

It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9ku11DyXNIUN3+UQRAvs9AJ4jGZ9X4QKEXQDhKYXBLAjTXzO/ygCcCHXw
aT5wk0Z0Lc97xlqpIgQQaHs=
=po2u
-END PGP SIGNATURE-

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




[PHP] remote files to servers

2002-09-26 Thread Simon Angell

Hi all.
i was wondering if it is possible to use PHP to retrieve a remote file and
then write a copy to my own server for quicker access?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.




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




[PHP] Parsing RDF files help needed?

2002-09-26 Thread Rus Foster

Hi All,
 I've been playing with parsing RDF/XML files using PHP (code snippet
below). However I'm having trouble trying to work out how to actually
format the results in an order. My source is in the form

item
titlePoliticizing Science/title
linkhttp://slashdot.org/article.pl?sid=02/09/17/0349219/link
/item

Now I could easily cope with it if it was link, title as I would just
print a href=$link$title/a. However I just can't work out a way of
doing this, this way. My attempt so far is below (mostly debugging code)

function startElement($parser, $name, $attrs) {
global $depth,$type,$title,$url;
for ($i = 0; $i  $depth[$parser]; $i++) {
print   ;
}
$type = $name;
$depth[$parser]++;
}

function stopElement($parser, $name) {
global $depth,$type,$title,$url;
$depth[$parser]--;
print depth parse = $depth[$parser] and  $title !! $url br ;
}

function characterData($parser, $data) {
   global $type,$title,$url;
   if ($data)
   {
switch ($type) {
case ITEM:
case 'LINK':
   $url=$data;
case TITLE:
   $title=$data;
}
}
}
$file=slashdot.rdf;

$fp= fopen($file,r);

$parser=xml_parser_create();
xml_set_element_handler($parser,startElement,stopElement);
xml_set_character_data_handler($parser,characterData);

while ($data = fread($fp,4096))
xml_parse($parser, $data, feof($fp))
or die(sprintf(XML error: %s at line %d,
xml_error_string(xml_get_error_code($parser)),xml_get_current_line_number($parser)));

fclose($fp);


As you can see I'm trying to use global variables but I'm just really
unhappy with the quality of the code so any help would be appreciated.

Rgds

Rus foster
--
http://www.fsck.me.uk - Rant wibble wave
http://shells.fsck.me.uk - Hosting and stuff






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




Re: [PHP] remote files to servers

2002-09-26 Thread ed


 While were on the subject what about retreiving a web page and images
based on URL?

Ed Curtis


On Fri, 27 Sep 2002, Simon Angell wrote:

 Hi all.
 i was wondering if it is possible to use PHP to retrieve a remote file and
 then write a copy to my own server for quicker access?
 
 --
 Cheers
 -
 Simon Angell
 Canberra ACT
 www.canberra-wx.com
 -
 Member of:
 Australian Severe Weather Association.
 www.severeweather.asn.au
 -
 This email is virus free.
 Scanned before leaving my mailbox
 using Norton Antivirus 2002 for Win2k
 Scanned with the latest definition File.
 
 
 
 
 -- 
 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] hello everybody - date problem -

2002-09-26 Thread Christoph Siefer

Hi everybody out there,

my name is Christopher (loc:germany), and i'm new in here.

My actual pain is: 

I expecting

?php

$timestamp = ($now - $five_minutes_ago);
print date(H:i:s, $timestamp);

?

to print something like 00:05:00.

The two given timstamps, differing (e.g.) five minutes, wich is 300
seconds, print this instead: 01:05:00.
Whatever I try, the result always is an hour to much.

Any 'hacks' on this ?-)

Thanks for your time,

Christopher


-- 

sym.net  -  martin butz  christoph siefer gbr
zwirnerstrasse 26 - 50678 koeln - 0221/3762591
email: [EMAIL PROTECTED] - netz: http://www.sym.net


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




RE: [PHP] Getting started with PHP

2002-09-26 Thread Support @ Fourthrealm.com

Sauron,
Since you're running Win2K, then you can use IIS already installed instead 
of Apache.  I use Win2K Server, with IIS, PHP 4, and mySQL on my local box, 
and it works just fine.

Peter



At 10:55 AM 9/26/2002 -0400, Steve Bradwell wrote:
Welcome Steve,

You'll need to do two things to get started, download apache and php for
windows, and configure 2 files - httpd.conf (apache), and php.ini. A good
tutorial can be found here :

http://softwaredev.earthweb.com/script/article/0,,12014_912381,00.html

After that create a .php file in apache's /htdocs dir (which is where you
will put your pages), the file should look like this:

?
phpinfo();
?

This will show you all of php's configuration settings.

 From there the world is your oyster ;)

HTH,
Steve.

-Original Message-
From: Sauron [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting started with PHP


Hi all

I am brand new to PHP, I have a friend that develops in it and I'm
interested in learning more about it. I am familiar with VB at the moment
and that's about it, but I'm always willing to learn!!

What do I need to get developing using PHP? I want to develop completely on
my machine rather than upload files to a web server. I have W2K installed.

Any help is much appreciated,

Regards,

Steve.




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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] RE: Who is online script example

2002-09-26 Thread Sear, Mick

I have my own login system - which authenticates against a MySQL database
and then uses sessions to keep track of logins.  It registers a session
variable for last access time, and logs access to pages in a separate table.
Then I can do things like this:

function currently_active_users(){
//Returns a formatted string of currently logged in (and with valid
sessions) users
$query = SELECT DISTINCT user_id from log_access WHERE
(UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lastaccess))  (30*60);//Users
accessing the site in last half an hour.
$db = db_connect();
$result = mysql_query($query, $db);
while ($row = mysql_fetch_array($result)) {
$users_online .= $row[user_id];
$users_online .= , ;
} //loop through and add returned users to string.
$users_online = substr($users_online, 0, -2);//Ditch last comma and
space.
return $users_online;
}

Dunno if this is any use to you?

Mick

-Original Message-
From: Research and Development [mailto:[EMAIL PROTECTED]]
Sent: 25 September 2002 23:26
To: PHP General List
Subject: Who is online script example


Hello. Has anyone noticed that some sites can display a list of users 
currently looking at their site? I would like to see the code to do 
such things.

Thanks in advance.


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




RE: [PHP] hello everybody - date problem -

2002-09-26 Thread Ford, Mike [LSS]

 -Original Message-
 From: Christoph Siefer [mailto:[EMAIL PROTECTED]]
 Sent: 26 September 2002 16:16
 
 I expecting
 
 ?php
 
 $timestamp = ($now - $five_minutes_ago);
 print date(H:i:s, $timestamp);
 
 ?
 
 to print something like 00:05:00.
 
 The two given timstamps, differing (e.g.) five minutes, wich is 300
 seconds, print this instead: 01:05:00.
 Whatever I try, the result always is an hour to much.

This looks like it might be a time-zone issue, as I'd guess being in Germany you're 1 
hour different from GMT.   Let's see: $timestamp should contain 300, which equates to 
00:05:00 01-Jan-1970 GMT -- but if you're 1 hour ahead of GMT, date will compensate 
for this and return 01:05:00 01-Jan-1970 in your local timezone.

Try using gmdate instead, which does not do any timezone compensation.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] remote files to servers

2002-09-26 Thread David Buerer

Of Course!  

You can use the fopen functions or curl functions depending on what and how
you want to manage the data once you get it.

Look at the manual in both of these sections and it will show you how to do
it.

BTW: What you are talking about doing is building a caching webserver.
Apache can do this by default, so can many other web server so check
documentaiton there as well.

David


-Original Message-
From: Simon Angell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 8:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] remote files to servers


Hi all.
i was wondering if it is possible to use PHP to retrieve a remote file and
then write a copy to my own server for quicker access?

--
Cheers
-
Simon Angell
Canberra ACT
www.canberra-wx.com
-
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
-
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.




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




Re: [PHP] PHP POST arrar is dropping 4 characters - Bug Info

2002-09-26 Thread David Busby

List,
Here's the bugs:

  http://bugs.php.net/bug.php?id=19460
  http://bugs.php.net/bug.php?id=19554

It's related to mbstring, Apache 2.0.40 and PHP 4.2.3 you can get the 
latest snapshot or you can follow instructions below

snip from the bug page
The issue was with the --enable-mbstr-enc-trans configure
option; remove it from your configure line and rebuild and
the problem goes away.
This has been fixed in CVS.
/snip from the bug page

John Holmes wrote:
 This was just talked about last week, search the archives. IIRC, it was
 a bug, so maybe search the buglist, too.
 
 ---John Holmes...
 
 
-Original Message-
From: David Busby [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 7:29 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP POST arrar is dropping 4 characters

List,
  I'm using PHP on my RH73 box and when I post it drops 4
 
 characters
 
out of
the post array.  Can someone look at the code below and tell me if I'm
missing something?  Why would it cut four characters off?  Perhaps
 
 cause
 
the name is four chars?  Bug?

TIA
/B

HTML that is sent to browser

input name='ei[]' type='checkbox'
value=24033CD9-7C60-4AB0-9D7D-180D885DC857 /Item Onebr /
input name='ei[]' type='checkbox'
value=8D86D6B8-A42E-4B19-B930-826AAECA2AB4 /Item Twobr /
input name='ei[]' type='checkbox'
value=3D6A7538-55ED-47C9-9447-0083EE6525F5 /Item Threebr /
input name='ei[]' type='checkbox'
value=9CAC5C80-AEAA-4EF3-9B96-750994A3E787 /Item Fourbr /

PHP that reads the post:

$ar_ei = $_POST['ei'];
if (is_array($ar_ei))
{
$c = sizeof($ar_ei);
for ($i=0;$i$c;$i++)
{
  // Right here is where the first four characters are cut off
 
 from
 
  // the 'ei[]' value, should be
  // 24033CD9-7C60-4AB0-9D7D-180D885DC857 but instead is
  // 3CD9-7C60-4AB0-9D7D-180D885DC857
  echo $ar_ei[$i].br /;
}
}


--
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] Looking for a forum

2002-09-26 Thread Peter J. Schoenster

On 26 Sep 2002 at 1:26, John Taylor-Johnston wrote:

 Hi,
 I'm looking for some forum script, a bit like this:
 http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi
 Can anyone post a link to something useful?

I know a couple of webmasters who are using and like 

http://www.phpbb.com/

I've never used any bb systems to say one way or another. Certainly 
easy to install.

Peter

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




[PHP] mobile number

2002-09-26 Thread Ryan A

Hi guys,
I am trying to make a script which will automatically put in the first 4-5 numbers of  
a mobile number depending on which mobile connection the user hasbut since i do 
not live in the states I would appreciate any help you can give me..


To call here from outside Stockholm,Sweden(my location) the number is something like 
+46 7371(5 digits here) and my provider is CONVIQ

what is the  country code + first five digits and provider of your mobile number?
As you can see i am not asking for your personal number, just the code and first 4 or 
5 provider digits and locationalso please tell me if its a prepaid card or a 
regular..

If you can give me differient providers numbers I would appreciate it even more

Thanks in advance,
-Ryan.



RE: [PHP] Finding out when a Web page has changed

2002-09-26 Thread John Holmes

Yeah, true. Maybe you could just ereg() out the content. Each url would
need it's own ereg, though, so it won't be as easy to set up.

But, technically, if the quote changes, then the page has been updated,
even if it's dynamic. How do you define updated??

---John Holmes...

 -Original Message-
 From: Justin French [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 26, 2002 10:25 AM
 To: Marek Kilimajer; PHP
 Subject: Re: [PHP] Finding out when a Web page has changed
 
 Same with sites that have negligible daily changes (like today's date
 dynamically inserted), or random changes (a random quote, tip, stock
 quote,
 product, image, etc etc would all screw that up).
 
 Justin
 
 
 on 26/09/02 11:03 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:
 
  Hope the sites have no banners :),  they change all the time
 
  John Holmes wrote:
 
  You could cache/save the actual contents of the file, then when you
 read
  it next time, compare it to what you saved and see if it changed.
You
  may want to filter out everything but what's between body and
 /body,
  so you're not thinking it changed just b/c of something in the
  headers...
 
  ---John Holmes...
 
 
 
  -Original Message-
  From: Vikram Vaswani [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, September 26, 2002 7:04 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Finding out when a Web page has changed
 
  Hi all,
 
  I need to write an application that accepts a list of URLs and
checks
 
 
  them
 
 
  on a daily basis (via cron) to see if the pages have changed in
the
 
 
  past
 
 
  day.
 
  I need some help with this. Does anyone know the most optimal way
to
 
 
  find
 
 
  out when a particular Web page has been modified? I am thinking
about
  using
  the Last-Modified: HTTP header - however, all servers do not
return
 
 
  this
 
 
  header - any ideas on what the fallback should be?
 
  TIA,
 
  Vikram
  --
  I find your lack of faith disturbing.
  --Darth Vader
 
  --
  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




Re: [PHP] mobile number

2002-09-26 Thread Ryan A

Hey,

 It used to be that 07xxx = vodafone ... and 07yyy = orange - but now it
 could be anything.

DAMN, that sounds bad, any fixed numbers in the UK atleast?
My cousins number is +44 79320- so that could be any company right?
I am not just trying to do the states, any location..trying to make it a
bit workwide for a study project.


Cheers,
-Ryan.


 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED]]
 Sent: 26 September 2002 17:16
 To: [EMAIL PROTECTED]
 Subject: [PHP] mobile number


 Hi guys,
 I am trying to make a script which will automatically put in the first 4-5
 numbers of  a mobile number depending on which mobile connection the user
 hasbut since i do not live in the states I would appreciate any help
you
 can give me..


 To call here from outside Stockholm,Sweden(my location) the number is
 something like +46 7371(5 digits here) and my provider is CONVIQ

 what is the  country code + first five digits and provider of your mobile
 number?
 As you can see i am not asking for your personal number, just the code and
 first 4 or 5 provider digits and locationalso please tell me if its a
 prepaid card or a regular..

 If you can give me differient providers numbers I would appreciate it even
 more

 Thanks in advance,
 -Ryan.


 _
 This message has been checked for all known viruses by the
 MessageLabs Virus Control Centre.

 This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.


 *

 Notice:  This email is confidential and may contain copyright material of
Ocado Limited (the Company). Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the Company.
 If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.

 Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

 *



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




[PHP] LocalHost won't show PHP files

2002-09-26 Thread Serbinski, Theodore S

Hi. I've scoured the net, posted tons of forum threads, tried everything. I
simply cannot get this to work, yet it should be so simple.

I recently had our Admin guy install PHP as a CGI-binary on a Unix system.
Apache 1.3.2 is also installed.

He didn't install PHP as a Apache module because the server was never
configured with axps. 

Now, I can run PHP scripts at the command line, which is great.

However, anytime I visit our server and try to view a *.php page, it just
tries to open/save the file, instead of actually displaying HTML.

My question is, what do I have to do to enable php to run like this in
Apache? Is there something I need to add to httpd.conf to get this to work?
I've tried everything and nothing works. Yet in the same folder my *.cgi
scripts run flawlessly.

Please help. Appreciated.

ted

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




[PHP] Looking for some help on web header coding.

2002-09-26 Thread Joshua Patterson

I have been working to try and have flash MX use PHP to access a database
but have been having issues with retrieving the post values in php.

http://127.43.1.1/learning/checkpassword.php?password=somepasswordusername=
MyUserName

html

body

?php


//store header values to internal defined values.
 $username = $HTTP_POST_VARS['username'];
 $password = $HTTP_POST_VARS['password'];
//db_connect has been removed for security purposes.

 mysql_select_db(test,$db);

 $result = mysql_query(SELECT * FROM users WHERE username =
$username,$db);
 $myrow = mysql_fetch_array($result);

 if( md5($password) == $myrow['user_password'] )
   echo 1;
 else
  echo 0;

//Trying to get some visibility on what is actually retrieved.
 echo $password;
 echo \n\n\n;
 echo $username;
 echo \n\n\n;
 echo end of the line;


?



/body



/html

---
 Initiative is what separates a genius from the rest of the pack...
---
This Quote has been brought to you in part by the Letter C.
For C is for cookie.




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




Re: [PHP] Owner

2002-09-26 Thread Paul Roberts

the list as replies asking you to confirm your email before allowing the post, this 
was brought in to stop people spamming the lists.

so to post you need a subscribed email or a confirmed email.

Paul Roberts

- Original Message - 
From: Justin French [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 1:22 PM
Subject: Re: [PHP] Owner


Why can't you post to the newsgroup with [EMAIL PROTECTED]

(not that i've tried)

Justin


on 26/09/02 4:38 PM, John Taylor-Johnston ([EMAIL PROTECTED])
wrote:

 Justin,
 
 Best advice is to post strictly to the newsgroup with a dud email address,
 
 Unfortunately, that doesn't work. I had a hotmail address, but not acceptable.
 Someone did not put it on the accepted' list. Someone back there needs to
 accept that address to allow that poster to post when using
 news://news.php.net/php.general. Been through that. That's what I want to do
 now. Who is he? I would like to work something out with him.
 
 filter out anything to that address which doesn't have [PHP] in the subject
 
 I've been filtering :)
 
 Using 'nospam' in your address' prolly doesn't help as much as it used to,
 
 True, But I could work around that too, when I talk with the chap in charge :)
 
 Fun huh?
 
 Giggle loads :p
 
 Thanks,
 John
 
 


-- 
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] Encrypted MySQL passwords

2002-09-26 Thread Richard Fox

Hi,

I am connecting to  a mysql server on a remote machine, and opened up port 3306 for 
this purpose. But, I am concerned about sending a clear text password, via the 
mysql_pconnect() call. My question is, what is the procedure for connecting to a 
remote server with an encrypted password? Or, does mysql_pconnect handle this?

THX
RIch



RE: [PHP] Encrypted MySQL passwords

2002-09-26 Thread John Holmes

 I am connecting to  a mysql server on a remote machine, and opened up
port
 3306 for this purpose. But, I am concerned about sending a clear text
 password, via the mysql_pconnect() call. My question is, what is the
 procedure for connecting to a remote server with an encrypted
password?
 Or, does mysql_pconnect handle this?

Nope, it's all in the clear. MySQL 4.0 has support for doing this over
SSL, I think.

---John Holmes...


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




RE: [PHP] Encrypted MySQL passwords

2002-09-26 Thread Adam Voigt

Maybe you could somehow setup your SSH tunnel before-hand
(at server start up or something) and use that instead.

Adam Voigt
[EMAIL PROTECTED]

On Thu, 2002-09-26 at 12:40, John Holmes wrote:
  I am connecting to  a mysql server on a remote machine, and opened up
 port
  3306 for this purpose. But, I am concerned about sending a clear text
  password, via the mysql_pconnect() call. My question is, what is the
  procedure for connecting to a remote server with an encrypted
 password?
  Or, does mysql_pconnect handle this?
 
 Nope, it's all in the clear. MySQL 4.0 has support for doing this over
 SSL, I think.
 
 ---John Holmes...
 
 
 -- 
 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] Taking a Snapshot of Memory Usage

2002-09-26 Thread Robert James Kaes

Hi,
Is there any way of taking a snapshot of the current memory usage of a
script?  I tried the getrusage() function, but the PHP version doesn't
seem to support all the options of the systems getrusage() system call.

What I would like to do is take a snapshot of the memory usage before and
after I make a call to a function, or create an object, so that I have an
idea of where memory is being used by the script.  Is this even possible
under PHP?

Any insight you can provide would be appreciated.
-- Robert

-- 
  --
Robert James Kaes---  Flarenet Inc.  ---(519) 426-3782
   http://www.flarenet.com/
  * Putting the Service Back in Internet Service Provider *
  --


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




[PHP] Displaying full array contents

2002-09-26 Thread Brad Harriger

I'm trying to write a function that will display the full contents of an 
array.  If one of the keys contains a value that is an array, the full 
array (all indices) should be shown.

As an example, given the following definitions:

$Arr1[1] = Apple;
$Arr1[2] = Banana;
$Arr1[3] = $Arr2[];
$Arr2[1] = Carrot;
$Arr2[2] = $Arr3[];
$Arr3[1] = Orange;
$Arr3[2] = Peach;


the output should be:

Arr1:1:Apple
Arr1:2:Banana
Arr1:3:Arr2[]
Arr1:3:Arr2:1:Carrot
Arr1:3:Arr2:2:Arr3[]
Arr1:3:Arr2:2:Arr3:1:Orange
Arr1:3:Arr2:2:Arr3:2:Peach

The closest I've come is:

  while (current($myArr))
   {
 if(is_array(current($myArr)))
 {
   $arrKey = key(current($myArr));
   echo Array ;
   echo nbsp=nbsp;
   $baseArray = key($myArr);
   echo key($myArr);
   echo BR\n;
   walkArray(current($myArr));
 }
 else
 {
   $arrKey = key($myArr);
   if ($baseArray != )
   {
 echo $baseArray;
 echo :;
   }
   echo $arrKey;
   echo nbsp=nbsp;
   echo current($myArr);
   echo BR\n;
 }
 next($myArr);
   }

This code only echoes one dimension of a multi-dimension array.  I can't 
find a way to reliably store more than that.  Any suggestions?

Thanks in advance,

Brad


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




[PHP] Re: Displaying full array contents

2002-09-26 Thread Martin W Jørgensen

Yes. my idea is to use:
echo pre;
print_r($array);
echo /pre;

Brad Harriger [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to write a function that will display the full contents of an
 array.  If one of the keys contains a value that is an array, the full
 array (all indices) should be shown.

 As an example, given the following definitions:

 $Arr1[1] = Apple;
 $Arr1[2] = Banana;
 $Arr1[3] = $Arr2[];
 $Arr2[1] = Carrot;
 $Arr2[2] = $Arr3[];
 $Arr3[1] = Orange;
 $Arr3[2] = Peach;


 the output should be:

 Arr1:1:Apple
 Arr1:2:Banana
 Arr1:3:Arr2[]
 Arr1:3:Arr2:1:Carrot
 Arr1:3:Arr2:2:Arr3[]
 Arr1:3:Arr2:2:Arr3:1:Orange
 Arr1:3:Arr2:2:Arr3:2:Peach

 The closest I've come is:

   while (current($myArr))
{
  if(is_array(current($myArr)))
  {
$arrKey = key(current($myArr));
echo Array ;
echo nbsp=nbsp;
$baseArray = key($myArr);
echo key($myArr);
echo BR\n;
walkArray(current($myArr));
  }
  else
  {
$arrKey = key($myArr);
if ($baseArray != )
{
  echo $baseArray;
  echo :;
}
echo $arrKey;
echo nbsp=nbsp;
echo current($myArr);
echo BR\n;
  }
  next($myArr);
}

 This code only echoes one dimension of a multi-dimension array.  I can't
 find a way to reliably store more than that.  Any suggestions?

 Thanks in advance,

 Brad




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




RE: [PHP] Looking for some help on web header coding.

2002-09-26 Thread David Buerer

go look at the tutorial for using php with flash to retrieve variables from
a database. it's pretty self explanatory and clear in how/what to do.

-Original Message-
From: Joshua Patterson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 10:35 AM
To: 'PHP'
Subject: [PHP] Looking for some help on web header coding.


I have been working to try and have flash MX use PHP to access a database
but have been having issues with retrieving the post values in php.

http://127.43.1.1/learning/checkpassword.php?password=somepasswordusername=
MyUserName

html

body

?php


//store header values to internal defined values.
 $username = $HTTP_POST_VARS['username'];
 $password = $HTTP_POST_VARS['password'];
//db_connect has been removed for security purposes.

 mysql_select_db(test,$db);

 $result = mysql_query(SELECT * FROM users WHERE username =
$username,$db);
 $myrow = mysql_fetch_array($result);

 if( md5($password) == $myrow['user_password'] )
   echo 1;
 else
  echo 0;

//Trying to get some visibility on what is actually retrieved.
 echo $password;
 echo \n\n\n;
 echo $username;
 echo \n\n\n;
 echo end of the line;


?



/body



/html

---
 Initiative is what separates a genius from the rest of the pack...
---
This Quote has been brought to you in part by the Letter C.
For C is for cookie.




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




Re: [PHP] Looking for some help on web header coding.

2002-09-26 Thread Peter J. Schoenster

On 26 Sep 2002 at 10:35, Joshua Patterson wrote:

 I have been working to try and have flash MX use PHP to access a
 database but have been having issues with retrieving the post values in
 php.

 http://127.43.1.1/learning/checkpassword.php?password=somepasswordusern
 am e= MyUserName

 //store header values to internal defined values.
  $username = $HTTP_POST_VARS['username'];
  $password = $HTTP_POST_VARS['password'];
 //db_connect has been removed for security purposes.

You are using a GET, not a POST. I've never worried about this stuff. I 
started with Perl and using the CGI.pm library I just was given the 
input in a hash .. left details up to CGI.pm and I got the input no 
matter how it was given. I use the following in PHP

function ProcessFormData($GLOBAL_INPUT) {
$FormVariables = array();
$input = $GLOBAL_INPUT['HTTP_GET_VARS'] ? 
$GLOBAL_INPUT['HTTP_GET_VARS'] : $GLOBAL_INPUT['HTTP_POST_VARS'];
foreach($input as $Key=$Value) {
if(is_array($Value)) {
foreach($Value as $SubKey=$SubValue) {
$FormVariables[$Key][$SubKey] = 
htmlspecialchars($SubValue);
}
}else {
$FormVariables[$Key] = htmlspecialchars($Value);
}
} 
return $FormVariables;

} # End ProcessFormData


You might not want to use htmlspecialchars.

Also, when I do use globals (and I hate to do that) I stick them in a 
global array that gets passed around. I don't use global Yaddda 
(only very rarely). Have you ever worked on someone else's code 
which has over 50 scattered files and no documentation and you need to 
find out where in the heck a variable is intialiazed and modified (can 
be anywhere)? Is there an easy way to handle this? Drives me nuts :)  
Maybe I've just not recognized the nutcracker.

Peter

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




Re: [PHP] Looking for some help on web header coding.

2002-09-26 Thread Joshua Patterson

Thank you for your help it seems that Macromedia in there support document
is a little confused about php or I need a new brain.  (points to option
number 2)
the Macromedia document can be found at
http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php02.html

---
 Anger is only one letter short of danger.
---
This Quote has been brought to you in part by the Letter C.
For C is for cookie.

- Original Message -
From: Peter J. Schoenster [EMAIL PROTECTED]
To: 'PHP' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 11:31 AM
Subject: Re: [PHP] Looking for some help on web header coding.


 On 26 Sep 2002 at 10:35, Joshua Patterson wrote:

  I have been working to try and have flash MX use PHP to access a
  database but have been having issues with retrieving the post values in
  php.

  http://127.43.1.1/learning/checkpassword.php?password=somepasswordusern
  am e= MyUserName

  //store header values to internal defined values.
   $username = $HTTP_POST_VARS['username'];
   $password = $HTTP_POST_VARS['password'];
  //db_connect has been removed for security purposes.

 You are using a GET, not a POST. I've never worried about this stuff. I
 started with Perl and using the CGI.pm library I just was given the
 input in a hash .. left details up to CGI.pm and I got the input no
 matter how it was given. I use the following in PHP

 function ProcessFormData($GLOBAL_INPUT) {
 $FormVariables = array();
 $input = $GLOBAL_INPUT['HTTP_GET_VARS'] ?
 $GLOBAL_INPUT['HTTP_GET_VARS'] : $GLOBAL_INPUT['HTTP_POST_VARS'];
 foreach($input as $Key=$Value) {
 if(is_array($Value)) {
 foreach($Value as $SubKey=$SubValue) {
 $FormVariables[$Key][$SubKey] =
 htmlspecialchars($SubValue);
 }
 }else {
 $FormVariables[$Key] = htmlspecialchars($Value);
 }
 }
 return $FormVariables;

 } # End ProcessFormData


 You might not want to use htmlspecialchars.

 Also, when I do use globals (and I hate to do that) I stick them in a
 global array that gets passed around. I don't use global Yaddda
 (only very rarely). Have you ever worked on someone else's code
 which has over 50 scattered files and no documentation and you need to
 find out where in the heck a variable is intialiazed and modified (can
 be anywhere)? Is there an easy way to handle this? Drives me nuts :)
 Maybe I've just not recognized the nutcracker.

 Peter

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



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




[PHP] Session

2002-09-26 Thread Bill Farrell

Hi all,

Is there a really thorough tutorial on the use of
session variables?  Seems like there are a zillion
options to choose from, lots of interdependent
settings, etc, and I'm a bit confused on how to make
it work.

I try not to use session objects too much in any
language as it makes the code somewhat less portable,
but I did want to experiment with PHP's notion before
launching off on another suite of apps.  I'm starting
with a simple fake hit counter that checks session to
see if the counter was already dinged.  It works if I
turn on enable_transient_sid, but setting that drives
ht://dig nuts by appending ?PHPSESSIDyaddayadda to the
URL.  Really makes a mess of the database :-)~~.

Obviously, I'm missing something pretty fundamental. 
Any suggested reading would be appreciated (yes, I did
read the PHP manual :-).

Thanks in advance,
B


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

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




[PHP] Relative Paths and file_exists() - Solaris

2002-09-26 Thread James Nikolich

Hello;
 
I'm using PHP 4.2.3 on a Solaris 2.8 (Sparc) system.
 
I've been having some difficulties getting PHP-Nuke 6.0 to work for me.
I eventually narrowed the problem down to incorrect results from calls
to file_exists().  It seems that file_exists() is having trouble finding
an existing file within a subdirectory of the current directory -- IF I
use relative pathnames.  If I use absolute pathnames (specifically by
prepending the results of getpwd() as stored in a variable), then things
work fine - but clearly this shouldn't be necessary.
 
I've written a sample PHP script to illustrate the problem I'm having.
Below it can be found the output of having executed this script.  (You
can see it for yourself  http://wireless.pleiades.com/jim.php).  As you
can see, only the third test works - and that's the one with $CurrentDir
prepended to the $targetfile...
 
This is probably a doh! kind of problem, but it's got me stumped.  Any
help would be appreciated.
 
Thanks,
 
Jim
 
 
 

?php
$CurrentDir = getcwd();
 
echo Current directory (saved as \$CurrentDir)
is:br[$CurrentDir]/br;
 
$targetfile = modules/News/index.php;
 
echo brTest 1 - Relative Pathname.brLooking for [$targetfile]br;
if ( file_exists( $targetfile ) ) {  
echo - Found it.br;
} else {
echo - Not found.br;
}
 
echo brTest 2 - Relative Pathname with preceding './'brlooking for
[./$targetfile]br;
if ( file_exists( ./$targetfile ) ) {
echo - Found it.br;
} else {
echo - Not found.br;
}
 
echo brTest 3 - Absolute Pathname (By prepending
\$CurrentDir)brlooking for [$CurrentD
ir/$targetfile]br;
if ( file_exists( $CurrentDir/$targetfile ) )
{
echo - Found it.br;
} else {  
echo - Not found.br;
}
?
===
 
 
 
OUTPUT:
--
 
Current directory (saved as $CurrentDir) is:
[/usr/local/websites/wireless.pleiades.com/html]

Test 1 - Relative Pathname.
Looking for [modules/News/index.php]
- Not found.

Test 2 - Relative Pathname with preceding './'
looking for [./modules/News/index.php]
- Not found.

Test 3 - Absolute Pathname (By prepending $CurrentDir)
looking for
[/usr/local/websites/wireless.pleiades.com/html/modules/News/index.php]
- Found it.



[PHP] wrong date

2002-09-26 Thread Rodrigo Meurer

Hi!

Someone knows why is this returning 1969-12-31 ???

$day = 13;
$month = 10;
$year = 2002;
echo date(Y-m-d,mktime (0,0,0,$month,$day,$year)); 

And MySQL also does the same when I insert '2002-10-13' in a date field!!!

::: R o d r i g o M e u r e r  
   [EMAIL PROTECTED]
B a s e 5 1 - W e b p r o j e c t s
Tel 51 3332.8813 / Fax 51 3321.1405
: : :www.base51.com.br: : : 

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




Re: [PHP] Displaying full array contents

2002-09-26 Thread debbie_dyer

You could use recursion example:-

  function printArray($arr) {
for ($i =0; $i  count($arr); $i++) {
  if (!is_array($arr[$i])) {
echo $arr[$i];
  }
  else {
printArray($arr[$i]);
  }
}
  }
 
$arr = array(Orange, Peach, Apple);
$arr2 = array(Banana, $arr, Pear);
$arr3 = array($arr, $arr2);

printArray($arr3);

Debbie

- Original Message - 
From: Brad Harriger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 6:50 PM
Subject: [PHP] Displaying full array contents


 I'm trying to write a function that will display the full contents of an 
 array.  If one of the keys contains a value that is an array, the full 
 array (all indices) should be shown.
 
 As an example, given the following definitions:
 
 $Arr1[1] = Apple;
 $Arr1[2] = Banana;
 $Arr1[3] = $Arr2[];
 $Arr2[1] = Carrot;
 $Arr2[2] = $Arr3[];
 $Arr3[1] = Orange;
 $Arr3[2] = Peach;
 
 
 the output should be:
 
 Arr1:1:Apple
 Arr1:2:Banana
 Arr1:3:Arr2[]
 Arr1:3:Arr2:1:Carrot
 Arr1:3:Arr2:2:Arr3[]
 Arr1:3:Arr2:2:Arr3:1:Orange
 Arr1:3:Arr2:2:Arr3:2:Peach
 
 The closest I've come is:
 
   while (current($myArr))
{
  if(is_array(current($myArr)))
  {
$arrKey = key(current($myArr));
echo Array ;
echo nbsp=nbsp;
$baseArray = key($myArr);
echo key($myArr);
echo BR\n;
walkArray(current($myArr));
  }
  else
  {
$arrKey = key($myArr);
if ($baseArray != )
{
  echo $baseArray;
  echo :;
}
echo $arrKey;
echo nbsp=nbsp;
echo current($myArr);
echo BR\n;
  }
  next($myArr);
}
 
 This code only echoes one dimension of a multi-dimension array.  I can't 
 find a way to reliably store more than that.  Any suggestions?
 
 Thanks in advance,
 
 Brad
 
 
 -- 
 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] Echoing HTML in PHP as CGI

2002-09-26 Thread Reuben D. Budiardja

Hi all,
When using Apache web server, with php module, I can intermix between HTML 
code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as 
far as I know, I have to write all HTML code using either echo or print 
statement, right? Is there a better way to do this? 

The problem is that someone already have the HTML part, and I just wont to 
insert some PHP codes around it. If I use 
echo 
[HTML CODE] ;

then I have to escape all the quotation mark () inside the HTML code, which 
is laborious and not really elegant. The same problem occurs even if I use 
echo with single quote instead of double quote. I have to escape all the 
single quote, since the HTML code is also intermix between HTML and 
javascript, which has single and double quotes.

How do I best solve this problem? Thanks a lot for any response.
Reuben D. Budiardja

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




Re: [PHP] Echoing HTML in PHP as CGI

2002-09-26 Thread 1LT John W. Holmes

The module and CGI will work the same. Just put your PHP where  you need it
within the HTML.

---John Holmes...

- Original Message -
From: Reuben D. Budiardja [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 3:27 PM
Subject: [PHP] Echoing HTML in PHP as CGI


Hi all,
When using Apache web server, with php module, I can intermix between HTML
code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as
far as I know, I have to write all HTML code using either echo or print
statement, right? Is there a better way to do this?

The problem is that someone already have the HTML part, and I just wont to
insert some PHP codes around it. If I use
echo 
[HTML CODE] ;

then I have to escape all the quotation mark () inside the HTML code, which
is laborious and not really elegant. The same problem occurs even if I use
echo with single quote instead of double quote. I have to escape all the
single quote, since the HTML code is also intermix between HTML and
javascript, which has single and double quotes.

How do I best solve this problem? Thanks a lot for any response.
Reuben D. Budiardja

--
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: Echoing HTML in PHP as CGI

2002-09-26 Thread Martin W Jørgensen

You can use this code:

print  EndOfHTML

put all html in here even with 

EndOfHTML;

This will print out all html. and dont care about special signs.

goodluck.
Martin

Reuben D. Budiardja [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi all,
When using Apache web server, with php module, I can intermix between HTML
code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as
far as I know, I have to write all HTML code using either echo or print
statement, right? Is there a better way to do this?

The problem is that someone already have the HTML part, and I just wont to
insert some PHP codes around it. If I use
echo 
[HTML CODE] ;

then I have to escape all the quotation mark () inside the HTML code, which
is laborious and not really elegant. The same problem occurs even if I use
echo with single quote instead of double quote. I have to escape all the
single quote, since the HTML code is also intermix between HTML and
javascript, which has single and double quotes.

How do I best solve this problem? Thanks a lot for any response.
Reuben D. Budiardja



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




Re: [PHP] Displaying full array contents

2002-09-26 Thread Brad Harriger

Debbie,

Yes.  I could use recursion, but what's really hanging me up is keeping 
track of how deep into an array I am.  It should be fairly simple, but I 
seem to be having a brain freeze.

Brad



Debbie_dyer wrote:

 You could use recursion example:-
 
   function printArray($arr) {
 for ($i =0; $i  count($arr); $i++) {
   if (!is_array($arr[$i])) {
 echo $arr[$i];
   }
   else {
 printArray($arr[$i]);
   }
 }
   }
  
 $arr = array(Orange, Peach, Apple);
 $arr2 = array(Banana, $arr, Pear);
 $arr3 = array($arr, $arr2);
 
 printArray($arr3);
 
 Debbie
 
 - Original Message - 
 From: Brad Harriger [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, September 26, 2002 6:50 PM
 Subject: [PHP] Displaying full array contents
 
 
 
I'm trying to write a function that will display the full contents of an 
array.  If one of the keys contains a value that is an array, the full 
array (all indices) should be shown.

As an example, given the following definitions:

$Arr1[1] = Apple;
$Arr1[2] = Banana;
$Arr1[3] = $Arr2[];
$Arr2[1] = Carrot;
$Arr2[2] = $Arr3[];
$Arr3[1] = Orange;
$Arr3[2] = Peach;


the output should be:

Arr1:1:Apple
Arr1:2:Banana
Arr1:3:Arr2[]
Arr1:3:Arr2:1:Carrot
Arr1:3:Arr2:2:Arr3[]
Arr1:3:Arr2:2:Arr3:1:Orange
Arr1:3:Arr2:2:Arr3:2:Peach

The closest I've come is:

  while (current($myArr))
   {
 if(is_array(current($myArr)))
 {
   $arrKey = key(current($myArr));
   echo Array ;
   echo nbsp=nbsp;
   $baseArray = key($myArr);
   echo key($myArr);
   echo BR\n;
   walkArray(current($myArr));
 }
 else
 {
   $arrKey = key($myArr);
   if ($baseArray != )
   {
 echo $baseArray;
 echo :;
   }
   echo $arrKey;
   echo nbsp=nbsp;
   echo current($myArr);
   echo BR\n;
 }
 next($myArr);
   }

This code only echoes one dimension of a multi-dimension array.  I can't 
find a way to reliably store more than that.  Any suggestions?

Thanks in advance,

Brad


-- 
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] Simple directory listing

2002-09-26 Thread ed


 I've been hunting all over to find a script that will just list a
directory. I don't need a full feature file system manager just something
I can list files and choose to delete a file if I wish. Where would I find
this.

TIA,

Ed



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




Re: [PHP] Displaying full array contents

2002-09-26 Thread debbie_dyer

Use a static variable in the function? A static var retains its value
between function calls

function printArray($arr) {
static $depth = 0;
for ($i =0; $i  count($arr); $i++) {
  if (!is_array($arr[$i])) {
echo $depth $arr[$i];
  }
  else {
$depth++;
printArray($arr[$i]);
$depth--;
  }
}
  }

  $arr = array(Orange, Peach, Apple);
  $arr2 = array(Banana, $arr, Pear);
  $arr3 = array($arr, $arr2);

  printArray($arr3);

Debbie

- Original Message -
From: Brad Harriger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 8:46 PM
Subject: Re: [PHP] Displaying full array contents


 Debbie,

 Yes.  I could use recursion, but what's really hanging me up is keeping
 track of how deep into an array I am.  It should be fairly simple, but I
 seem to be having a brain freeze.

 Brad



 Debbie_dyer wrote:

  You could use recursion example:-
 
function printArray($arr) {
  for ($i =0; $i  count($arr); $i++) {
if (!is_array($arr[$i])) {
  echo $arr[$i];
}
else {
  printArray($arr[$i]);
}
  }
}
 
  $arr = array(Orange, Peach, Apple);
  $arr2 = array(Banana, $arr, Pear);
  $arr3 = array($arr, $arr2);
 
  printArray($arr3);
 
  Debbie
 
  - Original Message -
  From: Brad Harriger [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Thursday, September 26, 2002 6:50 PM
  Subject: [PHP] Displaying full array contents
 
 
 
 I'm trying to write a function that will display the full contents of an
 array.  If one of the keys contains a value that is an array, the full
 array (all indices) should be shown.
 
 As an example, given the following definitions:
 
 $Arr1[1] = Apple;
 $Arr1[2] = Banana;
 $Arr1[3] = $Arr2[];
 $Arr2[1] = Carrot;
 $Arr2[2] = $Arr3[];
 $Arr3[1] = Orange;
 $Arr3[2] = Peach;
 
 
 the output should be:
 
 Arr1:1:Apple
 Arr1:2:Banana
 Arr1:3:Arr2[]
 Arr1:3:Arr2:1:Carrot
 Arr1:3:Arr2:2:Arr3[]
 Arr1:3:Arr2:2:Arr3:1:Orange
 Arr1:3:Arr2:2:Arr3:2:Peach
 
 The closest I've come is:
 
   while (current($myArr))
{
  if(is_array(current($myArr)))
  {
$arrKey = key(current($myArr));
echo Array ;
echo nbsp=nbsp;
$baseArray = key($myArr);
echo key($myArr);
echo BR\n;
walkArray(current($myArr));
  }
  else
  {
$arrKey = key($myArr);
if ($baseArray != )
{
  echo $baseArray;
  echo :;
}
echo $arrKey;
echo nbsp=nbsp;
echo current($myArr);
echo BR\n;
  }
  next($myArr);
}
 
 This code only echoes one dimension of a multi-dimension array.  I can't
 find a way to reliably store more than that.  Any suggestions?
 
 Thanks in advance,
 
 Brad
 
 
 --
 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




Re: [PHP] Session

2002-09-26 Thread debbie_dyer

PHP is automatically rewriting the URLs for the tags specified in
url_rewriter.tags (php.ini) because the session cookie has not been
accepted. I found it best to remove these tags and append the SID manually
to the URLs that need it for when cookies are off - else SIDs can get
appended where you don't want them appended.

I think PHP's session system is really good and definitely worth learning.

Debbie

- Original Message -
From: Bill Farrell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 8:09 PM
Subject: [PHP] Session


 Hi all,

 Is there a really thorough tutorial on the use of
 session variables?  Seems like there are a zillion
 options to choose from, lots of interdependent
 settings, etc, and I'm a bit confused on how to make
 it work.

 I try not to use session objects too much in any
 language as it makes the code somewhat less portable,
 but I did want to experiment with PHP's notion before
 launching off on another suite of apps.  I'm starting
 with a simple fake hit counter that checks session to
 see if the counter was already dinged.  It works if I
 turn on enable_transient_sid, but setting that drives
 ht://dig nuts by appending ?PHPSESSIDyaddayadda to the
 URL.  Really makes a mess of the database :-)~~.

 Obviously, I'm missing something pretty fundamental.
 Any suggested reading would be appreciated (yes, I did
 read the PHP manual :-).

 Thanks in advance,
 B


 =
 Bill Farrell
 Multivalue and *nix Support Specialist

 Phone: (828) 667-2245
 Fax:   (928) 563-5189
 Web:   http://www.jwfarrell.com

 __
 Do you Yahoo!?
 New DSL Internet Access from SBC  Yahoo!
 http://sbc.yahoo.com

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



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




Re: [PHP] Simple directory listing

2002-09-26 Thread Kevin Stone

http://www.php.net/manual/en/function.opendir.php
-Kevin


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 26, 2002 1:58 PM
Subject: [PHP] Simple directory listing



  I've been hunting all over to find a script that will just list a
 directory. I don't need a full feature file system manager just something
 I can list files and choose to delete a file if I wish. Where would I find
 this.

 TIA,

 Ed



 --
 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] Displaying full array contents

2002-09-26 Thread Martin W Jørgensen

print_r($array); simply print out the entire array..
It cant be easier.

Debbie_dyer [EMAIL PROTECTED] wrote in message
01bf01c26598$1d84ec00$0100a8c0@homepc">news:01bf01c26598$1d84ec00$0100a8c0@homepc...
 Use a static variable in the function? A static var retains its value
 between function calls

 function printArray($arr) {
 static $depth = 0;
 for ($i =0; $i  count($arr); $i++) {
   if (!is_array($arr[$i])) {
 echo $depth $arr[$i];
   }
   else {
 $depth++;
 printArray($arr[$i]);
 $depth--;
   }
 }
   }

   $arr = array(Orange, Peach, Apple);
   $arr2 = array(Banana, $arr, Pear);
   $arr3 = array($arr, $arr2);

   printArray($arr3);

 Debbie

 - Original Message -
 From: Brad Harriger [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, September 26, 2002 8:46 PM
 Subject: Re: [PHP] Displaying full array contents


  Debbie,
 
  Yes.  I could use recursion, but what's really hanging me up is keeping
  track of how deep into an array I am.  It should be fairly simple, but I
  seem to be having a brain freeze.
 
  Brad
 
 
 
  Debbie_dyer wrote:
 
   You could use recursion example:-
  
 function printArray($arr) {
   for ($i =0; $i  count($arr); $i++) {
 if (!is_array($arr[$i])) {
   echo $arr[$i];
 }
 else {
   printArray($arr[$i]);
 }
   }
 }
  
   $arr = array(Orange, Peach, Apple);
   $arr2 = array(Banana, $arr, Pear);
   $arr3 = array($arr, $arr2);
  
   printArray($arr3);
  
   Debbie
  
   - Original Message -
   From: Brad Harriger [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Thursday, September 26, 2002 6:50 PM
   Subject: [PHP] Displaying full array contents
  
  
  
  I'm trying to write a function that will display the full contents of
an
  array.  If one of the keys contains a value that is an array, the full
  array (all indices) should be shown.
  
  As an example, given the following definitions:
  
  $Arr1[1] = Apple;
  $Arr1[2] = Banana;
  $Arr1[3] = $Arr2[];
  $Arr2[1] = Carrot;
  $Arr2[2] = $Arr3[];
  $Arr3[1] = Orange;
  $Arr3[2] = Peach;
  
  
  the output should be:
  
  Arr1:1:Apple
  Arr1:2:Banana
  Arr1:3:Arr2[]
  Arr1:3:Arr2:1:Carrot
  Arr1:3:Arr2:2:Arr3[]
  Arr1:3:Arr2:2:Arr3:1:Orange
  Arr1:3:Arr2:2:Arr3:2:Peach
  
  The closest I've come is:
  
while (current($myArr))
 {
   if(is_array(current($myArr)))
   {
 $arrKey = key(current($myArr));
 echo Array ;
 echo nbsp=nbsp;
 $baseArray = key($myArr);
 echo key($myArr);
 echo BR\n;
 walkArray(current($myArr));
   }
   else
   {
 $arrKey = key($myArr);
 if ($baseArray != )
 {
   echo $baseArray;
   echo :;
 }
 echo $arrKey;
 echo nbsp=nbsp;
 echo current($myArr);
 echo BR\n;
   }
   next($myArr);
 }
  
  This code only echoes one dimension of a multi-dimension array.  I
can't
  find a way to reliably store more than that.  Any suggestions?
  
  Thanks in advance,
  
  Brad
  
  
  --
  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] mySQL question

2002-09-26 Thread drparker

I'm just starting to use PHP with mySQL, and I have a few basic
questions.  I've successfully created a mySQL database on my local
machine, was able to create tables and populate them (from the command
line), query it with php from the browser, etc - no problems there.  Now
I need to create one on a remote server.

1) Since I have access to the ftp, is that login/pass valid for the
mysql database?  if not, is there a location where this information (l/p
to mySQL) is stored?

2) Are there concrete files in mySQL?  For example, can i create the
database i want from my local machine and then upload it?  where are
they located?  this is the most puzzling to me - i don't understand how
these databases seem to exist in thin air...

3) How do i go about getting that command line setting, the one that i
use to create tables and add things and whatever on my local machine, on
a remote server?  do they have to have telnet enabled?

4)  what is phpmyAdmin?  could this help my situation?

any help would be greatly appreciated

-Doug


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




  1   2   >