#31
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Originally Posted by Sepodati
    How the hell do you write it correct one way and then on the next line screw it up again?


    No, the FORWARD slashes are there to indicate the beginning and end of the pattern, for the regular expression. You're not even using a regular expression (although you should be; we'll get there later), so you shouldn't even have FORWARD slashes in your strings... Stop trying to pass your blind, stab-in-the-dark copy-and-paste off as "modernization". lol...
    Sedopati,

    I think I have spotted my error. The youtube video was using preg_replace and so made use of the forward slashes to indicate the beginning and ending of the regex like you say.
    I just modified a little by not using regex but str_replace but I kept intact the forward slashes taking them as part of the html the php needs top search to replace. That's my mistake. Mistake because I did not really understand why the slashes were there (for regex starting & ending point indications).
    Anyway, removing them and gonna see how things fair.

    You failed to notice that, I used "echo" instead of "print_r" when trying to spit array results.
    I learnt from some forum not to use echo in such instances.
    Last edited by UniqueIdeaMan; July 20th, 2017 at 06:15 AM.
  2. #32
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Originally Posted by SimonJM
    I think I used one of our favourite words when I spotted he'd done that - in between the laughing, of course
    Ah man!
  4. #33
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Ok. Here's my latest update. I believe you won't find any errors on it:

    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);

    error_reporting(E_ALL);


    // STEP 2: Database connection

    $conn mysqli_connect("localhost""root""""id");

    if (!
    $conn) {
        
    // message to use in development to see errors
        
    die("Database error : " mysqli_error($conn));

        
    // user friendly message
        // die("Database error.");
        
    exit();
    }


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

    if(isset($_GET["url_to_proxify"]) === TRUE)
       {
            
    $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);
            
            
    $domain parse_url($url_to_proxifyPHP_URL_HOST);
            
            
    $pattern = array("./""/""https://""http://""localhost");
            
    $replace = array("proxified_page_2.php?url_to_proxify=./""proxified_page_2.php?url_to_proxify=/""proxified_page_2.php?url_to_proxify=https://""proxified_page_2.php?url_to_proxify=http://""proxified_page_2.php?url_to_proxify=http://");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //Deal with Image Files (Eg. Google Img File)        
            
    $pattern = array("src=/"", "src = /"""src= /"", "src =/"""src='""src = '""src= '""src='");
            
    $replace = array("proxified_page_2.php?url_to_proxify=src=/"", "proxified_page_2.php?url_to_proxify=src = /"""proxified_page_2.php?url_to_proxify=src= /"", "proxified_page_2.php?url_to_proxify=src =/"""proxified_page_2.php?url_to_proxify=src='""proxified_page_2.php?url_to_proxify=src = '""proxified_page_2.php?url_to_proxify=src= '""proxified_page_2.php?url_to_proxify=src ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //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("proxified_page_2.php?url_to_proxify=action=/"", "proxified_page_2.php?url_to_proxify=action = /"""proxified_page_2.php?url_to_proxify=action= /"", "proxified_page_2.php?url_to_proxify=action =/"""proxified_page_2.php?url_to_proxify=action='""proxified_page_2.php?url_to_proxify=action = '""proxified_page_2.php?url_to_proxify=action= '""proxified_page_2.php?url_to_proxify=action ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    print_r $string_replaced_data;        
            
    curl_close($ch);        
        }
    else
        {            
            
    //Html Form
            
    ?>
            <html>
                <body>   
                    <form action = "<?php $_SERVER['PHP_SELF'?>" method = "GET">
                    Url: <input type = "text" name = "url_to_proxify" />
                    <input type = "submit" />
          </form>      
       </body>
    </html>
    <?php
        
    }

    ?>
    But for some reason I get this irritating error:

    Parse error: syntax error, unexpected '", "' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in C:\xampp\htdocs\id\proxified_page_2.php on line 58

    I can't figure why I get this error. I did put escapes where necessary.

    Line 58 is the final line mentioned here:

    PHP Code:

    //Deal with Image Files (Eg. Google Img File)        
    $pattern = array("src=/"", "src = /"""src= /"", "src =/"""src='""src = '""src= '""src='"); 
    Last edited by UniqueIdeaMan; July 20th, 2017 at 06:57 AM.
  6. #34
  7. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,810
    Rep Power
    4536
    You've got to be ****ing trolling us at this point.
    -- Cigars, whiskey and wild, wild women. --
  8. #35
  9. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,099
    Rep Power
    4103
    Originally Posted by UniqueIdeaMan
    I did put escapes where necessary.
    No, you didn't. Look again at this thread or the manual for how to escape characters then fix your code.

    Comments on this post

    • UniqueIdeaMan agrees : Pointed-out my mistake without being childishly rude, unlike some others.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  10. #36
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Originally Posted by kicken
    No, you didn't. Look again at this thread or the manual for how to escape characters then fix your code.
    Opps! I did the escaping out of memory. I learnt the escaping chapter 2 mnths back and so got my wires crossed. Should've used the back slash.
    Thanks for the link. I'm giving you a REP.
  12. #37
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Ok.

    I fixed my slash error (escaping).
    And here's the final code so far.

    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);

    error_reporting(E_ALL);


    // STEP 2: Database connection

    $conn mysqli_connect("localhost""root""""id");

    if (!
    $conn) {
        
    // message to use in development to see errors
        
    die("Database error : " mysqli_error($conn));

        
    // user friendly message
        // die("Database error.");
        
    exit();
    }


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

    if(isset($_GET["url_to_proxify"]) === TRUE)
       {
            
    $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);
            
            
    $domain parse_url($url_to_proxifyPHP_URL_HOST);
            
            
    $pattern = array("./""/""https://""http://""localhost");
            
    $replace = array("proxified_page_2.php?url_to_proxify=./""proxified_page_2.php?url_to_proxify=/""proxified_page_2.php?url_to_proxify=https://""proxified_page_2.php?url_to_proxify=http://""proxified_page_2.php?url_to_proxify=http://");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //Deal with Image Files (Eg. Google Img File)        
            
    $pattern = array("src=\"""src = \"""src= \"""src =\"""src='""src = '""src= '""src='");
            
    $replace = array("proxified_page_2.php?url_to_proxify=src=\"""proxified_page_2.php?url_to_proxify=src = \"""proxified_page_2.php?url_to_proxify=src= \"""proxified_page_2.php?url_to_proxify=src =\"""proxified_page_2.php?url_to_proxify=src='""proxified_page_2.php?url_to_proxify=src = '""proxified_page_2.php?url_to_proxify=src= '""proxified_page_2.php?url_to_proxify=src ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //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("proxified_page_2.php?url_to_proxify=action=\"""proxified_page_2.php?url_to_proxify=action = \"""proxified_page_2.php?url_to_proxify=action= \"""proxified_page_2.php?url_to_proxify=action =\"""proxified_page_2.php?url_to_proxify=action='""proxified_page_2.php?url_to_proxify=action = '""proxified_page_2.php?url_to_proxify=action= '""proxified_page_2.php?url_to_proxify=action ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    print_r($string_replaced_data);        
            
    curl_close($ch);        
        }
    else
        {            
            
    //Html Form
            
    ?>
            <html>
                <body>   
                    <form action = "<?php $_SERVER['PHP_SELF'?>" method = "GET">
                    Url: <input type = "text" name = "url_to_proxify" />
                    <input type = "submit" />
          </form>      
       </body>
    </html>
    <?php
        
    }

    ?>
    I am getting no errors. But the result is not good.
    Try typing "http://google.com" in the UI text box.
    Google homepage would be fetched by cURL.
    Then do a keyword search. You won't see any google results. Instead, a blank page with the UI text box again.
    This goes in a loop on every attempt I make by doing a search on google (proxified google homepage).

    Anyway, here's another version. I use single quotes now so escaping won;t be necessary on the double quotes. But result still same as above code:

    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);

    error_reporting(E_ALL);


    // STEP 2: Database connection

    $conn mysqli_connect("localhost""root""""id");

    if (!
    $conn) {
        
    // message to use in development to see errors
        
    die("Database error : " mysqli_error($conn));

        
    // user friendly message
        // die("Database error.");
        
    exit();
    }


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

    if(isset($_GET["url_to_proxify"]) === TRUE)
       {
            
    $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);
            
            
    $domain parse_url($url_to_proxifyPHP_URL_HOST);
            
            
    $pattern = array("./""/""https://""http://""localhost");
            
    $replace = array("proxified_page_2.php?url_to_proxify=./""proxified_page_2.php?url_to_proxify=/""proxified_page_2.php?url_to_proxify=https://""proxified_page_2.php?url_to_proxify=http://""proxified_page_2.php?url_to_proxify=http://");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //Deal with Image Files (Eg. Google Img File)        
            
    $pattern = array('src="''src = "''src= "''src ="'"src='""src = '""src= '""src='");
            
    $replace = array('proxified_page_2.php?url_to_proxify=src="''proxified_page_2.php?url_to_proxify=src = "''proxified_page_2.php?url_to_proxify=src= "''proxified_page_2.php?url_to_proxify=src ="'"proxified_page_2.php?url_to_proxify=src='""proxified_page_2.php?url_to_proxify=src = '""proxified_page_2.php?url_to_proxify=src= '""proxified_page_2.php?url_to_proxify=src ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //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('proxified_page_2.php?url_to_proxify=action="''proxified_page_2.php?url_to_proxify=action = "''proxified_page_2.php?url_to_proxify=action= "''proxified_page_2.php?url_to_proxify=action ="'"proxified_page_2.php?url_to_proxify=action='""proxified_page_2.php?url_to_proxify=action = '""proxified_page_2.php?url_to_proxify=action= '""proxified_page_2.php?url_to_proxify=action ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    print_r($string_replaced_data);        
            
    curl_close($ch);        
        }
    else
        {            
            
    //Html Form
            
    ?>
            <html>
                <body>   
                    <form action = "<?php $_SERVER['PHP_SELF'?>" method = "GET">
                    Url: <input type = "text" name = "url_to_proxify" />
                    <input type = "submit" />
          </form>      
       </body>
    </html>
    <?php
        
    }

    ?>
    Last edited by UniqueIdeaMan; July 20th, 2017 at 05:07 PM.
  14. #38
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Ah! I just learnt (in another forum where it got pointed-out to me) that this is incorrect:

    PHP Code:

    <form action = "<?php $_SERVER['PHP_SELF'?>" method = "GET">
    I know long hand:

    PHP Code:

    <?php

    ?>
    And, short hand:

    PHP Code:

    <?
    ?>
    But, I could not understand why the programmer over there was suggesting to place an equal sign, like so:

    PHP Code:

    <?=
    I was told just now:

    "If you put <?php $_SERVER['PHP_SELF']; ?> in a page by itself and load it, you will get a blank page. No output. Why? Because you simply referenced a variable, you didn't actually do anything with it, such as, echoing it out to the screen (get it?).

    Thus <?= is short-hand for <?php echo, they are synonmous. But <?php $_SERVER['PHP_SELF']; ?> does absolutely nothing!"



    So, the "=" in the short hand means "echo". Mmm. That is news indeed.

    But anyway. Fixing it to:

    PHP Code:

    <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET">
    Still gives me the same result as mentioned in my previous post.

    Anyone suspect why the google search results in you going back to the first page ?
    For some reason, line 62 - 65 is not working:

    PHP Code:

            
    //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('proxified_page_2.php?url_to_proxify=action="''proxified_page_2.php?url_to_proxify=action = "''proxified_page_2.php?url_to_proxify=action= "''proxified_page_2.php?url_to_proxify=action ="'"proxified_page_2.php?url_to_proxify=action='""proxified_page_2.php?url_to_proxify=action = '""proxified_page_2.php?url_to_proxify=action= '""proxified_page_2.php?url_to_proxify=action ='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result); 
    In other words, as soon as you click the google search button, whatever SERP url gets shown, it's url should be preceded by:
    **proxified_page_2.php?url_to_proxify=action="**

    That way, the SERP gets proxified.
    Last edited by UniqueIdeaMan; July 20th, 2017 at 05:31 PM.
  16. #39
  17. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,810
    Rep Power
    4536
    Your magic proxy changes the action URL of the form so it submits to your site. Since you're not Google, however, I don't know how you intend to process that form and retrieve results.

    After you solve that (it is solvable), then make sure account for cookies that need to be sent with requests to maintain sessions.

    And then ajax based scripts that perform asynchronous GET and POST actions in a variety of formats.

    At the end of the day, you're better off porting a web browser that had your spyware built into it. I'm sure that's be a good sale.
    -- Cigars, whiskey and wild, wild women. --
  18. #40
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Originally Posted by Sepodati
    Your magic proxy changes the action URL of the form so it submits to your site. Since you're not Google, however, I don't know how you intend to process that form and retrieve results.

    After you solve that (it is solvable), then make sure account for cookies that need to be sent with requests to maintain sessions.

    And then ajax based scripts that perform asynchronous GET and POST actions in a variety of formats.

    At the end of the day, you're better off porting a web browser that had your spyware built into it. I'm sure that's be a good sale.
    In other words, you're saying it is not do-able to log proxified pages. But, I managed it with MiniProxy (with another's help in another forum).
    Can you help to do the same with Php Proxy ? I can't ask the same person to do it again.
    As for you thinking I can ad my spyware feature onto a web browser where you think it would SELL. I am surpirsed that you think it would sell. Why would anyone want to buy it ?
    I did build a web browser nearly a year ago but it was FREE.
    Last edited by UniqueIdeaMan; July 21st, 2017 at 05:32 PM.
  20. #41
  21. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,810
    Rep Power
    4536
    Sell people on using it, dumbass.

    Good luck. Make sure you pay up on your bet.
    -- Cigars, whiskey and wild, wild women. --
  22. #42
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    Originally Posted by Sepodati
    Sell people on using it, dumbass.

    Good luck. Make sure you pay up on your bet.
    What bet ?
    And, how-about you use it ?
    You'd be able to see which user is browsing what! Including me.
    Other users would be able to see what you yourself are browsing and in return for their trailing clicks you'd earn money. Like ppc.
    Your browsing history would be made public. That means, unlimited people could follow you. Unlimited people could trail you online by generating unlimited clicks. Thus earning you unlimited ppc earnings.
    Say, you went to google. They'd click over to google. You'd earn money from their trailing click to google.
    You'd do a keyword search. They'd click and follow you to the google SERP and see what keywords you used. This is keyword research for them.
    Out of the 10 links, you'd then click 1. let us say, ranked number 5. They'd follow you to that number 5 ranked site. This is market research for them. They'll learn the site ranked 5 is popular for this keyword as the other 4 did not get your click. You'd earn from their trailing clicks to this site ranked 5th place.
    And so on. They can follow you LIVE or some other day.
    Tomorrow, you could wake-up and see thousands or millions have followed you to these same links (google homepage, google serp, 5th ranked site) and you'd earn from their clicks again.
    If 1k English speaking country people follow you to a link, you immediately earn $5. If 1 million follow you then $5k. Sky is the limit.
    So, you still think I am a dumbass, especially after I built this system to help people get out of poverty ? It's turned into a get rich quick no scam.
    Shall I tell you who would follow/trail your link clicks ? Marketers! Those websites you visit, they can trail you to third party sites. Those websites you did not visit (in our example the first 4 ranked on top of google SERP) can trail you and earn you clicks. Clicks that earn you money.
    These 4 can also PM you (without getting your email or fone) with better bargains so you go to them over the others. They can see what the other is offering you and they can bid lower price for you like a reverse auction. When they PM you, you'll earn $1-20USD. Infact, you can earn more like this to what you spend. You can use these earnings to buy what you were looking for. And pocket the difference or donate to charity and become a hero.
    Who is the dumb *** now ? Dumb asses don't build these systems, I'm afraid.

    Nevermind.
    Last edited by UniqueIdeaMan; July 23rd, 2017 at 09:43 AM.
  24. #43
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1
    It beats me to figure-out why the ISSET is malfunctioning here on the 2nd round when I click a proxified link:

    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)
       {
            
    $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);
            
            
    $domain parse_url($url_to_proxifyPHP_URL_HOST);
            
            
    $pattern = array("https://""http://""localhost");
            
    $replace = array("proxified_page_2.php?url_to_proxify=https://""proxified_page_2.php?url_to_proxify=http://""proxified_page_2.php?url_to_proxify=http://");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //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="''src = "proxified_page_2.php?url_to_proxify="''src= "proxified_page_2.php?url_to_proxify="''src ="proxified_page_2.php?url_to_proxify="'"src='proxified_page_2.php?url_to_proxify='""src = 'proxified_page_2.php?url_to_proxify='""src= 'proxified_page_2.php?url_to_proxify='""src ='proxified_page_2.php?url_to_proxify='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    //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="''action = "proxified_page_2.php?url_to_proxify="''action= "proxified_page_2.php?url_to_proxify="''action ="proxified_page_2.php?url_to_proxify="'"action='proxified_page_2.php?url_to_proxify='""action = 'proxified_page_2.php?url_to_proxify='""action= 'proxified_page_2.php?url_to_proxify='""action ='proxified_page_2.php?url_to_proxify='");
            
    $string_replaced_data str_replace($pattern$replace$curl_result);
            
            
    print_r($string_replaced_data);        
            
    curl_close($ch);
            
        }
    else
        {
            
    //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
        
    }

    ?>
    This is how the script works.
    It is a 1 page script, called:
    **proxified_page_2.php**

    When you first load the page, it shows you a ui text box: Url.
    You type a url there and it would proxify that page.
    Instead of typing the url in the ui text box, you can directly type the url in the url. For example, if you want the cURL to fetch google homepage then you'd visit:

    proxified_page_2.php?**url_to_proxify=**Google

    As you can see, the ISSET is fixed on the **"url_to_proxify="** part.
    So, when you click the SUBMIT button, the script checks the ISSET for the desired url. In our case, it finds "google.com" and cURL fetches that.
    Now, instead of fetching the page via the "Url" labelled ui text box and SUBMIT button, you can fetch your desired page (page that is to be proxified) by typing your desired url directly on your browser after typing:

    proxified_page_2.php?

    So, you would type:
    **proxified_page_2.php?**url_to_proxify=**http://www.google.com**

    And the ISSET would get triggered which would fetch your desired page (in this case: google.com).

    Now, here's the problem.
    On every proxified page. There would be links. In our google homepage case the following link:
    https://www.google.com/intl/en/about.html?fg=1

    gets converted to a proxified link such as so:

    proxified_page_2.php?**url_to_proxify=**https://www.google.com/intl/en/about.html?fg=1

    Now, when you click this proxified link, what is supposed to happen ?
    naturally, the same one page (proxified_page_2.php) where the script is residing, should reload and the ISSET should check for the new url it is supposed to fetch. In this case, the ISSET would find:

    https://www.google.com/intl/en/about.html?fg=1

    In other words, this:

    proxified_page_2.php?**url_to_proxify=**https://www.google.com/intl/en/about.html?fg=1

    should redirect you to a proxified page version of:

    https://www.google.com/intl/en/about.html?fg=1

    But you will see this does not happen. Instead, you are redirected to a blank page that has nothing but the "Url" ui text box (like you saw originally):

    proxified_page_2.php

    Therefore, I ask, why is not the ISSET getting triggered in this 2nd round when a link gets clicked in a proxified page ?

    Why is line 25 failing:

    PHP Code:

    if(isset($_GET["url_to_proxify"]) === TRUE
    On the 2nd round the ELSE gets triggered instead of the IF. The IF should have got triggered since the ISSET was holding the value:
    https://www.google.com/intl/en/about.html?fg=1
    Last edited by UniqueIdeaMan; July 23rd, 2017 at 09:25 AM.
  26. #44
  27. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,099
    Rep Power
    4103
    Code:
    var_dump($_GET);
    and find out.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  28. #45
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    307
    Rep Power
    1

    Question


    Originally Posted by kicken
    Code:
    var_dump($_GET);
    and find out.
    Ok. With your suggestion, I added your error code.
    I loaded my one page proxy page. Typed "http://google.com" and a proxified google homepage appeared. Searched for "cars" and I am shown this:

    array(8) { ["ie"]=> string(10) "ISO-8859-1" ["hl"]=> string(2) "en" ["source"]=> string(2) "hp" ["biw"]=> string(0) "" ["bih"]=> string(0) "" ["q"]=> string(4) "cars" ["btnG"]=> string(13) "Google Search" ["gbv"]=> string(1) "2" }

    What does all that mean ?
    I am new to error codes.
    I guess it is breaking the url into parts and defining each part.
    Last edited by UniqueIdeaMan; July 23rd, 2017 at 05:42 PM.

IMN logo majestic logo threadwatch logo seochat tools logo