Jump to content

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/281713-need-some-help-with-configphp-file/
Share on other sites

$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'

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);

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.