Jump to content

fpyontek

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fpyontek's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for your help, exactly what I needed. Fred
  2. I need to access the DOM Anchor Object Property while scraping an HTML file. I cannot find a reference to the text between the anchors, not the href but the "clickable" text which appears between the right and left carots. Here is an example of the Anchor. a href="http://cnj.craigslist.org/ctd/1668776815.html">1998 Pontiac Grand Prix GT - $3995</a> What I am having trouble retrieving is the text: 1998 Pontiac Grand Prix GT - $3995 Here is my code: <?php $dom = new domDocument; $dom->loadHTML($html); $dom->preserveWhiteSpace = false; $anchors = $dom->getElementsByTagName('a'); foreach ($anchors as $anchor){ echo $anchor->getAttribute("href")."<br>"; echo $anchor->getAttribute("innerhtml")."<br>"; } ?> Thanks
  3. Thanks for the reply. Yes, I can write to "C:\Program Files\TMP\somefile.txt" and read from the same file using php. An interesting note, I had to change the name of the folder from "tmp" to "TMP" because "\t" is a non-printing character and no such file "...\ mp\somefile.txt" was found on my first try.
  4. Session data is sent to my session.save_path (C:\Program Files\tmp), but does not pass to the next page. (I'm using WinXP PHP5 Apache2.2) I tried a simple script (see below). The same script works as expected on my Linux box (PHP4.* Apache2.*.) The php.ini files are identical (except for session.save_path ). The only way I could get the session data to pass ( in WinXP) is to pass the SID in the header URL, e.g. header("Location:page2.php?".strip_tags(SID)); Which is obviously undesirable on other than localhost. Thanks. (page1.php) <?php session_start(); $_SESSION['fname'] = 'DERF'; $_SESSION['eMailAddr'] = '[email protected]'; header("Location:page2.php"); /* uncomment the header below, and comment the header above and the session data will pass to page2.php (in WinXP)*/ //header("Location:page2.php?".strip_tags(SID)); ?> (page2.php) <?php session_start(); echo $_SESSION['fname']; echo $_SESSION['eMailAddr']; ?>
×
×
  • 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.