尝试为会员登录时创建欢迎页面 [英] Trying to create a welcome page for when member login it

查看:98
本文介绍了尝试为会员登录时创建欢迎页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我正在尝试为会员注册/登录时创建欢迎页面,但我不知道错误在哪里。我知道那里有一个错误,但像往常一样,在我的一个主要错误中发现我的错误。我在php中执行它



php中的开头标记是红色的,因为它应该是,但结束标记是黑色的,不应该是其他代码中的表单



我把它放在一个html表单中,但它保存为php。正文和html元素的结束标记是黑色的,我不认为它应该是。它应该是蓝色的,但代码中的某处是错误的,有人可以向我解释为什么会这样。试图查看代码,但无法找到它,我甚至通过PHP验证器通过它。



这里是我试过的代码。



我尝试了什么:



hi there

am trying to create a welcome page for when a member register/login but i dont quite know where the error is. i know there is an error there somewhere but as usual, finding my errors in one of my major fault. I am doing it in php

the opening tag in php is red as it supposed to be but the closing tag is black which is not supposed to be among other codes in the form

I put it in a html form but it is saved as a php. the closing tag of the body and html element are black in color which i dont think it should be. it should be blue but somewhere in the codes is an error, can someone explain to me why it is like that. trying looking through the codes but cant find it, i even past it thru a php validator.

here is the codes that I have tried.

What I have tried:

<?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>
		
		<?php
		
		
			<h2> Welcome!!!</h2>
			
			<option value="realname"><?php echo $_SESSION['firstname']. ' ' .$_SESSION['lastname']?></option>

		?>
	
	
	</body>
</html>

推荐答案

_SESSION [' user'])){
header(' 位置: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 = zh-CN >

< head >
< title > 欢迎 - <? php echo <
_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 [' 用户]; ?> < / title < span class =code-keyword>>
< / head >
< body >

<? php


< h2 > 欢迎!!! < / h2 > ;

< 选项 value = realname > <? php echo
_SESSION['user']; ?></title> </head> <body> <?php <h2> Welcome!!!</h2> <option value="realname"><?php echo


_SESSION [' firstname']。 ' '
_SESSION['firstname']. ' ' .


这篇关于尝试为会员登录时创建欢迎页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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