XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 5th, 2002, 09:46 PM
torkil torkil is offline
Another damn newb...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Bodø, Norway
Posts: 94 torkil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Unhappy XML expertise needed!

I have a webpage - simple one really.
Its supposed to take in one variable in php and print this out using xml and svg.

Here is the complete code:
PHP Code:
<?
  header
("Content-type: image/svg+xml");
  print(
'<?xml version="1.0" encoding="iso-8859-1"?>');
?>

<?php $text="This page uses PHP and SVG"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd">

<svg xml:space="preserve" width="100%" height="20">
    <desc>Using styles</desc>
    <rect style="fill:#333333" x="0" y="0" width="100%" height="145"/>
    <text x="50" y="70" style="text-anchor:left; fill:#cccccc; font-size:26;
    font-weight:15; font-family:Tahoma, Verdana; font-style:regular"><?php echo
    
$text?></text>
</svg>


You can see it in action here:
follow this link
(if the code snipplet above doesn't show correctly, just view source at the URL)

Now... The php code isn't even parsed, and its returning a strange error message which I do not understand... ANYONE have ANY idea as to why this is happening?

The person that wrote the code says it works fine on his server, so I'm wondering what's the matter here... Are the server settings screwed up or??

HELP!!!
__________________
Torkil Johnsen

Never underestimate the power of stupid people in large groups...
---------------------------(òÓ,)----

Reply With Quote
  #2  
Old January 5th, 2002, 10:12 PM
lectos lectos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 10 lectos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Your files has a .psvg extension. PHP will only parse pages with .php or .php3 (and sometimes .php4) extensions. It's not parsing your PHP code and it's interpreting your PHP code as an XML file. Change your file name to index.php and I bet it will work. Also when you are mixing PHP and XML, you should always start a PHP block with a "<?php" instead of just a "<?" It goofs up occasionally if you do not do this.

Reply With Quote
  #3  
Old January 5th, 2002, 10:24 PM
torkil torkil is offline
Another damn newb...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Bodø, Norway
Posts: 94 torkil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Wow...

As easy as that, huh?

Well it worked just fine here in my end, so I hope you on your side can settle for a 'thank you'

... *amazed*

On a sidenote: If .psvg is interpreted as .php, like .php3, .php, and .inc, should the index.psvg-file not have worked just fine then, or??

Thanks again...

Reply With Quote
  #4  
Old January 8th, 2002, 07:31 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Of course you could also use the .psvg extension, but the server has to be configured for this. This is not the case on most servers, but if you have your own one you could easily configure this.
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML expertise needed!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway