Jump to content

[SOLVED] i am 1 step away from being done on a 3 year project please help php code


scbookz

Recommended Posts

hallelujah i got it to work!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

i was using  wrong  item in one spot only

 

$osctag = preg_match_all('/$product_info['products_description']/', $oscfile, $oscmatches, PREG_PATTERN_ORDER);

 

is right  but i was trying to get

products_description  without $product_info

 

 

 

it is done i am  done with my 3 year project

 

thanks for your time

 

you get a free book out of the deal

final code works and is:

-------------------------------------------------------

<?php

$oscfile = file_get_contents("http://ww1:81/osc/osc/osc/catalog/product_info.php?products_id");

$osc = (get_oscdoc_title($oscfile));

$test = $osc;

 

 

//function

function get_oscdoc_title($oscfile){

$osctag = preg_match_all('/$product_info['products_description']/', $oscfile, $oscmatches, PREG_PATTERN_ORDER);

return($oscmatches[1][0]);}

 

 

 

 

$file = file_get_contents("http://www.2.com/IsbnSearch.aspx?isbn={$test}");

$x = (get_doc_title($file));

 

echo preg_replace('/^Book -/','(10 digit isbn above) -',$x);

 

// retrieve page title

function get_doc_title($file){

    $h1tags = preg_match_all('/<title>(.*)<\/title>/', $file, $matches, PREG_PATTERN_ORDER);

return($matches[1][0]);}

 

?>

 

it works perfectly now  thanks for your time and effort  i hope this helps someone else some day

 

all i can say is  php is  cool

oops last code was not working but now it is

--------------------------------------------------------------

<?php

$oscfile = file_get_contents("http://xx.xx.xx.xx:81/osc/osc/osc/catalog/product_info.php?products_id");

$osc = (get_oscdoc_title($oscfile));

$test = $osc;

 

//function

function get_oscdoc_title($oscfile){

$osctag = preg_match_all('/<img src="images\/(.*).jpg/', $oscfile, $oscmatches, PREG_PATTERN_ORDER);

   

return($oscmatches[1][0]);}

echo $test;

$file = file_get_contents("http://www.cc.cc.cc.cc.com/IsbnSearch.aspx?isbn={$test}");

$x = (get_doc_title($file));

echo preg_replace('/^Book -/','(10 digit isbn above) -',$x);

 

// retrieve page title

function get_doc_title($file){

    $h1tags = preg_match_all('/<title>(.*)<\/title>/', $file, $matches, PREG_PATTERN_ORDER);

return($matches[1][0]);}

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.