मैं PHP के साथ एक एसवीजी फ़ाइल बनाना चाहता हूं, और उसके बाद इसे एक HTML फ़ाइल में शामिल करना चाहता हूं।मैं PHP के साथ जेनरेट की गई एक एसवीजी फ़ाइल कैसे लोड करूं?
<?php
header("Content-type: image/svg+xml");
?>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/
REC-SVG-20010904/DTD/svg10.dtd">
<svg width="310" height="140" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g style="stroke:black;fill:lightgreen" transform="translate(30,30)">
<rect x="10" y="10" width="100" height="30" style="stroke-width:4"/>
<circle cx="170" cy="25" r="20" style="stroke-width:4"/>
<line x1="265" y1="10" x2="200" y2="70" style="stroke-width:4"/>
<text x="80" y="90" style="font:size: 8">Basic shapes</text>
</g>
</svg>
index.html
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html,body, #MOSVG {
height: 100%;
width: 100%;
padding:0;
margin:0;
}
</style>
</head>
<body>
<object data="svg.php" type="image/svg+xml" id="MOSVG" />
</body>
</html>
जब मैं index.html
सभी को देखो मैं देख रहा हूँ एक खाली है: यहाँ मैं अब तक (निम्नलिखित this tutorial)
svg.php क्या है है पृष्ठ। कंसोल पर कोई चेतावनी/त्रुटियां नहीं हैं। अपाचे त्रुटि लॉग (मैं XAMPP का उपयोग कर रहा हूं) [Mon Jul 09 14:36:15 2012] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/svgtest/public/svg.php' not found or unable to stat, referer: http://localhost/svgtest/public/
दें। वे एक ही निर्देशिका में हैं।
सार्वजनिक सार्वजनिक नहीं है – Gntem
पहले से ही मिला/तय किया गया है, अभी भी समस्या प्राप्त हो रही है। – SomeKittens
यदि आप लाइन को हटाते हैं तो यह svg – Gntem