Current location: Hot Scripts Forums » Programming Languages » PHP » how to call a php query in xml file???


how to call a php query in xml file???

Reply
  #1 (permalink)  
Old 04-18-09, 12:39 PM
whatashareman whatashareman is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
how to call a php query in xml file???

how to call a php query in xml file???


i want to make a dynamic mp3 player who reads song from xml file. i want to give the dynamic path of the song so that i can upload the song from admin and it will save in the song folder. how can i do this??


thanks in adv
Reply With Quote
  #2 (permalink)  
Old 04-18-09, 01:03 PM
dgreenhouse's Avatar
dgreenhouse dgreenhouse is offline
Aspiring Coder
 
Join Date: Mar 2009
Location: San Francisco
Posts: 457
Thanks: 0
Thanked 3 Times in 3 Posts
You've answered your own question - to a degree...

This is a little too involved to just explore it without some upfront work on your part.
If you just want something working, maybe you should go to the script request section.

If you've already started doing some of your work and have some questions, it would
then be appropriate to ask for help with that.

If you've already started playing around with the xml and need help with that, post the relevant code snippets.

On another note...

From just a design overview standpoint, these are some of the items you'll need for the app:
(this is basic and doesn't reflect all that you'll need)

Admin:

1- Database calls
2- Presentation
3- Upload song (manage songs i.e. rename, delete, etc.)
4- Read xml
5- Generate xml

User:
1- Database calls
2- Read xml
3- Presentation (display songs)
4- Get song
5- Play song
Reply With Quote
  #3 (permalink)  
Old 04-18-09, 04:01 PM
Jcbones Jcbones is offline
Aspiring Coder
 
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 516
Thanks: 5
Thanked 47 Times in 44 Posts
You call the query the same as any other time...

PHP Code:



<?php
//file poll.xml.php;

header('Content-Type: application/xml; charset=ISO-8859-1');
echo 
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
include(
'php/connect.php');


$xml_output .= "<graph caption='AM I HOT???:)' subCaption='' yaxisname='Votes' xaxisname='' showAlternateVGridColor='1' alternateVGridAlpha='10' alternateVGridColor='AFD8F8' numDivLines='4' decimalPrecision='0' canvasBorderThickness='1' canvasBorderColor='114B78' baseFontColor='114B78' hoverCapBorderColor='114B78' hoverCapBgColor='E7EFF6'>";

$query mysql_query("SELECT * FROM `poll`");
                    
$add1 0;
                    
$add2 0;
                    
$total 0;
                    while(
$r mysql_fetch_array($query))
                        {
                            
$value $r['result'];
                            
                            if(
$value == 1$add1 $add1 1000;  //;)
                         
elseif($value == 2$add2 $add2 1;
                         
                         
$total++;
                         
                        }
                
mysql_free_result($query);
$xml_output .= "<set name='Yes' value='$add1' color='AFD8F8' alpha='70'/>"
                
"<set name='No' value='$add2' color='F6BD0F' alpha='70'/>";

$xml_output .= "</graph>";

echo 
$xml_output;

?>
This is from a recent project, and is an xml file that is used to generate a chart.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP script allowing to create, and write to an XML file... Xenon121 Script Requests 0 04-18-06 09:50 PM
PHP and XML dwoody PHP 11 04-05-06 03:32 PM
create php file on the fly and delete when session ends recedo PHP 0 01-06-06 10:28 PM
reading a remote xml file into a variable bdee1 PHP 1 12-20-05 12:32 PM
PHP and XML (Used for lottery statistics) v1brazy PHP 2 08-19-04 11:00 AM


All times are GMT -5. The time now is 08:32 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.