亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在沒有javascript的情況下將值從php傳遞到簡單的html?

如何在沒有javascript的情況下將值從php傳遞到簡單的html?

PHP
侃侃爾雅 2023-05-12 14:26:07
我正在嘗試使用 php GET Info 更新我的 HTML a ref 標簽,但是我似乎無法替換獲取值這是 HTML$message = '<h2>Your confirmation link</h2> <p>Click on this <a href="127.0.0.1/ResendVerification.php?passkey=$verification_Code">link</a> to activate your account</p>';我正在嘗試用我已經擁有的實際代碼替換 $verification_Code,但是由于某種原因它沒有替換,有任何指導嗎?
查看完整描述

1 回答

?
拉風的咖菲貓

TA貢獻1995條經驗 獲得超2個贊

看看引號"和'。


您混合了 HTML 和 PHP 之間的引號類型。我建議對 PHP 使用單引號,對 HTML 使用雙引號。那么,正確的字符串是:


<?php

$message = '<h2>Your confirmation link</h2>

    <p>Click on this <a href="127.0.0.1/ResendVerification.php? 

    passkey=' . $verification_Code . '">link</a> to activate your account</p>';

當您對 PHP 使用雙引號時,HTML 字符串需要轉義引號\",正確的字符串是:


<?php

$message = "<h2>Your confirmation link</h2>

    <p>Click on this <a href=\"127.0.0.1/ResendVerification.php? 

    passkey=$verification_Code\">link</a> to activate your account</p>";


查看完整回答
反對 回復 2023-05-12
  • 1 回答
  • 0 關注
  • 118 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號