Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Edit Variables contained in a file
Old 07-24-2010, 10:57 PM Edit Variables contained in a file
Skilled Talker

Posts: 83
Trades: 0
I want to create a page that contains all sorts of Variables with values such as Prices, Name of Site, Rates, etc.

I want to create an admin page, that allows the admin to easily edit the values inside this php file. How does this work without the variables being reset to their default values everytime the page is reloaded.

I tried google but wasn't sure what exactly to search for. I'll take anything you can give me. A link to learn more about how to do something like this or even some tips & tricks.
Smudly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-24-2010, 11:22 PM Re: Edit Variables contained in a file
OleTom's Avatar
Extreme Talker

Posts: 176
Location: Out there some where
Trades: 0
It sounds like you are in need of a E-Commerce script if your hosting account has cPanel you have "Fantastico" a one click script installer it comes with CubeCart, OS Commerce and Zen Cart I like cube cart but anyway that is your easiest way to do this

If you don't have it Check out his link

http://www.hotscripts.com/category/p...ms/e-commerce/
__________________
Life is Good,OleTom

Please login or register to view this content. Registration is FREE

Last edited by OleTom; 07-24-2010 at 11:27 PM..
OleTom is offline
Reply With Quote
View Public Profile Visit OleTom's homepage!
 
Old 07-25-2010, 09:47 AM Re: Edit Variables contained in a file
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
You can do that in several ways. One would be to store the values of the variables in a database (or flat file) and look them up every time the page is loaded.

Another is throgh sessions, the values would stay the same even when the user goes from page to page once the session is set - however the session will only affect the admin's browser. Not any one else's and when the admin closes the browser the session will be deleted and they have to re-enter the variable values in the management page again.

The other option is via setting cookies which works similarly to the session method in that only the admin's browser will be affected but the values would remain even if the admin closes the browser. Values will be gone when the cookie expiration time comes or if the admin clears his cookies manually.

Since you want the admin to be able to control this, I assume you need the values of variables to change on a site that would affect all users, in which case the database method is probably what you need.
__________________

Please login or register to view this content. Registration is FREE
Marik is offline
Reply With Quote
View Public Profile
 
Old 07-26-2010, 08:08 PM Re: Edit Variables contained in a file
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
If your storing these values in a text file, you can split (explode) the file into an array with an offset of 1 by the variable you want to change, then simply write to the file your new information, and then insert the previous content.

I did this once, and that's how I think I did it :P it was a while ago :P
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Edit Variables contained in a file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15962 seconds with 12 queries