iedit.cgi

iedit.cgi

You are currently viewing a revision titled "iedit.cgi", saved on 2025年10月2日 9:25 PM by Serchan Binti
タイトル
iedit.cgi
コンテンツ
#!/usr/bin/perl BEGIN{ $| = 1; print "Content-type: text/html\n\n"; open(STDERR, ">&STDOUT"); } use CGI; $query = new CGI; open(IN, "< save.txt"); @data=<IN>; close (IN); #新しく修正された各項目################# $name = $query->param('name'); $add = $query->param('add'); $tel = $query->param('tel'); $mail = $query->param('mail'); $edit = $query->param('edit'); #時間を取得########## local($nsec,$nmin,$nhour,$nmday,$nmon,$nyear)=localtime(time); $nmon++; $nyear+=1900; $day="$nyear\t$nmon\t$nmday\t$nhour\t$nmin"; ############################################# $arenge = "$day\t$name\t$add\t$tel\t$mail\n"; ############################################### print <<END; <html> <head> <title>2017 basic perl No2</title> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div align="center"> <h1><b>データベース 初歩</b></h1> </div> <hr> END for($i=0;$i<@data;$i++){ if($i=~m/$edit/){ @data[$i] = $arenge; } } @dat=@data; open(FILE,">save.txt")||&error("save.txt 外部ファイルが開きませんでしたエラー"); print FILE @dat; close(FILE); print"edit complete\n";
抜粋
脚注


Old New Date Created Author Actions
2025年10月2日 12:25 PM Serchan Binti

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です