php-general Digest 21 Jan 2005 12:10:25 -0000 Issue 3240
Topics (messages 206900 through 206923):
Re: [PHP-DB] php5 busts php4 code
206900 by: Jochem Maas
For HomeSite users...
206901 by: Daevid Vincent
206902 by: daniel.electroteque.org
206906 by: Danny Brow
206911 by: daniel.electroteque.org
Re: mkdir security concern
206903 by: kids_pro
Re: Upgrading PHP 4.2.2 on Red Hat 9
206904 by: Bret Hughes
Re: debugging modules
206905 by: Rasmus Lerdorf
Re: [suspicious - maybe spam] [PHP] Re: How to access remote files with php?
206907 by: Sephiroth
Re: .Net Web services
206908 by: Jonel Rienton
Re: Search engine
206909 by: Jordi Canals
206916 by: Raj Shekhar
Re: Best way to encode?
206910 by: Sephiroth
Extending a Class
206912 by: Phillip S. Baker
Allow users to upload images to directory
206913 by: Tim Burgan
206914 by: Greg Donald
Re: too slow to unset big array (after mem fragment)
206915 by: Xuefer Tinys
Re: Hidden Images.
206917 by: Paul Birnstihl
Re: php 5 interfaces
206918 by: Sergio Gorelyshev
Re: php 5 interfaces]
206919 by: Jochem Maas
206921 by: Sergio Gorelyshev
Re: DOM->removeChild Problem
206920 by: Mike Blank
if then else short form
206922 by: Ben Edwards
206923 by: Richard Davey
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 ---
Hassan Ebrahimi-Nuyken wrote:
Thank you Martin & Richard,
First Richard's question:
I am using the preconfigured binary install package
for Mac OS X 10.3.7 from Marc Liyanage at:
http://www.entropy.ch/
It has support for mysql compiled into it with
the mysql client library ver. 4.1.3beta as
if he's using MySQL 4.1.x should he be using the mysqli_*() functions
instead of the mysql_*() functions?
--- End Message ---
--- Begin Message ---
OMG!
This is quite possibly the coolest thing I've found in a while, and it
breathes new life into my aging HomeSite+ v5.2 (now that Macromedia isn't
really updating it and is focusing more on their DreamWeaver line).
http://www.wilk4.com/asp4hs/installation.htm#parser
http://www.wilk4.com/asp4hs/dnld/php5_parser_js.zip
http://www.wilk4.com/asp4hs/list2.htm
Just look around all those links and you will find an abundance of useful
toolbars, PHP5 color coders, snippets, context manuals, etc. I nearly
spooged on myself when I came across this today. (no pun intended)
"Jeremy Swinborne" <[EMAIL PROTECTED]> created a PHP5 color coding .scc
file that is just a life saver. It fixes many of the short comings of the
default PHP4 color coder. It handles stuff like:
echo "\"this is embeded $variable in my output\""; and it knows about
classes!
daevid.com
--- End Message ---
--- Begin Message ---
I havent used Homesite in years, I am now an Eclipse advocate :)
www.phpeclipse.org :)
> OMG!
>
> This is quite possibly the coolest thing I've found in a while, and it
> breathes new life into my aging HomeSite+ v5.2 (now that Macromedia
> isn't really updating it and is focusing more on their DreamWeaver
> line).
>
> http://www.wilk4.com/asp4hs/installation.htm#parser
>
> http://www.wilk4.com/asp4hs/dnld/php5_parser_js.zip
>
> http://www.wilk4.com/asp4hs/list2.htm
>
> Just look around all those links and you will find an abundance of
> useful toolbars, PHP5 color coders, snippets, context manuals, etc. I
> nearly spooged on myself when I came across this today. (no pun
> intended)
>
> "Jeremy Swinborne" <[EMAIL PROTECTED]> created a PHP5 color coding
> .scc file that is just a life saver. It fixes many of the short comings
> of the default PHP4 color coder. It handles stuff like:
>
> echo "\"this is embeded $variable in my output\""; and it knows about
> classes!
>
>
> daevid.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
.org don't work but www.phpeclipse.de does.
Dan.
On Fri, 2005-01-21 at 12:06 +1100, [EMAIL PROTECTED] wrote:
> I havent used Homesite in years, I am now an Eclipse advocate :)
>
> www.phpeclipse.org :)
>
>
> > OMG!
> >
> > This is quite possibly the coolest thing I've found in a while, and it
> > breathes new life into my aging HomeSite+ v5.2 (now that Macromedia
> > isn't really updating it and is focusing more on their DreamWeaver
> > line).
> >
> > http://www.wilk4.com/asp4hs/installation.htm#parser
> >
> > http://www.wilk4.com/asp4hs/dnld/php5_parser_js.zip
> >
> > http://www.wilk4.com/asp4hs/list2.htm
> >
> > Just look around all those links and you will find an abundance of
> > useful toolbars, PHP5 color coders, snippets, context manuals, etc. I
> > nearly spooged on myself when I came across this today. (no pun
> > intended)
> >
> > "Jeremy Swinborne" <[EMAIL PROTECTED]> created a PHP5 color coding
> > .scc file that is just a life saver. It fixes many of the short comings
> > of the default PHP4 color coder. It handles stuff like:
> >
> > echo "\"this is embeded $variable in my output\""; and it knows about
> > classes!
> >
> >
> > daevid.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
>
> .org don't work but www.phpeclipse.de does.
>
Sorry yeh , anyway it took me a while to change, but with all the added
plugins i now have a cooolIDE which does cvs, debugging, xml, html, xsl
testing, db schema, db
modeller, uml, java, tomcat,team syncing, the list goes on. One thing i cant
manage to do yet is
generate phpdocs aswell asimport project to cvs , still have to do that via
command line :|
May get my hands dirty and build a phpdoc java plugin :)
--- End Message ---
--- Begin Message ---
So your suggestion is that I should create an ftp account and use this
account to create folder structure for user right?
I still not sure about the permission to set.
If I set 0755 how do OS know who is the owner?
May be I think too much. But let say I use ftp account: ftp1 to create
folder structure
That mean owner is ftp1 user right? And then later I use PHP file upload
script to upload image to user folders what will happen?
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> kids_pro wrote:
>> Hi there,
>>
>> I want to create a script.
>> When user register I want to create a folder :
>> users\<new_user_folder>\images
>> The purpose is that I want to allow them to upload image to this image
>> folders.
>>
>> What sort of permission should I give to each folder
>> Root: users, <new_user_folders>, and images folder.
>>
>
> The least necessary. That depends on your server setup, primarily the user
> id your scripts are run under (mod_php/cgi or suexec). You might want to
> use ftp functions to create the directories if they would be created with
> apache as the owner otherwise.
--- End Message ---
--- Begin Message ---
On Thu, 2005-01-20 at 18:12, James Butler wrote:
> Greetings,
>
> Has anyone successfully upgraded a PHP 4.2.2 installation on a
> Red Hat 9 machine to a more secure version?
>
> I just want any more-secure version of PHP than 4.2.2, but it's looking
> like I'll have to use Fedora or Gentoo or Mandrake or something in order
<snip>
> Thanks in advance for ANY help at all.
>
Redhat used to do a pretty good job of backporting security issues and I
am assuming that fedoralegacy.org is still doing it. There are php rpms
out there dated October so I it looks like to me they are trying to keep
up.
http://download.fedoralegacy.org/redhat/9/updates/i386/
you might take a look at the changelog to see if the fix you are worried
about is there.
Bret
--- End Message ---
--- Begin Message ---
Arshavir Grigorian wrote:
Hi,
I am having trouble debugging a PECL module (APC) because while I am
able to --enable-debug when configuring the PHP course, I cannot do the
same for APC (no such configure option). Does anyone know how to do that?
PHP Warning: Unknown(): apc: Unable to initialize module\nModule
compiled with module API=20020429, debug=0, thread-safety=0\nPHP
compiled with module API=20020429, debug=1, thread-safety=0\nThese
options need to match\n in Unknown on line 0
You need to make install after compiling PHP with --enable-debug to get
phpize and php-config to inherit the debug flag which will cause apc to
be built with debug mode when you run phpize in the apc directory.
-R
--- End Message ---
--- Begin Message ---
The error message:
HTTP/1.0 400 Bad Request Server: squid/2.5.STABLE5 Mime-Version: 1.0 Date:
Fri, 21 Jan 2005 01:48:05 GMT Content-Type: text/html Content-Length: 1213
Expires: Fri, 21 Jan 2005 01:48:05 GMT X-Squid-Error: ERR_INVALID_URL 0
X-Cache: MISS from ns1.autoera.com.tw X-Cache-Lookup: NONE from
ns1.autoera.com.tw:3128 Proxy-Connection: close
ERROR
The requested URL could not be retrieved
--- End Message ---
--- Begin Message ---
any more details?
On Tue, 18 Jan 2005 11:06:16 +1000, Michael Leung wrote
> Hi all,
> I have a parameter passing problem by using PHP SOAP extension.
> .Net web services seem not to be read the parameters.
>
> yours,
> Michael
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Jonel Rienton
http://jonel.road14.com
--- End Message ---
--- Begin Message ---
On Thu, 20 Jan 2005 14:04:44 +0200, Rosen <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Can someone recommend me a search engine script in PHP for inside one site?
>
http://www.phpdig.net/
Regards,
Jordi
--- End Message ---
--- Begin Message ---
"Rosen" <[EMAIL PROTECTED]> writes:
> Hi,
> Can someone recommend me a search engine script in PHP for inside one site?
If you need to index through static pages phpdig can be useful for you
http://www.phpdig.net/
--- End Message ---
--- Begin Message ---
in HTML with HTTP_GET, you can use:
xxx.href = "my.php?data="+encodeURI(escape("...foreign strings..."));
my.php:
$data = uniDecode($_GET["data"]);
echo $data;
function uniDecode($sText) {
$sData = preg_replace_callback("/%u[0-9A-Za-z]{4}/",toUtf8, $sText);
return unescape($sData);
}
function toUtf8($ar) {
$c = "";
foreach($ar as $val) {
$val = intval(substr($val,2),16);
if($val < 0x7F){ // 0000-007F
$c .= chr($val);
}
elseif ($val < 0x800) { // 0080-0800
$c .= chr(0xC0 | ($val / 64));
$c .= chr(0x80 | ($val % 64));
}
else { // 0800-FFFF
$c .= chr(0xE0 | (($val / 64) / 64));
$c .= chr(0x80 | (($val / 64) % 64));
$c .= chr(0x80 | ($val % 64));
}
}
return $c;
}
function unescape($sText) {
$sTranArray = array("%09" => "\t",
"%0A" => "\n",
"%0B" => "\x0b",
"%0D" => "\r",
"%20" => " ",
"%21" => "!",
"%22" => "\"",
"%23" => "#",
"%24" => "$",
"%25" => "%",
"%26" => "&",
"%27" => "'",
"%28" => "(",
"%29" => ")",
"%2C" => ",",
"%3A" => ":",
"%3B" => ";",
"%3C" => "<",
"%3D" => "=",
"%3E" => ">",
"%3F" => "?",
"%5C" => "\\",
"%5B" => "[",
"%5D" => "]",
"%5E" => "^",
"%60" => "`",
"%7C" => "|",
"%7B" => "{",
"%7D" => "}",
"%7E" => "~");
return strtr($sText, $sTranArray);
}
--- End Message ---
--- Begin Message ---
Greetings all,
I have a class I use for MySQL connection and functions.
I also have a class that I use to create Paged Results.
The paged results class connects to a DB and uses allot of sql calls to make
this happen. I am noticing that it does allot that the MySQL class does.
What I would like to do is to Have the paged results extend the MySQL class
so it can use the functions within that class so I can keep them updated in
just one place. How would I go about doing that?? Is it as simple as
something like this (this is shortened for convience)??
class Mysql {
var $results;
var $dbcnx;
function Mysql($query, $cnx) { // Constructor function
$this->dbcnx = $cnx;
if (!$this->results = @mysql_query($query))
$this->_error("There was an error with executing your query. Try again
later.", $query);
}
}
class PageResultSet extends MySQL {
var $results;
function PageResultSet ($query,$pageSize,$resultpage,$cnx) {
$this->results = @mysql_query($query,$cnx) or $this->_error('Error Running
your search. Try back later.', $query);
$this->pageSize = $pageSize;
if ((int)$resultpage <= 0) $resultpage = 1;
if ($resultpage > $this->getNumPages())
$resultpage = $this->getNumPages();
$this->setPageNum($resultpage);
}
}
I would like to be able to pass the results from the MySQL class to the
PageResultSet class without have to do the query over and such.
How would I go about coding that? I am not clear on that.
Also can I extend a function in PageResultSet that is started in MySQL??
In MySQL I have
function fetchAssoc() {
if (!$this->results) return FALSE;
$this->row++;
return mysql_fetch_assoc($this->results);
}
In PageResultSet I have
function fetchAssoc() {
if (!$this->results) return FALSE;
if ($this->row >= $this->pageSize) return FALSE;
$this->row++;
return mysql_fetch_assoc($this->results);
}
Can I just write something like within PageResultSet
function fetchAssocPRS extends fetchAssoc () {
if ($this->row >= $this->pageSize) return FALSE;
}
Thanks for the help.
--
Blessed Be
Phillip
--- End Message ---
--- Begin Message ---
Hello,
How can I allow users of my website to upload JPEG's to a set directory,
and then have the JPEG scaled-down if they upload some huge image (both
in pixel size and resolution)?
Is there anything around that clearly (and simply) explains this?
Thanks
Tim
--- End Message ---
--- Begin Message ---
On Fri, 21 Jan 2005 13:12:54 +1030, Tim Burgan <[EMAIL PROTECTED]> wrote:
> Hello,
>
> How can I allow users of my website to upload JPEG's to a set directory,
> and then have the JPEG scaled-down if they upload some huge image (both
> in pixel size and resolution)?
>
> Is there anything around that clearly (and simply) explains this?
php.net/imagecopyresized
There's an example right there on the manual page.
--
Greg Donald
Zend Certified Engineer
http://destiney.com/
--- End Message ---
--- Begin Message ---
On Wed, 19 Jan 2005 16:28:21 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> A question from another naive reader.
>
> Have you tried re-setting the array to an empty one, using array(),
> instead of using unset()?
indeed!, unset($arr); $arr = array();
or $arr = array(); directly
it's same :(
>
> Kirk
>
On Wed, 19 Jan 2005 14:44:10 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]>
wrote:
>
> Just some ideas from a naive reader:
>
> 1. unset() more often
i'm tracking ip of visiters to avoid double trigger of the counter.
if i shorten time to 5mins, therere so many ppl revisit after 5mins,
which give counter more points
> 2. unset() only a portion of the elements of the array
i guess so, but ..
>
> You may even want to store a TIME element, and only unset() the "old"
> items or something.
i did, but it double the size, and scan of expired elements is slower
>
> You may also want to, perhaps, put the unset() of older data inside your
> socket listening/reading loop, so that you are unset-ing the really old
> stuff as you read the new stuff, to always keep your array "small" in
> size.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
and i'm not unseting the new items
here's the logic After the slow TIME element scanning scheme:
data flow:
incomming->currentTracker->oldTracker
for .... {
$key = ...
$track = &$currentTracker[$countername][$key][$id];
if isset($currentTracker[$countername][$key][$id]):
$tarck ++;
continue; // skip trigger
elif isset($oldTracker[$countername][$key][$id]):
$track = $oldTracker[$countername][$key][$id] + 1;
continue; // skip trigger
$counts[$key] ++; // trigger, will save later
} // end for
unset($track);
expiring:
foreach 1hour:
1. unset($oldTracker); // slow
2. $oldTracker = $currentTracker; // fast, this is COW(no copy)
3. $currentTracker = array(); // fast (no efree)
if u think 2/3 is slow, i can do:
2. $oldTracker = &$currentTracker; // fast, php-reference
3. unset($currentTracker); // php-unreference
3. $currentTracker = array(); // fast
if i have to unset portion of the $oldTracker. i have to scan? or any other way?
--- End Message ---
--- Begin Message ---
If you have a 2bit GIF with only white and transparent and you place it
on a white page (background), you can hide it until it's highlit. Not
very pretty but it works.
Rob Adams wrote:
I've been figuring out how to create hidden images. The concept is: when
you highlight an image in Internet Explorer (and Mozilla too, though the
grid is reversed) it puts a grid over the image. If you put another image
in between what the grid covers, you can kind of hide the image that then is
exposed when highlighted in Internet Explorer. You can check out a kinda of
crappy first experiment at:
-- Rob
--- End Message ---
--- Begin Message ---
On Thu, 20 Jan 2005 11:13:11 -0800 (PST)
"Richard Lynch" <[EMAIL PROTECTED]> wrote:
> Sergio Gorelyshev wrote:
> > Hi all.
> >
> > Situation:
> >
> > interface MyInterface {
> > public static myMethod();
> > }
> >
> > class MyClass implements MyInterface {
> > public static myMethod() {}
> > }
> >
> > This sample will crash with message
> > Fatal error: Access type for interface method MyInterface::myMethod() must
> > be omitted in somefile.php on line NN
> >
> > Why I'm not able to clarify call's type (static) for methods in interface?
> > I'm predict closely that method myMethod() in all classes which implements
> > MyInterface must be called statically. A little trick allowed to me to
> > resolve this problem, but my question more ideological than practical.
>
> As I understand it, an 'interface' is, by definition, never gonna have an
> actualy object instantiated.
>
> Thus, there can never *BE* an object for which private/public/protected
> have any meaning.
>
> You can only use the private/public/protected on the 'class' definitions.
Thanks to all.
First sample of interface usage in php manual:
<?php
interface ITemplate
{
public function setVariable($name, $var);
public function getHtml($template);
}
class Template implements ITemplate
{
private $vars = array();
public function setVariable($name, $var)
{
$this->vars[$name] = $var;
}
public function getHtml($template)
{
foreach($this->vars as $name => $value) {
$template = str_replace('{'.$name.'}', $value, $template);
}
return $template;
}
}
?>
IMHO its normally to use access type for methods declaration in interfaces. Why
not?
Maybe my first example was not sufficiently illustrative. But my question was
"why it does not work in one environment and work fine in another". The problem
has acquired when i try to add "static" in my interface definition. I don't
think that this is a bug in PHP. I just want to be deep insight in OOP of PHP5
engine.
> Even if you *KNOW* that all class definitions *should* for this to be
> 'public' it just doesn't make sense from the strictly technical
> stand-point of what an 'interface' is to declare it there.
>
> Maybe somewhere over on php-dev you could make the case for the PHP Dev
> Team to implement something good/interesting when public/protected/private
> is used there, but currently it's semanticly undefined to have it there,
> so it can't be there.
>
> Disclaimer: I could easily be 100% wrong in this entire post. :-)
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
--
RE5PECT
Sergio Gorelyshev
--- End Message ---
--- Begin Message ---
Tbird switched the reply and reply-all buttons again ;-)...
?>
IMHO its normally to use access type for methods declaration in interfaces. Why not?
Maybe my first example was not sufficiently illustrative. But my question was "why it does not work in one environment and work fine in another".
it worked for a while because it was originally overlooked, then they
'fixed' it. -- you may not agree with the devs.
The problem has acquired when i try to add "static" in my interface definition. I don't think that this is a bug in PHP.
I just want to be deep insight in OOP of PHP5 engine.
your right, its not a bug - although some have argued that its Sucks(tm).
in short it was decided by the devs that interfaces are not meant for
static classes, they only apply to objects - which is why 'static' is
not (no longer) allowed on interface methods. if you want to know more
then digging into the php internals mailing list archives will give you
long discussions and justifications as to why it works they way it does.
if you think about it you can see where they are coming from: passing
around classes (i.e. classNames) and then checking whether said class
implements something is really odd, instead you pass around objects.
or more simply:
class == blueprint
object == house
you can interface with a house (lets hope your house IMPLEMENTS a door
interface!) but you can't interface with a blueprint (possibly with the
piece of paper it may be printed on but not with the actual blueprint)
because the blueprint is an idea/concept.
hope that helps you to understand the rationale.
rgds,
JOchem
...
--- End Message ---
--- Begin Message ---
On Fri, 21 Jan 2005 11:56:55 +0100
Jochem Maas <[EMAIL PROTECTED]> wrote:
> Tbird switched the reply and reply-all buttons again ;-)...
>
> > ?>
> > IMHO its normally to use access type for methods declaration in interfaces.
> > Why not?
> > Maybe my first example was not sufficiently illustrative. But my question
> > was "why it does not work in one environment and work fine in another".
>
> it worked for a while because it was originally overlooked, then they
> 'fixed' it. -- you may not agree with the devs.
>
> > The problem has acquired when i try to add "static" in my interface
> > definition. I don't think that this is a bug in PHP.
> > I just want to be deep insight in OOP of PHP5 engine.
> >
>
> your right, its not a bug - although some have argued that its Sucks(tm).
>
> in short it was decided by the devs that interfaces are not meant for
> static classes, they only apply to objects - which is why 'static' is
> not (no longer) allowed on interface methods. if you want to know more
> then digging into the php internals mailing list archives will give you
> long discussions and justifications as to why it works they way it does.
>
> if you think about it you can see where they are coming from: passing
> around classes (i.e. classNames) and then checking whether said class
> implements something is really odd, instead you pass around objects.
>
> or more simply:
>
> class == blueprint
> object == house
>
> you can interface with a house (lets hope your house IMPLEMENTS a door
> interface!) but you can't interface with a blueprint (possibly with the
> piece of paper it may be printed on but not with the actual blueprint)
> because the blueprint is an idea/concept.
>
> hope that helps you to understand the rationale.
Thanks. This really helped me to understand php developer's way of thinking.
> rgds,
> JOchem
>
> >
>
> ...
>
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
RE5PECT
Sergio Gorelyshev
--- End Message ---
--- Begin Message ---
Hi Guys!
I've got a problem with Dom and php 5.0.2. I'm trying to access an xml
node with $item = $objDom->documentElement->childNodes->item(0);. That
seems to work, because on the next line I can output the node Value with
echo $item->nodeValue. But when I use the command
$objDom->removeChild($item); on the next line, dom throws a
DOMException:
Fatal error: Uncaught exception 'DOMException' with message 'Not Found
Error' in
/opt/lampp/htdocs/www/snap_chubb/extensions/features/mitarbeiter/main.fe
a.php:13 Stack trace: #0
/opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(179): require()
#1 /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(154) :
eval()'d code(1): Admin->editFeature(Object(DOMElement)) #2
/opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(154): eval() #3
/opt/lampp/htdocs/www/snap_chubb/admin/index.php(142):
Admin->drawContent() #4 {main} thrown in
/opt/lampp/htdocs/www/snap_chubb/extensions/features/mitarbeiter/main.fe
a.php on line 13
Below you can see my code:
Index.php
-----------------------------------------------------------------------
$objDom = new DomDocument(); // neues dom objekt
$strXML = $this->loadXMLTree($objDATA->fields['pfe_con_id']); //
funktion, die eine xml datei als string aus der db ausliest if ($strXML
!= false) {
$objDom->loadXML($strXML); // string wird in das dom objekt
geladen } $item = $objDom->documentElement->childNodes->item(0); //
adressierung eines knoten echo $item->nodeValue; // ausgabe funktioniert
ohne probleme
$objDom->removeChild($item); // diese zeile spuckt den oben genannten
Error aus!
Geladener XML string
-----------------------------------------------------------------------
<?xml version="1.0"?>
<root>
<mitarbeiter>
<image>/images/43/team_fabian-bischof_kl.jpg</image>
<name>Fabian Bischof</name>
<detailpage>45</detailpage>
</mitarbeiter>
<mitarbeiter>
<image>/images/43/team_sandra-varela_kl.jpg</image>
<name>Sandra Varela</name>
<detailpage>0</detailpage>
</mitarbeiter>
<mitarbeiter>
<image>/images/43/team_sandra-varela_kl.jpg</image>
<name>Sandra Varela</name>
<detailpage>0</detailpage>
</mitarbeiter>
</root>
-----------------------------------------------------------------------
I hope somebody can help me somehow! I'm really desperate!
Cheers
mike
--- End Message ---
--- Begin Message ---
I seem to remember seing someone use a abreaviated form of a
if/them/else of the type that can be used in java.
It was something like
if ( a=b ) ? a=1 ; a=2;
Anybody know what the correct syntax is?
Ben
--
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
--- End Message ---
--- Begin Message ---
Hello Ben,
Friday, January 21, 2005, 12:01:09 PM, you wrote:
BE> I seem to remember seing someone use a abreaviated form of a
BE> if/them/else of the type that can be used in java.
BE> It was something like
BE> if ( a=b ) ? a=1 ; a=2;
BE> Anybody know what the correct syntax is?
It's called a ternary operator.
$action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
In the PHP manual under Comparison Operators.
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
--- End Message ---