Author Topic: Need help making a simple php script  (Read 396 times)

SaKing

  • New Member
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Need help making a simple php script
« on: September 07, 2011, 06:16:47 PM »
I know pretty much nothing about PHP, so i haven't got anything wrote down. If anyone could link me a tutorial for what I want or write one for me or something I'd be greatful.

Basically what i'm looking for is a script that will get certain lines of text off another page and post it on the php page. I believe it's called a parser or something? I'm not sure. I can go into more detail in PM so post here or send me a mesasge if you would like to help/

Thanks..

SaKing

  • New Member
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Need help making a simple php script
« Reply #1 on: September 07, 2011, 06:18:43 PM »
Ermm I don't know how to edit but by off another page, I mean info off a complete different website & server.


Example: A script that will take a certain line off a google search and 'paste' it into the php page on my server

commando_chandu

  • New Member
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Need help making a simple php script
« Reply #2 on: September 08, 2011, 04:08:21 AM »
Hello

please let me know your problem clearly

i will surely help you -----

Thanks


Tony

  • New Member
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Need help making a simple php script
« Reply #3 on: September 08, 2011, 01:43:16 PM »
Hi SaKing,

I don't know if this could help you but this function returns whatever is between 2 delimiter in a given string... if you use it with file_get_contents('http://www.heretheurl.com/pagetoparse.html) it should work well.

PHP Code: [Select]

$string 
file_get_contents('http://www.heretheurl.com/pagetoparse.html);

function get_string_between($string, $start, $end) {

	
$string = " ".$string;

	
$ini = strpos($string,$start);

	
if ($ini == 0) return "";

	
$ini += strlen($start);

	
$len = strpos($string,$end,$ini) - $ini;

	
return substr($string,$ini,$len);

}