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 3 of 3

Thread: Image in PHP?

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

    Image in PHP?

    I have a website and I'm trying to get text from a input box to go in put of the link for the image code. Like this:

    PHP Code:
    $to_put .= $<img src="http://res.public-craft.com/hb.php?ip=$ServerIP.&port=YOUR_PORT&on=OPTIONAL_ONLINE_IMAGE&off=OPTIONAL_OFFLINE_IMAGE"></img>."|".$ServerIP."|".$Port."|".$Password."|".$Hamachi."|".$Owner.""
    Where it says $ServerIP. is where the thing from the input box comes in.

    Here's the error I'm receiving.

    Code:
    Parse error: syntax error, unexpected T_STRING in /hermes/bosweb/web258/b2582/ipg.crowngaming/submit/process.php on line 32

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,313
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    You've made quite a few errors - this is what it should look like:

    PHP Code:
    $to_put .= "<img src=\"http://res.public-craft.com/hb.php?ip=$ServerIP&port=YOUR_PORT&on=OPTIONAL_ONLINE_IMAGE&off=OPTIONAL_OFFLINE_IMAGE\"></img>"
    I've ignored te stuff after the </img> tag as it was far too messy to understand it.

    I've no idea what you're trying to do with YOUR_PORT, OPTIONAL_ONLINE_IMAGE and OPTIONAL_OFFLINE_IMAGE but if they are supposed to be variables then they need the $ in front of them.
    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
    May 2011
    Posts
    122
    Thanks
    23
    Thanked 0 Times in 0 Posts
    They're not, thanks for the help.


  •  

    Posting Permissions

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