Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:16 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Need help with File
PostPosted: Sat Apr 18, 2009 4:15 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Sat Apr 18, 2009 4:00 pm
Posts: 3
Points: 0
Hi, i do really need help with file..

Let say i have a config.php:
Code:
<?//config.php
$firstline = [XCONFIG_FIRST];
$secondline = [XCONFIG_SECOND];
$thirdline = [XCONFIG_THIRD];
?>


And I have other php script (this contains forms, called it replace.php) which I will use it for change all values from config.php. This script will change the [XCONFIG_FIRST]; [XCONFIG_SECOND] & [XCONFIG_THIRD] with other value that I set from replace.php.

Code:
<!-- replace.php -->
<form method="post" action="something.php">
XConfig First : <input type="text" name="xcon_first" value=""><br/>
XConfig Second : <input type="text" name="xcon_second" value=""><br/>
XConfig Third : <input type="text" name="xcon_third" value=""><br/>
<input type="submit" value="Replace All">
</form>


All values submitted from replace.php will replace [XCONFIG_FIRST] and so on from config.php

Is there any ways to do it?

Thank you so much for your kind help.


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: Need help with File
PostPosted: Sun Apr 19, 2009 6:17 am 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
I guess you need to open the config file and replace with for example str_replace() the old values with the new values. Or you could re-build the config file and save it over the old config.php.

/Bylla

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Need help with File
PostPosted: Sun Apr 19, 2009 6:36 am 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Sat Apr 18, 2009 4:00 pm
Posts: 3
Points: 0
make sense... i'll try it..
thanks...


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]