473,788 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Do I need to use classes?

Hi again folks,
As a relative newbie I am probably trying to run before I can walk but here
goes:

Thanks to all you good folks I have managed to get some sort of a site up and
running whereby people can view my catalogue, select items from it and then send
the aggregate amount to PayPal for payment processing. I have a precheckout page
where people can view their selected items before proceeding to the final
payment stage. My script is as follows:

$query = 'SELECT * FROM Catalogue WHERE id IN (' . implode( ',',
$_POST['selection'] ) . ')';
$result = mysql_query($qu ery) or die ("Error in query: $query. " .
mysql_error());
$totalprice = 0;
echo "<table cellpadding=2 border=0>";

echo "<tr>";
echo "<td bgcolor='#FF800 0' valign='top' align='center'> <font face='Arial'
size='1'><u><b> Cat No</b></u></font></td>";
echo "<td bgcolor='#FF800 0' valign='top' align='center'> <font face='Arial'
size='1'><u><b> Description</b></u></font></td>";
echo "<td bgcolor='#FF800 0' valign='top' align='center'> <font face='Arial'
size='1'><u><b> Price</b></u></font></td>";
echo "</tr>";

while($row = mysql_fetch_row ($result)) {
echo "<tr>";
echo "<td><font face='Arial' size='1'>" . $row[0] . "</font></td>";
echo "<td><font face='Arial' size='1'>" . $row[3] . "</font></td>";
echo "<td><font face='Arial' size='1'>£" . $row[6] . "</font></td>";
echo "</tr>";
$totalprice += $row[6];
}
echo "</table>";
echo "<p align='center'> <b><font color='#FF0000' >Total price of selected items =
£$totalprice</br>Your credit card will be debited with this
amount</br></font></b></p>";
echo "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>
<input type='hidden' name='cmd' value='_xclick' >
<input type='hidden' name='business' value='myemaila ddress'>
<input type='hidden' name='item_name ' value='aggregat epurchase'>
<input type='hidden' name='currency_ code' value='GBP'>
<input type='hidden' name='amount' value='$totalpr ice'>
<p align='center'> <b>Payment method is via PayPal - The secure way to make
payments over the internet.</b></p>
<p align='center'> <input type='image' src='x-click-but03.gif' name='submit'
alt='Make payments with PayPal - it's fast, free and secure!'></p>
</form>";

Yeah Yeah I know it needs tidying but it works.
My question is will it work in the real world. What happens if their are
multiple users all trying to checkout at the same time and trying to access the
same checkout script? Do I need to use classes?

Any help/suggestions greatly appreciated.

Regards
Dynamo

Jul 17 '05 #1
2 1570

Dynamo wrote:
Hi again folks,
As a relative newbie I am probably trying to run before I can walk but here goes:

Thanks to all you good folks I have managed to get some sort of a site up and running whereby people can view my catalogue, select items from it and then send the aggregate amount to PayPal for payment processing. I have a precheckout page where people can view their selected items before proceeding to the final payment stage. My script is as follows:

$query = 'SELECT * FROM Catalogue WHERE id IN (' . implode( ',',
$_POST['selection'] ) . ')';
$result = mysql_query($qu ery) or die ("Error in query: $query. " .
mysql_error());
$totalprice = 0;
echo "<table cellpadding=2 border=0>";

echo "<tr>";
echo "<td bgcolor='#FF800 0' valign='top' align='center'> <font face='Arial' size='1'><u><b> Cat No</b></u></font></td>";
echo "<td bgcolor='#FF800 0' valign='top' align='center'> <font face='Arial' size='1'><u><b> Description</b></u></font></td>";
echo "<td bgcolor='#FF800 0' valign='top' align='center'> <font face='Arial' size='1'><u><b> Price</b></u></font></td>";
echo "</tr>";

while($row = mysql_fetch_row ($result)) {
echo "<tr>";
echo "<td><font face='Arial' size='1'>" . $row[0] . "</font></td>"; echo "<td><font face='Arial' size='1'>" . $row[3] . "</font></td>"; echo "<td><font face='Arial' size='1'>£" . $row[6] . "</font></td>"; echo "</tr>";
$totalprice += $row[6];
}
echo "</table>";
echo "<p align='center'> <b><font color='#FF0000' >Total price of selected items = £$totalprice</br>Your credit card will be debited with this
amount</br></font></b></p>";
echo "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'> <input type='hidden' name='cmd' value='_xclick' >
<input type='hidden' name='business' value='myemaila ddress'> <input type='hidden' name='item_name ' value='aggregat epurchase'> <input type='hidden' name='currency_ code' value='GBP'>
<input type='hidden' name='amount' value='$totalpr ice'>
<p align='center'> <b>Payment method is via PayPal - The secure way to make payments over the internet.</b></p>
<p align='center'> <input type='image' src='x-click-but03.gif' name='submit' alt='Make payments with PayPal - it's fast, free and secure!'></p>
</form>";

