如何解决此错误 [英] How to fix this error

查看:67
本文介绍了如何解决此错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我终于可以将数据插入到我的数据库中,但事实是,当输入数据时,它会进入欢迎页面但是有一个在我的欢迎页面中我需要修复的错误。



它与代码有关。我不知道我是否以错误的方式构造它,或者如果遗漏了语法,有些人会指出我如何解决它。



这是我收到的错误:



)注意:未定义的索引:第25行的C:\ wamp64 \\\\ [x] pt中的第一个名称





我尝试了什么:



这是我尝试过的。



 <   pre  >  <? php 

session_start() ;

if(isset($ _ SESSION [' user']))
{
header(' Location:login.php');
}

?>
<? xml version = 1.0 encoding = UTF-8 ?>
< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.1 // EN

http://www.w3.org/TR/xhtml11.dtd & gt;

< html xmlns = http:www.w3.org/1999/xhtml xml:lang = < span class =code-keyword> zh lang = zh >

< head >
< title > 欢迎 - <? php echo 。$ _ SESSION [' user']; ?> < / title < span class =code-keyword>>
< / head >
< body >




欢迎!!! <? php echo $ _POST [' firstname']; ?> <? php echo $ _POST [' lastname']; ?>
<? php
echo 您现在是加勒比海烹饪网络(CCIN)的成员。
您的每月时事通讯将通过电子邮件发送给您。

?>


< / body >
< / html >

解决方案

_SESSION [' user']))
{
header(' Location :的login.php');
}

?>
<? xml version = 1.0 encoding = UTF-8 ?>
< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.1 // EN

http://www.w3.org/TR/xhtml11.dtd & gt;

< html xmlns = http:www.w3.org/1999/xhtml xml:lang = < span class =code-keyword> zh
lang = zh >

< head >
< title > 欢迎 - <? php echo


_SESSION [' user'< /跨度>]; ?> < / title < span class =code-keyword>>
< / head >
< body >




欢迎!!! <? php echo


_POST [' firstname']; ?> <? php echo

hi all

I have finally get to insert data into my database but the thing is, when data is entered it went to the welcome page but there is an error in my welcome page that i need to fix.

it has something with the code. I dont know if I have constructed it the wrong way or if have left out a syntax can some point me in the direction into how to fix it.

this is the error that I have recieved:

) Notice: Undefined index: firstname in C:\wamp64\www\luana_itec244\php\welcome.php on line 25



What I have tried:

this is what I have tried.

<pre><?php

	session_start();
	
	if(isset($_SESSION['user']))
	{
		header('Location:login.php');
	}

?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

"http://www.w3.org/TR/xhtml11.dtd">

<html xmlns="http:www.w3.org/1999/xhtml"xml:lang="en" lang="en">

	<head>
		<title> Welcome - <?php echo "".$_SESSION['user']; ?></title>
	</head>
	<body>
		
		
			
			
			Welcome!!! <?php echo $_POST['firstname']; ?><?php echo $_POST['lastname'];?>
			<?php
				echo " you are now a member of the Caribbean Culinary Network (CCIN). 
						Your monthly newsletter will be email to you."
			?>
	
	
	</body>
</html>

解决方案

_SESSION['user'])) { header('Location:login.php'); } ?> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11.dtd"> <html xmlns="http:www.w3.org/1999/xhtml"xml:lang="en" lang="en"> <head> <title> Welcome - <?php echo "".


_SESSION['user']; ?></title> </head> <body> Welcome!!! <?php echo


_POST['firstname']; ?><?php echo


这篇关于如何解决此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