PHP/MySQL help!

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
Rite guys! I have my database all set up, and I have the code to connect and I can pull the stuff off the server! But here is where I need some help!

I want people to be able to upload their own scripts into my database, then have the page display links to the pages containing the scripts description etc.

The database I have at the moment is called tutorials, and it contains a database called content. Within the table is a row called phptuts, and I can edit and put the links in manually, then on the page it will display the stuff I have put in.

http://zenaxnetwork.exofire.net/tuts/tutorial.php

Code:
[FONT=Verdana][SIZE=2]  <?php [/SIZE][/FONT]
[FONT=Verdana][SIZE=2]//The Code to Connect to the Database
include("connect_db.php"); [/SIZE][/FONT]
[FONT=Verdana][SIZE=2][/SIZE][/FONT] 
[FONT=Verdana][SIZE=2]//This retrieves the content and puts into an array. Notice we are calling ID 1, this would change if we wanted to call a page stored on a different row
$text = mysql_query("SELECT * FROM content WHERE content_id =1") or die(mysql_error()); 
$content = mysql_fetch_array( $text ); [/SIZE][/FONT]
[FONT=Verdana][SIZE=2]Print $content['phptut'];
?> 
[/SIZE][/FONT]

All that does is Prints the stuff from the row phptut!

What I need is an upload script for people to upload their scripts in zips/just text file etc and then have it display them on the page.

I am also going to be requiring it to pull the latest script etc from the server!

Can anyone help me?

Regards,
Zenax
 
Last edited:

lambada

New Member
Messages
2,444
Reaction score
0
Points
0
What you need then is for the scripts to be contained in a directory on the server, and the db to contain a link to that particular file and it's version id.

e.g.
Folder
|
|foo.script
|
|bar.script

Databse
tut_name | tut_version
foo.script | 1.0.0
bar.script | 1.0.1

Then you'd echo/print Folder/$php[tut].

then you just need a simple file upload script modified to insert the path and version number into the db, or update as necessary.
 
Last edited:

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
Hmmmmm, the scripts I have already I fount on the interent, so i am a bit of a novice at PHP so it might take a while!
 
Top