Yeah Yeah I know it needs tidying but it works.
My question is will it work in the real world. What happens if their are multiple users all trying to checkout at the same time and trying to access the same checkout script? Do I need to use classes?

Any help/suggestions greatly appreciated.

Regards
Dynamo


Jul 17 '05 #2
It does not look like you need to use a class, although it may make
things neater and nicer to deal with. There shoulden't be a PHP problem
if you have a mass of requests to the page so long as the SQL server
and web server are functioning properly and can handle the number of
requests.

Jul 17 '05 #3

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

Similar topics

1
1624
by: Robert | last post by:
I have two tables (classes and students). Right now, I'm generating a report in asp that shows a list of classes, the enrollment for each class, and how many seats are available (see query below). SELECT classes.classid, classes.classname, classes.maxstudents, classes.Active COUNT(students.class) AS countstudentsclass, classes.maxstudents - COUNT(students.class) AS remain FROM classes LEFT OUTER JOIN students ON students.class =...
2
1441
by: cm500 | last post by:
I'm very new to databases so bear with me. What I need is a way to track the training for the employees at my firm. I have 40 classes that I will be teaching on various subjects and various levels of difficulty. I have 100 employees that will need to take some of the classes offered (already determined who needs to take what). I need a way to track the training by class (did everyone who was supposed to take the class, actually...
5
3487
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices by adding a WebReference, since it does not allow me to keep state (cookiecontainer) or to specify functions on the classes (like if i want to override the ToString() function on a class from my webservice). So the only way i can see how i can get...
2
1993
by: Andrew S. Giles | last post by:
OK, Ive run my head into this wall for too long. I need help. I am developing an applicaiton in C# to present a user with a GUI to specify a configurable list of machines that he wants to listen to the output of. Specify a filename to shove all of the data (into Excel), and start the whole thing going. I get that done no problem. The problem comes with the Data. The data is coming from a different application, and I am not 100% sure of...
8
2324
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta) My app (an image viewer) opens with a Main form with a file explorer if you open the program with the exe, but opens with the ImageView form if you double click an image file, if you want to see the Main form once the ImageView is open the...
1
1169
by: bonk | last post by:
I have a set of unmanaged c++ classes that internally need to use managed classes (WPF formerly know as "Avalon") but I do not want to compile the whole MFC project with the /clr switch. What options do I have in that case? Could I a) swap out all the classes that need to use managed classes into its own dll and compile ONLY that one with the /clr switch ? b) compile the whole project with the /clr switch but force certain classes not to...
10
2026
by: Luke Meyers | last post by:
So, just a little while ago I had this flash of insight. It occurred to me that, while of course in general there are very good reasons for the conventional two-file header/implementation separation for each C++ class, there are cases in which this paradigm contributes nothing and simply introduces extra boilerplate overhead. The particular case I have in mind is CppUnit tests. Each test header is only ever included by the...
18
2344
by: bsruth | last post by:
I tried for an hour to find some reference to concrete information on why this particular inheritance implementation is a bad idea, but couldn't. So I'm sorry if this has been answered before. Here's the scenario: We have a base class with all virtual functions. We'll call this the Animal class. We then make two classes Fish and Bird that both inherit from Animal. In the program, we have a single array of Animal pointers that will...
1
3132
by: Tyno Gendo | last post by:
Hi everyone I need to move on a step in my PHP... I know what classes are, both in PHP4 and 5 and I'm aware of "patterns" existing, but what I'm looking for are some real world projects eg. Open Source that people consider to use classes and patterns correctly. I lack a senior person to lead me in this so I feel I'm losing out on only using bare PHP class features and not really knowing how to design
3
2030
by: =?Utf-8?B?SmF5IFZpbnRvbg==?= | last post by:
I see general messages about how to learn .NET but I have an immediate requirement to ramp up my old skills very quickly. Can anyone recommend the FASTEST way for me to get almost-competent in VB.NET (C# will come later)? This must be an online or book adventure because I can't totally disappear to attend physical classes. I have 15 years experience with commercial VB & C development, and I understand OO & database. I'm looking for a...
0
9498
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10370
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10113
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.