|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
hey all,
i have a problem! no not a mentl one as most would say but one problem with my shopping cart! BACKGROUND INFORMATION --------------------------- i have designed it so that the stock levels are adjusted everytime you add an item to your basket. This is purley down to the fact that the site i am building supplies limited stock of rare parts, so an accurate guide to quantity is required. this means the parts are stored in a virtual basket table with columns including: _________________________________ |session_ID | part_id | unixtimestamp | |__________|_______|_____________| |__________|_______|_____________| |__________|_______|_____________| other colums are included. Now i know roughly how to build the script in PHP but the problem i am having is: THE PROBLEM ------------- WHERE THE HELL DO I PUT THE SCRIPT? & IS PHP A SUITABLE LANGUAGE FOR THIS PROBLEM? i know i have to put it on the server somewhere but where! i have bought a domain and webspace from PREMIERHOST who have 4 default folders 1) public_html = where the website is stored 2) private = dunno? 3) cgi_scripts = dont know what a cgi script is but i havent used it yet 4) logs = people logging into ftp site details are kept if anyone have created anything similar please can you just point me in the right direction I hope reading this wasnt too tedious but the help would be mucho appreciated ![]() thanks ed |
|
#2
|
||||
|
||||
|
If I understand you correctly, I think you need to integrate this script as part of the script which adds products to the basket. So, if you've got your basket script in /public_html/basket.php (it needs to be in the public folder because otherwise people won't be able to run it), you just need to add some code which sorts out the stock levels when someone adds something to their basket.
PHP is suitable I would say for this, especially if you're using a MySQL database. These two work very well together. If I haven't answered what you wanted, then if you try explaining it differently then maybe I'll be able to help better ![]() |
|
#3
|
||||
|
||||
|
Quote:
Basically it cant sit on the public side because i dont want the user to run it i want it to be automatic and seperated from any individual user. basically i want the script to automatically run every hour just checking a table and its content. ive been told it has to go into the CGI_BINS so i know the location. What do i do next? |
|
#4
|
||||
|
||||
|
If it's something that you need to run every hour, then it would be best to run it on some sort of cron job. But you'll have to speak to your host to see if that is allowed. You won't be able to put the script in a private folder because it still needs to be run by the cron job, so you'll have to somehow password protect the directory or only allow it to be run from the one IP address.
You shouldn't need to put the file in the cg-bin directory - I would imagine that your script could be anywhere in the public_html folder and it should still run. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Web Design Help > running a script on a server on a timer? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|