Jump to content

Displaying a users picture after login?**Solved**


Round

Recommended Posts

hello all,
At a college I work at we have a web site that students can log into to view their course progress. The site is currently written in ASP and after numerous issues with it we have decided to re-write it in PHP. Most of the code is easy to see what its currently doing and therefore easy enough to be replicated in PHP, but I have this snippet of code that I can't replicate in PHP:-

[code]<p>This is your individual Learner Profile</p>
    <img src="http://www.url.com/<%=mid(rsStu("st_id"),4,12)%>.bmp" width="100">[/code]

Its currently displaying their picture after they have logged in. How do I get PHP to do the same?
I have already set the variable $student_id which can be used to query the tables, but it doesn't look like the pictures are stored in a table?

Any help or suggestion would be a great help

Many thanks

Link to comment
Share on other sites

Thanks jvrothjr,
So do I amend the code as follows?:-
[code]<img src="http://www.url.com/substr(($student_id),4,12).bmp" width="100">[/code]
as i'm assuming <%=mid.....%> is asp specific.
or would it be:-
[code]<img src="http://www.url.ac.uk/sudstr<?php substr(($student_id),4,12) ?>.bmp" width="100">[/code]
Many Thanks
Link to comment
Share on other sites

[quote author=Round link=topic=111893.msg454202#msg454202 date=1161244502]
Thanks jvrothjr,
So do I amend the code as follows?:-
[code]<img src="http://www.collegeurl.ac.uk/qlpics/substr(($student_id),4,12).bmp" width="100">[/code]
as i'm assuming <%=mid.....%> is asp specific.
or would it be:-
[code]<img src="http://www.collegeurl.ac.uk/qlpics/<?php substr(($student_id),4,12) ?>.bmp" width="100">[/code]
Many Thanks
[/quote]

either
[code]<img src="http://www.collegeurl.ac.uk/qlpics/<?=substr($student_id,4,12) ?>.bmp" width="100">[/code]
or
[code]<img src="http://www.collegeurl.ac.uk/qlpics/<?php echo substr($student_id,4,12); ?>.bmp" width="100">[/code]

but I'm not 100% sure on the first one, but for suer the second
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.