473,545 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with product registration

Hi everyone,
I have the following problem: i have 3 pages: Page1, Page2,
Page3; These pages register a product.
In Page1 i do a post to Page2. In Page2, i asynchrony upload some
images, to be used at Page2 itself, the images will be saved at the
DB, and used like: <img src="ShowImage. php?cod=1231">. Each Image has
a product associated.
If the user that will register his product, at Page2 already has
done 3 images upload, and close the web browser, what will happen? The
database will have the uploaded images, but these images will not have
a product associated, cause the user had not done the last post at
Page3!
I´ve beeing doing a research, and i realized that i could use a
transaction. But, this transaction needs a persisten connection.
I use postgresql, Did anyone knows how to solve my problem? How Can
i use a persistent connection with php? Did the persistent connection
will solve my problem?
Thanks very much
Jun 2 '08 #1
2 1279
xaviergxf wrote:
Hi everyone,
I have the following problem: i have 3 pages: Page1, Page2,
Page3; These pages register a product.
In Page1 i do a post to Page2. In Page2, i asynchrony upload some
images, to be used at Page2 itself, the images will be saved at the
DB, and used like: <img src="ShowImage. php?cod=1231">. Each Image has
a product associated.
If the user that will register his product, at Page2 already has
done 3 images upload, and close the web browser, what will happen? The
database will have the uploaded images, but these images will not have
a product associated, cause the user had not done the last post at
Page3!
I´ve beeing doing a research, and i realized that i could use a
transaction. But, this transaction needs a persisten connection.
I use postgresql, Did anyone knows how to solve my problem? How Can
i use a persistent connection with php? Did the persistent connection
will solve my problem?
Thanks very much
Persistent connections won't help you here, either. The transaction
will still be terminated at the end of your second page.

What you need to do is store the data somewhere temporarily, i.e. in
another table, then remember the key to the row. Also add a timestamp
column to tell when the data was inserted.

If the complete Page 3, fetch the data you just stored and place it in
your live tables, then delete it. Then, on a regular basis (i.e. once a
day), go through your temporary storage table and remove anything 24
hours (via a cron job), based on the timestamp you placed in the row.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 2 '08 #2
On Wed, 14 May 2008 19:18:56 +0200, xaviergxf <xa*******@gmai l.comwrote:
Hi everyone,
I have the following problem: i have 3 pages: Page1, Page2,
Page3; These pages register a product.
In Page1 i do a post to Page2. In Page2, i asynchrony upload some
images, to be used at Page2 itself, the images will be saved at the
DB, and used like: <img src="ShowImage. php?cod=1231">. Each Image has
a product associated.
If the user that will register his product, at Page2 already has
done 3 images upload, and close the web browser, what will happen? The
database will have the uploaded images, but these images will not have
a product associated, cause the user had not done the last post at
Page3!
I´ve beeing doing a research, and i realized that i could use a
transaction. But, this transaction needs a persisten connection.
I use postgresql, Did anyone knows how to solve my problem? How Can
i use a persistent connection with php? Did the persistent connection
will solve my problem?
As you're not sure how slow your users can be (upload something, go drink
a cup of coffee, come back, and only then continue), I'd say go for the
easy route: let them sit there for a certain period of time you and your
users deem reasonably safe to assume the action is aborted, and clean your
database up with a cron job that looks for either orphan images with a
timestamp longer then X time ago.

Alternatively, you could use a database driven session, in which case the
garbage handler would take over the job mentioned for the cronjob earlier:
as soon as you think a session is timed out, the garbage collector can
delete the sessiondata and related images. Of course, loading all data of
the images in $_SESSION is not the way to go, so either store them in in
other BLOB columns of a related row if they have a fixed amount, or in a
related table, and use a foreign key delete cascade.
--
Rik Wasmus
[SPAM] Now temporarily looking for some smaller PHP/MySQL projects/work to
fund a self developed bigger project, mail me at rik at rwasmus.nl. [/SPAM]
Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2833
by: Gudni G. Sigurdsson | last post by:
Hi. I am working on a program for the .NET Framework written in C# with Visual Studio .NET. With this program, one can print a report realized with the Crystal Report software included with VS .NET. This has all been working fine until recently, when I had to install and run the program on more computers. Then I suddenly start getting...
1
6719
by: Chris | last post by:
Hello, I have a program that uses the CInternetSession and CHttpConnection mfc classes to register the program...it works for the majority of our customers, but a few have received errors, all of whom are going through proxy servers. Specifically, we have encountered a 400 error, a 500 error, and a 12152 error. On the 500, we have noticed...
3
4306
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by using a report I created and then printing them on a continuous-feed dot matrix printer. I used the Label Wizard, chose the query I created, picked the...
11
11020
by: Paul Aspinall | last post by:
Hi Can anyone offer any hints / tips for creating registration keys / application activation, as software copy protection measures for a Winform app developed in C#? Thanks
3
1655
by: dtvuser | last post by:
Hi, I'm new to PHP and seem to be having soom problems, I'm getting confused with all the different styles of script writing. I've created a PHP script to submit details to my email but the details don't forward. PHP is enabled on the windows server host site. I don't get any errors it just stays on the submit form. below is the scripts...
0
967
by: DanielP | last post by:
I'm trying to call a C# assembly from an unmanaged C++ app, but I'm having some problems. I've tracked it down to a registration problem, and a search through the registry shows that the guid I've assigned to the assembly in the COM interface is not there. Also, my HRESULT from my CreateInstance call shows "Class not registered" in debug mode. ...
2
1614
by: Wayne Smith | last post by:
Applies to: Visual Studio 2008 Professional Hi everyone, I'm in the middle of creating a website with VS2008 and I'm trying to integrate a user registration/login section on the website but I've come up against a small problem. I've configured the database and set up a test user through the ASP.NET Website Administration Tool (Website ASP.NET...
2
1523
by: =?Utf-8?B?TWlja3lQ?= | last post by:
Ok, so I have a HP xw4200 with a valid XP Pro registration key, in fact it came on it already installed. I then bought a second-hand computer that needed Wnidows installed on, but that also had it's own valid registration key. Now, like an idiot, when installing XP Pro on the second computer, I accidently put the registration key from the...
6
2402
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The connection string works fine and the tables are added to the project without a problem. When I create the tables they appear to bind and I am able to...
0
7411
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7669
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7926
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.