Html 我想知道是什么使文本发生了变化?Css/Php
你好,我的网站有问题。所有按钮都会将您重定向到不同的页面Homemypage.php有关memore.php的更多信息请联系meRegister.phpHtml 我想知道是什么使文本发生了变化?Css/Php,html,css,Html,Css,你好,我的网站有问题。所有按钮都会将您重定向到不同的页面Homemypage.php有关memore.php的更多信息请联系meRegister.php <?php include_once 'dbconfig.php'; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My page</ti
<?php
include_once 'dbconfig.php';
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My page</title>
<link rel="stylesheet" href="style2.css" type="text/css" />
<style>
<?php include 'style.css'; ?>
</style>
</head>
<body>
<?php include 'links.php';?>
<center>
<div id="body">
<div id="content">
<table align="center">
<tr>
<th colspan="5"><a href="add_data.php">add data here.</a></th>
</tr>
<th>Name</th>
<th>Last Name</th>
<th>City Name</th>
<th colspan="2">Operations</th>
</tr>
<?php
$sql_query="SELECT * FROM users";
$result_set=mysqli_query($con,$sql_query);
while($row=mysqli_fetch_row($result_set))
{
?>
<tr>
<td><?php echo $row[1]; ?></td>
<td><?php echo $row[2]; ?></td>
<td><?php echo $row[3]; ?></td>
<td align="center"><a href="javascript:edt_id('<?php echo $row[0]; ?>')"><img src="edit.png" align="EDIT" /></a></td>
<td align="center"><a href="javascript:delete_id('<?php echo $row[0]; ?>')"><img src="delete.png" align="DELETE" /></a></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
</center>
</body>
</html>
我只是想知道为什么当我点击联系人meRegister.php时,下面的文本会发生变化
其他页面应该是这样的
他们都有相同的css脚本写在下面
style.css
h1{color:yellow;}
h2{color: yellow;}
body{outline-style: dotted;outline-color: yellow;}
.r{font-family: verdana}
body {background-image: url("c.jpg");}
#h{border-radius: 50%;}
.1{border-radius: 20%;}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgba(255,255,255,0.5);
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
}
li a {
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
border-right: 1px solid #111;
}
li a:hover{
background-color: yellow;}
#content2{
margin-top: 100px;
color:blue;
}
register.php
<?php
include_once 'dbconfig.php';
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My page</title>
<link rel="stylesheet" href="style2.css" type="text/css" />
<style>
<?php include 'style.css'; ?>
</style>
</head>
<body>
<?php include 'links.php';?>
<center>
<div id="body">
<div id="content">
<table align="center">
<tr>
<th colspan="5"><a href="add_data.php">add data here.</a></th>
</tr>
<th>Name</th>
<th>Last Name</th>
<th>City Name</th>
<th colspan="2">Operations</th>
</tr>
<?php
$sql_query="SELECT * FROM users";
$result_set=mysqli_query($con,$sql_query);
while($row=mysqli_fetch_row($result_set))
{
?>
<tr>
<td><?php echo $row[1]; ?></td>
<td><?php echo $row[2]; ?></td>
<td><?php echo $row[3]; ?></td>
<td align="center"><a href="javascript:edt_id('<?php echo $row[0]; ?>')"><img src="edit.png" align="EDIT" /></a></td>
<td align="center"><a href="javascript:delete_id('<?php echo $row[0]; ?>')"><img src="delete.png" align="DELETE" /></a></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
</center>
</body>
</html>
links.php
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="more.php">More about me</a></li>
<li><a href="Register.php">Contact me</a></li>
</ul>
add_data.php
<?php
include_once 'dbconfig.php';
if(isset($_POST['btn-save']))
{
// variables for input data
$Name = $_POST['Name'];
$Nickname = $_POST['Nickname'];
$Email = $_POST['Email'];
$Phone_number = $_POST['Phone_number'];
$Home_address = $_POST['Home_address'];
// variables for input data
// sql query for inserting data into database
$sql_query = "INSERT INTO users(Name,Nickname,Email,Phone_number,Home_address) VALUES('$Name','$Nickname','$Phone_number',$'Home_address')";
// sql query for inserting data into database
// sql query execution function
if(mysqli_query($con,$sql_query))
{
?>
<script type="text/javascript">
alert('Data Are Inserted Successfully ');
window.location.href='index.php';
</script>
<?php
}
else
{
?>
<script type="text/javascript">
alert('error occured while inserting your data');
</script>
<?php
}
// sql query execution function
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
<?php include 'style.css';?>
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Page :)</title>
</head>
<body>
<?php include 'links.php';?>
<center>
<div id="header">
<div id="content2">
<label>Contact me</label>
</div>
</div>
<div id="body">
<div id="content">
<form method="post">
<table align="center">
<tr>
<td><input type="text" name="Name" placeholder="Name" required /></td>
</tr>
<tr>
<td><input type="text" name="Nickname" placeholder="Nickname" required /></td>
</tr>
<tr>
<td><input type="text" name="Email" placeholder="Email" required /></td>
</tr>
<tr>
<td><input type="text" name="Phone_number" placeholder="Phone Number" required /></td>
</tr>
<tr>
<td><input type="text" name="Home_address" placeholder="Home Address" required /></td>
</tr>
<tr>
<td><button type="submit" name="btn-save"><strong>SAVE</strong></button></td>
</tr>
</table>
</form>
</div>
</div>
</center>
</body>
</html>
样式表style2.css将主体字体设置为字体系列:Courier New、Courier、monospace;样式表style.css不设置主体字体
Register.php引用style2.css,因此其主体字体设置为新。add_data.php不引用style2.css,因此其主体字体将默认为Times New Roman
这就是为什么它们有不同的字体。要修复它,请添加字体系列:Courier New、Courier、monospace;添加到style.css中的主体样式,或从style2.css中删除该样式,具体取决于您需要的字体。您可以提供more.php或mypage.php的代码吗?另外,您正在链接第二个css表style2.css,请检查是否也可以使用将css文件包含在HTML中,您可以发布links.php的代码吗?@Blinkydamo添加