Round Posted October 18, 2006 Share Posted October 18, 2006 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 helpMany thanks Quote Link to comment Share on other sites More sharing options...
jvrothjr Posted October 18, 2006 Share Posted October 18, 2006 [code=php:0]substr(($STUDENT_ID),4,12)[/code] Quote Link to comment Share on other sites More sharing options...
Round Posted October 19, 2006 Author Share Posted October 19, 2006 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 Quote Link to comment Share on other sites More sharing options...
MCP Posted October 19, 2006 Share Posted October 19, 2006 [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 Quote Link to comment Share on other sites More sharing options...
Round Posted October 23, 2006 Author Share Posted October 23, 2006 Ok Nice 1.I will let you know if it works when we go live.Cheers :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.