php-general Digest 26 Sep 2002 14:24:04 -0000 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]


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




On Thu, 26 Sep 2002, Justin French wrote:

JF>What test are you running?
JF>
JF>Justin

I am running this code only..

<? phpinfo() ?>


Regards,
Uma

--- End Message ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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
>
> ______________________________________
>


--- End Message ---
--- Begin Message ---
Hello,

On 09/25/2002 07:00 PM, Tom Ray wrote:
> I was wondering with mail() how do you attach a file to the message you are
> sending? I have to take the data from the form and write it to a CSV file that
> needs to be mailed to the client, I got everything put how to attach the CSV
> file to the mail when the script runs..

You may want to try this class that can compose and send a MIME message 
just like you need attaching any files you need among other things.

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
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

-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
No DB abstraction layer, including MetaBase offers true database
abstraction.  No layer will make stored procedures portable.  No layer
will make your fancy Oracle DECODE() query portable.  No layer will
magically make your MS-SQL triggers work anywhere else.

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.

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.

-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
>
> --
>
> Regards,
> Manuel Lemos
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
-----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 web....the 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-----
--- End Message ---
--- Begin Message ---
Hi,

Who is the forum's owner?

I want to post questions using [EMAIL PROTECTED] and 
[EMAIL PROTECTED] in my from: and reply-to:

I post infrequently to this list using news://news.php.net/php.general NOT 
[EMAIL PROTECTED]
This is about the only list I post to. I've been receiving a lot of spam from Korea 
lately and what to put a stop to it, or at least slow it down.

John

--- End Message ---
--- Begin Message ---
The problem is NOT the list, but the services like marc that archive the
lists activities... this means your email address sits there in plain view
on MANY web pages for bots to find.

Best advice is to post strictly to the newsgroup with a dud email address,
or use a specific email address for your activities on the PHP list, and
filter out anything to that address which doesn't have [PHP] in the subject
line, which is what I plan to do soon.

Using 'nospam' in your address' prolly doesn't help as much as it used to,
because it's common practice these days, hence spiders probably attempt to
parse it out.

Your spam may be originating from somewhere entirely different from the PHP
list... if your address is on ANY web page accessed via GET (URL, not POST),
it's within reach of the spiders...

Fun huh?


Justin






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

> Hi,
> 
> Who is the forum's owner?
> 
> I want to post questions using [EMAIL PROTECTED] and
> [EMAIL PROTECTED] in my from: and reply-to:
> 
> I post infrequently to this list using news://news.php.net/php.general NOT
> [EMAIL PROTECTED]
> This is about the only list I post to. I've been receiving a lot of spam from
> Korea lately and what to put a stop to it, or at least slow it down.
> 
> John
> 

--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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
> 
> 

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
Why don't you keep you mind ahead and use session auth

bsantos

"Meltem Demirkus" <[EMAIL PROTECTED]> wrote in message
001701c26532$ba7c8c90$55000083@hiborya">news:001701c26532$ba7c8c90$55000083@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
>


--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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



--- End Message ---
--- Begin Message ---
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]


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---

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


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---

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


--- End Message ---
--- Begin Message ---
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:

        <p>Some text here.</p>
        <?php print("<p>Some more text.</p>"); ?>
        <p>The last bit of text.</p>

... and the output would be:
        <p>Some text here.</p>
        <p>Some more text.</p>
        <p>The last bit of text.</p>

What the best way of doing this?

Cheers in anticipation!


-- 
Matt Browne <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
> 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

--- End Message ---
--- Begin Message ---
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
>
>
>  
>

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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
1600000 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
>
>

--- End Message ---
--- Begin Message ---
> 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
> 1600000 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


--- End Message ---
--- Begin Message ---

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

--- End Message ---
--- Begin Message ---
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)...

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

--- End Message ---
--- Begin Message ---
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)...
>
> Hmmmm...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
>

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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
>

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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 
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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
>>    
>>
>
>
>
>  
>

--- End Message ---
--- Begin Message ---
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]

--- End Message ---
--- Begin Message ---
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
>>> 
>>> 
>> 
>> 
>> 
>> 
>> 
> 

--- End Message ---
--- Begin Message ---
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?

<td><input value=$cost name="txtSubTotalAmount" size="40" readonly></td>

Thanks in advance!



