简体   繁体   English

PHP HREF URL 链接无法打开网页

[英]PHP HREF URL Link not opening webpage

I have an HREF link which allows my users to click a button(image) and they then get routed to the payment engine.我有一个 HREF 链接,它允许我的用户点击一个按钮(图像),然后他们被路由到支付引擎。 Based on the clients account type depends on which link he is sent to.基于客户的帐户类型取决于他被发送到哪个链接。 What i have done is i have used a string in my HREF and then declared the string as a SQL statement which checks the clients account type and brings back the correct link.我所做的是在我的 HREF 中使用了一个字符串,然后将该字符串声明为一个 SQL 语句,该语句检查客户帐户类型并带回正确的链接。 I have check the SQL script is working fine and brining back the correct link BUT when i click on the button a get a Error 404 ie its not finding the link on my localhost but i want it to go to the internet not my local host.我已经检查过 SQL 脚本是否工作正常并恢复了正确的链接,但是当我单击按钮时出现错误 404,即它在我的本地主机上找不到链接,但我希望它去互联网而不是我的本地主机。 My code:我的代码:

<div class="paynow"><a href="$payfastl"><img src="./img/paynow.png"> 
</a></div>

$userloggedin= $_SESSION['user_id'];

$payfastl=("SELECT Payment_Link.Link
FROM Payment_Link
inner join phpro_users on Payment_Link.Amount=phpro_users.Amount_Due
where phpro_users.User_Id= $userloggedin
order by phpro_users.Date_Created
limit 1");

Can anyone pick up my mistake ?任何人都可以接受我的错误吗? Thanks in advance :)提前致谢 :)

SQL statements are not URLs. SQL 语句不是 URL。

You need to run your SQL through your database, get the URL back, and then use the URL in your href attribute.您需要通过数据库运行 SQL,取回 URL,然后在您的href属性中使用该 URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM