ID:1230265
 
(See the best response by GhostAnime.)
Code:
        EditProfile()
set hidden = 1
switch(input("Which part of your profile would you like to edit?") in list ("Cancel","My Image"))
if("Cancel")
return
if("My Image")
switch(input("Please select from the list of current image's you have.") in list ("Cancel","Test","Test2"))
if("Cancel")
return
if("Test")
src.img='PNGS/test.png'
if("Test2")
src.img='PNGS/test2.png'

mob/Login()
. = ..()
usr << output({"<html>
<head><center><title>"
[src.key]"</title></center></head>

<body bgcolor=gray text=black>



<br><font face="Garamond" size="3px" color="black">

<table border bgcolor=white text=black align=right>
<tr>
<th colspan="2" class="mainheader" bgcolor="#C0C0C0"><center>"
[src.key]"</center></th>
</tr>
<tr>
<td colspan="2"><center><img src="
[src.img]"width="230" height="240"></center></td>


Problem description: Same problem, The img will not change even though you click test 1 or 2. I tried what Albro said in my other post, Didn't work.

Get rid of the semicolon after the img src. Please don't delete your posts after they have been answered because other people can use these to fix their problems.
I got rid of the semicolon, The img still won't show where it needs to be.
In response to Marcus55
Since you are trying to display it with HTML, you need to have the image in the user's cache in order to display it.

This is done using browse_rsc()

This is also noted in the example of the icon text macro

Example of how to use:
X << browse_rsc(icon/image file reference, "output_name.png") //  png chosen as the extension for this example though, IIRC, you don't need it

X << browse({"You look like this: <img src = "output_name.png">"})
/*
Of course, in your case, this is output() but same idea.

In output(), a \icon text macro would be better... but meh

The {"..."} is an unbreakable string, hence why the "" in the img tag didn't break the string.

Alternatively, if you did not use {"..."} and going with just "...", you would need to backslash the img tag quotes so it doesn't break the string: ...<img src = \"...\">...

*/
Tried it that way Ghost, Still didn't work out the way I wanted.
Well we told you how to make it work. You have to tell us more specifically what is wrong.
Okay, Well what I want to happen is when you go to the window with the profile and button to edit profile. All interface wise.

When you click Edit Profile button, It brings up the window that ask if you want to change your description or profile image. You click My Image and it will bring up a list of options, Then when you click Option one the [img] in the HTML profile would change to that option, Or if you click option 2 the [img] in the HTML changes to that one e.t.c
Is the image showing but not showing how you want it or not showing at all?
Not showing at all.
Mind showing us your entire code for making it show, including the browse_rsc that GhostAnime told you to use?
Lemme re-add it when I get back from lunch.
<td colspan="2"><center><img src = \"test.png\"><width="230" height="240"></center></td>


That's how I thought to set it up
In response to Marcus55
Best response
There is no point of the backslash being there, get rid of them. Make sure you are calling the browse_rsc() before that snippet as well.
{"......
<td colspan="2"><center><img src = "test.png"><width="230" height="240"></center></td>
......"}

The case for the backslash will be demonstrated here:
X = "This single string would be \"broken\" without the backslash here"

X = "See what "happened"?" <-- The appearance of "" without \ in a single string ("...") broke it


When using the paragraph string ({"..."}, which I can't recall the correct name of), this is not an issue:

X = {"I can use " this as " many times as I want and it won't break " because the string will stop when this appears : "}

// Same thing as the above but using "..." instead of {"..."}

Y = "I can use " this as " many times as I want and it won't break " because the string will stop when this appears : "
// Disregards Y statement, it is identical to the X right before it, which it was meant for. You can see that the string broke for Y
EditProfile()
set hidden = 1
switch(input("Which part of your profile would you like to edit?") in list ("Cancel","My Image"))
if("Cancel")
return
if("My Image")
switch(input("Please select from the list of current image's you have.") in list ("Cancel","Test","Test2"))
if("Cancel")
return
if("Test")
usr.FIMG='PNGS/test.png'
if("Test2")
usr.FIMG='PNGS/test2.png'
mob/var
FIMG
mob/Login()
..()
usr << output({"<html>
<head><center><title>"
[src.key]"</title></center></head>

<body bgcolor=gray text=black>



<br><font face="Garamond" size="3px" color="black">

<table border bgcolor=white text=black align=right>
<tr>
<th colspan="2" class="mainheader" bgcolor="#C0C0C0"><center>"
[src.key]"</center></th>
</tr>
<tr>
<td colspan="2"><center><IMG CLASS=icon SRC=\ref
[usr.FIMG]"</center></td>
In response to Chumble93
1. Don't use usr in Login().
2. Use input() as null | anything in list("My Image"), which adds a Cancel button automatically.
3. You still need to use browse_rsc() to put images into the cache.
Something like this..

EditProfile()
set hidden = 1
switch(input("Which part of your profile would you like to edit?") in list ("Cancel","My Image"))
if("Cancel")
return
if("My Image")
switch(input("Please select from the list of current image's you have.") in list ("Cancel","Test","Test2"))
if("Cancel")
return
if("Test")
src.img='PNGS/test.png'
if("Test2")
src.img='PNGS/test2.png'
refreshBrowser()

mob/verb/exampleOfHowToShowImageThroughBrowser()
src<<browse_rsc([src.img,"Img.png")
src<<output({"
<script></script>
<img src=Img.png>"}
,"browser")//script tag required to run any script using BYOND. Even built in ones.


mob/proc/refreshBrowser()
src<<browse_rsc(src.img,"Img.png")
src<<output("","browser:document.location.reload")