gpt4 book ai didi

php - 弹出窗口不起作用

转载 作者:行者123 更新时间:2023-11-30 18:13:34 25 4
gpt4 key购买 nike

我在弹出窗口中使用 javascript 和 php。计划是将父页面上的行 ID 传递给弹出窗口。

这段代码运行良好:

<a href="#" onclick="PopupCenter('example.php', 'myPop1',500,400); " class="add"><img src='images/buttons/edit.png' title='Edit Content'></a>

出现弹出窗口。但是当我尝试添加 ?textID=<?$row['textID']?> ,这是我用来传递行 ID 的代码,结果如下:

<a href="#" onclick="PopupCenter('example.php?textID=<?$row['textID']?>', 'myPop1',500,400); " class="add"><img src='images/buttons/edit.png' title='Edit Content'></a>

弹出窗口不起作用。它似乎只是刷新页面。谢谢你的帮助。

这是我的完整代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<?php
include("global.php");
?>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>About | ILAM</title>

<!-- main css -->
<link href="style.css" rel="stylesheet" type="text/css">
<link href="styleAdmin.css" rel="stylesheet" type="text/css">

<script type= "text/javascript">
<!-- showHideDiv -->
function divHideShow(divToHideOrShow){
var div = document.getElementById(divToHideOrShow);
if (div.style.display == "block"){
div.style.display = "none";}
else{
div.style.display = "block";}
}

