1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

any php/html guru here?

Discussion in 'Off Topic' started by Mike Law, Jul 10, 2011.

  1. Mike Law

    Mike Law Active Member

  2. ragtek

    ragtek Guest

    You're starting the php process(if it's called so:D ) 2 times;)

    <?php
    echo ..... <?php echo

    remove the second <?php echo
     
  3. ragtek

    ragtek Guest

    this should work

    PHP:

    echo '<a href="http://www.myforumurl.com/search/search?keywords=' urlencode($page_title) . '">Discuss this topic in forums</a>';
    this will ONLY work, if you have a url_encode function ;)

    I think you want to use urlencode ;)
     
  4. Mike Law

    Mike Law Active Member

    same result,

    search/search?keywords=%20echo%20url_encode();
     
  5. Mike Law

    Mike Law Active Member

    Thanks,

    that results
    Fatal error: Call to undefined function url_encode() in /
     
  6. Mike Law

    Mike Law Active Member

    Ah that might be part of the problem.... how do I do that?
     
  7. ragtek

    ragtek Guest

    that's why i wrote
     
  8. ragtek

    ragtek Guest

    it's the same;)

    just replace url_encode with urlencode
     
    Mike Law likes this.
  9. Mike Law

    Mike Law Active Member

    Thanks for the kind help,

    result is now

    /search/search?keywords=

    using

    PHP:
    <div style="float:left;"/>
    <?php
    echo '<a href="http://www.forum.com/search/search?keywords=' urlencode($page_title) . '">Discuss this topic in forums</a>';
    ?>
    </div>
    See here, next to twitter button

    http://bit.ly/p4S4YR
     
  10. ragtek

    ragtek Guest

    have you checked if $page_title is set?
     
    Mike Law likes this.
  11. Mike Law

    Mike Law Active Member

    No didnt think about that one, sorry!

    Title is set as

    <title>Direct effect - Law Wiki | Law student Wiki</title>


     
  12. borbole

    borbole Well-Known Member

    You shouldn''t close the first div tag. Also it would be better to include the div inside the php tags.
     
    Mike Law likes this.
  13. Mike Law

    Mike Law Active Member

    Sorted!

    Thanks so much for the help!
     
    borbole likes this.
  14. Dark Matter

    Dark Matter Active Member

    Code:
    <?php
    
    echo '<div style="float:left"><a href="http://www.forum.com/search/search?keywords=' . urlencode($page_title) . '">Discuss this topic in forums</a></div>';
    
    ?>
    Would that not have been better above, also there's no need to include a "semi-colon" in that style class seeing as your only using one style attribute only (float).

    I would also consider doing away with using an in-line style class, instead putting your css in the extra css box and called it that way using a class rather than adding "style". Helps keep your pages loading faster.

    Code:
    <div class="customsearch">
    CSS Added

    Code:
    .customsearch {
    float:left;
    }
    
     
    Mike Law likes this.
  15. Mike Law

    Mike Law Active Member

    Thanks, looks much cleaner!
     

Share This Page