--- End Message ---
--- Begin Message ---
[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?

<td><input 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?

<td><input 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! *
*****************************************************



--- End Message ---
--- Begin Message ---
hey folks, don't forget quotes  ;o)

<td><input 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?
>
> <td><input 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?
>
> <td><input 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
>
--- End Message ---
--- Begin Message ---
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)
>
><td><input 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?
>>
>><td><input 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?
>>
>><td><input 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
>>
>>    
>>
>
>  
>

--- End Message ---
--- Begin Message ---
[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)
>
><td><input 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! *
*****************************************************


--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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
> 
> 

--- End Message ---
--- Begin Message ---
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
> >
> >
>


--- End Message ---
--- Begin Message ---
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
>>> 
>>> 
>> 
> 
> 

--- End Message ---
--- Begin Message ---
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 <-<-


--- End Message ---
--- Begin Message ---
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
>


--- End Message ---
--- Begin Message ---
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.
>
>

--- End Message ---
--- Begin Message ---
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.
>
>
>
>  
>

--- End Message ---
--- Begin Message ---
$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
>
>
>  
>

--- End Message ---
--- Begin Message ---
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
>         if(!isset($_GET["t"])) mysql_query("UPDATE opscifi_news_data SET
> requests = requests + 1 WHERE data_id = ".$_GET["d"],$DB);
>
>       // Load nxdx.ext into
>
>
$f="./news/n".$ditem["news_id"]."d".$ditem["data_id"].".".substr($ditem["fil
>
ename"],strpos($ditem["filename"],".",0)+1,strlen($ditem["filename"])-(strpo
> s(fname,".",0)+1));
>         $img=imagecreatefromjpeg($f);
>         $size=getimagesize($f);
>         if(isset($_GET["h"]) or isset($_GET["w"])) {
>
>
$outimg=imagecreate((isset($_GET["w"])?$_GET["w"]:$size[0]),(isset($_GET["h"
> ])?$_GET["h"]:$size[1]));
>           imagecopyresized($outimg, $img,
>
0,0,0,0,(isset($_GET["w"])?$_GET["w"]:$size[0]),(isset($_GET["h"])?$_GET["h"
> ]:$size[1]),$size[0],$size[1]);
>         } else {
>           $outimg=$img;
>         }
>         imageinterlace($outimg,1);
>         imagejpeg($outimg,"",(isset($_GET["q"])?$_GET["q"]:100));
>       }
>     } else {
>       $errmsg[]="News Data Item Not in 'news_data' table!";
>
>
$fwidth=(strlen($errmsg[count($errmsg)-1])>$fwidth?strlen($errmsg[count($err
> msg)-1]):$fwidth);
>     }
>   }
>
>   if(strlen($errmsg)>0) {
>   // Spit out required [standard] MIME-type header
>     header("Content-type: image/jpeg");
>     $f_size=2;
>
>
$img=imagecreate(imagefontwidth($f_size)*$fwidth+14,(imagefontheight($f_size
> )+2)*count($errmsg)+5);
>     imagefill($img, 0, 0, imagecolorallocate($img, 220,220,220));
>     foreach($errmsg as $pos=>$str) imagestring($img, $f_size, 7,
> 3+($pos*(imagefontheight($f_size)+2)), $str, imagecolorallocate($img, 255,
> 0, 0));
>     imageinterlace($img,1);
>     imagejpeg($img);
>     exit();
>   } else {
>     exit();
>   }
>
> ------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: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, September 23, 2002 1:09 AM
> Subject: [PHP] Create Thumbnails from image
>
>
> > Hi,
> > I'm using a Win2k with php4.1 and I'd like to make some thumbnails from
> > pictures on my disk.
> > I've gotten the impression that it's possible, but I havent' found out
> > just how.
> >
> > I've stumbled across the ImageCopyResized function but it requires a
> > imagehandle(?) to the file copied from. How do I get that? Is it the
> > right way to do this?
> > I guess I could use some picture manipulating program to do this, but
> > doing it the PHP way is nicer :)
> >
> > TIA
> > Kjell
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>




--- End Message ---
--- Begin Message ---
> -----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 
--- End Message ---
--- Begin Message ---
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]
______________________________________

--- End Message ---
--- Begin Message ---
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
--- End Message ---

Reply via email to