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

Link to comment
Share on other sites

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]);}

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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