Jump to content

Archived

This topic is now archived and is closed to further replies.

Round

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

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Ok Nice 1.
I will let you know if it works when we go live.
Cheers :)

Share this post


Link to post
Share on other sites

×

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.