Welcome Guest, Not a member yet? Register   Sign In
Change variable value in php file
#1

(This post was last modified: 09-11-2017, 07:17 AM by omid_student.)

Hello
I have below data in application/config/config.php
$config['sms_number'] = '0123124123123';

Now i need to change it without manual
So i need get data via user and set it to $config['sms_number']
Maybe?
Reply
#2

Don't. Store the value in your database and create a form to change the value and update the record.
Reply
#3

(09-11-2017, 07:52 AM)Wouter60 Wrote: Don't. Store the value in your database and create a form to change the value and update the record.

Why?
Reply
#4

I dont quite understand your problem? If the sms number changes why would you have it in the $config array in the first place?
The config is normally used for things that dont change.

When does the number change? When a user logs in? Then I agree with Wouter60 the sms number should be in the database with the other user relevant data.
On the package it said needs Windows 7 or better. So I installed Linux.
Reply
#5

https://codeigniter.com/user_guide/libra...onfig-item
Reply
#6

(09-11-2017, 08:49 AM)rtenny Wrote: I dont quite understand your problem? If the sms number changes why would you have it in the $config array in the first place?
The config is normally used for things that dont change.

When does the number change? When a user logs in? Then I agree with Wouter60 the sms number should be in the database with the other user relevant data.

I understood your purpose.
I try save data in database
Thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB