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,294
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    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>"
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    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,294
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #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
    824
    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,294
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    @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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

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