User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion

Reply
Thread Tools Display Modes
Unread 5 Feb 2003, 15:45   #1
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Need some simple and usefull tips for making a site with PHP

I got my hosting sorted with impulsed.net (I'm hoping for a discount ) and I've started with making a simple site for it.
All neat and dandy, but I know shiet of PHP or professional site building so I need some tips. I don't really feel like learning everything of PHP as I have other thingies I want to play around with, so "keep it stupidly simple". I have PHP and one mySQL database available. I am not sure what kind of access the process has, but I'm only exploring what is possible and how far I can go.

- How do I make the index? Tables, with includes in each td? How do I pass URL's then? I know frames are bad mmkay....

- Content: can I write to files on the server? For example when I want to change a project description. Can I make new folders/files, for when I want to make a new project?

- Upload: is it possible to upload images? and store them in a certain folder? Can I upload other files?

- Folder browsing: Can I browse a folder and return all files in that folder. For example if I have a download page for a project.

Any sources, examples, other tips and things that just happen to cross your mind and that are quite important/handy and shouldn't be forgotten are very welcome.

TY
Structural Integrity is offline   Reply With Quote
Unread 5 Feb 2003, 15:51   #2
Flavius
 
Join Date: Jan 2002
Posts: 421
Flavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet society
you can upload, and pretty much all the rest u asked for

i still got the upload.php file i found somewhere, the only problem is CHMODing a folder to 777, a tad insecure


ps will u still need struct.m33p.net ?
Flavius is offline   Reply With Quote
Unread 5 Feb 2003, 20:13   #3
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
I don't want to compromise the servers security, so I guess the uploading bit is a nono.
Flav, I'd love to have that script, it also does the folderbrowsing thingy which could be dandy.

And about struct.m33p.net.... well.... now I have my own hosting I don't know why I would need it anymore.
Structural Integrity is offline   Reply With Quote
Unread 5 Feb 2003, 20:14   #4
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Oh, and thing that I'm specifically interrested in now is getting rid of the damn frames....
Structural Integrity is offline   Reply With Quote
Unread 5 Feb 2003, 20:17   #5
Flavius
 
Join Date: Jan 2002
Posts: 421
Flavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet society
Quote:
Originally posted by Structural Integrity
I don't want to compromise the servers security, so I guess the uploading bit is a nono.
Flav, I'd love to have that script, it also does the folderbrowsing thingy which could be dandy.

And about struct.m33p.net.... well.... now I have my own hosting I don't know why I would need it anymore.

ill send you later tonight when i get on msn
Flavius is offline   Reply With Quote
Unread 5 Feb 2003, 20:41   #6
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by Structural Integrity
Oh, and thing that I'm specifically interrested in now is getting rid of the damn frames....
That leaves you with Tables and/or CSS then.
A very basic 'dynamic' site would just use simple tables for each 'item'.
A basic layout for a news page might be:
Code:
-------------------
|N | ------------ |
|A | |  Title1  | |
|V | ------------ |
|I | |Item text | |
|G | |in here...| |
|A | ------------ |
|T |              |
|I | ------------ |
|O | |  Title2  | |
|N | ------------ |
|  | |Item text | |
|  | |in here...| |
|  | ------------ |
-------------------
...where the lines indicate table boundarys. The large table could probably be static for such a simple design, and the tables within the large tables would be generated 'on the fly' by your code as each subsequent news item is looked up in the database.

I assume that's the sort of thing you mean?

__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
meglamaniac is offline   Reply With Quote
Unread 5 Feb 2003, 20:56   #7
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Quote:
Originally posted by meglamaniac
**lotsa stuff**

Yeh, I got it loading from the DB, but how would I do this with other pages I want to load in the centre table?
Should I pass a variable with each link like: index.php?show=project/projectbla.html

This would be quite difficult with linking (for me) I think, because I'd like to subdivide the projects in folders.... I would have to know the full path to that folder for each image or download.
Or should I store the folders in the DB, then give the projects an ID and match those. It would make my project listing easier too.
Structural Integrity is offline   Reply With Quote
Unread 5 Feb 2003, 21:08   #8
Flavius
 
Join Date: Jan 2002
Posts: 421
Flavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet societyFlavius is a pillar of this Internet society
Code:
<?php	
switch ( $pg ) {
  case "news":
      include "news/news.txt";
      break;
  case "links":
      include "links.txt";
      break;
  case "faq":
      include "faq.txt";
      break;
  case "contact":
      include "contact.txt";
      break;
    default:
      include "news/news.txt";
      break;
}
?>

opening index.php, it imports the "news/news.txt"
opening index.php?pg=links imports "links.txt"

all this is on my site template, so nothing changes

Last edited by Flavius; 5 Feb 2003 at 21:13.
Flavius is offline   Reply With Quote
Unread 6 Feb 2003, 00:32   #9
Mong
Forever Delayed
 
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
Mong is on a distinguished road
Re: Need some simple and usefull tips for making a site with PHP

Quote:
Originally posted by Structural Integrity
I got my hosting sorted with impulsed.net (I'm hoping for a discount )
It's the cheapest around! Don't be cheeky!

M.
__________________
Firefly Oper and General l4m3r - "I Do Stuff"

O2 Rip-off campaign

<vampy> plus i hate people ... i despise humanity as a whole

pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
Mong is offline   Reply With Quote
Unread 6 Feb 2003, 00:35   #10
Cyp
∞+♪˛
 
Join Date: Nov 2000
Location: :uo!te]oŻ|
Posts: 428
Cyp is an unknown quantity at this point
Re: Re: Need some simple and usefull tips for making a site with PHP

Quote:
Originally posted by Mong
It's the cheapest around! Don't be cheeky!

M.
Isn't geocities cheaper? And ad free, if all the html files have a .txt extension.
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Unread 6 Feb 2003, 00:36   #11
Intervention
In fond memory of SB
 
Join Date: Dec 2002
Location: LIGHTNING BOLT!!
Posts: 393
Intervention is an unknown quantity at this point
Re: Re: Need some simple and usefull tips for making a site with PHP

Quote:
Originally posted by Mong
It's the cheapest around!
Debatable



SI: Have a look at the include() functions. They'll start you on your road from frames.
__________________
Peace, Love and Linux

--------------
My Artwork
Intervention is offline   Reply With Quote
Unread 6 Feb 2003, 08:46   #12
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Re: Re: Re: Need some simple and usefull tips for making a site with PHP

Quote:
Originally posted by Intervention
Debatable



SI: Have a look at the include() functions. They'll start you on your road from frames.
I have.... I now have changed to a table that includes the desired file. I will look into flavius' solution later, as that'd save me some lengthy URL's and saves me having to know full paths when making a link.

I got my news thingy going yesterday, with a login system.

As for the projects, I shall make a project php file and use the DB to give them ID's and appoint a folder.
Structural Integrity is offline   Reply With Quote
Unread 6 Feb 2003, 13:50   #13
Jerazol
Guest
 
Posts: n/a
Quote:
Originally posted by Flavius
Code:
<?php	
switch ( $pg ) {
  case "news":
      include "news/news.txt";
      break;
  case "links":
      include "links.txt";
      break;
  case "faq":
      include "faq.txt";
      break;
  case "contact":
      include "contact.txt";
      break;
    default:
      include "news/news.txt";
      break;
}
?>

opening index.php, it imports the "news/news.txt"
opening index.php?pg=links imports "links.txt"

all this is on my site template, so nothing changes
That solution contains a few flaws. It's not entirely unlikely that it won't work on most servers who have sensible admins.
Starting 1 year ago, the default for PHP installations was to have register_globals sett to off, which means the variable $pg in the example above, won't exist.
you need to use on of $_GET/$_POST/$_REQUEST

Another thing is that you don't need a break; on a default selection.
  Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 20:36.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018