[PHP] php varaible to perl
Hello all, Can anyone see what's happening here? I'm trying to pass some variables (font stuff) to a cgi script so that it will appear the same as the current theme being used. Everything seems to be working except the replacements. here's the code. Any help much appreciated, thanks! Or would there be a better way to do this? ?php include(/path_to/preload.php); include($header_forum_prog); $out = implode(\n, file(http://domain.com/path_to/forum.pl$QUERY_STRING;)); preg_match_all(/PHP?([^?]+)?PHP/, $out, $matches, PREG_PATTERN_ORDER); for($i=0; $i count($matches[1]); $i++){ $out = str_replace(PHP?.$matches[1][$i].?PHP, $$matches[1][$i], $out); } echo $out; include($footer_prog); ? and the variable in the cgi script are var heading_bgcolor = \PHP?$bgcolor?PHP\ var heading_font = \PHP?$ThemeFont?PHP\ but eh variable from the php globals are $bgcolor, $ThemeFont Thanks Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] making e-mail link
Bill I grabed this function from the www.php.net manual and it works great, it covers all your bases, except that it will show you http://www.something.com for http://www.something.com or www.something.com. If somone knows how to modify it so it would only show www.something.com when linked, that would be perfect. // Auto Link HTML /** * Function from phpmanual http://www.php.net/ * [EMAIL PROTECTED] */ function getAutoLink($text){ if($GLOBALS[use_AutoLinks]){ $text = ereg_replace(((www.)([a-zA-Z0-9@:%_.~#-\?]+[a-zA-Z0-9@:%_~#\?/])), http://\\1;, $text); $text = ereg_replace(((ftp://|http://|https://){2})([a-zA-Z0-9@:%_.~#-\?]+[a-zA-Z0 -9@:%_~#\?/]), http://\\3;, $text); $text = ereg_replaceftp://|http://|https://){1})[a-zA-Z0-9@:%_.~#-\?]+[a-zA-Z0 -9@:%_~#\?/]), A HREF=\\\1\ TARGET=\_blank\\\1/A, $text); $text = ereg_replace(([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}),A HREF=\mailto:\\1\;\\1/A, $text); return $text; } } peace Richard bill [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use this to replace URLs as links: $text = eregi_replace((http://[^ ]*),a href=\\\1\\\1/a,$text); What can I use to replace email addresses (like [EMAIL PROTECTED]) as e-mail links? kind regards, bill hollett -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] pc/mac and ie/nav
Hello all, Can anyone see what's happening here? I'm trying to pass some variables (font stuff) to a cgi script so that it will appear the same as the current theme being used. Everything seems to be working except the replacements. here's the code. Any help much appreaciated, thanks! Or would there be a better way to do this? ?php include(/path_to/preload.php); include($header_forum_prog); $out = implode(\n, file(http://domain.com/path_to/forum.pl$QUERY_STRING;)); preg_match_all(/PHP?([^?]+)?PHP/, $out, $matches, PREG_PATTERN_ORDER); for($i=0; $i count($matches[1]); $i++){ $out = str_replace(PHP?.$matches[1][$i].?PHP, $$matches[1][$i], $out); } echo $out; include($footer_prog); ? and the variable in the cgi script are var heading_bgcolor = \PHP?$bgcolor?PHP\ var heading_font = \PHP?$ThemeFont?PHP\ but eh variable from the php globals are $bgcolor, $ThemeFont Thanks Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]