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

Thread: Processing PHP

  1. #1
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts

    Processing PHP

    Hi, im trying to escape php code to convert all into html references ie

    PHP Code:
    $str "$_GET['foo'];"
    echo encodeString($str); 
    but $str would convert into what ever that var is but I don't want to do that.
    i want to convert the ' into ' and the $ into $. Anyone know how?
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    PHP Code:
    $new htmlspecialchars($_GET['foo']);
    echo 
    "$new"
    Try that.

    http://php.net/manual/en/function.htmlspecialchars.php
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    PHP Code:
    $str '$_GET[\'foo\']'
    echo 
    htmlentities($str); 
    Like that? Not really syre what you're trying to do with $_GET['foo']
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Phil Jackson View Post
    Hi, im trying to escape php code to convert all into html references ie

    PHP Code:
    $str "$_GET['foo'];"
    echo encodeString($str); 
    but $str would convert into what ever that var is but I don't want to do that.
    i want to convert the ' into ' and the $ into $. Anyone know how?
    http://www.php.net/manual/en/functio...ars-decode.php

    best regards


  •  

    Posting Permissions

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