Current location: Hot Scripts Forums » Programming Languages » PHP » Installation Script


Installation Script

Reply
  #1 (permalink)  
Old 12-12-03, 10:22 AM
Hosemeyer Hosemeyer is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Installation Script

As my first ever php script, I've decided to make a news script to addon to the millions of others. I'd like to make an Installation script so that anyone who downloads it, can just open up the installation script into the browser and enter their db info and username & passwords, and it would right it to the settings.php, But I also need it to install the sql I have to properly set up the database to work. I'm quite the newbie, so If you guys can help me it would be great. (this is for a free script)
Reply With Quote
  #2 (permalink)  
Old 12-12-03, 10:25 AM
Hosemeyer Hosemeyer is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Also, If you guys can point me into the direction of how to set up a template system so that all the person has to do is take their regular html template, and put in the variables for news and other features. ie: $news$ or something and it would put it out.
Reply With Quote
  #3 (permalink)  
Old 12-12-03, 03:21 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

Quote:
Originally Posted by Hosemeyer
But I also need it to install the sql I have to properly set up the database to work. I'm quite the newbie, so If you guys can help me it would be great. (this is for a free script)
I guess you are almost answering your own question, but include with your distribution an SQL file that defines your tables, etc. Run it during the installation (after you ask DB info like user, pass, etc, of course). Some software ask the users to run this SQL prior to installation, but I guess that's not what you want.

As for the template scheme, one thing you might want to check is Smarty. This template engine is (semi-?) official PHP template engine and is very powerful. You can check it at http://smarty.php.net/ .

Again, like you almost answered your question, but basically you have something like {OUTPUT1}, {OUTPUT2}, etc, in the HTML template. Load the template when the page is loaded, get the file contents in a string, str_replace all the {}'s with corresponding output. There may be different ways to achieve this, but I know this is one common way.

Hope this helps. Cheers,
__________________
Blavv =|
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for a good review management script griz_fan Script Requests 10 07-29-07 05:08 AM
Searching for a random quote free script... Sgrebs Script Requests 4 03-11-06 09:09 PM
live chat script, form script, autoresponder, babalu Script Requests 0 12-04-03 01:55 PM
Talkback script..help pls BC_ PHP 0 06-22-03 06:44 PM


All times are GMT -5. The time now is 07:32 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.