Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Need help....

  1. #1
    Join Date
    May 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help....

    I'm thinking of something and wonder if it exists...
    Making an info.xml > use a script to get the info > display it on a site or something....
    like...
    inside the info.xml
    (separated by commas)
    |rank|name|datereg|image|
    #00001,Maaku,05/11/2010,http://www.google.com/images/srpr/nav_logo13.png
    ----
    and the script would like.. get all the information....
    <image><name>
    <rank><datereg>

    is it possible to do something like that?

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    of course.
    There have been a rash of threads on the forums regarding xml; look through some of them. If you're using ph
    p, I'd recommend starting here.

    Do you have a good grasp on xml yet? For example, your example above would be something like:
    Code:
    <?xml version="1.0" encoding='UTF-8'?>
    <xmlroot>
       <record>
          <id>0001</id>
          <name>Maaku</name>
          <datereg>05-10-2010</datereg>
          <image>http://www.google.com/images/srpr/nav_logo13.png</image>
       </record>
       <record>
          ...more records, etc...
       </record>
    </xmlroot>

  3. #3
    Join Date
    May 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh, I forgot to add, is that possible doing in Javascript, I googled it up and found some but for some reason it doesn't work in Mozilla Firefox D:
    and I also found XML parsing using PHP (output xml using php)
    but there's always an error D:

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by kenshn111 View Post
    Oh, I forgot to add, is that possible doing in Javascript, I googled it up and found some but for some reason it doesn't work in Mozilla Firefox D:
    I'm sure it can be, but that's not my expertise. Maybe you could find some help in the javascript forum.
    Quote Originally Posted by kenshn111 View Post
    ...and I also found XML parsing using PHP (output xml using php)
    but there's always an error D:
    Not always . What sort of errors are you getting?

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Regarding Javascript, it may be possible, but it would be less reliable and almost inevitably harder to setup. PHP is designed for this kind of thing; Javascript is definitely not.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    May 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If possible, can someone code it for me?

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Try google to see what you find. I think it would be a lot of work to code. It's not something I can do (but my specialty isn't Javascript).
    You could look for paid help if you can't find someone to do it for free.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    May 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh.. okay I'll look harder this time(for some reason, I can't find what I've found yesterday! D: )

  9. #9
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I can do this for you (via php), but not for free. Please contact me here if you're interested.

    If you'd like to try it yourself, post what you have and we'd be happy to help you figure it out.

    Quote Originally Posted by kenshn111
    Oh.. okay I'll look harder this time(for some reason, I can't find what I've found yesterday! D: )
    look in your browser history

  10. #10
    Join Date
    May 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So.... I tried something...

    XML
    <books>
    <book>
    <author>Jack Herrington</author>
    <title>PHP Hacks</title>
    <publisher>O'Reilly</publisher>
    </book>
    <book>
    <author>Jack Herrington</author>
    <title>Podcasting Hacks</title>
    <publisher>O'Reilly</publisher>
    </book>
    </books>
    PHP
    PHP Code:
      <?php
      $doc 
    = new DOMDocument();
      
    $doc->load'abc.xml' );
      
      
    $books $doc->getElementsByTagName"book" );
      foreach( 
    $books as $book )
      {
      
    $authors $book->getElementsByTagName"author" );
      
    $author $authors->item(0)->nodeValue;
      
      
    $publishers $book->getElementsByTagName"publisher" );
      
    $publisher $publishers->item(0)->nodeValue;
      
      
    $titles $book->getElementsByTagName"title" );
      
    $title $titles->item(0)->nodeValue;
      
      echo 
    "$title - $author - $publisher\n";
      }
      
    ?>
    And I get this error : Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /~/www/transparent.agilityhoster.com/test.php on line 9

    Links : http://transparent.agilityhoster.com/test.php

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •