W3C home > Mailing lists > Public > www-svg@w3.org > March 2004

Dynamic SVG (Mind suggesting, please!)

From: shwathi a <loveshwathi@yahoo.co.in>
Date: Tue, 9 Mar 2004 06:39:41 +0000 (GMT)
Message-ID: <20040309063941.35001.qmail@web8205.mail.in.yahoo.com>
To: www-svg@w3.org
Hi,
I'm involved in a project with PHP, SVG and MySQL.
I pass a record number from page1 to page2.
The corresponding SVG code from MySQL is displayed in PHP in page2.
 
This is page1.html for a better idea:
<html>
<head><title>Form</title><head>
<body bgcolor=white>
<form method=post action="page2.php" target="right">
Enter Record please :  <input type="text" size=2 name="layno">
<input type="submit" value="Display">
</form>
</body>
</html>

This is page2.php:
<?
   header("Content-type: image/svg+xml");
   print('<?xml version="1.0" encoding="iso-8859-1"?>');
?>
<!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" x="-4.72439in" y="3.5434in" width="9.44879in" height="7.0868in" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision;
 image-rendering:optimizeQuality"
     viewBox="-4724 0 9448 7086">
<?
// Connection
     $conec = mysql_connect("localhost","admin","pwd");
     mysql_select_db("vgsvg",$conec);
// Query
     $query = ("select img from pict where id='$layno'");
     $resid = mysql_query($query,$conec);
     while ($row = mysql_fetch_array ($resid))
             $mycopy = $row[img];
     mysql_free_result ($resid);
// SVG Display
     print ("$mycopy");
?>
</svg>

The problem:
If the svg code to be retrieved is small, then the image is displayed correctly. (So, no probs in Passing values!)
If the svg code is 9Kb or more, I'm not able to retrieve the file and the SVG is blank. 
Should I give any specification in the Doctype? I've tried several Doctypes, in vain. Please Help!  
I tried numerous forums and help links, nothing seemed to work.
Will you mind helping me out of this, please.
Shwathi

Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
Received on Tuesday, 9 March 2004 01:40:13 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:26 GMT