Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need help writting a script
Old 02-27-2008, 05:19 AM Need help writting a script
Extreme Talker

Posts: 189
Trades: 0
im having trouble writing a script that will create an xml file for me

Code:
<images>
    <pic>
    <image>photos/1.jpg</image>
    <thumbnail>photos/s1.jpg</thumbnail>
    <caption></caption>
    </pic>
    <pic>
    <image>photos/2.jpg</image>
    <thumbnail>photos/s2.jpg</thumbnail>
    <caption></caption>
    </pic>
</images>
(and it repeats the <pic> to </pic> till end)

i would like a script that writes that for as many images as i want.

it can write it in a text file so i can copy it over

and i would like to be able to add some captions.

How hard would it be to write a script that does this and can someone write it.

im thinking maybe a loop that adds 1 to its variable (that puts the number in the xml code) each time. The loop should go till it gets to 100 if possible.

Last edited by simster; 02-27-2008 at 05:20 AM..
simster is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-27-2008, 05:33 AM Re: Need help writting a script
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
PHP Code:
<?
   $max 
100;
   for (
$i 1$i <= $max$i++): ?>
<pic>
   <image>photos/<?= $i ?>.jpg</image>
   <thumbnail>photos/s<?= $i ?>.jpg</thumbnail>
   <caption><?= $captions[$i?></caption>
</pic>
<? endfor ?>
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 02-27-2008, 06:39 AM Re: Need help writting a script
Extreme Talker

Posts: 189
Trades: 0
thank you
simster is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help writting a script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11880 seconds with 12 queries