Current location: Hot Scripts Forums » Advertising Forums » Job Offers & Assistance » Help with making a installer config script


Help with making a installer config script

Reply
  #1 (permalink)  
Old 09-28-03, 01:13 PM
dazz dazz is offline
New Member
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Help with making a installer config script

I really like a little help with some coding, i be told this is the place to come

What i am trying to do is make a script that a user enters there name, and then that name is then saved into a config.php file as a string.

So when a user say types "sqldb"

It would place in the config

<?
$sql="sqldb"
?>

And so on with other items entered.
Reply With Quote
  #2 (permalink)  
Old 09-28-03, 01:26 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Topic moved to more appropriate forum.
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #3 (permalink)  
Old 09-29-03, 12:42 AM
rob2132 rob2132 is offline
Newbie Coder
 
Join Date: Sep 2003
Location: USA
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by dazz
I really like a little help with some coding, i be told this is the place to come :P

What i am trying to do is make a script that a user enters there name, and then that name is then saved into a config.php file as a string.

So when a user say types "sqldb"

It would place in the config

<?
$sql="sqldb"
?>

And so on with other items entered.

This is very simple. What sort of input are you wanting to accept and why? And, how? After all, this could be a security issue if you just allow for anything to be written to an interpreted script or any config file a script or program would use.
Reply With Quote
  #4 (permalink)  
Old 09-29-03, 02:51 AM
dazz dazz is offline
New Member
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Well i am trying to make a script that allows me to enter the following into a submit field.

Sql username
Sql password
Sql database

Then the details from those 3 above would be copied into a config.php file showing.

$sqluser="input 1 from above"
$sqlpass="input 2 from above"
$sqldata="input 3 from above"

But i need to to write to a config that is already there, so it would only add these lines and not delete the rest of the contents.

Once that is working i need to be able to make a new script that lets me enter a username and a password that then is copied into the sql tables.

So far this only works from 2 files.


Ok this is the installer file for entering the sql details into the database.

PHP Code:

<?php


include "admin/conf.php";
$installip="CREATE TABLE IP (
ID bigint(20) NOT NULL auto_increment,
IP varchar(255) NOT NULL default '',
votedfor varchar(255) NOT NULL default '',
time bigint(20) NOT NULL default '0',
PRIMARY KEY(ID)
)"
;
mysql_query($installip) or die("Sorry, Could not install IP table");
$intalladmin="CREATE TABLE admin (
ID int(11) NOT NULL auto_increment,
adminname varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
PRIMARY KEY(ID)
)"
;
mysql_query($intalladmin) or die(mysql_error());
$installcategories="CREATE TABLE categories (
ID bigint(20) NOT NULL auto_increment,
catname varchar(255) NOT NULL default '',
PRIMARY KEY(ID)
)"
;
mysql_query($installcategories) or die("Sorry, Could not install categories");
$installreset="CREATE TABLE reset (
ID bigint(20) NOT NULL auto_increment,
lastreset bigint(20) NOT NULL default '0',
res varchar(255) NOT NULL default '',
PRIMARY KEY(ID)
)"
;
mysql_query($installreset) or die("Sorry, Could not reset install table");
$installreviews="CREATE TABLE reviews (
ID bigint(20) NOT NULL auto_increment,
atid bigint(20) NOT NULL default '0',
review mediumtext NOT NULL,
name varchar(80) NOT NULL default '',
IP varchar(255) NOT NULL default '',
catid bigint(20) NOT NULL default '0',
PRIMARY KEY(ID)
)"
;
mysql_query($installreviews) or die("Sorry, Could not install reviews");
$installsites="CREATE TABLE sites (
ID bigint(20) NOT NULL auto_increment,
hitsin bigint(20) NOT NULL default '0',
out bigint(20) NOT NULL default '0',
url varchar(255) NOT NULL default '',
title varchar(40) NOT NULL default '',
description varchar(255) NOT NULL default '',
username varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
button varchar(255) NOT NULL default '',
email varchar(255) NOT NULL default '',
validated int(11) NOT NULL default '0',
allin bigint(20) NOT NULL default '0',
allout bigint(20) NOT NULL default '0',
lastvote bigint(20) NOT NULL default '0',
catparent varchar(255) NOT NULL default '',
totalscore bigint(20) NOT NULL default '0',
totalvotes bigint(20) NOT NULL default '0',
avgvote float NOT NULL default '0',
PRIMARY KEY(ID)
)"
;
mysql_query($installsites) or die("Sorry, Could not install sites");
$installvoteip="CREATE TABLE voteip (
ID bigint(20) NOT NULL auto_increment,
IP varchar(255) NOT NULL default '0',
votedfor bigint(20) NOT NULL default '0',
time bigint(20) NOT NULL default '0',
PRIMARY KEY(ID)
)"
;
mysql_query($installvoteip) or die("Sorry, Could not install vote ips");
print 
"Installed Sucessfully.";
?>

This is the conf file that is used.

PHP Code:



<?php 
// edit below for username and password for sql database.
$db mysql_connect("localhost""dazz""house") or die("Sorry, Could not connect.");
// edit above for username and password for sql database.
if(!$db) die("no db");



// edit below for the database name you plan to install this into.    
if(!mysql_select_db("test",$db))
// edit above for the database name you plan to install this into.
die("Sorry, No database selected.");



//edit below for the path to your install(do not include the slash at the end)
$path="http://local.co.uk/dazz/" 
//edit below for the path to your install(do not include the slash at the end)


//edit below with the Admin e-mail address.
$adminemail="dazz@"
//edit above with the Admin e-mail address.


//General setting that can be changed.

//Title for this Listings
$title="The listings";

//Allow people to rate sites ? yes/no
$votepage="Yes"

//number of sites per page on Top List.
$numentries=4

//Allow user reviews to be added ? yes/no
$usereviews="Yes"

//Do you want to verify sites before they are added? yes/no
$adminverify="yes"

//number of days before Listings resets itself.
$resetdays=365

// These setting are not to be change or no images will show on your Listings.
$showfeatured="yes";
$showbutton="Yes"
$showad="Yes";
 
?>
As for once this is installed the install file would be deleted so that its no longer able to be used again.

Hope this helps

Thanks for looking at this, i been going no where now.
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
Help making a script. Arctic ASP 0 10-02-03 06:50 PM
Question of the Day script? ncasares Script Requests 1 08-28-03 01:12 PM
Talkback script..help pls BC_ PHP 0 06-22-03 06:44 PM
Need help with a script boardpix PHP 7 06-08-03 11:37 PM


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