-1

我想在 Wordpress Post 中使用该代码。

当我在没有 Wordpress 的情况下使用该代码时,它可以工作。我的意思是我创建了一个 php 文件并将此代码粘贴到其中。它有效。但它在 Wordpress 帖子中不起作用。

我应该怎么办?

请帮助我。提前致谢。

<html>
<head>
<title>test</title>
<style type="text/css" media="screen">
textarea { resize: none; }
.hide{ display: none; }
#popupoverlay { background-color: #000000; bottom: 0px; display: none; left: 0px; opacity: .75; position: fixed; right: 0px; top: 0px; }
#popupwindow { background-color: #FAFAD2; border: solid 2px #cccccc; display: none; height: 150px; left: 50%; margin: -75px 0 0 -35px; position: absolute; left: 350px; top: 80px; width: 800px; height: 630px }
#popupwindow a { background-color: #ff3333; display: block; font-size: 9px; height: 20px; left: 50%; margin: -309px 0 0 370px; position: absolute; text-align: center; text-decoration: none; top: 50%; width: 25px; }
#popupwindow h1 { background-color: #cccccc; display: block; margin: 0; padding: 3px 5px; text-align: center; }
#popupwindow p { font-size: 9pt; margin: 0px; padding: 5px; }
body{font: 9pt Verdana;list-style:none;margin:0;padding:-10}
td{font: 9pt Verdana;}
th{font: 9pt Verdana; text-align: left; font-weight: bold;}
</style>
<SCRIPT>
function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
return (true)
}
alert("Please check your email.")
return (false)
}
//  End -->
</script>
<script>
function SayiKontrol(e) {
    olay = document.all ? window.event : e;
    tus = document.all ? olay.keyCode : olay.which;
    if(tus<48||tus>57) {
        if(document.all) { olay.returnValue = false; } else { olay.preventDefault(); }
    }
}

function HarfKontrol(e) {
    olay = document.all ? window.event : e;
    tus = document.all ? olay.keyCode : olay.which;
    if(tus>=48&&tus<=57) {
        if(document.all) { olay.returnValue = false; } else { olay.preventDefault(); }
    }
}
</script>
    <script type="text/javascript">
    function OpenPopup() {
        document.getElementById('PopupOverlay').style.display = 'block';
        document.getElementById('PopupWindow').style.display = 'block';
    }
    function ClosePopup() {
        document.getElementById('PopupOverlay').style.display = 'none';
        document.getElementById('PopupWindow').style.display = 'none';
    }
    </script>
    <script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
function HostingSpec(rad){
 var rads=document.getElementsByName(rad.name);
 var all=['first_giz','first_giz_1','second_giz']
 var ary=[
  ['first_giz','first_giz_1'],
  ['second_giz']
 ]
 for (var z0=0;z0<all.length;z0++){
  document.getElementById(all[z0]).style.display='none';
 }
 for (var z1a,z1=0;z1<rads.length;z1++){
  if (rads[z1].checked&&ary[z1]){
   for (z1a=0;z1a<ary[z1].length;z1a++){
    document.getElementById(ary[z1][z1a]).style.display='block';
   }
   return;
  }
 }

}
/*]]>*/
</script>
</head>
<body>
<form name="myform" action="submit.php" method="POST" onSubmit="return checkEmail(this)">
       <a href="javascript: void(0)" onClick="OpenPopup();"><img border="0" src="submit.jpg"></a>
    </p>

    <div id="PopupOverlay"></div>
    <div id="PopupWindow">
<h1>Test</h1>
<table border="0" width="100%" cellspacing="1">
<tr>
<th width="333">Name</th>
<th width="249">Surname</th>
<th width="258">No<th width="182">Email</th>
</tr>
            <tr><td width="333"><input type="text" name="name" size="45"></td>
                <td width="249">
                <!--webbot bot="Validation" s-display-name="name" s-data-type="Integer" s-number-separators="x" i-maximum-length="12" --><input type="text" name="name2" size="10" maxlength="11"></td>
                <td width="258"> 
                &nbsp;<input type="text" name="name3" size="10" maxlength="11"></td>
                <td width="182"><input type="text" name="email" size="20"></td>
        </tr>
            <tr>
                <td width="333">&nbsp;</td>
                <td width="249">&nbsp;</td>
                <td colspan="2">&nbsp;</td>
            </tr>
<tr><th width="333">Address</th>
    <th width="249">area 1</th>
