Jump to content

Recommended Posts

i have written the code for a static page and it works but for changing pages i have no clue

like when you have  -->  catalog/product_info.php?products_id=6899

 

i  use $oscfile = file_get_contents to get files from an off server page and the  info i grab

looks  nice inside of my <iframe>

 

i use the same function to get  information from a server side page but

that darn variable id=6899  changes so my data does not  match the page

 

so i need  some way to get the  6899 into

 

$aa = '6899';

$oscfile = file_get_contents

("http://www.ccc.com:81/osc/osc/osc/catalog/popup_image.php?pID=$aa");

 

$osc = (get_oscdoc_title($oscfile));

$test = $osc;

 

6899 is the page id and it  changes each time  someone clicks a new product

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

i have  thought  of everything i can think of and to no avail

no ideas any one  got an idea?

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

in a nutshell i am uploading a database and i am grabbing  off server and inserver

from other files already built, and i am putting my iframe data that i grab into my

main  product .php file but not touching  that file except with  one statement from an excel  spreadsheet  an <iframe> satement

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

i found out i can not use long php statements in my  excel  cell so i had to create a new php page on the server and the  iframe includes this page and another page i coded so everything works

except when a new page is called up my old data stays in the iframe 

well not old data but the data from  a  <tag> that has another similar tag as the one i want

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

now if i could grasp the idea of  skipping some data and going down in the page past the other header  data that has a similar tag then problem is solved

but i have not found anyone to help solve that issue

no one seems to be able to explain the offset in the manual

 

Description

int preg_match_all ( string $pattern , string $subject , array &$matches [, int $flags [, int $offset ]] )

 

if this offset can be explained and worked out  then i am done this is my last step in a 3 year  process of building  and learning everything from scratch

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

i have learned linux built the server html bash csv tab delimited verses the others, css some php  well pretty much everything you need to know except for high level  php and mysql commands. webmin phpmyadmin putty command line etc etc etc

thisis my last  step i am only 1 step away after all this  hard learning i hope someone has an answer

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/168563-is-this-impossible-or-am-i-dumb/
Share on other sites

I admit I'm not entirely sure what you are asking or trying to do so I don't know if this is what you're looking for but in php you can access the value from the url string using $_GET['variable'] so for instance if you go to

 

http://www.mysite.com/somepage.php?id=123

 

you can for instance

 

echo $_GET['id']; // output: 123

 

As far as the offset for preg_match_all... the description is pretty straight forward:  instead of starting the whole matching process at the beginning of the string, you can specify an offset to start at, instead.  So for instance, if you have this:

 

$string = "some string";

 

If you put 5 as the offset, it will start trying to match at the 's' in 'string' instead of at the beginning, because the 's' in 'string' is the 5th character position in the string (position starts at 0).

ok thanks for reading all that and yes

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

echo $_GET['id']; // output: 123

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

i knew  about this function  but the issue here  again is

static verses  variable

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

here is my logic

1)oscommerce  store

2)upload data from excel sheet

3)description = isbn  because this is easy for us to track

4)<iframe> in the cell from a php page that instead of wgeting all the page i use

preg match all

5)preg match all will grab the description  via the  isbn on the end of the url

6) but  getting the data in my iframe to change  to match the changing oscommerce store is the trick

now one possible answer is to use the  $_GET function

this way

 

1)when the url of the product = url of the image

then i can grab  from the database that  description id value

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

if  url_id_1 = url_image_id_1  , then  get description from mysql somehow

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

 

see here is the  deal  oscommerce is very advanced for me and to know all the ins and outs  and links they have and  to know how the code works i decided to by pass i can not become a programmer  as such, i can only  do a little here and there. i am trying to hack into their setup without knowing all their variables and  mysql commands

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.