<!-- popUp -->
function PopupCenter(pageURL, title,w,h)
{
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
</head>

<!-- Body -->
<body>
<div id="pagewrap">
<!-- Header -->
<div id="header">
<div class="floating-menu">
<div class="logo"><img src="images/static/ilamLogo.png"></div>
<div class="translator">
</div>
<ul>
<li><a href="join.php">Join Us!</a></li>
<li><div class="indent">&nbsp;</div></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="career.php">Career</a></li>
<li><a href="gallery.php">Gallery</a></li>
<li><a href="facilities.php">Facilities</a></li>
<li><a href="courses.php">Courses</a></li>
<li><a href="#" class="active">About</a></li>
<li><a href="index.php">Home</a></li>
<li><a href="javascript:divHideShow('menuContentBanner');divHideShow('menuContentBannerText');divHideShow('menuOpenPost');divHideShow('menuMainPost');divHideShow('menuFooterLeft');divHideShow('menuFooterMiddle');divHideShow('menuFooterRight');">Admin</a></li>
</ul>
</div>
</div>
<!-- //Header -->
<!-- ContentBanner -->
<div id="contentBanner">
<div id="menuContentBanner" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><a href="addImage.php"><img src="images/buttons/edit.png" title="Edit Image"></a></li>
</ul>
</div>
</div>
<img src="images/headers/aboutHeader.jpg"></div> <!--BannerImage -->
<div class="textLeft">
<div id="menuContentBannerText" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><a href="#" onclick="PopupCenter('edit_article.php', 'myPop1',500,400); " class="add"><img src="images/buttons/edit.png" title="Edit Content"></a></li>
</ul>
</div>
</div>
<h3>As an Academic Institution.</h3><p> ILAM takes to heart its responsibilities, not only to its students, but also to its team, and community</p></div> <!-- BannerText -->
<!-- //ContentBanner -->
<!-- Content: Blue -->
<div id="content">
<!-- SidePost -->
<aside id="sidebar">
<section class="widget">
<ul>
<li><a href="#"><img src="images/buttons/factsbtn.png" onmouseover="this.src='images/buttons/factsbtnHover.png'" onmouseout="this.src='images/buttons/factsbtn.png'"></a></li>
<li><a href="#"><img src="images/buttons/testibtn.png" onmouseover="this.src='images/buttons/testibtnHover.png'" onmouseout="this.src='images/buttons/testibtn.png'"></a></li>
<li><a href="#"><img src="images/buttons/promosbtn.png" onmouseover="this.src='images/buttons/promosbtnHover.png'" onmouseout="this.src='images/buttons/promosbtn.png'"></a></li>
</ul>
</section>
</aside>
<!-- //SidePost -->
<!-- OpenerPost -->
<article class="openerPost">
<table>
<tr>
<div id="menuOpenPost" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><a href="#" onclick="PopupCenter('example.php?promoID=<?=$row['promo_id']?>', 'myPop1',400,400); "><img src="images/buttons/edit.png" height="27" width="65"></a></li>
</ul>
</div>
</div>
</tr>
<tr>
<td><?php
$query="SELECT * from text_tb WHERE textID = '1'";
$result=mysql_query($query);
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
echo $row[1]; // the email value
?>
</td>
</tr>
</table>
</article>
</div>
<!-- //OpenerPost -->
<!-- Content: White -->
<div id="content">
<article class="mainPost">
<table>
<tr>
<div id="menuMainPost" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><a href="addImage.php"><img src="images/buttons/edit.png" title="Edit Content"></a></li>
</ul>
</div>
</div>
</tr>
<tr><td class="title">Our Mission</td></tr>
<tr>
<td><p>As an academic institution, ILAM takes to heart its responsibilities, not only to its students,
but also to its team, and community. We know that in addition to reaching our vision for the school, ILAM has
a role and certain duties that it has to carry out.</p></td>
</tr>

<tr>
<td class="subtitle">For the Students.</td>
</tr>
<tr>
<td><p>International Language Academy Manila (I.L.A.M.) is a premier language school in Makati
City, Philippines whose mission is to provide quality education to professionals and
non-professionals aiming to be proficient in English. The school takes pride in its ESL/EFL
courses such as: Functional Grammar, Conversation, Business Writing, Business English,
Pronunciation, IELTS review, TOEIC review, etc. which are all taught in a multidisciplinary
setting to ensure comprehensive skill development in the four areas of communication (listening,
speaking, reading, and writing). Apart from teaching English, the school also intends to inculcate strong intercultural
awareness among its students by integrating outdoor activities in its curriculum. </p></td>
</tr>
<tr>
<td class="subtitle">For the Community.</td>
</tr>
<tr>
<td><p>As an academic institution, ILAM takes heart to its responsibilities in promoting education and tourism in the country, which is the reason behind its partnership with the Bureau of Immigration and various multinational companies for English training. It aims to show its foreign students how much the
country has improved, and that the Philippines is a place where they can always find another
home. ILAM goes beyond the technicalities of language. It offers students the opportunity to
foster a deeper understanding of various cultures and thus, enables them to appreciate more the
beauty of language as they get to communicate and interact with different people.</p></td>
</tr>
<tr>
<td class="subtitle">For its Team.</td>
</tr>
<tr>
<td><p>As an academic institution, ILAM takes heart to its responsibilities in promoting education
and tourism in the country, which is the reason behind its partnership with the Bureau of Immigration and various
multinational companies for English training. It aims to show its foreign students how much the
country has improved, and that the Philippines is a place where they can always find another
home. ILAM goes beyond the technicalities of language. It offers students the opportunity to
foster a deeper understanding of various cultures and thus, enables them to appreciate more the
beauty of language as they get to communicate and interact with different people.</p></td>
</tr>
</table>
</article>
</div>

<footer id="footer">
<table>
<tr>
<td>
<div id="menuFooterLeft" class="menuBarStyle">
<a href="addImage.php"><img src="images/buttons/edit.png" title="Edit Content"></a>
</div>
<h3>Let's Meet</h3>
<p>2/F Makati Creekside Mall Bldg. Amorsolo Cor. VA Rufino St. Legazpi Village, Makati City Philippines</p></td>
<td>
<div id="menuFooterMiddle" class="menuBarStyle">
<a href="addImage.php"><img src="images/buttons/edit.png" title="Edit Content"></a>
</div>
<h3>Let's Talk</h3>
<p>Telephone: 632-8400285 / 519 9502<br>Cellphone: 0917-5324332</p></td>
<td>
<div id="menuFooterRight" class="menuBarStyle">
<a href="addImage.php"><img src="images/buttons/edit.png" title="Edit Content"></a>
</div>
<h3>The Affiliates</h3>
<p>Accenture<br>
Asian Institute of Management<br>
ConveyThis<br>
The Little Web Directory<br></td>
</tr>
<tr>
<td class="copyright">Copyright &copy; 2012 ILAM</td>
</tr>
</table>
</footer>
</div>
<!-- /#pagewrap -->

</body>
</html>

最佳答案

你需要像这样使用echo:

<?php echo($row['textID']) ?>

关于php - 弹出窗口不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13938988/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com