Results 1 to 3 of 3

Thread: PHP help needed

  1. #1
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default PHP help needed

    Ok so I am trying to add <?php echo curPageURL(); ?>

    To
    <?php
    function curPageURL() {
    $pageURL = 'http';
    if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    } else {
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    }
    return $pageURL;
    }
    include 'simple_html_dom.php';
    $html = file_get_html("RIGHT HERE");
    foreach($html->find('td[name=desc]') as $e);

    ?>

    Can anyone help?

    Tim..
    Last edited by tgallagher26; 03-23-2009 at 01:47 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I guess...

    PHP Code:
    <?php
      
    function curPageURL() {
        
    $pageURL 'http';
        if (
    $_SERVER["HTTPS"] == "on") {
          
    $pageURL .= "s";
        }
        
    $pageURL .= "://";
        if (
    $_SERVER["SERVER_PORT"] != "80") {
          
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
        } else {
          
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
        }
        return 
    $pageURL;
    }
    include 
    'simple_html_dom.php';
    $html file_get_html(curPageUrl());
    foreach(
    $html->find('td[name=desc]') as $e);

    ?>
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    tgallagher26 (03-23-2009)

  4. #3
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Thanks for you help Niles
    Last edited by tgallagher26; 03-23-2009 at 01:47 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •