如何在这个PHP代码中包含链接?

时间:2013-05-06 11:52:24

标签: php html

我对PHP不太熟悉所以我不知道该怎么做。

$error["sess_msg"] = "This email has already been used. Select another one or use Forgot Password tool." ;  

如何在此php代码中创建“Forgot Password”链接,以便用户可以点击它并重定向到正确的页面以重置密码,因为标准html在这里不起作用。

由于

4 个答案:

答案 0 :(得分:3)

$error["sess_msg"] = 'This email has already been used. Select another one or use <a href="#">Forgot Password tool.</a>' ;

答案 1 :(得分:2)

$error["sess_msg"] = 'This email has already been used. Select another one or use Forgot <a href="forgotpass.php">Password tool.</a>';

为你清理它:

$pw_reset_tool = '<a href="forgotpass.php">Forgot Password tool.</a>';

$error["sess_msg"] = 'This email has already been used.';
$error["sess_msg"] .= 'Select another one or use ';
$error["sess_msg"] .= $pw_reset_tool;

通过这种方式,您可以将链接部分放在某个变量中进行配置。

答案 2 :(得分:1)

更改为:

$error["sess_msg"] = "This email has already been used. Select another one or use <a href='YOUR_URL' />Forgot Password tool</a>." ;

答案 3 :(得分:0)

使用以下代码:

$error["sess_msg"] = "This email has already been used. Select another one or use <a href='http://your_path_to_forgot_password_page'>Forgot Password</a> tool." ;