This topic is locked

Change image from event

3/29/2012 7:57:27 AM
PHPRunner General questions
S
sickacid author

Hi, I've put an image in HTML editor with this tag.
<IMG style="WIDTH: 250px; HEIGHT: 234px" height=81 alt=PAGLIAIO src="images/vecchio.jpg" width=324 border=1>
How can I pass a var from event for change che src path of image?
for example
event php

if something happend src=image1.jpg

else src=image2.jpg

C
cgphp 3/29/2012

Please, explain what you mean for php event?

S
sickacid author 3/29/2012



Please, explain what you mean for php event?


for example in Before Login event

C
cgphp 3/29/2012

In the "After successful login" event keeps a session var with the image path.

if($username == 'admin')

$_SESSION['image_path'] = "path/to/image_1";

else

$_SESSION['image_path'] = "path/to/image_2";


then update the PHP custom script as follows:



echo "<IMG style='WIDTH: 250px; HEIGHT: 234px' height=81 alt=PAGLIAIO src='".$_SESSION['image_path']."' width=324 border=1>";