Why does my PHP script do this?

Discussion in 'PHP' started by jacobbannier, Dec 6, 2006.

  1. #1
    I run a proxy site using phproxy 0.4.
    The site can be found here.
    What I want to know is:
    When i type in a URL in the phproxy bar, it won't go there. What am i doing wrong?
    E.G
    I type in google.com the URL bar and i get this in the address bar:
    http://browsebebo.com/?url=http%3A%2F%2Fgoogle.com&browse=Browse
    PHP:
    Help would be much apreciated :)
    Thanks a lot,
    Jacob
     
    jacobbannier, Dec 6, 2006 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    you closed the first form tag too early, include the url box in the first form.....
     
    krakjoe, Dec 6, 2006 IP
    jacobbannier likes this.
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    I cant really say without looking at the script, but you may need to use the urlencode function on the url that is put in the text box.
     
    jestep, Dec 6, 2006 IP
  4. jacobbannier

    jacobbannier Active Member

    Messages:
    1,155
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    90
    #4
    Script can be found here.

    I done that. It now takes me a page and says invalid URL. more help please? (BTE REpped you)
     
    jacobbannier, Dec 6, 2006 IP
  5. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #5
    I dunno exactly, so delete all the php proxy form and the able around it write a new one with just one input called url, and another hidden one called dophp with a value of 1

    then put this at the top of your page, before ANYTHING :
    
    <?
    if ($_POST['dophp'])
    {
       header("location: http://browsebebo.com/s1/index.php?q=". base64_encode(preg_replace("/^http:\\/\\//", "", $_POST['url'])));
    } 
    ?>
    
    PHP:
    that'll do it
     
    krakjoe, Dec 6, 2006 IP
  6. IntelliGuy

    IntelliGuy Banned

    Messages:
    42
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You messed up everything, change this block:

    
    <div align=center><h3>PHP Proxy</h3>
    <p>Use This Proxy if you just generally want to browse the internet, or download without logging into any sites.</p>
    	<p><b>NOT for MySpace browsing</b></p>
    
    <table width="100%" border="0" cellpadding="2" cellspacing="0" align="center">
         <tr>   
          <form name="poxy_url_form" method="get" action="/s1/index.php">
      <input type="hidden" name="q" value="" id="url_input" />
      <input type="hidden" name="hl" value="" />
    
    <strong>URL:</strong>
    <form name="poxy_settings_form" method="get" action="" onsubmit="return submit_form();">
    <input type="text" name="url" size="50" value="http://" />
    </form>
    <input type="submit" name="browse" class="button" value="Browse" onclick="return submit_form();" />
         </form>    </form></div></td>
    
    	   
         </tr>
    
       </table>
       </form></div>
    
    Code (markup):
    to

    
    <div align=center>
    <h3>PHP Proxy</h3>
    <p>Use This Proxy if you just generally want to browse the internet, or download without logging into any sites.</p>
    <p><b>NOT for MySpace browsing</b></p>
    
    <table width="100%" border="0" cellpadding="2" cellspacing="0" align="center">
        <tr>
        <td>
         <form name="poxy_url_form" method="get" action="/s1/index.php">
           <input type="hidden" name="q" value="" id="url_input" />
           <input type="hidden" name="hl" value="" />
         </form>
        <strong>URL:</strong>
       <form name="poxy_settings_form" method="get" action="" onsubmit="return submit_form();">
         <input type="text" name="url" size="50" value="http://" />
         <input type="submit" name="browse" class="button" value="Browse" onclick="return submit_form();" />
        </form>
      </td>	   
      </tr>
    </table>
    </div>
    
    Code (markup):
     
    IntelliGuy, Dec 6, 2006 IP
    jacobbannier likes this.
  7. jacobbannier

    jacobbannier Active Member

    Messages:
    1,155
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    90
    #7
    No that didnt work either =\

    EDIT: Got it to work. Repped you for your effort anyway :)
    Thanks everybody!
     
    jacobbannier, Dec 7, 2006 IP