Another PHP question

  PurplePenny 20:58 01 May 2004

I mentioned this in my other thread but as it is a new question I'll outline it again. I'm attempting to write a mod. for an e-commerce package (there's a users' forum where such things are encouraged).

I'm adding a postage by region to a routine that already calculates postage by weight. The routine happens twice and my mod works the first time but not the second. By putting in obvious default actions I was able to work out that the reason it didn't work the second time was that a variable had a value the first time but was empty the second time.

I've now gone through the page matching up ifs elses and curly brackets and the reason for the missing data is obvious ....... the second time the calculation happens the point at which the value is added to the variable is by-passed.

Now we get to the crux of my question: all the other data for the calcualtion is stored in a session file, is there any way to add my extra bit of data just once? The other data is written for every item purchased but this would have to be just once so the calculation just takes (for instance) DATA[6], DATA[7] and DATA[8] for each item and does the relevent calculations.

Is it feasible to add a final line with just one item of data so that I could then retrieve that for the second calculation? Would I still have to supply all the other fields and fill with zero ...

.... no that won't work ..... it will display as a on the basket and checkout.

OK - I need to create another file to store it in don't I? Does that sound like a reasonable course of action or can anyone think of a better way? It would have to be uniquely identified the same way as the session file (who knows? - two people *might* be buying at the same time) and it will have to get deleted at the end of the page, right?

Oh my this is quite a learning curve. Forgive the rambling - why don't I just go away and try it out?


  PurplePenny 23:52 01 May 2004

Well that was a complete and utter failure.

Now I understand why no-one else has submitted this mod. despite that fact that people keep asking for it :-(

I can't paste the code here 'cos' it isn't my code to paste. Without showing you how, where and what it is that I'm trying to do you're all in the dark so I'll shut up now.


  PurplePenny 12:46 02 May 2004

(checks clock) , Afternoon fourm member. Thanks.

Here I am, back at the PC again. This kept waking me up last night. It is such a simple thing that I'm trying to do. It *has* to be possible. But from what I've read in the users' forum the developer has been working on the same thing and hasn't come up with anything yet.

  Taran 13:11 02 May 2004

I think the trouble is Penny, that you can't post code details here and without them nobody can really say "do this, that and a little bit of the other and X will happen".

It's easy enough to say modify the session parameters and all will be well but frankly, I haven't a clue about the actual workings of what you're trying to achieve and your general description is not really enough to spark a solution.

I'll echo the 'good luck' sentiments, but without anything other than generalised concepts to go on I'm goosed in trying to help.


  PurplePenny 14:37 02 May 2004

I know :-( (heaves big sigh).


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

See the work of famous artists playing with toys

iPad Pro 10.5in (2017) review

Comment faire une capture d’écran sur un Mac ?