Eldar Posted August 30, 2013 Share Posted August 30, 2013 Hi, guys, I'm learning PHP and I'm total beginner and I need help. Here's the problem, I have config.php in my website, I need to "update/edit" that file and it should be saved. Like installation for website. $conf = $TMPL = array(); $conf['host'] = 'localhost'; $conf['user'] = 'username'; $conf['pass'] = 'password'; $conf['name'] = 'name'; $conf['url'] = 'http://yourdomain.com'; $conf['mail'] = 'example@example.com'; I need PHP file which will insert and connect database, and insert mysql dump file (database.sql). In the config.php there are more code bellow, I would like to save that code to, just to edit upfront code. I've did something before and it delete all code bellow and insert the new code. If anyone can help me please. Quote Link to comment Share on other sites More sharing options...
Eldar Posted August 30, 2013 Author Share Posted August 30, 2013 $conf['name'] = 'INSERT HERE'; - > config file <input type="text" class="form_text" name="name" size="30" value="<?php echo $conf['name'] ?>"> - > install file How to make form in "install file" which will insert in config file where is currently 'INSERT HERE' Quote Link to comment Share on other sites More sharing options...
jcbones Posted August 30, 2013 Share Posted August 30, 2013 I read that twice, and I still have no idea what you want. Slow down, and type out your question, concisely. So that someone, that doesn't know how to read minds, can understand your question. Quote Link to comment Share on other sites More sharing options...
jasmeet Posted August 31, 2013 Share Posted August 31, 2013 i dnt understand what you r asking.... for connectivity on localhost..use.. $conn=mysql_connect("localhost","root",""); mysql_select_db("databasename",$conn); if on live server, use... $conn=mysql_connect("hostname","username","password"); mysql_select_db("databasename",$conn); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.