SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    -
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quick question here about PHP.
    Can someone please tell me what I am doing wrong here? (I get errors)

    The document is called by http://localhost/find.php?search=term-goes-here

    <?
    $url = 'http://localhost/cgi/s?srch=$search';

    $lines_array = file($url);

    $lines_string = implode('', $lines_array);

    eregi("(.*)", $lines_string, $head);

    echo $head[0];
    ?>

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should always post the error you got.
    Anyway, I believe the problem is with the $url. Make sure the file is accessible (using web browser) and also, the single quote will disable the $search. Might need to replace with double-quote
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Monmouth Junction, NJ
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try

    $url = "http://localhost/cgi/s?srch=$search';

    I believe this should fix it.


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
  •