How to Add AdBrite to PHProxy

Discussion in 'PHP' started by JoseYe, Mar 26, 2008.

  1. #1
        if ($_flags['include_form'] && !isset($_GET['nf']))
        {
            $_url_form      = '<div style="width:100%;margin:0;text-align:center;border-bottom:1px solid #725554;color:#000000;background-color:#F2FDF3;font-size:12px;font-weight:bold;font-family:Bitstream Vera Sans,arial,sans-serif;padding:4px;">'
                            . '<form method="post" action="' . $_script_url . '">'
                            . ' <label for="____' . $_config['url_var_name'] . '"><a href="' . $_url . '">Address</a>:</label> <input id="____' . $_config['url_var_name'] . '" type="text" size="80" name="' . $_config['url_var_name'] . '" value="' . $_url . '" />'
                            . ' <input type="submit" name="go" value="Go" />'
                            . ' [go: <a href="' . $_script_url . '?' . $_config['url_var_name'] . '=' . encode_url($_url_parts['prev_dir']) .' ">up one dir</a>, <a href="' . $_script_base . '">main page</a>]'
                            . '<br /><hr />';
    
            foreach ($_flags as $flag_name => $flag_value)
            {
                if (!$_frozen_flags[$flag_name])
                {
                    $_url_form .= '<label><input type="checkbox" name="' . $_config['flags_var_name'] . '[' . $flag_name . ']"' . ($flag_value ? ' checked="checked"' : '') . ' /> ' . $_labels[$flag_name][0] . '</label> ';
                }
            }
    
            $_url_form .= '</form></div>';
    PHP:

    The guy whom I bought the site from did it for me, and it was in between the " '<br /><hr />' " which is in in the middle kind of, at the end of the first "paragraph." However, when I put the new code in, it is not working gives a parse error.
     
    JoseYe, Mar 26, 2008 IP
  2. JoseYe

    JoseYe Well-Known Member

    Messages:
    266
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    118
    #2
    This is the error:


    Parse error: syntax error, unexpected T_LNUMBER in /homepages/29/d210271167/htdocs/unlocked surfing/index.php on line 1149
     
    JoseYe, Mar 26, 2008 IP
  3. JoseYe

    JoseYe Well-Known Member

    Messages:
    266
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    118
    #3
    Oh, and line 1149 is

    '" var AdBrite_Title_Color = '000FF';"
     
    JoseYe, Mar 26, 2008 IP
  4. torhost

    torhost Banned

    Messages:
    348
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    kinda difficult to tell since you didnt post your index.php but it just sounds you like you put the ad in the wrong place and it screwed up the syntax..

    try keeping it out of functions
     
    torhost, Mar 26, 2008 IP
  5. jeffmathew

    jeffmathew Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i also need help with the same thing..... i cant get my adsense code in there
     
    jeffmathew, Mar 26, 2008 IP
  6. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #6
    That problem has something to do that you echo a string within inverted commas (') and the string you are trying to echo has also inverted commas in it. PHP can't handle that.

    Solution

    You need to escape the inverted commas within the string you wish to echo

    Example

    WRONG
    
    echo ' var AdBrite_Title_Color = '000FF';';
    
    PHP:

    CORRECT
    
    echo ' var AdBrite_Title_Color = \'000FF\';';
    
    PHP:
    Hope this helps
     
    stephan2307, Mar 27, 2008 IP
  7. belgin fish

    belgin fish Well-Known Member

    Messages:
    1,544
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    185
    Digital Goods:
    2
    #7
    hmm, im having the same problem, and tries what you just said and its still not working :(
     
    belgin fish, Jan 10, 2009 IP