doutan6286 2017-12-28 12:20 采纳率: 100%
浏览 235

如何在另一个个人资料页面上回显内容中的用户名

If I had to explain more specifically. If user "A" was to look at user "B"'s profile page at the top of the content I would like it to say "Welcome "A" hope you enjoy my profile." Currently as a way of logging in and setting a username I have the following code.

<pre>
<button class="btn btn-default btn-block" for="charName_118563" name="charName" value="Serina_Locher" style="border-top-right-radius:0;border-bottom-right-radius: 0;">
                                    <b><span style="color: #bf16fe;">Serina_Locher</span></b>
                                </button>
</pre>

Or rather I was under the impression that this amount of code was enough to pull just the value set for charName out of an active account looking at a profile. I've tried echoing it with

?php
echo 'Welcome "charName". Hope you enjoy my profile.'
?>

But it did not work. Any suggestions would be helpful. I'd like to apologize if my question is worded oddly. Also The "<?" seems to make the entire text go blank before posting it.

EDIT:

to be highly specific rp.aryion.com/account.srv uses a method from what I can only deduce is a form of 2 part login to a chat room. on our profile pages after the 2nd login we are allowed to use web design code to create our own profiles from basically scratch. However I can't seem to locate the method used to store user names in order to echo it onto my page. In like a "User A" Is a friend.

EDIT2:

<pre>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width initial-scale=1, maximum-scale=1">
    <meta http-equiv="content-language" content="en-us"> 
    
    <!-- Global CSS -->
    <link rel="stylesheet" href="/static/jslib/jquery.jgrowl.css" />
    <link rel="stylesheet" href="/static/css/bootstrap-jchat.css" />
    <link rel="stylesheet" href="/static/jslib/bootstrap-tagsinput/bootstrap-tagsinput.css" />
    
    <!-- Global Javascript -->
    <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.js"></script>
    <script type="text/javascript" src="/static/concat/bootstrap_headers.js"></script>
    <title>ETA ::Character Select</title>
    <style>
        .btn-default.active {
            border-color: #66afe9;
            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
            outline: 0 none;
          }
    </style>
        
