Page 4 of 4 First ... 234
  • Jump to page:
    #46
  1. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,814
    Rep Power
    4536
    I already explained this. You changed the action parameter of Google's form to point to your PHP script. So the browser happily follows directions and sends the form data via GET to your script. The var_dump shoes you the fields Google has in their form.

    Your "url_to_proxify" is not (not surprisingly) a part of Google's form on their website, so it's not sent. Even though you rewrite it into the action URL, it's not a part of the form.

    If you want your script to work, you'll need to come up with a way of detecting when a form is submitted, ANY KIND of form, mind you, and then have your cURL process resubmit the GET or POST data so you can retire the correct page to show your user.

    You'll also need to deal with receiving and sending cookie data in your cURL process.

    And then figure out what you're going to do for asynchronous requests that don't actually trigger page loads through form or anchor <a> elements.
    -- Cigars, whiskey and wild, wild women. --
  2. #47
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,814
    Rep Power
    4536
    Originally Posted by UniqueIdeaMan
    Who is the dumb *** now ?
    *raises hand* oooo, ooo, pick me! I know!!!
    -- Cigars, whiskey and wild, wild women. --
  4. #48
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    318
    Rep Power
    1
    Originally Posted by Sepodati
    I already explained this. You changed the action parameter of Google's form to point to your PHP script. So the browser happily follows directions and sends the form data via GET to your script. The var_dump shoes you the fields Google has in their form.

    Your "url_to_proxify" is not (not surprisingly) a part of Google's form on their website, so it's not sent. Even though you rewrite it into the action URL, it's not a part of the form.

    If you want your script to work, you'll need to come up with a way of detecting when a form is submitted, ANY KIND of form, mind you, and then have your cURL process resubmit the GET or POST data so you can retire the correct page to show your user.

    You'll also need to deal with receiving and sending cookie data in your cURL process.

    And then figure out what you're going to do for asynchronous requests that don't actually trigger page loads through form or anchor <a> elements.
    Don't flatter yourself! Ha! Ha! "Who is the dumb *** now ?" was just an expression. Not an insult at you! Lol!
    Anyway, do tell me that, I managed to add your suggestions onto these 3 scripts even though they fully not working.

    Look at these 3 different attempts in 3 different ways. It does not have more than one question mark in the url. And so, not breaking the valid url rule.
    Can you figure-out why then when you type a url in the URL ui text box, then cURL does not fetch the page belonging to your inputted url ? Shows a complete blank page.
    Which sample, do you reckon is more accurate and what errors do you see on each of them ?
    To jog your memory, this is what the scripts are supposed to do. Their purpose is one. Just coded differently.
    One page scripts.
    On proxy homepage, you see a ui text box labelled: URL.
    You type a url, eg. Google.
    Click "submit" button.
    cURL fetches page. Proxified homepage of: google.com.
    All links on google homepage supposed to be preceded by the proxy homepage link so no matter what link you click, the proxy homepage supposed to load and it's GET method supposed to pick what link you clicked and then fetch that page. Proxify that page.
    You do a keyword search and cURL supposed to fetch the SERP. And, proxify it. So, you supposed to see a proxified SERP on your screen.
    Simple web proxy script with cURL really.

    SAMPLE 1: Fails to load proxified page. Your desired page. cURL fails to fetch the page after you click the "submit" button by entering the url (in the URL ui text box) of the page you want fetched. Reloads the proxy homepage with the URL ui text box.

    PHP Code:
    <?php

    /*
    ERROR HANDLING
    */
    ini_set('display_errors'1);
    ini_set('display_startup_errors''1');

    //For All Error, Warning and Notice
    error_reporting(E_ALL) OR error_reporting(-1);
    //For All Errors
    error_reporting(E_ERROR);
    //For All Warnings
    error_reporting(E_WARNING);
    //For All Notice
    error_reporting(E_NOTICE);

    ?>

    <html>
        <body>   
            <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET">
            Url: <input type = "text" name = "url_to_proxify" />
            <input type = "submit" />
            </form>      
        </body>
    </html>

    <?php
    if(isset($_GET["url_to_proxify"]) === TRUE)
       {
            echo 
    "IF got triggered!";
            
    ?>
            
                <html>
                    <body>   
                        <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET">
                        Url: <input type = "text" name = "url_to_proxify" />
                        <input type = "submit" />
                        </form>      
                    </body>
                </html>
            
            <?php
            $url_to_proxify 
    filter_input(INPUT_GET'url_to_proxify'FILTER_VALIDATE_URL);
            echo 
    "Url to proxify = $url_to_proxify";
       
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL"$url_to_proxify");
            
    curl_setopt($chCURLOPT_FOLLOWLOCATIONTRUE);
            
    curl_setopt($chCURLOPT_HEADER5);
            
    curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
            
    $curl_result curl_exec($ch);
            
    curl_close($ch);

            
    $pattern = array("https://""http://""localhost");
            
    $replace = array("proxified_page.php/?url_to_proxify=https://""proxified_page.php/?url_to_proxify=http://""proxified_page.php/?url_to_proxify=");
            
    $phrase str_replace($pattern$replace$curl_result);

            
    print_r($phrase);
        }
       else
        {
           echo 
    "ELSE got triggered!";
        
    ?>
            <html>
                <body>   
                    <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET">
                    Url: <input type = "text" name = "url_to_proxify" />
                    <input type = "submit" />
                    </form>      
                </body>
            </html>
        <?php
       
    }
    ?>

    SAMPLE 2: Shows complete blank page when you type your desired url and click the "submit" button. cURL fails to fetch the script.

    PHP Code:
    <?php

    //STEP 1: ERROR HANDLING


    ini_set('display_errors''1');
    ini_set('display_startup_errors''1');

    //For All Error, Warning and Notice
    error_reporting(E_ALL) OR error_reporting(-1);
    //For All Errors
    error_reporting(E_ERROR);
    //For All Warnings
    error_reporting(E_WARNING);
    //For All Notice
    error_reporting(E_NOTICE);

    /* STEP 2:
    The IF gets triggered as soon as the "submit" button is clicked in the text box labeled: Url
    Following IF code deals with GET method.
    */

    if(isset($_GET["url_to_proxify"]) === TRUE)
       {
            function 
    get_parse_results($url_to_proxify$curl_result=NULL) {
            echo 
    "IF got triggered!";
            
    $url_to_proxify filter_input(INPUT_GET'url_to_proxify'FILTER_VALIDATE_URL);
            
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL"$url_to_proxify");
            
    curl_setopt($chCURLOPT_FOLLOWLOCATIONTRUE);
            
    curl_setopt($chCURLOPT_HEADER5);
            
    curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
            
    $curl_result curl_exec($ch);
            
    curl_close($ch);
            
    $domain parse_url($url_to_proxifyPHP_URL_HOST);
            echo 
    $domain;
            
            
    $pattern = array("https://""http://""localhost");
            
    $replace = array("proxified_page_2.php/?url_to_proxify=https://\"$domain\"""proxified_page_2.php/?url_to_proxify=http://\"$domain\"""proxified_page_2.php/?url_to_proxify=http://\"$domain\"");
            
    $string_replaced_data_1 str_replace($pattern$replace$curl_result);
            
    print_r($string_replaced_data_1);
            
            
    //Deal with Image Files (Eg. Google Img File)        
            
    $pattern = array('src="''src = "''src= "''src ="'"src='""src = '""src= '""src='");
            
    $replace = array('src="proxified_page_2.php/?url_to_proxify=\"$domain\""''src = "proxified_page_2.php/?url_to_proxify=\"$domain\""''src= "proxified_page_2.php/?url_to_proxify=\"$domain\""''src ="proxified_page_2.php/?url_to_proxify=\"$domain\""'"src='proxified_page_2.php/?url_to_proxify=\"$domain\"'""src = 'proxified_page_2.php/?url_to_proxify=\"$domain\"'""src= 'proxified_page_2.php/?url_to_proxify=\"$domain\"'""src ='proxified_page_2.php/?url_to_proxify=\"$domain\"'");
            
    $string_replaced_data_2 str_replace($pattern$replace$string_replaced_data_1);
            
    print_r($string_replaced_data_2);
            
            
    //Deal with all the links presented by the searchengine result pages (SERPS). Eg. Google Search Pages (SERPs)
            
    $pattern = array('action="''action = "''action= "''action ="'"action='""action = '""action= '""action='");
            
    $replace = array('action="proxified_page_2.php/?url_to_proxify=\"$domain\""''action = "proxified_page_2.php/?url_to_proxify=\"$domain\""''action= "proxified_page_2.php/?url_to_proxify=\"$domain\""''action ="proxified_page_2.php/?url_to_proxify=\"$domain\""'"action='proxified_page_2.php/?url_to_proxify=\"$domain\"'""action = 'proxified_page_2.php/?url_to_proxify=\"$domain\"'""action= 'proxified_page_2.php/?url_to_proxify=\"$domain\"'""action ='proxified_page_2.php/?url_to_proxify=\"$domain\"'");
            
    $string_replaced_data_3 str_replace($pattern$replace$string_replaced_data_2);                        
            
    print_r($string_replaced_data_3);
            
            echo 
    'action="proxified_page_2.php?/url_to_proxify=\"$domain\""';
           
            }
            
        }
    else
        {
            echo 
    "ELSE got triggered!";
            
    //Html Form
            
    ?>
            <html>
                <body>   
                    <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET">
                    Url: <input type = "text" name = "url_to_proxify" />
                    <input type = "submit" />
          </form>      
       </body>
    </html>
    <?php
        
    }

    ?>

    SAMPLE 3: Same result as SAMPLE 2.

    PHP Code:
    <?php

    //STEP 1: ERROR HANDLING


    ini_set('display_errors''1');
    ini_set('display_startup_errors''1');

    //For All Error, Warning and Notice
    error_reporting(E_ALL) OR error_reporting(-1);
    //For All Errors
    error_reporting(E_ERROR);
    //For All Warnings
    error_reporting(E_WARNING);
    //For All Notice
    error_reporting(E_NOTICE);

    /* STEP 2:
    The IF gets triggered as soon as the "submit" button is clicked in the text box labeled: Url
    Following IF code deals with GET method.
    */

    if(isset($_GET["url_to_proxify"]) === TRUE
       {
            echo 
    "IF got triggered!";
            
    $url_to_proxify filter_input(INPUT_GET'url_to_proxify'FILTER_VALIDATE_URL);
                    
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL"$url_to_proxify");
            
    curl_setopt($chCURLOPT_FOLLOWLOCATIONTRUE);
            
    curl_setopt($chCURLOPT_HEADER5);
            
    curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
            
    $curl_result curl_exec($ch);
            
    curl_close($ch);
            
            
    $pattern = array("https://""http://""localhost");
            
    $replace = array("proxified_page_3.php/?url_to_proxify=https://""proxified_page_3.php/?url_to_proxify=http://""proxified_page_3.php/?url_to_proxify=http://");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
    print_r($string_replaced_data);
            
            
    //Deal with Image Files (Eg. Google Img File)        
            
    $pattern = array('src="''src = "''src= "''src ="'"src='""src = '""src= '""src='");
            
    $replace = array('src="proxified_page_3.php/?url_to_proxify="''src = "proxified_page_3.php?/url_to_proxify="''src= "proxified_page_3.php/?url_to_proxify="''src ="proxified_page_3.php/?url_to_proxify="'"src='proxified_page_3.php?url_to_proxify='""src = 'proxified_page_3.php/?url_to_proxify='""src= 'proxified_page_3.php/?url_to_proxify='""src ='proxified_page_3.php/?url_to_proxify='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
    print_r($string_replaced_data);
            
            
    //Deal with all the links presented by the searchengine result pages (SERPS). Eg. Google Search Pages (SERPs)
            
    $pattern = array('action="''action = "''action= "''action ="'"action='""action = '""action= '""action='");
            
    $replace = array('action="proxified_page_3.php/?url_to_proxify="''action = "proxified_page_3.php/?url_to_proxify="''action= "proxified_page_3.php/?url_to_proxify="''action ="proxified_page_3.php/?url_to_proxify="'"action='proxified_page_3.php/?url_to_proxify='""action = 'proxified_page_3.php/?url_to_proxify='""action= 'proxified_page_3.php/?url_to_proxify='""action ='proxified_page_3.php/?url_to_proxify='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);                
            
    print_r($string_replaced_data);
            
            
    $domain parse_url($url_to_proxifyPHP_URL_HOST);
        }
    else
        {
            echo 
    "ELSE got triggered!";
            
    //Html Form
            
    ?>
            <html>
                <body>   
                    <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET">
                    Url: <input type = "text" name = "url_to_proxify" />
                    <input type = "submit" />
          </form>      
       </body>
    </html>
    <?php
        
    }

    ?>
  6. #49
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    318
    Rep Power
    1
    Sedopati,

    Did you see my last post ?
Page 4 of 4 First ... 234
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo