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

Thread: Display help.

  1. #1
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts

    Question Display help.

    I have a search engine and have dynamic META description tags for my results. They however do not when you click view all media results for this listing which takes you to a media results page for that link.

    I am using this
    PHP Code:
        $description    'Desc'
    The rest of my code does a Preg_replace and removes the Desc and puts in the dynamic text for that page.

    On my media results in the description it is static but also shows Desc in it because the code doesn't work for it like I said. Is there a way I can change Desc to $query to show the query instead by using echo or something?

    here is what I am trying to do.
    PHP Code:
    $description    'echo "".$query.""'
    I know this doesn't work but I thought the example may help.
    Is there a way for me to throw in echo or something in there to make that work? any info is appreciated. thanks.

  • #2
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts
    Basically I am asking, how could I place an echo or print statement into this?

    PHP Code:
    $description    'Desc'
    Desc being where the echo or print would go.

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Is that honestly a serious question?

    Code:
    $description = htmlspecialchars($query);

  • #4
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by MattF View Post
    Is that honestly a serious question?

    Code:
    $description = htmlspecialchars($query);
    Unfortunately it is, and that doesn't work. It doesn't display anything. It will display htmlspecialchars($query) if I put

    PHP Code:
    $description 'htmlspecialchars($query)'
    But I already knew that. Anything will display between the ''
    Thats why I was trying to figure out how to print out $query inside ''

  • #5
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by cosmicsea View Post
    PHP Code:
    $description 'htmlspecialchars($query)'
    But I already knew that. Anything will display between the ''
    Thats why I was trying to figure out how to print out $query inside ''
    Why are you adding the single quotes? It will obviously treat anything between those as a string. If you need to enclose anything within quotes, double them and escape: \''.function().'\'


  •  

    Posting Permissions

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