</head>
<body>
    <!--    
    <pre>
    Debugging Info:
    Account: Account{id=74975, accountName=ShadeyAnaconda, domain=aryion.com}</pre>
    -->
    <div class="container">
        <div class="page-header">
            <h1>Character Login</h1>
        </div>
        
        <div class="panel panel-default">
            <div class="panel-heading">
                Welcome ShadeyAnaconda, please choose a character and login.
            </div>
            <div class="panel-body">
                <form id="sso-login-form" action="account.srv" method="POST">
                    <input type="hidden" name="command" value="charLogin" />

                    <div class="form-group">
                        <label for="username">Account Name</label>
                        <p class="form-control-static"><span id="sso-username">ShadeyAnaconda@aryion.com</span>
                        (From Single-Sign-On with <a href="https://aryion.com/">Aryion.com</a>) - <a href="login.srv?mode=accountLogout">Logout &amp; Switch Account</a></p>
                    </div>
                    <div class="form-group">
                        <label for="room">Choose Room</label>
                        
                        <div class="btn-toolbar">
                            <div class="btn-group" data-toggle="buttons">
                                <label class="btn btn-default active">
                                        <input checked="" type="radio" name="room" value="3"> Out-Of-Chat-World</label>
                                <label class="btn btn-default ">
                                        <input  type="radio" name="room" value="2"> Vore Room</label>
                                <label class="btn btn-default ">
                                        <input  type="radio" name="room" value="1"> Roleplay Room</label>
                                <label class="btn btn-default ">
                                        <input  type="radio" name="room" value="4"> Games Room</label>
                                <label class="btn btn-default ">
                                        <input  type="radio" name="room" value="5"> Library</label>
                                </div>
                        </div>
                    </div>
                    <div class="form-group" style="max-width: 300px;">
                        <label>Click Character to Login</label>
                        <div>
                            <!-- Using input-group so it spans entire width of column -->
                            <div class="input-group">
                                    <!--
                                    <span class="input-group-addon">
                                        <input type="radio" name="charName" value="Username" id="charName_######">
                                    </span>
                                    -->
                                    <!--
                                    <label class="btn btn-default btn-block active" for="charName_117774" style="border-top-right-radius:0;border-bottom-right-radius: 0;">
                                       <input checked="" type="radio" name="charName" value="Name" style="display: none;"> <b><span  style='color: #f20d12;'>Name</span></b>
                                    </label>
                                    -->
                                    <button class="btn btn-default btn-block" for="charName_117774" name="charName" value="Name"  style="border-top-right-radius:0;border-bottom-right-radius: 0;">
                                        <b><span  style='color: #f20d12;'>Name</span></b>
                                    </button>
                                    <span class="input-group-btn">
                                        <a class="btn btn-default dropdown-toggle" data-toggle="dropdown">Edit <span class="caret"></span></a>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                            <li><a href="profileEdit.srv?cid=117774&page=profile" target="_blank"><i class="glyphicon-wrench glyphicon"></i> Edit Profile</a></li>
                                            <li><a href="profileEdit.srv?cid=117774&page=prefs" target="_blank"><i class="glyphicon-heart glyphicon"></i> Edit Preferences</a></li>
                                            <li><a href="profileEdit.srv?cid=117774&page=settings" target="_blank"><i class="glyphicon-cog glyphicon"></i> Edit Settings</a></li>
                                        </ul>
                                    </span>
                                </div>
                            <div class="input-group">
                                    <!--
                                    <span class="input-group-addon">
                                        <input type="radio" name="charName" value="Serina_Locher" id="charName_118563">
                                    </span>
                                    -->
                                    <!--
                                    <label class="btn btn-default btn-block " for="charName_118563" style="border-top-right-radius:0;border-bottom-right-radius: 0;">
                                       <input  type="radio" name="charName" value="Serina_Locher" style="display: none;"> <b><span  style='color: #bf16fe;'>Serina_Locher</span></b>
                                    </label>
                                    -->
                                    <button class="btn btn-default btn-block" for="charName_118563" name="charName" value="Serina_Locher"  style="border-top-right-radius:0;border-bottom-right-radius: 0;">
                                        <b><span  style='color: #bf16fe;'>Serina_Locher</span></b>
                                    </button>
                                    <span class="input-group-btn">
                                        <a class="btn btn-default dropdown-toggle" data-toggle="dropdown">Edit <span class="caret"></span></a>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                            <li><a href="profileEdit.srv?cid=118563&page=profile" target="_blank"><i class="glyphicon-wrench glyphicon"></i> Edit Profile</a></li>
                                            <li><a href="profileEdit.srv?cid=118563&page=prefs" target="_blank"><i class="glyphicon-heart glyphicon"></i> Edit Preferences</a></li>
                                            <li><a href="profileEdit.srv?cid=118563&page=settings" target="_blank"><i class="glyphicon-cog glyphicon"></i> Edit Settings</a></li>
                                        </ul>
                                    </span>
                                </div>
                            </div>
                    </div>
                    <!--
                    <div class="form-group">
                        <button class="btn btn-default">Login</button>
                    </div>
                    -->
                </form>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">New Character</div>
            <div class="panel-body">
                <a class="btn btn-primary" href="account.srv?command=showCreate" id="showCreate" value="Login" class="ui-state-default ui-corner-all">Create A New Character</a>
            </div>
        </div>

        <div class="page-header">
            <h1>Instructions</h1>
        </div>
        <ol>
            <li>
                <h3>Before entering the muck:</h3>
                <p>Perhaps try reading the Wiki, or supplying a better page than this blatant copy of C<sup>3</sup></p>
            </li>
            <li>
                <h3>On character creation:</h3>
                <p>To create a new character, click on the <u>Create New Character</u> button and enter the information required.</p>
                <p>If you have trouble logging in to the main site, creating a character, or migrating a character, please <a href="mailto:admin@aryion.com">contact us</a>.</p>
            </li>
        </ol>
    </div>
</body>
</html>
</pre>

</div>
  • 写回答

1条回答 默认 最新

  • douqian3712 2017-12-28 13:14
    关注

    You can do this:

    1. If user A is current logged in user, then its name can be in session variable.
    2. Using that session variable you can echo that session variable on any profile page. e.g:
    1. If there is no such session variable, you can post user A's data to other's profile page using HTML form with method post and submit to profile page.

    2. Also you can redirect profile page with user id in url. Can get user info using that user id.

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?