|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 9 Jul 2003 22:15:58 -0000 Issue 2166
php-general-digest-help
lists.php.net
Date: Wed Jul 09 2003 - 17:15:58 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 9 Jul 2003 22:15:58 -0000 Issue 2166
Topics (messages 154513 through 154645):
Re: session data missing
154513 by: Ford, Mike [LSS]
154567 by: Johnson, Kirk
154615 by: ulf sundin
154623 by: Kevin Stone
Re: seeing strange things?
154514 by: Ford, Mike [LSS]
154518 by: Marek Kilimajer
Re: include/require inside of function
154515 by: Ford, Mike [LSS]
Re: PHP4 and PHP5 at one machine
154516 by: Ford, Mike [LSS]
154557 by: Scott Fletcher
Re: Text boxes posted to MySQL record that contain quotes
154517 by: John W. Holmes
154636 by: electroteque
Re: Using PHP with windows logon
154519 by: Marek Kilimajer
154569 by: Ray Hunter
Re: PHP forum
154520 by: David Robley
154537 by: Dan Anderson
154544 by: Jay Blanchard
154547 by: Steve Jackson
Re: Create a Report
154521 by: David Robley
mail() - how to attach file to the message???
154522 by: szparag
154525 by: Marek Kilimajer
154526 by: Chris Hayes
154531 by: sven
154625 by: szparag
154630 by: Mark
154631 by: Mark
Re: Please assist - been on this for hours - Permissions on server
154523 by: Steve Jackson
154601 by: Jason Wong
Re: picture(s) in Excel
154524 by: Marek Kilimajer
154534 by: jan
154539 by: Marek Kilimajer
linking with home directory path
154527 by: mpalermo
154581 by: David Nicholson
Cookie header and location header.
154528 by: Ns_Andy
Re: Sessions
154529 by: Dave Alger
Form being filled out automatically....
154530 by: Wendell Brown
154533 by: David Otton
154535 by: Wendell Brown
Re: XML
154532 by: Petre Agenbag
154571 by: Ray Hunter
PHP, MySQL and Flash
154536 by: Rankin, Randy
154538 by: Dan Anderson
154611 by: Ralph Guzman
154613 by: Miles Thompson
PHP Bug or just a strange behaivor?
154540 by: Marcus Hufvudsson
154554 by: Chris Boget
154560 by: Ford, Mike [LSS]
Looping or what?
154541 by: Zac Hillier - Net Affectors
154599 by: Jason Wong
Big problem....need help
154542 by: phpu
154546 by: Nicolas Costes
154588 by: phpu
154594 by: Haseeb
154607 by: phpu
154614 by: Mark
Headers and server
154543 by: Steve Jackson
Re: Refresh PHP
154545 by: Mauricio
154559 by: Scott Fletcher
Can php/mysql handle 10000s of records
154548 by: Adam Gerson
154551 by: Jay Blanchard
154552 by: Adam Voigt
154568 by: Joe Harman
154574 by: Jay Blanchard
Antithesis to array_unique
154549 by: Jay Blanchard
154553 by: David Nicholson
154564 by: Ford, Mike [LSS]
Re: How configure PHP parser 4.3.x in IIS version 6.0?
154550 by: Leif K-Brooks
Re: __get, __set, __clone
154555 by: Yann Larrivee
154570 by: Marek Kilimajer
Re: NEW SPAMMER -> [PHP] New Krysalis version released
154556 by: Steve Magruder
Re: Compiling PHP
154558 by: Mike At Spy
154609 by: Ralph Guzman
mcrypt warning
154561 by: Dan Joseph
Re: simple ereg() question
154562 by: gamin
To All Those Seeking XML & PHP Wisdom!
154563 by: Joe Harman
Steve - > Re: [PHP] Re: NEW SPAMMER -> [PHP] New Krysalis version released
154565 by: Ryan A
Regex nightmare:(
154566 by: Tim Steele
client running
154572 by: Randy Johnson
154633 by: Randy Johnson
154634 by: electroteque
linking with home directory
154573 by: mpalermo
154576 by: Mike Brum
154577 by: Matt Matijevich
154578 by: mpalermo
154579 by: mpalermo
154580 by: Matt Matijevich
154582 by: mpalermo
154584 by: Mike Brum
154595 by: Micah Montoy
$_SESSION act funny...
154575 by: Scott Fletcher
154583 by: Marek Kilimajer
154590 by: Mike Migurski
154591 by: Scott Fletcher
154592 by: Scott Fletcher
Simple forms query
154585 by: Enda Nagle
154586 by: Jay Blanchard
154587 by: Matt Matijevich
154589 by: Enda Nagle
Where do I post loadable extensions questions? (semi-multi-part)
154593 by: Kris Yates
154596 by: Ray Hunter
nested for loops
154597 by: Micah Montoy
154598 by: Matt Matijevich
154600 by: Dan Joseph
154603 by: Ray Hunter
154604 by: Micah Montoy
154610 by: Burhan Khalid
154616 by: Micah Montoy
154620 by: Rob Adams
154621 by: Matt Matijevich
Can anyone please help me? Re: Using PHP to change unix environment
154602 by: Guy Davis
154605 by: Matt Matijevich
Re: Image verification problem..
154606 by: Jason Wong
Calling Apache Modules from PHP
154608 by: Guy Davis
TextArea vs. URLEncode/URLDecode/quotes
154612 by: Arcadius A.
154618 by: Kevin Stone
154619 by: Marek Kilimajer
passing commands via ssh
154617 by: Mignon Hunter
154629 by: Jeff Harris
154632 by: Mignon Hunter
Re: New to PHP
154622 by: Ralph Guzman
String conversion function
154624 by: Simon Fredriksson
154626 by: Pascal Polleunus
SQL Query slow with 'Select' ....
154627 by: Scott Fletcher
Re: Object assignment
154628 by: Matt Grimm
Credit card/Debit card validation
154635 by: Sparky Kopetzky
154637 by: Matt Matijevich
154640 by: zbranigan
154641 by: Ralph Guzman
154643 by: Sparky Kopetzky
World Pac
154638 by: Brian V Bonini
php - javascript together prob?
154639 by: Micah Montoy
154642 by: Jennifer Goodie
154644 by: Ray Hunter
shoutcast communication
154645 by: Ben Paul
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
> -----Original Message-----
> From: ulf sundin [mailto:majikthse
spray.se]
> Sent: 09 July 2003 01:01
>
> After creating a new session with session_start() and
> inserting a few values
> e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file
> /tmp/sess_{session_id} is
> created.
> The problem is that this file is empty! 0 bytes. no data is stored.
> I'm using php 4.0.6 on linux with apache 1.3 something.
Just doing session_start() will create the file. Are you also
session_register()-ing your session vars? The $HTTP_SESSION_VARS array
isn't like the $_SESSION array introduced in PHP 4.1 -- it's values are not
automatically registered. You still have to use session_register(), thus:
session_start();
session_register('foo');
$HTTP_SESSION_VARS['foo'] = 'bar';
HTH
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: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
> After creating a new session with session_start() and
> inserting a few values
> e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file
> /tmp/sess_{session_id} is
> created.
> The problem is that this file is empty! 0 bytes. no data is stored.
> I'm using php 4.0.6 on linux with apache 1.3 something.
Check the register_globals setting in php.ini. If it is set to "On", then
code like this:
session_start();
$foo = 'bar';
session_register('foo');
echo $foo;
If register_globals is set to "Off", then code as you are already doing:
session_start();
$HTTP_SESSION_VARS['foo'] = 'bar';
echo {$HTTP_SESSION_VARS['foo']};
Kirk
attached mail follows:
ok, so now the variable names are registred and stored in the file. But
without values.
check this:
--firstpage.php----
session_start()
session_register('foo');
$HTTP_SESSION_VARS['foo'] = 'bar';
echo $HTTP_SESSION_VARS['foo']; //outputs bar;
transport by a href to:
----secondpage.php----
session_start();
echo $HTTP_SESSION_VARS['foo']; //outputs nothing
---
checking the contents of the file called /tmp/sess_{session_id}:
!foo|
I guess it should be something like !foo=bar|
but, as I said, the values doesnt seem to stick in the file, just the names
of the variables.
I must be doing something wrong.
Regards
Ulf
"Mike Ford" <M.Ford
lmu.ac.uk> skrev i meddelandet
news:841D90E489448A4F804E1D1B95768BF7D4613B
lis-exchange3.lmu.ac.uk...
> > -----Original Message-----
> > From: ulf sundin [mailto:majikthse
spray.se]
> > Sent: 09 July 2003 01:01
> >
> > After creating a new session with session_start() and
> > inserting a few values
> > e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file
> > /tmp/sess_{session_id} is
> > created.
> > The problem is that this file is empty! 0 bytes. no data is stored.
> > I'm using php 4.0.6 on linux with apache 1.3 something.
>
> Just doing session_start() will create the file. Are you also
> session_register()-ing your session vars? The $HTTP_SESSION_VARS array
> isn't like the $_SESSION array introduced in PHP 4.1 -- it's values are
not
> automatically registered. You still have to use session_register(), thus:
>
> session_start();
> session_register('foo');
> $HTTP_SESSION_VARS['foo'] = 'bar';
>
> HTH
>
> 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: m.ford
lmu.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
----- Original Message -----
From: "ulf sundin" <majikthse
spray.se>
To: <php-general
lists.php.net>
Sent: Wednesday, July 09, 2003 1:00 PM
Subject: Re: [PHP] session data missing
> ok, so now the variable names are registred and stored in the file. But
> without values.
> check this:
>
> --firstpage.php----
> session_start()
> session_register('foo');
> $HTTP_SESSION_VARS['foo'] = 'bar';
> echo $HTTP_SESSION_VARS['foo']; //outputs bar;
>
> transport by a href to:
> ----secondpage.php----
> session_start();
> echo $HTTP_SESSION_VARS['foo']; //outputs nothing
>
> ---
> checking the contents of the file called /tmp/sess_{session_id}:
> !foo|
(snip)
Make a choice here..
=> session_register('foo');
=> $HTTP_SESSION_VARS['foo'] = 'bar';
Use either the session_register() function or the session global array. Not
both.
- Kevin
attached mail follows:
> -----Original Message-----
> From: Micah Montoy [mailto:montmica
isu.edu]
> Sent: 09 July 2003 01:37
>
> A couple more things and I'll stop bugging everyone. I'm
> trying to get the
> file name of the string. If it includes the extension that's
> fine as well.
> I thought the code below would do this but its not.
>
> $filevalue = str_replace("\\\\", "/", $filevalue);
>
> //get specific file name
> $parts = explode("/",$filevalue);
> $file_name = $parts[count($parts)]; //line 42
>
> Its giving me error:
> Notice: Undefined offset: 6 in
> c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.ph
> p on line 42
This is because count() returns the number of elements in the array, but because the indexes start at zero the highest offset is count($parts)-1 -- so when you try to access element count($parts), PHP throws a wobbly.
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: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Micah Montoy wrote:
> A couple more things and I'll stop bugging everyone. I'm trying to get the
> file name of the string. If it includes the extension that's fine as well.
pathinfo() should do the job for you.
attached mail follows:
> -----Original Message-----
> From: Ow Mun Heng [mailto:ow.mun.heng
wdc.com]
> Sent: 09 July 2003 03:44
>
> I finally got it. Thanks. All I needed to do was just
> define global
> $page_title inside the function to denote that I wanted to use that
> variable.
>
> One other quick question, in my original code (per below) the function
> create_global() was used to create_globals on demand. But
> this involved a
> lot of jumping, from one function to another just to create
> the globals on
> demand. Is this efficient (more?? less??) compared to just
> stating global
> $page_title inside the function?
I don't think create_global() is of any use to you in this situation --
you're just wasting the time taken to do the function call and return. Just
do either:
function org_display_title_code()
{
global $page_title;
echo 'This is title1 -> ' . $page_title;
}
Or:
function org_display_title_code()
{
echo 'This is title1 -> ' . $GLOBALS['page_title'];
}
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: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
> -----Original Message-----
> From: Milan Reznicek [mailto:reznicekm
gytool.cz]
> Sent: 09 July 2003 07:38
>
> Yes all these things I know, because already I'm running
> these two servers,
> but both with PHP4.
> But now I came accros the problem of "php4ts.dll". Because in
> both versiones
> it has the same name. And if I have the old one my \WINNT\SYSTEM32 the
> server which is running PHP5 won't start, and if i put there
> the newer one
> the one with PHP4 won't start. That's my problem. Do you know
> how to solve
> this?
Don't put either php4apache.dll (or equivalent) or php4ts.dll in your
Windows directory. Put the files for each version in separate directories
specific to the version (say, C:\php\4.3.2\dlls and C:\php\5.0.0\dlls), then
in your Apache .conf file specifically name this location in your LoadModule
command -- for instance:
Module php4_module c:/php/4.3.2/dlls/php4apache.dll
This has worked fine for me for a while now.
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: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Well, it is not possible to run two seperate php4ts.dll file in the same
file path with the same file name even though they have different version.
One workaround to it would be to compile the older version into a different
file name while making sure the script point to that different file name but
it got to be tough to do that. Because you'll be modifying the codes and
compile it, into windows files and so on.
"Milan Reznicek" <reznicekm
gytool.cz> wrote in message
news:20030709063928.35104.qmail
pb1.pair.com...
> Yes all these things I know, because already I'm running these two
servers,
> but both with PHP4.
> But now I came accros the problem of "php4ts.dll". Because in both
versiones
> it has the same name. And if I have the old one my \WINNT\SYSTEM32 the
> server which is running PHP5 won't start, and if i put there the newer one
> the one with PHP4 won't start. That's my problem. Do you know how to solve
> this?
>
>
> Milan
>
> --
> ----------------------------------
> Milan Reznicek
> Software Developer
>
> e-mail: reznicekm
gytool.cz
> "Burhan Khalid" <phplist
meidomus.com> wrote in message
> news:1587371732.20030709061856
lists.php.net...
> > On Tuesday, July 8, 2003, 8:42:16 PM, Milan wrote:
> >
> > MR> is there any posibility to run PHP4 and PHP5 at one machine,
with
> two
> > MR> Apache servers running at the same time.
> >
> > MR> Windows 2000 SP3
> > MR> Apache 1.3.27/PHP 4.3.0
> > MR> Apache 2.0.46/PHP 5.0.0b1
> >
> > Yes it is possible. If you want both of the servers to be running at
> > one time, then you'll have to change the Listen directive on one of
> > them, since both will default to port 80. So, change one to something
> > else, like 8080. Then access it with the port number
> > http://address:port
> >
> > As far as the PHP install goes, you can have two PHP installs (one for
> > each server), you just have to make sure where the .ini files are
> > stored, and that the configuration directives for PHP (such as
> > LoadModule, etc.) point to the right direction for each server.
> >
> > I also believe that the Apache Service Monitor can handle more than
> > one Apache install, so you'll have a convienient place to control your
> > servers.
> >
> > --
> > Regards,
> > Burhan Khalid
> > phplist[at]meidomus[dot]com
> > http://www.meidomus.com
> >
>
>
attached mail follows:
Vernon wrote:
> I know that using stripslashes will remove \ using php but I'm having
> trouble with posting quotation marks in a text record field. Anyone know how
> I can get them to post to the database? It's basically like an email and I'd
> like anything written to be able to post.
Use htmlentities() to convert quotes to HTML entities.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
attached mail follows:
lol why didnt i think of this , i have done this before for hidden form
fields when creating a preview page :\ , i guess i have to reconvert if it
reposts so it doesnt screw up the sql
-----Original Message-----
From: John W. Holmes [mailto:holmes072000
charter.net]
Sent: Wednesday, July 09, 2003 8:49 PM
To: Vernon
Cc: php-general
lists.php.net
Subject: Re: [PHP] Text boxes posted to MySQL record that contain quotes
Vernon wrote:
> I know that using stripslashes will remove \ using php but I'm having
> trouble with posting quotation marks in a text record field. Anyone know
how
> I can get them to post to the database? It's basically like an email and
I'd
> like anything written to be able to post.
Use htmlentities() to convert quotes to HTML entities.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I think if php runs under IIS and IIS is set up to do so, the variable
(phpinfo() will tell you its name) is set. I don't know much more.
Brenton Dobell wrote:
> Hello all,
>
> I just have a quick question, I am not sure that it is even possible but im
> gonna take a whack anyways, basically what i want to know is,
>
> can you use your windows logon as set it as a variable in php??
>
> eg I log onto a windows machine using brenton can i use a php script to set
> that as a variable, I have seen a similar type function before but i have no
> idea how it works, I know windows sets the variable %username% that as a
> network administrator i use in shortcuts to point to their home drive..
>
> Hopefully i can do this :P
>
> Cheers in advance
>
>
attached mail follows:
On Wed, 2003-07-09 at 03:32, Brenton Dobell wrote:
> can you use your windows logon as set it as a variable in php?
U should probably look at how activex does it. I know that asp scripts
do it all the time and possibly some com objects can set that for you.
I have connected to exchange and used the username login (they type in)
to authenticate against.
--
BigDog
attached mail follows:
In article <BB30DD26.21A10%rick
baskettcase.com>, rick
baskettcase.com
says...
> Ok some of you might not like this, others of you will know exactly what I
> mean, but it just reminded me so much of this forum that I am sure some of
> you will catch the humor in it:
>
> http://www.mac-forums.com/forums/showpost.php?postid=5736&postcount=85
>
> Please keep your flames directed at me instead of the mailing list so we can
> keep this thread to one post.
>
> Cheers!
>
> "What's in a name? That which we call a rose by any other name would smell
> as sweet." - Shakespeare
Goodness me! I first saw that sometime in a year that started with 19 :-)
--
Quod subigo farinam
$email =~ s/oz$/au/o;
attached mail follows:
me three!
j/k.
-Dan
On Wed, 2003-07-09 at 00:21, PHP4 Emailer wrote:
> HOLY COW,
>
> I never laughed so hard in my life, This is DEAD ON, for what happens in
> this exact forum.
>
> Damn that $#
# is funny!!
>
> And I've only been here for about 3 months now. I've see about every one of
> those in that short time. Boy that cracks me up.
>
> Good find Richard!!
> ha... :}
>
> -----Original Message-----
> From: Richard Baskett [mailto:rick
baskettcase.com]
> Sent: Tuesday, July 08, 2003 10:42 PM
> To: PHP General
> Subject: [PHP] PHP forum
>
>
> Ok some of you might not like this, others of you will know exactly what I
> mean, but it just reminded me so much of this forum that I am sure some of
> you will catch the humor in it:
>
> http://www.mac-forums.com/forums/showpost.php?postid=5736&postcount=85
>
> Please keep your flames directed at me instead of the mailing list so we can
> keep this thread to one post.
>
> Cheers!
>
> "What's in a name? That which we call a rose by any other name would smell
> as sweet." - Shakespeare
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
me four!
Couldn't resist, and I loke the top posty thingie too.
JB
-----Original Message-----
From: Dan Anderson [mailto:dan
mathjunkies.com]
Sent: Wednesday, July 09, 2003 7:39 AM
To: PHP4 Emailer
Cc: Richard Baskett; php-general
lists.php.net
Subject: RE: [PHP] PHP forum
me three!
j/k.
-Dan
On Wed, 2003-07-09 at 00:21, PHP4 Emailer wrote:
> HOLY COW,
>
> I never laughed so hard in my life, This is DEAD ON, for what happens
in
> this exact forum.
>
> Damn that $#
# is funny!!
>
> And I've only been here for about 3 months now. I've see about every
one of
> those in that short time. Boy that cracks me up.
>
> Good find Richard!!
> ha... :}
>
> -----Original Message-----
> From: Richard Baskett [mailto:rick
baskettcase.com]
> Sent: Tuesday, July 08, 2003 10:42 PM
> To: PHP General
> Subject: [PHP] PHP forum
>
>
> Ok some of you might not like this, others of you will know exactly
what I
> mean, but it just reminded me so much of this forum that I am sure
some of
> you will catch the humor in it:
>
> http://www.mac-forums.com/forums/showpost.php?postid=5736&postcount=85
>
> Please keep your flames directed at me instead of the mailing list so
we can
> keep this thread to one post.
>
> Cheers!
>
> "What's in a name? That which we call a rose by any other name would
smell
> as sweet." - Shakespeare
>
>
> --
> 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
attached mail follows:
I should also add that another 685 posts would say RTFM about
lightbulbs.
Steve Jackson
Web Development and Marketing Manager
Viola Systems Ltd.
http://www.violasystems.com
stephen.jackson
violasystems.com
Mobile +358 50 343 5159
> -----Original Message-----
> From: Richard Baskett [mailto:rick
baskettcase.com]
> Sent: 9. heinäkuuta 2003 6:42
> To: PHP General
> Subject: [PHP] PHP forum
>
>
> Ok some of you might not like this, others of you will know
> exactly what I mean, but it just reminded me so much of this
> forum that I am sure some of you will catch the humor in it:
>
http://www.mac-forums.com/forums/showpost.php?postid=5736&postcount=85
Please keep your flames directed at me instead of the mailing list so we
can keep this thread to one post.
Cheers!
"What's in a name? That which we call a rose by any other name would
smell as sweet." - Shakespeare
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
In article <20030709072226.68848.qmail
pb1.pair.com>, cavagnaro
jalyn.net
says...
> I'm using MySQL and PHP for building a website, however now I need to create
> a report with something like this:
>
> -------------------------------------------------
> {Title}
> {Description}
>
> {Zone1}
> Detail Zone1.Topic1
> DetailZone1.Topic2
> DetailZone1.Topic3
>
> {Zone2}
> Detail Zone2.Topic1
> DetailZone2.Topic2
>
> {Zone3}
> Detail Zone3.Topic1
> DetailZone3.Topic2
> DetailZone3.Topic3
> DetailZone3.Topic4
> -------------------------------------------------
>
> I have 2 tables named Zone1 and Zone1detail where I do a join to get values
> I need. How ever don't know how to make something like this.
>
> Can anyone help? Thanks in advance
Depends on how you have structured your tables. There should be a common
field between the tables on which you can join.
--
Quod subigo farinam
$email =~ s/oz$/au/o;
attached mail follows:
i know that in mail-form i need <input type=file name=attach>
but i don't know how to write message headers to send file with e-mail.
please help me.
szparag.
attached mail follows:
Use this class:
http://www.phpclasses.org/mimemessage
szparag wrote:
> i know that in mail-form i need <input type=file name=attach>
>
>
>
> but i don't know how to write message headers to send file with e-mail.
>
>
>
> please help me.
>
>
>
> szparag.
attached mail follows:
this worked for me but i did some editing and censoring oso maybe a tiny
bug got in.
///SETUP strings
$subject='hi there, this is not a Viagra business proposal, ';
$mailto = 'xxx
ivm.vu.nl,xxx
sense.nl';// for multiple recipients, use
comma 'x
x.x,y
y.y,z
z.z'
$From = '"Your website'" <yourmail
mail.org>'; // gets shown as mail
sender. can be anything.
$message = "\nThis is a backup created by a script on your site. \nThe
location of the script is ".__FILE__.'.';
$filedata = getyourcontentsomehow();
//create a filename for the email. the date and time at the start of the
filename make it easy to sort it.
$filename = date("Y_m_d__H_i").'anytext'.".sql";
//prepare mail body
$filedata = chunk_split(base64_encode($filedata));
$type = "application/octet-stream";
$encoding = "base64";
mt_srand((double)microtime()*1000000);
$boundary = '--b'.md5(uniqid(mt_rand())) . getmypid(); //as long as
it starts with -- it should work
$mailbody = "From: Your website script\n"
."MIME-Version: 1.0\n"
."Content-Type: multipart/mixed; boundary=\"$boundary\"\n\n"
."This is a MIME encoded message. \n\n"
."--$boundary\n"
."Content-Type: text/plain\n";
."Content-Transfer-Encoding: 8bit\n\n"
.$message . "\n\n\n--$boundary";
$data = "Content-Type: $type"."; name = \"$filename\"\n"
."Content-Transfer-Encoding: $encoding"
."\n\n$filedata\n";
$mailbody .= "\n$data\n--$boundary"
."--\n";
//send mail
mail($mailto, $subject , ' ', $mailbody) or die ('Could not send email!');
attached mail follows:
do you want to send a file via mail (mime-type of the file?) or do you want to attach the file to a mail (multipart?)?
the mail-format is defined in rfc2045 and following. but if you don't want to build your own function, there are good mime-mail-classes out there. (e.g. http://www.phpguru.org/mime.mail.html)
ciao SVEN
"Szparag" <szparag
tlen.pl> schrieb im Newsbeitrag news:3F0BFA33.000008.01616
przemek-ya7p6ek...
i know that in mail-form i need <input type=file name=attach>
but i don't know how to write message headers to send file with e-mail.
please help me.
szparag.
____________________________________________________
IncrediMail - Email has finally evolved - Click Here
attached mail follows:
ok.
i have those classes.
but if it is possible i would like to send message with file
attachment without using classes.
i know that it should look something like:
in form : <input type=file name=attach>
in script run be something like:
if (is_uploaded_file($attach))
{
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: ".$attach_type."; name=".$attach_name.";
Content-Disposition: attachment";
$headers .= "X-Attach: $attach";
}
but it doesn't work.i miss something.
szparag
attached mail follows:
From your question, it seems you're more concerned with how to get
the file from the user to the server. To upload a file, you need the
following format for your web form:
<form action="upload.php" method="post"
enctype="multipart/form-data">
Upload file: <input type="file" name="upfile"><br>
<input type="submit" value="submit">
</form>
That will let you move the file to the server. How you email it from
their is a whole 'nuther matter.
--- szparag <szparag
tlen.pl> wrote:
> ok.
>
> i have those classes.
> but if it is possible i would like to send message with file
> attachment without using classes.
>
> i know that it should look something like:
> in form : <input type=file name=attach>
>
> in script run be something like:
>
>
> if (is_uploaded_file($attach))
> {
> $headers .= "MIME-Version: 1.0\r\n";
>
> $headers .= "Content-Type: ".$attach_type.";
> name=".$attach_name.";
> Content-Disposition: attachment";
> $headers .= "X-Attach: $attach";
> }
>
>
> but it doesn't work.i miss something.
>
> szparag
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
Mark Weinstock
mark_weinstock
yahoo.com
***************************************
You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing.
***************************************
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
attached mail follows:
Also note that the uploaded file will be in the $_FILES[] array.
http://us4.php.net/features.file-upload
--- Mark <mark_weinstock
yahoo.com> wrote:
> From your question, it seems you're more concerned with how to get
> the file from the user to the server. To upload a file, you need
> the
> following format for your web form:
>
> <form action="upload.php" method="post"
> enctype="multipart/form-data">
> Upload file: <input type="file" name="upfile"><br>
> <input type="submit" value="submit">
> </form>
>
> That will let you move the file to the server. How you email it
> from
> their is a whole 'nuther matter.
>
>
>
> --- szparag <szparag
tlen.pl> wrote:
> > ok.
> >
> > i have those classes.
> > but if it is possible i would like to send message with file
> > attachment without using classes.
> >
> > i know that it should look something like:
> > in form : <input type=file name=attach>
> >
> > in script run be something like:
> >
> >
> > if (is_uploaded_file($attach))
> > {
> > $headers .= "MIME-Version: 1.0\r\n";
> >
> > $headers .= "Content-Type: ".$attach_type.";
> > name=".$attach_name.";
> > Content-Disposition: attachment";
> > $headers .= "X-Attach: $attach";
> > }
> >
> >
> > but it doesn't work.i miss something.
> >
> > szparag
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> =====
> Mark Weinstock
> mark_weinstock
yahoo.com
> ***************************************
> You can't demand something as a "right" unless you are willing to
> fight to death to defend everyone else's right to the same thing.
> ***************************************
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
Mark Weinstock
mark_weinstock
yahoo.com
***************************************
You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing.
***************************************
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
attached mail follows:
> On Tue, 2003-07-08 at 07:21, Steve Jackson wrote:
> > If I set permissions of my server root to chmod 777 that's
> a security
> > risk right? How do I set my server to allow me to write a
> file to my
> > web root from another directory using PHP? Or is it a Unix problem?
> >
> > I have a generator file writes a string to a text file and then
> > renames the text file as a PHP file however it occurred to
> me while I
> > was doing this that chmod 777 the root might not be a good idea.
> >
> > Anyone have a simple fix or idea for this?
>
> Change the ownership on the directory to whichever user
> apache is running as (this is the User directive in your
> httpd.conf file). Then you can restrict the permissions on
> that directory. You could probably make it 600 if you want.
Can this be done automatically with PHP?
I want a file to be written to the root directory by PHP and not have to
get the web server admin to change ownership privaleges on the root.
Basically does anyone know how to get PHP to see what the server name
and group is and then assign the writing rights to the script?
This will allow me to generate a file on the fly.
attached mail follows:
On Wednesday 09 July 2003 19:29, Steve Jackson wrote:
> > Change the ownership on the directory to whichever user
> > apache is running as (this is the User directive in your
> > httpd.conf file). Then you can restrict the permissions on
> > that directory. You could probably make it 600 if you want.
>
> Can this be done automatically with PHP?
>
> I want a file to be written to the root directory by PHP and not have to
> get the web server admin to change ownership privaleges on the root.
Think about it, permissions are there for a reason -- to prevent users from
doing what they shouldn't be doing.
> Basically does anyone know how to get PHP to see what the server name
> and group is and then assign the writing rights to the script?
Run the script as root. Not recommended, unless you know what you're doing.
> This will allow me to generate a file on the fly.
But _why_ do you need to write to the root directory? Why not just write to a
directory where you *do* have permission to write to?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The University of California Statistics Department; where mean is normal,
and deviation standard.
*/
attached mail follows:
Use this class:
http://phpclasses.web4u.cz/browse.html/package/767.html
and insert_bitmap() method of a Worksheet object.
jan wrote:
> Hi there!
>
> I'd like to ask if there is any work-around available for saving
> picture(s) (BMP/JPG/PNG) in *.xls file.
>
> I need to create (using PHP) dynamically xls file with some pictures in
> it.
>
> thanks
>
> Jan
>
>
attached mail follows:
Hi !
thanks.
yes, that's the solution for BMP files. I would prefer using PNG of JPG
format. Is it possible ?
Jan
On Wed, 2003-07-09 at 13:34, Marek Kilimajer wrote:
> Use this class:
> http://phpclasses.web4u.cz/browse.html/package/767.html
> and insert_bitmap() method of a Worksheet object.
>
>
> jan wrote:
>
> > Hi there!
> >
> > I'd like to ask if there is any work-around available for saving
> > picture(s) (BMP/JPG/PNG) in *.xls file.
> >
> > I need to create (using PHP) dynamically xls file with some pictures in
> > it.
> >
> > thanks
> >
> > Jan
> >
> >
>
attached mail follows:
You can explore the possibility of Web Archives. This is how a web
archive starts:
MIME-Version: 1.0
X-Document-Type: Worksheet
Content-Type: multipart/related; boundary="----=_NextPart_01C3461B.AE5C1F00"
This document is a Web archive file. If you are seeing this message,
this means your browser or editor doesn't support Web archive files.
For more information on the Web archive format, go to
http://officeupdate.microsoft.com/office/webarchive.htm
------=_NextPart_01C3461B.AE5C1F00
Content-Location: file:///C:/8B52764B/obrazok.htm
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="windows-1250"
<html xmlns:v=3D"urn:schemas-microsoft-com:vml"
xmlns:o=3D"urn:schemas-microsoft-com:office:office"
xmlns:x=3D"urn:schemas-microsoft-com:office:excel"
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dwindows-125=
0">
<meta name=3DProgId content=3DExcel.Sheet>
<meta name=3DGenerator content=3D"Microsoft Excel 10">
... and so goes the head tag.
<body>
<div id=3D"obrazok_11330" align=3Dcenter x:publishsource=3D"Excel">
<table x:str border=3D0 cellpadding=3D0 cellspacing=3D0 width=3D512 style=
=3D'border-collapse:
collapse;table-layout:fixed;width:384pt'>
<col width=3D64 span=3D8 style=3D'width:48pt'>
<tr height=3D17 style=3D'height:12.75pt'>
<td height=3D17 class=3Dxl1511330 width=3D64
style=3D'height:12.75pt;widt=
h:48pt'>halo</td>
.....
As you can see it is a simple mime multipart message with some html tags
in it, there are plenty of classes that can help you to build this.
Image will be in another part. Also check out the above mentioned link.
jan wrote:
> Hi !
>
> thanks.
> yes, that's the solution for BMP files. I would prefer using PNG of JPG
> format. Is it possible ?
>
> Jan
attached mail follows:
I have a script that contains style sheets and I can't seem to link it on my
Windows 2000 IIS server. It works perfectly fine on my Windows XP IIS server.
Here is what I am trying to do. The index.php file (which links to the style
sheets) is located in the MyScript folder and inside that folder is another
folder called themes (where the style sheets are located). I am doing the
following, which works fine on a Windows XP IIS server, but not my Windows
2000.
// Path to script files (absolute file path)
$HomeDir = "c:/inetpub/wwwroot/MyScript/";
// Name of style folder
$ThemeFolder = "default";
//--- Then later in the page, I link the style sheet like this ---//
echo "
<link rel='stylesheet' type='text/css'
href='".$HomeDir."themes/".$ThemeFolder."/style.css'>
";
Like I said before, the style sheets load up fine on my Windows XP IIS server,
but not the Windows 2000. In order to get it to work on the Windows 2000 IIS
server, I have to link the style sheets relative to the folder I am working
in, but I want to be able to move certain files into other directories without
manually linking each one, so that's why I am linking them from the absolute
home directory.
Is there some setting in the php.ini file that deals with this? If anyone has
suggestions, please let me know. I assume the above code would work on Linux
systems without problems (given the correct home directory path). Can anyone
verify this? Thanks a lot.
Matt
attached mail follows:
Hello,
This is a reply to an e-mail that you wrote on Wed, 9 Jul 2003 at 12:51,
lines prefixed by '>' were originally written by you.
> // Path to script files (absolute file path)
> $HomeDir = "c:/inetpub/wwwroot/MyScript/";
> // Name of style folder
> $ThemeFolder = "default";
> //-Then later in the page, I link the style sheet like this ---//
> echo "
> <link rel='stylesheet' type='text/css'
> href='".$HomeDir."themes/".$ThemeFolder."/style.css'>
Doing this will mean that your script will only work correctly when viewed
on webserver computer. Remote browsers will not be able to access the
style sheet as you are referencing it as a file on your server machine.
Is this what you intended?
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)
attached mail follows:
In PHP4.3.x
If I set a cookie with setcookie and send a location header immediately.
I find no problem for the task.
That is,
<?php
setcookie("testcookie","teststr",time()+360000);
header ("Location:nextpage.php");
?>
And testcookie can be found in the latter page.
However, I can't In PHP4.1.x
What's the problem?
A compromised method of using meta refresh of zero second is used.
attached mail follows:
Thanks to all who posted.
Well, I managed to track down the problem. The PHP system was set to use
/tmp for its session.save_path but there was no /tmp directiory.
Strange because on my test site I don't have a /tmp directory... I'm
guessing my ISP has taken care of that separately.
Anyway I created a tmp folder and everything seems fine.
Thanks again.
Dave
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003
attached mail follows:
I've got a problem. I have a form that the user fills out and then
hits submit on and it sends an e-mail. My problem is that I have one
AOL user that claims that when ever he goes back to the form, it
doesn't present the form - it just sends the message. It appears that
for some reason $HTTP_POST_VARS["EMAIL"] has a default value or it's a
cache issue. Any ideas????
Here is the psudo-code...
if( ! isset( $HTTP_POST_VARS["EMail"] ) ) {
<form method="POST" onsubmit="return validate(this)" name="MailForm">
// Rest of form stuff
} else {
// send message here
}
attached mail follows:
On Wed, 09 Jul 2003 07:00:38 -0500, you wrote:
>I've got a problem. I have a form that the user fills out and then
>hits submit on and it sends an e-mail. My problem is that I have one
>AOL user that claims that when ever he goes back to the form, it
>doesn't present the form - it just sends the message. It appears that
>for some reason $HTTP_POST_VARS["EMAIL"] has a default value or it's a
>cache issue. Any ideas????
>
>Here is the psudo-code...
>
>if( ! isset( $HTTP_POST_VARS["EMail"] ) ) {
The obvious thing to do is change all instances of "EMail" to "emailaddress"
or somesuch, and see if the problem still exists. Do you know anyone on AOL
who isn't having the problem?
Your guesses as to cause seem reasonable to me, but without an example of
their browser to test against, you're working blind.
> <form method="POST" onsubmit="return validate(this)" name="MailForm">
Hmm... or maybe AOL is doing something wacky with onsubmit()?
attached mail follows:
On Wed, 09 Jul 2003 13:23:59 +0100, David Otton wrote:
>On Wed, 09 Jul 2003 07:00:38 -0500, you wrote:
>
>>
>>if( ! isset( $HTTP_POST_VARS["EMail"] ) ) {
>
>The obvious thing to do is change all instances of "EMail" to "emailaddress"
>or somesuch, and see if the problem still exists. Do you know anyone on AOL
>who isn't having the problem?
Hmmm... I'll give that a try. And to the best of my knowledge this is
the ONLY user having the problem. I don't know for certain that others
are using AOL but I'm pretty sure they are and aren't having the
problem.
>Your guesses as to cause seem reasonable to me, but without an example of
>their browser to test against, you're working blind.
>
>> <form method="POST" onsubmit="return validate(this)" name="MailForm">
>
>Hmm... or maybe AOL is doing something wacky with onsubmit()?
Could be!
attached mail follows:
Hi List
Firstly, thanks for the replies and mostly for the accommodating
attitude to this, arguable non-PHP subject.
I don't want this thread to become a flame war on why one should use
XML, or why not.
I do have personal issues wrt XML and the way it works, and although I
cannot *yet* see the need, it doesn't mean that there isn't one.
My original post should have made this clear, but it seems it didn't.
I have laid to rest my reservations wrt XML, and am more interested in
understanding the entire process in the hope that 1) I will "see" the
need, and 2) understand how all those XML jargon fits together ( XML,
XSL, XSLT, DTD, DOMXML, phew...)
That was why I gave a brief summary of where I am atm wrt understanding
what it is.
What I still don't know much about, and at last, this is where the PHP
comes in, is once I have this XML file, whereto from here using PHP (
you see, it should be clear that I want to use PHP as my "one and only"
trusty tool.
As I stated, and correct me, the XML file contains the structured data,
and the XSL file contains the "look and feel" and the XSL file is
written in XSLT language.
My understanding is further that, again focused only on web applications
here, one would have an XML file in your web folder, along with it's XSL
file. These files would be "linked" by means of calls or references to
each other inside the files.
Having these two files (oh, and the dtd which can be used to verify the
XML, but doesn't seem necessary from what I can see), as I understand
it, gives the basis from where one would then parse the XML into XHTML
in order to actually "see" anything in a browser via one of two routes:
1) client side via the browser's built in XML parser -> arguably leaving
the old Netscape/IE gap wrt compatibility, or 2) server side parsing
with the built-in XML parser that comes with the webserver (IIS or
Apache in my case) -> with this approach being in my mind the "best" if
you want to make sure you don't run into browser issues.
This is where my PHP question really starts:
On apache.org they talk about the XML support of apache etc, and in the
PHP documentation there are lots of XML functions and yet more jargon
like DOMXML etc, which is not clear for me what to do now (should I
elect to parse server side).
If someone can just give me a quick and easy "tour" on what to do and
what is needed from here to actually parse and display the contents
correctly, I should have enough to keep me busy for a while, and
hopefully help me to increase my knowledge and understanding so I won't
ask stupid questions on this list ;)
Thanks again for the input.
On Wed, 2003-07-09 at 00:36, Ray Hunter wrote:
> I see that not many sites require the use of xml/xsl(t). Many sites can
> just use html and database to accomplish 99.9% of the work.
>
> I always suggest that when you have tons of data that you need to send
> to the user that it is a good idea. Especially now that xslt is growing
> up :)
>
> I like to use xml and xsl for various reasons, mainly i can really
> separate the logic and presentation. All data is keep in the xml file
> and presentation in the xsl file. So when i need to make changes in the
> presentation then i only change the xsl file and never really have to
> touch the logic (php) code. This is really, really great for some sights
> that are extremely complex.
>
> Also in php i can create standards that my xml files will follow (dtds,
> schema) and allowing me to create modules (functionality) very
> efficiently and timely.
>
> Also as mentioned xml provides a format for transfering data. However, i
> would not use it with databases unless it is large amounts of data.
> However, i have used xml for creating sql queries and setting up
> configureation files which are extremely reliabe.
>
> --
> BigDog
>
>
>
> On Tue, 2003-07-08 at 15:51, Jeff Harris wrote:
> > |-----Original Message-----
> > |From: Petre Agenbag [mailto:internet
vsa.co.za]
> > |Sent: Tuesday, July 08, 2003 6:27 AM
> > |To: php-general
lists.php.net
> > |Subject: [PHP] XML
> > |
> > |
> > |Hi List
> > |
> > |Firstly, this question is arguable more about XML than PHP, but they are
> > |interlinked, so I hope it is "topical" for this list.
> > |
> > |Firstly, Where I come from:
> > |
> > |I am VERY comfortable with PHP/MySQL on Linux and understand all those
> > |concepts.
> > |
> > |Now I'm trying to see the benefits of XML, and quite frankly, I just
> > |cannot see why one would want to use it...
> > |
> > [snip]
> >
> > On Jul 8, 2003, "Joe Harman" claimed that:
> >
> > |Okay Petre... You have asked the question that I always wanted to ask!!!
> > |I can't wait to see peoples answer... I simply can't find a use for it
> > |either....
> > |
> > |Joe
> >
> > This probably should be on another list, but it might give someone an idea
> > on how to create something in PHP. I've been trying to figure out if some
> > of what I'm doing would be good for XML. The answer for that is "no, use a
> > database."
> >
> > It seems to me, that XML is a way of encoding data for the transmission
> > between two processors. For example, the database uses XML to transfer
> > data to the PHP engine. The weather magnet uses XML to transmit
> > information to your PHP script, which parses it and produces the HTML
> > output. My page asks your script for some information, and it's returned
> > as well-formed XML.
> >
> > As far as using an XML file to act as a database and your parser to create
> > the HTML, it's probably better to use a database.
> >
> > Jeff
> > (my $.015 [after taxes] )
> > --
> > Registered Linux user #304026.
> > "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
> > Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
> > Responses to this message should conform to RFC 1855.
> >
> >
>
attached mail follows:
U should read the docs on domxml. There is alot of examples in there on
how to do that and xslt.
Here are tons of tutorials to on phpbuilder.com, phpbeginner.com.
--
BigDog
On Wed, 2003-07-09 at 06:02, Petre Agenbag wrote:
> Hi List
>
> Firstly, thanks for the replies and mostly for the accommodating
> attitude to this, arguable non-PHP subject.
>
> I don't want this thread to become a flame war on why one should use
> XML, or why not.
> I do have personal issues wrt XML and the way it works, and although I
> cannot *yet* see the need, it doesn't mean that there isn't one.
>
> My original post should have made this clear, but it seems it didn't.
>
> I have laid to rest my reservations wrt XML, and am more interested in
> understanding the entire process in the hope that 1) I will "see" the
> need, and 2) understand how all those XML jargon fits together ( XML,
> XSL, XSLT, DTD, DOMXML, phew...)
>
> That was why I gave a brief summary of where I am atm wrt understanding
> what it is.
>
> What I still don't know much about, and at last, this is where the PHP
> comes in, is once I have this XML file, whereto from here using PHP (
> you see, it should be clear that I want to use PHP as my "one and only"
> trusty tool.
>
> As I stated, and correct me, the XML file contains the structured data,
> and the XSL file contains the "look and feel" and the XSL file is
> written in XSLT language.
>
> My understanding is further that, again focused only on web applications
> here, one would have an XML file in your web folder, along with it's XSL
> file. These files would be "linked" by means of calls or references to
> each other inside the files.
>
> Having these two files (oh, and the dtd which can be used to verify the
> XML, but doesn't seem necessary from what I can see), as I understand
> it, gives the basis from where one would then parse the XML into XHTML
> in order to actually "see" anything in a browser via one of two routes:
> 1) client side via the browser's built in XML parser -> arguably leaving
> the old Netscape/IE gap wrt compatibility, or 2) server side parsing
> with the built-in XML parser that comes with the webserver (IIS or
> Apache in my case) -> with this approach being in my mind the "best" if
> you want to make sure you don't run into browser issues.
>
> This is where my PHP question really starts:
> On apache.org they talk about the XML support of apache etc, and in the
> PHP documentation there are lots of XML functions and yet more jargon
> like DOMXML etc, which is not clear for me what to do now (should I
> elect to parse server side).
>
> If someone can just give me a quick and easy "tour" on what to do and
> what is needed from here to actually parse and display the contents
> correctly, I should have enough to keep me busy for a while, and
> hopefully help me to increase my knowledge and understanding so I won't
> ask stupid questions on this list ;)
>
>
> Thanks again for the input.
>
>
>
>
> On Wed, 2003-07-09 at 00:36, Ray Hunter wrote:
> > I see that not many sites require the use of xml/xsl(t). Many sites can
> > just use html and database to accomplish 99.9% of the work.
> >
> > I always suggest that when you have tons of data that you need to send
> > to the user that it is a good idea. Especially now that xslt is growing
> > up :)
> >
> > I like to use xml and xsl for various reasons, mainly i can really
> > separate the logic and presentation. All data is keep in the xml file
> > and presentation in the xsl file. So when i need to make changes in the
> > presentation then i only change the xsl file and never really have to
> > touch the logic (php) code. This is really, really great for some sights
> > that are extremely complex.
> >
> > Also in php i can create standards that my xml files will follow (dtds,
> > schema) and allowing me to create modules (functionality) very
> > efficiently and timely.
> >
> > Also as mentioned xml provides a format for transfering data. However, i
> > would not use it with databases unless it is large amounts of data.
> > However, i have used xml for creating sql queries and setting up
> > configureation files which are extremely reliabe.
> >
> > --
> > BigDog
> >
> >
> >
> > On Tue, 2003-07-08 at 15:51, Jeff Harris wrote:
> > > |-----Original Message-----
> > > |From: Petre Agenbag [mailto:internet
vsa.co.za]
> > > |Sent: Tuesday, July 08, 2003 6:27 AM
> > > |To: php-general
lists.php.net
> > > |Subject: [PHP] XML
> > > |
> > > |
> > > |Hi List
> > > |
> > > |Firstly, this question is arguable more about XML than PHP, but they are
> > > |interlinked, so I hope it is "topical" for this list.
> > > |
> > > |Firstly, Where I come from:
> > > |
> > > |I am VERY comfortable with PHP/MySQL on Linux and understand all those
> > > |concepts.
> > > |
> > > |Now I'm trying to see the benefits of XML, and quite frankly, I just
> > > |cannot see why one would want to use it...
> > > |
> > > [snip]
> > >
> > > On Jul 8, 2003, "Joe Harman" claimed that:
> > >
> > > |Okay Petre... You have asked the question that I always wanted to ask!!!
> > > |I can't wait to see peoples answer... I simply can't find a use for it
> > > |either....
> > > |
> > > |Joe
> > >
> > > This probably should be on another list, but it might give someone an idea
> > > on how to create something in PHP. I've been trying to figure out if some
> > > of what I'm doing would be good for XML. The answer for that is "no, use a
> > > database."
> > >
> > > It seems to me, that XML is a way of encoding data for the transmission
> > > between two processors. For example, the database uses XML to transfer
> > > data to the PHP engine. The weather magnet uses XML to transmit
> > > information to your PHP script, which parses it and produces the HTML
> > > output. My page asks your script for some information, and it's returned
> > > as well-formed XML.
> > >
> > > As far as using an XML file to act as a database and your parser to create
> > > the HTML, it's probably better to use a database.
> > >
> > > Jeff
> > > (my $.015 [after taxes] )
> > > --
> > > Registered Linux user #304026.
> > > "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
> > > Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
> > > Responses to this message should conform to RFC 1855.
> > >
> > >
> >
>
attached mail follows:
Does anyone know of any articles on integrating PHP, MySQL and Flash to
perform a drag and drop routine for updating a db?
Specifically, I have a client who is _INSISTING_ that I integrate a drag and
drop feature into his railcar storage application. He wants to be able to
view two railcar storage tracks, Track A and Track B, then drag and drop
cars from Track A to Track B ( or Track B to Track A ). Once he positions (
orders ) all the cars properly on each track, I need to update a MySQL db to
reflect the changes.
I have already developed the above feature so that he can do this
'textually', but he is _determined_ that he must have the graphic 'drag and
drop' feature.
There may be another method ( Javascript ? ) to accomplish the same effect.
I am certainly open to any advice and/or opinions. Any pointers would be
_greatly_ appreciated.
Thanks,
Randy Rankin
attached mail follows:
Why don't you just write a program in Java? It would be simple to do,
wouldn't require Flash, and might make your life easier.
-Dan
attached mail follows:
Might want to look at: http://polar-lights.com/en/
-----Original Message-----
From: Rankin, Randy [mailto:randy.rankin
invensys.com]
Sent: Wednesday, July 09, 2003 5:30 AM
To: 'php-general
lists.php.net'
Subject: [PHP] PHP, MySQL and Flash
Does anyone know of any articles on integrating PHP, MySQL and Flash to
perform a drag and drop routine for updating a db?
Specifically, I have a client who is _INSISTING_ that I integrate a drag
and
drop feature into his railcar storage application. He wants to be able
to
view two railcar storage tracks, Track A and Track B, then drag and drop
cars from Track A to Track B ( or Track B to Track A ). Once he
positions (
orders ) all the cars properly on each track, I need to update a MySQL
db to
reflect the changes.
I have already developed the above feature so that he can do this
'textually', but he is _determined_ that he must have the graphic 'drag
and
drop' feature.
There may be another method ( Javascript ? ) to accomplish the same
effect.
I am certainly open to any advice and/or opinions. Any pointers would be
_greatly_ appreciated.
Thanks,
Randy Rankin
attached mail follows:
Randy,
Flash is so damned graphically oriented, but the graphic bits aren't
necessarily connected to bits of data ...
I'm just talking off the top of my head here .... w/o knowing any specifics
of your requirements.
Assuming you have n cars, then two tracks would have to be created, each
with n track elements. I guess these would be an array of movie clips.
Then a set of "car" movie clips would be created, each car loaded with the
information necessary, at a minimum, to uniquely identify it.
These get loaded on to one track, each car superimposed over a track element.
Then the cars can be dragged to the appropriate places on the "tracks".
When everything is positioned just so, then clicking "Update" would process
each track array, updating the database with the car and track-position data.
So, having blabbered on, I'm not much wiser. but this is much like a puzzle
game isn't it? How do the Flash games store their state?
It would also be nice to be able to shove a car in between two other cars.
So, if this model works, the bottom layer (scene?) has to be able to
identify what overlies it.
Try posting this on FlashCoders.
Cheers - Miles
At 07:30 AM 7/9/2003 -0500, Rankin, Randy wrote:
>Does anyone know of any articles on integrating PHP, MySQL and Flash to
>perform a drag and drop routine for updating a db?
>
>Specifically, I have a client who is _INSISTING_ that I integrate a drag and
>drop feature into his railcar storage application. He wants to be able to
>view two railcar storage tracks, Track A and Track B, then drag and drop
>cars from Track A to Track B ( or Track B to Track A ). Once he positions (
>orders ) all the cars properly on each track, I need to update a MySQL db to
>reflect the changes.
>
>I have already developed the above feature so that he can do this
>'textually', but he is _determined_ that he must have the graphic 'drag and
>drop' feature.
>
>There may be another method ( Javascript ? ) to accomplish the same effect.
>I am certainly open to any advice and/or opinions. Any pointers would be
>_greatly_ appreciated.
>
>Thanks,
>
>Randy Rankin
attached mail follows:
Hi, Let's get right to it...
When I try to do this:
<?
echo $_COOKIE['test.1'];
?>
It doesn't work (needless to say there is a cookie that goes by this name)
So, when I did this:
<?
foreach($_COOKIE as $cook => $val) {
echo $val ." -> " .$cook ."<br>";
}
?>
I got:
ec1c9edd209143432f36fsd29af410ef27 -> test_1
Notice the _ (underscore) instead of . (dot)
So I though that you couldn't have dots in your array names... Just to
be sure I wrote a small test program like this:
<?
$d['donald.1'] = "Donald duck";
echo $d['donald.1'];
?>
This however gave me the output:
Donald duck
# /usr/local/jail/apache/bin/php -v
PHP 4.3.1 (cli) (built: Apr 2 2003 11:25:25)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
So... anyone know what's up?
--
Marcus Hufvudsson
Artech administrator
Office: +46-500-427788
Email: admin
artech.se
attached mail follows:
> So I though that you couldn't have dots in your array names... Just to
> be sure I wrote a small test program like this:
[snip]
> So... anyone know what's up?
I believe that if you do it manually in a script, it works fine. But if PHP
gets/sets the value from POST, GET, COOKIE, etc. it converts the dot
to an underscore.
Using the same test script (using donald.1), store it in a cookie and then
retrieve it. Send it as POST or GET then try to display the value. Really
good odds are that the dot will be converted. Again, I belive this is in
the documentation, but I can't rightly remember where. :|
Chris
attached mail follows:
> -----Original Message-----
> From: Marcus Hufvudsson [mailto:talos
artech.se]
> Sent: 09 July 2003 13:56
>
> Hi, Let's get right to it...
> When I try to do this:
>
> <?
> echo $_COOKIE['test.1'];
> ?>
>
> It doesn't work (needless to say there is a cookie that goes
> by this name)
>
> So, when I did this:
>
> <?
> foreach($_COOKIE as $cook => $val) {
> echo $val ." -> " .$cook ."<br>";
> }
> ?>
>
> I got:
> ec1c9edd209143432f36fsd29af410ef27 -> test_1
>
> Notice the _ (underscore) instead of . (dot)
Because, when register_globals is set to On, the names of all GET, POST and
COOKIE parameters will be used as variable names, they may only contain
characters which are legal in PHP variable names. PHP automagically
converts all other characters to _ on the fly as they are loaded into the
$_GET, $_POST and $_COOKIE arrays and, if register_globals is set, the
equivalent global variables.
> So I though that you couldn't have dots in your array
> names...
There's no problem with this -- it's purely that GET, POST and COOKIE names
must conform to PHP variable naming rules.
This is documented, if somewhat minimally, at
http://uk2.php.net/manual/en/language.variables.external.php#language.variab
les.external.dot-in-names.
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: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
The code below is suppose to replace some images and links but when I run it
the page just seems to hang and eventually times out.
Am I Looping somewhere and not realising it?
Thanks
Zac
$i = $c01_1;
$imgLst = '';
function imgRplc($val){
global $imgLst;
global $i;
$imgLst .= "<div class=\"figTtl\">Fig. $i</div><img src=\"$val[1]\" />,";
return '<div class="fig">(Fig.'.$i.')</div>';
}
// first remove pics and add a reference to the end of the doc for those
that are required
while(preg_match("/<img type=\"reg\" src/",$disp)){
$disp = preg_replace_callback("/<img type=\"reg\" src=\"(.+)\" alt=(.+)
\/>/i", 'imgRplc', $disp,1);
$i++;
}
// now remove all other pics
$disp = preg_replace("/<img (.+) \/>/i", '', $disp);
// remove bigPic links target="bigPic"
$disp = preg_replace("/<a (.+) target=\"bigPic\">(.+)<\/a>/i", '\\2',
$disp);
// next find shopping links and mark up
$disp = preg_replace("/<a href=\"(.+)\"(.*)>(.+)<\/a>/i", '<div
class="shpLnk">Link to: \\3 (Enter into your browser:
http://www.lasersailing.com\\1)</div>', $disp);
// remove paragraphs
$disp = preg_replace("/<\/p>(\s*)<p>/i", '<br /><br />', $disp);
$disp = preg_replace("/<p>/i", '', $disp);
$disp = preg_replace("/<\/p>/i", '', $disp);
echo $disp;
attached mail follows:
On Wednesday 09 July 2003 21:12, Zac Hillier - Net Affectors wrote:
> The code below is suppose to replace some images and links but when I run
> it the page just seems to hang and eventually times out.
>
> Am I Looping somewhere and not realising it?
print $i to find out?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
FORTUNE'S RULES TO LIVE BY: #2
Never goose a wolverine.
*/
attached mail follows:
I have a table like this:
------------------------------------------------------------------------------------
- product_id - mark_name - category_name -
------------------------------------------------------------------------------------
- 1 - aaa - catg 1 -
- 2 - bbb - catg 2 -
- 3 - aaa - catg 1 -
- 4 - ddd - catg 1 -
- 5 - bbb - catg 2 -
------------------------------------------------------------------------------------
and so on
I want to show all the mark_name in a category only once (if they more than once)
I have this code:
......
$sql = "SELECT * FROM products, category WHERE category.name_category=products.name_category and
category_id=".$_GET['category_id'] ;
$rezultat = mysql_query($sql);
while ($row=mysql_fetch_array($rezultat))
{
echo "<b>Name:</b> ".$row["mark_name"]."<br>\n";
}
..........
When i choose the category catg 1 the result is
Name: aaa
Name: aaa
Name: ddd
As you can see the name aaa appears 2 times insted 1.
How to make the result look like this:
Name: aaa
Name: ddd
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Le Mercredi 9 Juillet 2003 15:13, phpu a écrit :
> I have a table like this:
> ......
> $sql = "SELECT * FROM products, category WHERE
> category.name_category=products.name_category and
> category_id=".$_GET['category_id'] ;
>
> When i choose the category catg 1 the result is
> Name: aaa
> Name: aaa
> Name: ddd
>
> As you can see the name aaa appears 2 times insted 1.
> How to make the result look like this:
> Name: aaa
> Name: ddd
Use "GROUP BY" ....
$sql = "SELECT * FROM products, category WHERE
category.name_category=products.name_category and
category_id=".$_GET['category_id'] GROUP BY products.mark_name;
- --
,,
(°> Nicolas Costes
/|\ IUT de La Roche / Yon
( ^ ) Clé publique: http://www.keyserver.net/
^ ^ http://www.gnu.org/philosophy/can-you-trust.fr.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ
OgayWbAh0cOXc5OCdVy2uWs=
=vH6U
-----END PGP SIGNATURE-----
attached mail follows:
It isn't work. it gives me an error at this line.
----- Original Message -----
From: "Nicolas Costes" <nicolas.costes
iut-laroche.univ-nantes.fr>
To: <php-general
lists.php.net>
Sent: Wednesday, July 09, 2003 4:49 PM
Subject: Re: [PHP] Big problem....need help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Le Mercredi 9 Juillet 2003 15:13, phpu a écrit :
> I have a table like this:
> ......
> $sql = "SELECT * FROM products, category WHERE
> category.name_category=products.name_category and
> category_id=".$_GET['category_id'] ;
>
> When i choose the category catg 1 the result is
> Name: aaa
> Name: aaa
> Name: ddd
>
> As you can see the name aaa appears 2 times insted 1.
> How to make the result look like this:
> Name: aaa
> Name: ddd
Use "GROUP BY" ....
$sql = "SELECT * FROM products, category WHERE
category.name_category=products.name_category and
category_id=".$_GET['category_id'] GROUP BY products.mark_name;
- --
,,
(°> Nicolas Costes
/|\ IUT de La Roche / Yon
( ^ ) Clé publique: http://www.keyserver.net/
^ ^ http://www.gnu.org/philosophy/can-you-trust.fr.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ
OgayWbAh0cOXc5OCdVy2uWs=
=vH6U
-----END PGP SIGNATURE-----
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
try like this
$sql = "SELECT * FROM products, category WHERE category
name_category=products.name_category and category_id=".$_GET['category_id'].
GROUP BY products.mark_name";
-------Original Message-------
From: phpu
Date: Wednesday, July 09, 2003 09:51:08 PM
To: nicolas.costes
iut-laroche.univ-nantes.fr
Cc: php-general
lists.php.net
Subject: Re: [PHP] Big problem....need help
It isn't work. it gives me an error at this line.
----- Original Message -----
From: "Nicolas Costes" <nicolas.costes
iut-laroche.univ-nantes.fr>
To: <php-general
lists.php.net>
Sent: Wednesday, July 09, 2003 4:49 PM
Subject: Re: [PHP] Big problem....need help
-----BEGIN PGP SIGNED MESSA