...

View Full Version : PHP image



Xaqa
05-27-2011, 04:26 AM
I have this:


$to_put .= $ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner."|"<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover="alert('.$Info.')"></img>

I get a T_STRING error, please help. I'm not all that good at php.

tangoforce
05-27-2011, 11:12 AM
Try this:



$to_put .= $ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner."|<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover=\"alert('.$Info.')\"></img>";

//Or even this:
$to_put .= "$ServerIP|$Port$Password|$Hamachi|$Owner|<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover=\"alert('.$Info.')\"></img>";

tomharto
05-27-2011, 01:27 PM
I have this:


$to_put .= $ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner."|"<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover="alert('.$Info.')"></img>

I get a T_STRING error, please help. I'm not all that good at php.

The code tango posted should work fine, your problem was after $Owner."| you dont need the other ". It should just read $Owner."|<img ...... etc

Xaqa
05-28-2011, 12:57 AM
Can someone tell me what I did wrong?

http://www.forthelols.com

the onmouseover="alert('TEST')" doesn't work.

tangoforce
05-28-2011, 01:13 AM
Thats not a php issue - it's javascript so you should really ask in that forum.

Looking at your source though, you have an alert with a lot of html in. The alert starts like alert(' and then you have lots of html also using the ' character (so the javascript engine doesn't know where it really stops).

To fix this you need to escape all the ' characters with this slash \ - so it looks like \' all the way through the html inside the alert() function.

Xaqa
05-28-2011, 01:17 AM
I have this:


$to_put .= $ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner."|<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover=\"alert('$Info\')\"></img>

am i missing something?

Xaqa
05-28-2011, 02:12 AM
anyone?

tomharto
05-28-2011, 12:46 PM
$to_put .= $ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner."|<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover=\"alert('".$Info."')\"></img>

tangoforce
05-28-2011, 02:39 PM
@tomharto even that is wrong.

There is no "; on the end.

I'v already told the op what is wrong with his code, its down to him to listen.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum