php/mysql Web アプリケーションを持っています。それを wordpress プラグインに変換したいのですが、ある php ファイルを別のファイルにリンクするにはどうすればよいですか。たとえば、プラグイン tw があります。tw.php はそのインデックス ファイルで、もう一方のファイル名は tw1.php です。
先頭ページ
/* plugin name:tw
plugin url:httpL://csr.estheticsolutions.com.pk
*/
//tell wordpress to register the demolistposts shortcode
add_shortcode("demo-list-posts", "demolistposts_handler");
function demolistposts_handler()
{
//run function that actually does the work of the plugin
$demolph_output = my_function();
//send back text to replace shortcode in post
return $demolph_output;
}
function my_function()
{
?>
<html>
<body>
<form action="tw1.php" method="post">
<input type="text" name="fname" >
<input type="submit" value="Submit" >
</form>
</body>
</html>
<?php
}
?>
2ページ目
<?php
$First_Name=$_POST['fname'];
echo $First_Name;
?>
tw.php で値を送信すると、wordpress フォルダーに tw1.php が見つかりません (404) というエラーが表示されます。次に、tw1.php ファイルをその (wordpress) フォルダーに貼り付けて送信し、投稿された値を wordpress テーマなしで新しいページに取得します.