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

Thread: syntax issues

  1. #1
    Regular Coder
    Join Date
    Jun 2010
    Thanked 0 Times in 0 Posts

    syntax issues

    I'm having a slight problem setting an img tag in a variable. This variable will be called later in the page.

    PHP Code:
    $avatar $uploadrow['avatar'];
    $avatarshow "<img src=\'/avatars/$avatar\' width=\'100\' height=\'100\'>"
    Now I am certain the problem is with my syntax in the avatarshow variable. I tested it by typing out the full name of the file, and it is shown just fine. But doing it this way causes problems. Any suggestions on fixing this code?

    (I'm not getting any mysql errors)

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,662 Times in 2,631 Posts
    Single quotes only need escaping when contained in single quotes. Remove all the \ in the string. If the problem persists it lies in the use of data, so check the generated source to confirm the expected string.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


    Posting Permissions

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