Jump to content

marklarah

Members
  • Posts

    423
  • Joined

  • Last visited

    Never

Everything posted by marklarah

  1. Okay, we have this on the page: So it echoing from to the end of the link.
  2. Well okay, it's off, but I'm still getting lots of stuff before the link.
  3. Ok, sort of half-fixed it. Turns out the entities does matter, i'm using preg_match('~<a href="(.+?)" style="font-size:15px;">~si', $result, $matches); Now, I get a lot of stuff, but the last thing is the link. the first the characters of what's on the page is - I presume this is the preg_match. If this needs editing then, then what comes before the link is - there is a space between the end of that div and the link/
  4. Oh ok, thats a great way of doing it thanks. Only thing is, it's not echoing anything, which it should. The string has entities on, if that makes a difference.
  5. So I have the HTML for a remote webpage stored in a variable (gotten through cURL). It's htmlentities'd, so I have the text for it. I need to get a specific link from this webpage. I think there are other links, but there is one in a specific format. The format is <a href="http://linkhere" style="font-size:15px;"> I have read the things online how to parse it, but I can't seem to find a specific one which will do this. How would I go about doing it? Thanks...Mark.
  6. Actually thorpe, I see where you're coming from. I guess technically this could be considered XSS, but it's for legitimate purposes.
  7. haha, you're making me sound like a hacker or something. Lemme explain, I'm trying to make a customized homepage, that is able to display things displayed on other sites, such as new emails, ratio on trackers etc. If the div containing the info for it is the same, I can access it an display it. If some sites require a login, I want it to login from that user (all on the page) and display the data.
  8. As in, read a remote page, with the users cookies and such. I have <? $url = "http://www.test.com"; $ch = curl_init(); $timeout = 5; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_PROXY, IP Address); curl_setopt($ch, CURLOPT_PROXYPORT, Port No); $file_contents = curl_exec($ch); curl_close($ch); ?> but ???
  9. Okay wait, I have this <?php $url = "http://www.google.com"; $ch = curl_init(); $timeout = 5; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); ?> This uses cURL and is good, works fine. But lets say for example, there was a value in the source generated by the server, but always came before a set constant. If I wanted to just get the URL for the google logo for example, how would I do that using the PHP string functions?
  10. I know you can use fopen (I think my host may have disabled it,) but anyway, specifically, can you read the source code of it (as you would with view source) using php or even javascript of a remote page, and get specific bits parsing it with PHP?
  11. I know I can read external pages in PHP, but I need to be able to pick out certain elements.
  12. Also, I've been using this that I found on the internet var allHTMLTags = new Array(); function getElementByClass(theClass) { //Create Array of All HTML Tags var allHTMLTags=document.getElementsByTagName(”*”); //Loop through all tags using a for loop for (i=0; i<allHTMLTags.length; i++) { //Get all tags with the specified class name. if (allHTMLTags[i].className==theClass) { //Place any code you want to apply to all //pages with the class specified. //In this example is to “display:none;” them //Making them all dissapear on the page. allHTMLTags[i].style.display=’none’; } } }
  13. Hmmm....yes, but I also need to be able to do this function on an external page
  14. I want to get the value of an element (a span in this case), and display it on my page. Told to do this in javascript, all I have come up with is var target = ''; target.setAttribute( "src", "urlhere" ); target = document.getElementsByTagName( "span" )[3].value; It obviously doesn't work. The element doesn't actually have an ID, just it's class is unique. So how would I call the text from just the element on the page? I don't know where to start. Thanks...
  15. this is what i have //begin verification hack - PROOF OF CONCEPT ONLY $username = $_POST["user"]; $pusername = str_ireplace("_","+",$username); $url = "site=". $pusername ."&ip=".$_SERVER['REMOTE_ADDR']; $fhandle = fopen($url,"r"); $tempqb=""; while ( ! feof( $fhandle )){ $tempqb = $tempqb . fgets( $fhandle, 1024 ); } $output = $tempqb; if ($output!="1:".str_ireplace("+"," ",$pusername)) { die("Nope, unicorns " . $pusername); } //end LL verification hack
  16. its an external site its not what I need too
  17. I suck at both. Is there anyway of turning this script into using fopen instead of cURL? //begin verification hack - PROOF OF CONCEPT ONLY $username = $_POST["user"]; $pusername = str_ireplace("_","+",$username); $url = "somewebsite=". $pusername ."&ip=".$_SERVER['REMOTE_ADDR']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); curl_close($ch); if ($output!==("1:".str_ireplace("+"," ",$pusername))){ die("retry (some sort of error) " . $pusername); } //end LL verification hack ? Thanks...
  18. My server, and my hosts server have php enabled. Its pretty much expected that servers come compiled with perl and ruby and such. But What i want to know, is what makes it better to use perl?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.