This topic is locked

How to display user's logo on the top of each page

7/21/2014 6:23:43 PM
PHPRunner Tips and Tricks
admin

Let's say your have logo field in your login table and want to display it at the top of each page when this user logs in. Sample login table structure:

ID Username Password Logo


Logo field is setup as File/Image under 'Edit as' settings so users can upload their logos.

  1. AfterSuccessfulLogin event
    Save logo field value in session variable

$_SESSION["logo"]=$data["logo"];


2. Header file
Display image saved in session variable.

<?php

$filesArray = my_json_decode($_SESSION["logo"]);

echo "<p align=center><IMG src='".$filesArray[0]['name']."'></p>";

?>
G
GregJ 1/1/2015

One quick note:
The field logo in this user table is NOT a blob field as I had assumed. Make it a varchar 500 and save yourself a few days of pain trying to make this work.

ruzgarajans 2/14/2018



One quick note:
The field logo in this user table is NOT a blob field as I had assumed. Make it a varchar 500 and save yourself a few days of pain trying to make this work.



hi, sorry ı cant speak english...
does this work?

no viewing...

pls help me

admin 2/14/2018

Yes, it does work. You need to contact support directly.

ruzgarajans 2/14/2018



Yes, it does work. You need to contact support directly.



thank you,
small jobs must be finished,

after, I will contact the support team for major issues..
demo has not finished yet.. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=84371&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

thank you..

S
Salah 2/16/2019

Dears
Good day,
I have tried it and works fine, now what the c# code which does same function ? i want to try it with asprunner.net.
thanks for all.