<th colspan="2">area 2</th>
            </tr>
            <tr>
                <td width="333">
        <textarea rows="4" name="address" cols="39"></textarea></td>
                <td width="249">

        <input type="text" name="area1" size="20"><br>
        <b>area 3</b><br>
        <input type="text" name="area2" size="20"></td>
                <td colspan="2">

        <input type="text" name="area3" size="20"><br>
        <b>area 4</b><br>
        <input type="text" name="area4" size="20" maxlength="4"></td>
            </tr>
            <tr>
<th width="333">&nbsp;</th>
<th width="249">area 5</th>
<th colspan="2">area 6</th>
            </tr>
            <tr>
                <td width="333"> 

        &nbsp;</td>
                <td width="249"> 

        <input type="text" name="area5" size="20">
        <font color="#666666">(description)<br>
&nbsp;</font></td>
                <td colspan="2">

<input type="text" name="area6" size="20"><font color="#666666">(description)</font></td>
            </tr>
            <tr>
<th width="333">additional information</th>
<th width="249">&nbsp;</th>
<td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">

                  <textarea name="message" cols="93" rows="5"></textarea></td>
            </tr>
            <tr>
                <td width="333" align="center">
                <p align="left">div 1 
<INPUT type="radio" name="hosting_package" id="hosting_package_1" value="1" class="validate[required] radio" onClick="HostingSpec(this);" /></td>
                <td width="249" align="center">
                <p align="left">div 2
              <input type="radio" name="hosting_package" id="hosting_package_2" value="2" class="validate[required] radio" onClick="HostingSpec(this);" />
                <br>
                </td>
<td colspan="2"><br>
</td>
            </tr>
            <tr id="first_giz" style="display:none;">
<th width="333">Company</th>
<th width="249">
&nbsp;</th>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr id="first_giz_1" style="display:none;">
<td width="333"><select size="1" name="company">
        <option>test 1</option>
        <option>test 2</option>
        </select></td>
<td width="249"><br>
&nbsp;</td>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr id="second_giz" style="display:none;">
                <td width="333">
<b>company 2<br>
<br>
</b>
<select size="1" name="company2">
<option>test 1</option>
<option>test 2</option>
<option>test 3</option>
        </select><br>
<br>
<br>
<br>
<br>
<br>
&nbsp;</td>
                <td width="249">
<b>company 3<br>
</b>
<select size="1" name="company3">
        <option>test 1</option>
        <option>test 2</option>
        <option>test 3</option>
        </select><b><br>
<br>
area 7<br>
        </b><input type="text" name="test1" size="10"><b><br>
    area 8<br>
        </b>


        <input type="text" name="test2" size="10"><br>
&nbsp;</td>
                <td colspan="2">
&nbsp;</td>
            </tr></table>
<table border="0" width="1151" cellspacing="0" cellpadding="0">
    <tr>
        <td width="1151">

    <tr>
        <td width="1151">

<blockquote>
    <blockquote>
        <blockquote>
            <blockquote>
                <blockquote>
                    <blockquote>
                        <blockquote>
                            <blockquote>
                                <blockquote>
                                    <input type="submit" name="button" value="Submit" style="height: 50px; width: 200px; font-size:14pt; font-weight:bold; float:right"></blockquote>
                            </blockquote>
                        </blockquote>
                    </blockquote>
                </blockquote>
            </blockquote>
        </blockquote>
    </blockquote>
</blockquote>
        </td>
    </tr>
</table>
</form></p>
        <a href="javascript: void(0)" onClick="ClosePopup();">
        <font color="#FFFFFF" style="font-size: 9pt">x</font></a><span style="font-size: 9pt">
        </span>
        </div>
</body>
4

3 回答 3

2

试试这个链接wordpress 简单表单插件并在帖子中显示短代码

这样,您可以使用短代码将您的 php 代码直接包含到您的帖子中。我希望这会对你有所帮助。

于 2013-01-16T16:40:56.307 回答
1

你介意解释一下原因吗?如果您想在博客文章中显示整个网页,最好使用iframe

于 2013-01-16T16:43:24.767 回答
1

如果我正确理解您的问题,您的意图是在您的 wordpress 帖子中包含 HTML、PHP、CSS、Javascript 或其他一些代码。有很多插件可以做到这一点。但是,由于主题不同,某些插件可能无法按预期工作。

我最近遇到了一个名为Crayon Syntax Highlighter的插件,它可以与我的多个博客一起使用。按照此处指示的说明安装它并尝试。

于 2013-01-16T17:25:38.007 回答