Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: PHP image

  1. #1
    Regular Coder
    Join Date
    May 2011
    Posts
    122
    Thanks
    23
    Thanked 0 Times in 0 Posts

    PHP image

    I have this:

    PHP Code:
    $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.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Try this:

    PHP Code:
    $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>"
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #3
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    822
    Thanks
    93
    Thanked 18 Times in 18 Posts
    Quote Originally Posted by Xaqa View Post
    I have this:

    PHP Code:
    $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

  • #4
    Regular Coder
    Join Date
    May 2011
    Posts
    122
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Can someone tell me what I did wrong?

    http://www.forthelols.com

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

  • #5
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #6
    Regular Coder
    Join Date
    May 2011
    Posts
    122
    Thanks
    23
    Thanked 0 Times in 0 Posts
    I have this:

    PHP Code:
    $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?

  • #7
    Regular Coder
    Join Date
    May 2011
    Posts
    122
    Thanks
    23
    Thanked 0 Times in 0 Posts
    anyone?

  • #8
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    822
    Thanks
    93
    Thanked 18 Times in 18 Posts
    PHP Code:
    $to_put .= $ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner."|<img src=\"http://www.ceepus.info/images/icons/InfoIcon20.gif\" onmouseover=\"alert('".$Info."')\"></img> 

  • #9
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    @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.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •