[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4752: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4754: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4755: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
CSS3 PIE Forums :: View topic - SVG gradient script in PHP for IE9 with multiple stops
CSS3 PIE Forums
http://css3pie.com/forum/

SVG gradient script in PHP for IE9 with multiple stops
http://css3pie.com/forum/viewtopic.php?f=4&t=886
Page 1 of 1

Author:  bccsergio [ Thu May 05, 2011 11:23 pm ]
Post subject:  SVG gradient script in PHP for IE9 with multiple stops

A little script in PHP I wrote to use gradient in IE9 with multiple stops.
File attached (compressed in RAR format)

Instructions below and also commented inside PHP file.

Hope it helps anyone...

============================================
SVG gradient script in PHP by bccsergio

USAGE:
you can pass the following vars to gradient.php via GET:

x1, x2, y1, y2 (Ex.: x1=0&x2=0&y1=0&y2=100) - This values are OPTIONAL, but if set, MUST be a valid number between 0 and 100. They will change gradient direction.

stop1, stop2, ..., stop5, .. stopN (where N is the last stop - you can use as many stops as you want)
stop vars must have 2 arguments, separated by a comma (,) (Ex.: stop1=0,BCD1E0&stop2=49,7DA7C3&stop3=50,4E87AD&stop4=100,4E87AD)
first argument is the stop place (%) - This values MUST be a valid number between 0 and 100 WITHOUT the '%' char
second argument is the stop color (#) - This value MUST be a valid HEX color WITHOUT the '#' char
PS.: AT LEAST 2 STOP VALUES ARE NEEDED TO GENERATE A VALID GRADIENTE

Full examples in a CSS file:
.my_span { background: url(gradient.php?x1=0&x2=0&y1=0&y2=100&stop1=0,BCD1E0&stop2=49,7DA7C3&stop3=50,4E87AD&stop4=100,4E87AD); }
#my_div { background: url(gradient.php?x1=100&stop1=0,BCD1E0&stop2=49,7DA7C3&stop3=50,4E87AD&stop4=100,4E87AD); }
.my_span { background: url(gradient.php?x2=100&y2=0&stop1=0,BCD1E0&stop2=50,4E87AD&stop3=100,4E87AD); }
#my_div { background: url(gradient.php?stop1=0,BCD1E0&stop2=100,4E87AD); }

If no vars are passed via GET to gradient.php, default values will be:
x1=0
x2=0
y1=0
y2=100
stop1=0,FFFFFF
stop2=100,000000

PS.: Any error in vars will set them to default values.
============================================

Attachments:
File comment: SVG gradient script in PHP for IE9 with multiple stops by bccsergio
gradient.rar [1.49 KiB]
Downloaded 3175 times

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/