# Display custom profile field as text

**URL:** <https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678>\
**Category:** Development Help\
**Created:** [December 5, 2015, 9:14pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678 "2015-12-05T21:14:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CGlobe](https://forum.phpvms.net/user_avatar/forum.phpvms.net/cglobe/32/280_2.png) [@CGlobe](https://forum.phpvms.net/u/CGlobe)\
**Post date:** [December 5, 2015, 9:14pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/1 "2015-12-05T21:14:03Z")

</div>

Firstly, I’d like to start by saying my coding knowledge is non-existent, but I’d very much like to learn!

How would I go about displaying a custom profile field, which is just text, on another page?

Any help with code snippets or links to the right section of the documentation would be really helpful!

Thanks!

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [December 5, 2015, 9:43pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/2 "2015-12-05T21:43:04Z")

</div>

If you want it on your Pilot Roster, try this

```
<?php
$fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'FIELDNAMEHERE');
?>

```

If you want it in your Profile Page, try this

```
<?php
$fieldvalue = PilotData::GetFieldValue($userinfo->pilotid, 'FIELDNAMEHERE');
?>

```

---

<div class="post-metadata">

**Author:** ![CGlobe](https://forum.phpvms.net/user_avatar/forum.phpvms.net/cglobe/32/280_2.png) [@CGlobe](https://forum.phpvms.net/u/CGlobe)\
**Post date:** [December 5, 2015, 10:01pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/3 "2015-12-05T22:01:33Z")

</div>

Ok, it’s for the profile page, so trying this:

```
<li><strong>Station Callsign:</strong> <?php $fieldvalue = PilotData::GetFieldValue($userinfo->pilotid, 'STATION_CALLSIGN'); ?></li>

```

It’s not showing anything on the frontend though?

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [December 5, 2015, 10:05pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/4 "2015-12-05T22:05:26Z")

</div>

Oh, I forgot to mention that you have to echo the variable out, so

```
<?php echo $fieldvalue; ?>

```

---

<div class="post-metadata">

**Author:** ![CGlobe](https://forum.phpvms.net/user_avatar/forum.phpvms.net/cglobe/32/280_2.png) [@CGlobe](https://forum.phpvms.net/u/CGlobe)\
**Post date:** [December 5, 2015, 10:21pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/5 "2015-12-05T22:21:33Z")

</div>

This is what I’ve got, is this right? Still nothing showing

```
<?php
$fieldvalue = PilotData::GetFieldValue($userinfo->pilotid, 'STATION_CALLSIGN');
?>
<ul style="margin-top: 0px;">
<li><strong>Identification Number:</strong> <?php echo $pilotcode; ?></li>
<li><strong>Station Callsign:</strong> <?php echo $fieldvalue; ?></li>
<li><strong>Total Flights: </strong><?php echo $userinfo->totalflights?></li>
<li><strong>Total Hours: </strong><?php echo $userinfo->totalhours; ?></li>
</ul>

```

This is all going in profile\_main.tpl if that helps?

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [December 5, 2015, 10:26pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/6 "2015-12-05T22:26:58Z")

</div>

Has you got some information for STATION\_CALLSIGN in your admin panel for your pilot?

---

<div class="post-metadata">

**Author:** ![CGlobe](https://forum.phpvms.net/user_avatar/forum.phpvms.net/cglobe/32/280_2.png) [@CGlobe](https://forum.phpvms.net/u/CGlobe)\
**Post date:** [December 5, 2015, 10:32pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/7 "2015-12-05T22:32:10Z")

</div>

Yep, it’s a text field that says **BZN01**. Of the three accounts I have (mine and two for testing), only one account - the one I’m logged in with - has data, does that matter?

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [December 5, 2015, 10:48pm UTC](https://forum.phpvms.net/t/display-custom-profile-field-as-text/10678/8 "2015-12-05T22:48:55Z")

</div>

If you go to your admin panel, then to site & settings then to profile fields and select Show In User Profile.

If you don’t have the code for that, then verify that you’ve spelt the field correctly and put this

```
<?php
$fieldvalue1 = PilotData::GetFieldValue($userinfo->pilotid, 'STATION_CALLSIGN');
?> <?php echo $fieldvalue1; ?>

```

Because the above code works for me. And in regards to your last question, as long as you have got information for the user you are logged in as, it will show.
