Re: [PHP] quick and easy(php newbie)

2002-01-18 Thread Richard Crawford

Try something like:

$Entry = $openingEntry . $numberAtt . \ . $myNumber . \ . $nameAtt...

and so on.


travis wrote:

 just a quick syntax question: here is my php
 
 ?
 $openingItemTag = item\n;
 $openingEntry =  entry ;
 $numberAtt = number=;
 $nameAtt = name=;
 $dateAtt = date=;
 $messageAtt = message=;
 $linkAtt = link=;
 $closingEntry = /\n;
 $closingItemTag = /item;
 
 $Entry=
 $openingEntry.$numberAtt.$myNumber.$nameAtt.$myName.$dateAtt.$myDate.
 $messageAtt.$myMessage. $linkAtt.$myLink.$closingEntry;
 $Item = $openingItemTag.$Entry.$closingItemTag;
 
 $fp = fopen (news.xml, a);
 fwrite($fp,$Item);
 fclose($fp);
 ?
 
 
 if done twice it returns this:
 
 item
  entry number=01name=travisdate=01.08.02message=hello worldlink=http://www.me.com/
 /itemitem
  entry number=01name=travisdate=01.08.02message=hello worldlink=http://www.me.com/
 /item
 
 i want it to display as follows:
 
 item
  entry number=01 name=travis date=01.08.02 message=hello world 
link=http://www.me.com/;
 /item
 item
  entry number=01 name=travis date=01.08.02 message=hello world 
link=http://www.me.com/;
 /item
 
 now it is writing to the file I want perfectlybut but but I need to add
 quotes around the attributes and spaces between each attribute, and a line
 break before each item
 what do I need to add to $Entry to get that to display correctly
 
 
 
 



-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED] 
http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupery

Push the button, Max!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] quick and easy(php newbie)

2002-01-18 Thread travis

just a quick syntax question: here is my php

?
$openingItemTag = item\n;
$openingEntry =  entry ;
$numberAtt = number=;
$nameAtt = name=;
$dateAtt = date=;
$messageAtt = message=;
$linkAtt = link=;
$closingEntry = /\n;
$closingItemTag = /item;

$Entry=
$openingEntry.$numberAtt.$myNumber.$nameAtt.$myName.$dateAtt.$myDate.
$messageAtt.$myMessage. $linkAtt.$myLink.$closingEntry;
$Item = $openingItemTag.$Entry.$closingItemTag;

$fp = fopen (news.xml, a);
fwrite($fp,$Item);
fclose($fp);
?


if done twice it returns this:

item
 entry number=01name=travisdate=01.08.02message=hello worldlink=http://www.me.com/
/itemitem
 entry number=01name=travisdate=01.08.02message=hello worldlink=http://www.me.com/
/item

i want it to display as follows:

item
 entry number=01 name=travis date=01.08.02 message=hello world 
link=http://www.me.com/;
/item
item
 entry number=01 name=travis date=01.08.02 message=hello world 
link=http://www.me.com/;
/item

now it is writing to the file I want perfectlybut but but I need to add
quotes around the attributes and spaces between each attribute, and a line
break before each item
what do I need to add to $Entry to get that to display correctly