English 中文(简体)
2. 如何通过母子标签通过变数
原标题:how to pass variable through a href tag

i 有一个网站提供聊天服务。 i 在聊天时为每个成员提供成员资料。 i 想向在聊天点点名点击的任何人展示成员信息。

例如:

jack
hi
jhon
hi
jack 
i m jack
jhon
i m jhon

一、导 言

$chat_messages_html .=  <li>  .  <span class="chat_message_header">  .  <a href="meeting/member_info">  . $chat_message->username .  </a> 

我的问题是如何获得可变的聊天_message->成员信息页的用户名称如何检索信息

一、希望

问题回答

添加用户id,以连接:

$chat_messages_html .=  <li>  .
                        <span class="chat_message_header">  .
                        <a href="meeting/member_info?userid=  . $userid .  ">  .
                       $chat_message->username .
                        </a> 

然后,请通过<代码>_GET[“使用”]在meeting/member_info.php上检索用户。

并请考虑使用<代码>htmlspecialchars()来规避危险内容。

You can pass it through the query string:

 <a href="meeting/member_info?username="  . $chat_message->username .  ">  . $chat_message->username .  </a> 




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签