escaping - HTML PHP string special character escape
Get the solution ↓↓↓Just wondering if it is possible to write link button using PHP with so many special characters in the string.
$link='index.php?topic=transactions&content=transaction_adjustment&tx_number='.$tx_number;
echo '<button type="button" onclick="window.location.href="'.$link.'"">Adjust</button>';
Answer
Solution:
Try the following:
$link='index.php?topic=transactions&content=transaction_adjustment&tx_number='.$tx_number;
echo '<button type="button" onclick="window.location.href=\''.$link.'\'">Adjust</button>';
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: trying to access array offset on value of type null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.