
07-07-08, 03:33 PM
|
 |
Newbie Coder
|
|
Join Date: Jul 2008
Location: Georgia
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
how to change code from php to perl
is there a way to change this code to perl that is from http://www.programmingtalk.com/showt...2&goto=newpost
PHP Code:
<html> <head> <style> .td1_pad { padding-right:10px; } .td2_pad { padding-top:10px; text-align:center; } </style> </head> <body> <?php if(!file_exists("counter.txt")) { $f=fopen("counter.txt","w"); fwrite($f,'1'); fclose($f); } if(!empty($_POST["web_addr"])) { if(preg_match('^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$^',$_POST["web_addr"])) { $_POST["web_addr"]=str_replace("watch?","/",$_POST["web_addr"]); $_POST["web_addr"]=str_replace("=","/",$_POST["web_addr"]); $ct=file_get_contents("counter.txt"); $file_name="web_addr_".$ct.".html"; $ct++; $f=fopen("counter.txt","w"); fwrite($f,$ct); fclose($f); $data="<object width='425' height='344'> <param name='movie' value='".$_POST["web_addr"]."&hl=en&color1=0x006699&color2=0x54abd6'></param> <embed src='".$_POST["web_addr"]."&hl=en&color1=0x006699&color2=0x54abd6' type='application/x-shockwave-flash' width='425' height='344'></embed> </object>"; $f=fopen($file_name,'w'); fwrite($f,$data); fclose($f); echo "THANKS HERE IS YOUR YOUTUBE VIDEO</br>.$data<br />"; } else{echo "You didn't enter a web address.<br />";} } ?> <form action="#" method="POST"> <table cellspacing="0" cellpadding="0"> <tr> <td class="td1_pad">Enter web address here:</td><td><input type="text" name="web_addr" value="http://"></td> </tr> <tr> <td class="td2_pad" colspan="2"><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html>
Last edited by Nico; 07-07-08 at 04:25 PM.
Reason: Wrappers.
|