Jump to content


Install file


9 replies to this topic

#1 Herbert

    Young Padawan

  • Members
  • Pip
  • 35 posts
  • Location:Under Your Bed!
  • Interests:Computers, Rock Music, Cars, Girls!

Posted 19 March 2007 - 08:15 AM

Ok, I want to know if anyone has any information as to where I can find a tutorial for how to make a install.php file. Like, when someone buy a script, it sometimes comes with a install.php file for easy installation.

I need to create one but I forgot how to.

#2 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 19 March 2007 - 11:11 AM

Well an install file can be very different depending on what you want to be doing with the site. Say if your site has a database, typicaly like create the database, create all the tables needed. If the site has an admin panel it will ask you to make an account which will be set as an admin.

No tutorial can really tell you how to make an install file, they are always site/project specific, so what I suggest you do is go through your site and make a list of everything that needs to get setup when the site gets installed and make a scrip that will go through and do it all to make setup for users quick and easy.

Matt

#3 _*Creative Insanity_*

  • Guests

Posted 19 March 2007 - 02:51 PM

I have made one of these. They are a large job.
There are many ways to go about this. You can do something for the real beginner where they just upload 2 files.. one being an install.php file and the other being an image of the site.
Once the install.php has been loaded it unpacks all the files and folders into the correct location and then does all the normal stuff, just install the database and then creates the login for the acp.
These are a HUGE project and I have not done this type yet but a guy I done a project with has and he said never again LOL.
The next is one I have done.. and that is they upload all the files and folders and then just run the install file which asks a few database related questions and then creates the tables in a pre-created database, then does the acp login. That was a big enough job. But it is really like Matt said, they differ from site to site and a tutorial would be hard to create for a generic install file.

#4 Herbert

    Young Padawan

  • Members
  • Pip
  • 35 posts
  • Location:Under Your Bed!
  • Interests:Computers, Rock Music, Cars, Girls!

Posted 19 March 2007 - 03:41 PM

Thanks guys. But I need to create one that will create a db and the tables within it. I just need the basic coding for one.

#5 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 22 March 2007 - 01:28 PM

Install files aren't hard. After creating a CMS they are the easiest thing in the world.

Just have a form in the file that the user will put any basic data in, then validate the data and run the sql queries. We can't give you the basic coding for one, all we can give you is the basic structure of what some contain... which we can't really do anyway as we don't know what you're using the file to "install."

#6 _*Creative Insanity_*

  • Guests

Posted 22 March 2007 - 01:53 PM

Quote

After creating a CMS they are the easiest thing in the world.
I think that depends on ones skill level of php and mysql.

Edited by Creative Insanity, 22 March 2007 - 01:53 PM.


#7 bay

    Young Padawan

  • Members
  • Pip
  • 105 posts
  • Gender:Male
  • Location:Chicago, IL USA

Posted 22 March 2007 - 07:03 PM

For a general guideline on how to create one for just running mysql tables here's a quick run down of how it should work:

Have a form that a user fills out with their mysql connection details (username, pass, host, db name).

After checking that data out and testing to make sure you can connect to their database create a queries array like:

$query[] = "CREATE TABLE asg asg";
$query[] = "INSERT INTO asg asg";

and then to run each query:

foreach ( $query as $run )
{
mysql_query ( $query );
}

and then wrapping it up and saying its successful is easy. Of course you should probably have some sort of error catching/reporting system in there, but thats a loose outline.

If you want to go the extra mile, you can even create a config file with the mysql connection info they provided.

#8 Herbert

    Young Padawan

  • Members
  • Pip
  • 35 posts
  • Location:Under Your Bed!
  • Interests:Computers, Rock Music, Cars, Girls!

Posted 25 March 2007 - 02:50 AM

Thanks but i got it lol. Bay, i think that was gd help but more details/examples could nv hurt anyone lol.

#9 mattd8752

    Young Padawan

  • Members
  • Pip
  • 35 posts
  • Location:Canada

Posted 25 March 2007 - 07:51 AM

Use the SQL from phpMyAdmin. If you want to package the site for quick upload look into zip functions with PHP. You should be able to extract locally, then gather their FTP info to CHMOD.

#10 Herbert

    Young Padawan

  • Members
  • Pip
  • 35 posts
  • Location:Under Your Bed!
  • Interests:Computers, Rock Music, Cars, Girls!

Posted 30 March 2007 - 10:24 PM

I knew it but i forgot it so i needed something to jump start my memory. I just had to remember the codes like "create table", "alter table", etc....





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users