Web Design Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignWeb Design Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 24th, 2004, 05:35 PM
edfollett's Avatar
edfollett edfollett is offline
Mystical Monkey with Wings
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: SW1A London UK
Posts: 500 edfollett User rank is Corporal (100 - 500 Reputation Level)edfollett User rank is Corporal (100 - 500 Reputation Level)edfollett User rank is Corporal (100 - 500 Reputation Level)edfollett User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 12 h 59 m 21 sec
Reputation Power: 9
Question running a script on a server on a timer?

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

Reply With Quote
  #2  
Old August 25th, 2004, 01:52 AM
edwinbrains's Avatar
edwinbrains edwinbrains is offline
Retired Moderator
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2004
Location: London, UK
Posts: 6,670 edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced Folder
Time spent in forums: 1 Week 6 Days 23 h 36 m 40 sec
Reputation Power: 92
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
__________________
- Edwin -

The General Rules Thread | The General FAQ Thread

Reply With Quote
  #3  
Old August 25th, 2004, 02:45 AM
edfollett's Avatar
edfollett edfollett is offline
Mystical Monkey with Wings
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: SW1A London UK
Posts: 500 edfollett User rank is Corporal (100 - 500 Reputation Level)edfollett User rank is Corporal (100 - 500 Reputation Level)edfollett User rank is Corporal (100 - 500 Reputation Level)edfollett User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 12 h 59 m 21 sec
Reputation Power: 9
Quote:
Originally Posted by edwinbrains
If I understand you correctly, I think you need to integrate this script as part of the script which adds products to the basket.


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?

Reply With Quote
  #4  
Old August 25th, 2004, 06:03 AM
edwinbrains's Avatar
edwinbrains edwinbrains is offline
Retired Moderator
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2004
Location: London, UK
Posts: 6,670 edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)edwinbrains User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced Folder
Time spent in forums: 1 Week 6 Days 23 h 36 m 40 sec
Reputation Power: 92
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignWeb Design Help > running a script on a server on a timer?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway