Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 Round

Round
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts
  • LocationEngland

Posted 18 October 2006 - 01:15 PM

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:-

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

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


If it all gets too much just remember that, at the end of the day... It gets dark!! or that on the other hand... There are more Fingers!!
If you eventually get it right then Hip Hip ARRAY!! lol


#2 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 18 October 2006 - 02:58 PM

substr(($STUDENT_ID),4,12)

If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#3 Round

Round
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts
  • LocationEngland

Posted 19 October 2006 - 07:55 AM

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

If it all gets too much just remember that, at the end of the day... It gets dark!! or that on the other hand... There are more Fingers!!
If you eventually get it right then Hip Hip ARRAY!! lol


#4 MCP

MCP
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 19 October 2006 - 11:52 AM

Thanks jvrothjr,
So do I amend the code as follows?:-

<img src="http://www.collegeurl.ac.uk/qlpics/substr(($student_id),4,12).bmp" width="100">
as i'm assuming <%=mid.....%> is asp specific.
or would it be:-
<img src="http://www.collegeurl.ac.uk/qlpics/<?php substr(($student_id),4,12) ?>.bmp" width="100">
Many Thanks


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

but I'm not 100% sure on the first one, but for suer the second

#5 Round

Round
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts
  • LocationEngland

Posted 23 October 2006 - 08:50 AM

Ok Nice 1.
I will let you know if it works when we go live.
Cheers :)

If it all gets too much just remember that, at the end of the day... It gets dark!! or that on the other hand... There are more Fingers!!
If you eventually get it right then Hip Hip ARRAY!! lol





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users