未找到对象XAMPP PHP错误
我试图运行一个php文件使用xampp,但我得到的对象没有找到错误,我看了一些视频,人们说创建另一个文件夹,并在该文件夹下运行,但这是不适合我!请看下面的屏幕截图,如果你能帮助我理解为什么这不起作用 请注意,即使我使用另一个文件,如footer.php,我也会收到相同的错误 这是mens.php的代码,我没有把它包括在屏幕截图中未找到对象XAMPP PHP错误,php,xampp,Php,Xampp,我试图运行一个php文件使用xampp,但我得到的对象没有找到错误,我看了一些视频,人们说创建另一个文件夹,并在该文件夹下运行,但这是不适合我!请看下面的屏幕截图,如果你能帮助我理解为什么这不起作用 请注意,即使我使用另一个文件,如footer.php,我也会收到相同的错误 这是mens.php的代码,我没有把它包括在屏幕截图中 <?php session_start(); //unset($_SESSION['basket']); ?> <!DOCTYPE html>
<?php
session_start();
//unset($_SESSION['basket']);
?>
<!DOCTYPE html>
<html>
<head>
<!-- External Stylesheet -->
<link rel="stylesheet" href="style.css" type="text/css" />
<title>Mens</title>
</head>
<body>
<div class="bar">Sale Now On!</div>
<div id="outer">
<?php
include('header.php');
?>
<!-- All content will be wrapped insisde this container -->
<div id="container">
<!-- Page -->
<h2>Mens Clothing</h2>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="headings">
<th style="width: 20%;">Photo</th>
<th style="width: 30%;">Desciption</th>
<th style="width: 10%;">Size</th>
<th style="width: 10%;">Price</th>
<th style="width: 10%;">Qty</th>
<th style="width: 20%;">Action</th>
</tr>
<form action="addtocart.php" method="post" name="addtocart">
<tr class="datarow">
<td style="width: 20%; text-align: center; border-left:dotted
1px #333; border-bottom: dotted 1px #333; border-right:dotted 1px #333;">
<img src="img/suit.jpg" width="112px" />
</td>
<td style="width: 30%; text-align: center; border-bottom:
dotted 1px #333; border-right:dotted 1px #333;">Contempary Hugo Boss
Suit</td>
<input type="hidden" name="itemdesc" value="Contempary Hugo Boss
Suit" />
<input type="hidden" name="sku" value="100" />
<input type="hidden" name="pic" value="suit.jpg" />
<td style="width: 10%; text-align: center; border-bottom: dotted
1px #333; border-right:dotted 1px #333;">
<select name="size">
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
</select>
</td>
<td style="width: 10%; text-align: center; border-bottom:
dotted 1px #333; border-right:dotted 1px #333;">£500.00</td>
<input type="hidden" name="price" value="500.00" />
<td style="width: 10%; text-align: center; border-bottom: dotted
1px #333; border-right:dotted 1px #333;">
<select name="qty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</td>
<td style="width: 20%; text-align: center; border-bottom: dotted
1px #333; border-right:dotted 1px #333;">
<input type="submit" name="submit" value="Add to Basket" />
</td>
</tr>
</form>
<form action="addtocart.php" method="post" name="addtocart">
<tr class="datarow">
<td style="width: 20%; text-align: center; border-left:dotted
1px #333; border-bottom: dotted 1px #333; border-right:dotted 1px #333;">
<img src="img/suit1.jpg" width="112px" />
</td>
<td style="width: 30%; text-align: center; border-bottom:
dotted 1px #333; border-right:dotted 1px #333;">Wool Hugo Boss Suit</td>
<input type="hidden" name="itemdesc" value="Wool Hugo Boss Suit"
/>
<input type="hidden" name="sku" value="101" />
<input type="hidden" name="pic" value="suit1.jpg" />
<td style="width: 10%; text-align: center; border-bottom: dotted
1px #333; border-right:dotted 1px #333;">
<select name="size">
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
</select>
</td>
<td style="width: 10%; text-align: center; border-bottom:
dotted 1px #333; border-right:dotted 1px #333;">£450.00</td>
<input type="hidden" name="price" value="450.00" />
<td style="width: 10%; text-align: center; border-bottom: dotted
1px #333; border-right:dotted 1px #333;">
<select name="qty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</td>
<td style="width: 20%; text-align: center; border-bottom: dotted
1px #333; border-right:dotted 1px #333;">
<input type="submit" name="submit" value="Add to Basket" />
</td>
</tr>
</form>
</table>
</div>
</div>
<?php
include('footer.php');
?>
</body>
</html>
男人
现在开始减价!
男装
照片
描述
大小
价格
数量
行动
当代雨果老板
适合
小的
中等
大的
&磅;500
1.
2.
3.
羊毛雨果Boss套装
小的
中等
大的
&磅;450
1.
2.
3.
名为\u mens.php的文件与名为mens.php的文件不同
当您使用urllocalhost/example/mens.php
时,需要调用文件mens.php
是的,我意识到了这一点,所以我写了footer.php,但我得到了相同的错误。与其尝试localhost
不如尝试127.0.0.1
?它说无法访问站点为什么要放置端口5000?对不起,错误地放置了端口5000,仍然说找不到对象!您应该在此处添加代码,而不是链接到代码的图像。它使我们更容易调试。