Go to Post You don't need to prototype everything, just the stuff you want to work. - JVN [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-10-2006, 18:38
Musician's Avatar
Musician Musician is offline
Mechanical/Electrical/Driver/Music
AKA: Cody
FRC #0339 (Rappahannock Robotics)
Team Role: Mechanical
 
Join Date: Feb 2006
Location: Jammin (Stafford, VA)
Posts: 17
Musician is an unknown quantity at this point
Help w/ PHP

Hey, I'm an amateur webmaster. Can anyone give some advice with implementing PHP and MySQL with the following website: http://205.174.115.19/
__________________
2006 - Semi-Finalist at the Chesapeake Regional
2005 - Quarter-Finalist at the Duel on the Delaware
2005 - 1st seed at the Duel on the Delaware
2005 - Semi-Finalist at the Capital Clash part of the Digital Expo in D.C.
2005 - Finalist at the NASA/VCU Regional
2004 - Quarter-Finalist at the NASA/VCU Regional
2004 - Motorola Quality Award at the NASA/VCU Regional
2003 - Featured on the Discovery Science Channel
2003 - General Motors Industrial Design Award
2002 - Winner of the Johnson & Johnson Mid-Atlantic Regional
2001 - Xerox Creativity Award


  #2   Spotlight this post!  
Unread 24-10-2006, 19:14
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: Help w/ PHP

There are two easy things you can do to that page using PHP:

Right now, you are calling separate HTML files inside of a frame in order to create sub-pages. Instead of that, you could just write up your page template as separate file and simply have PHP automatically stick that header and footer into every single one of your pages. Then each individual page's code will look like:

PHP Code:
include("header.php");
<
p>Oh manwhat a cool page I have!</p>
include(
"footer.php"); 
Header.php and footer.php will contain all the boring HTML markup that is the same on every page, freeing up each file to just be the relevant code for that area. You can google around a bit to find some more information on these techniques, and I highly recommend taking advantage of the php.net website, which lets you search for information about almost anything you would ever want to know about PHP commands and syntax.

If you get comfortable with that, you can get really fancy and build a membership system. This phpfreaks.com tutorial is what taught me how to create login systems that I have since used on a few of my own projects. It's extremely step by step, but by the end you should have a solid understanding of what each piece of the system is doing when a user logs in.

You could use a user login system to protect sensitive documents, set up some sort of communication system, or just to be cool-looking.

Good luck! PHP is some pretty amazing stuff.
  #3   Spotlight this post!  
Unread 24-10-2006, 19:56
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Help w/ PHP

Is there something specific you want to do? If so I can help you. What where you planning on using MySQL for?
  #4   Spotlight this post!  
Unread 24-10-2006, 22:20
GRaduns340 GRaduns340 is offline
The Fruit Man
AKA: Gary
FRC #0340 (Greater Rochester Robotics)
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Rochester, NY
Posts: 152
GRaduns340 has a spectacular aura aboutGRaduns340 has a spectacular aura aboutGRaduns340 has a spectacular aura about
Send a message via AIM to GRaduns340
Re: Help w/ PHP

Quote:
Originally Posted by Musician
Hey, I'm an amateur webmaster. Can anyone give some advice with implementing PHP and MySQL with the following website: http://205.174.115.19/
The suggestion about include statements is definitely a good start, but once you get comfortable with that, you might want to move into storing content for each page in a database, then use a PHP to print the page's content from the database rather than from each file. That way you have ONE page with all of the relevent header and footer for every page, and the database holds unique entries for each of the others. It also saves a lot of space and effort. If you decide to add another section in addition to header/footer (or whatever you have) you can easily go back and change it once, rather than have to add it to every file again, which was the idea to avoid in the first place.
  #5   Spotlight this post!  
Unread 25-10-2006, 20:48
RoboJedi75's Avatar
RoboJedi75 RoboJedi75 is offline
Do or do not, there is no try.
AKA: Nate Fong
FRC #0075 (RoboRaiders)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Hillsborough, New Jersey
Posts: 79
RoboJedi75 has a spectacular aura aboutRoboJedi75 has a spectacular aura aboutRoboJedi75 has a spectacular aura about
Send a message via AIM to RoboJedi75 Send a message via Yahoo to RoboJedi75
Re: Help w/ PHP

Another option if you have a lot of pages: you can create the basic layout page (the header and the footer) and replace the body content with this code:

PHP Code:
if($_GET['page'] == "") {
    include(
"includes/main.php");
} else if (!
file_exists("includes/".$_GET['page'].".php")) {
    echo 
"Page not found.";
} else {
    include(
"includes/".$_GET['page'].".php");

This code just checks that a body content file exists and then loads it. Navigation is done by index.php?page=home. If no extenstion is given, then it loads main.php.

It's simple and I've seen a lot of websites use this method.
__________________
Nate Fong
Team #75, the RoboRaiders, Alumni


  #6   Spotlight this post!  
Unread 25-10-2006, 22:19
GRaduns340 GRaduns340 is offline
The Fruit Man
AKA: Gary
FRC #0340 (Greater Rochester Robotics)
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Rochester, NY
Posts: 152
GRaduns340 has a spectacular aura aboutGRaduns340 has a spectacular aura aboutGRaduns340 has a spectacular aura about
Send a message via AIM to GRaduns340
Re: Help w/ PHP

Quote:
Originally Posted by RoboJedi75
Another option if you have a lot of pages: you can create the basic layout page (the header and the footer) and replace the body content with this code:

PHP Code:
if($_GET['page'] == "") {
    include(
"includes/main.php");
} else if (!
file_exists("includes/".$_GET['page'].".php")) {
    echo 
"Page not found.";
} else {
    include(
"includes/".$_GET['page'].".php");

This code just checks that a body content file exists and then loads it. Navigation is done by index.php?page=home. If no extenstion is given, then it loads main.php.

It's simple and I've seen a lot of websites use this method.
That's probably a better idea than I suggested. I guess I just overthought it. I've used that method, too, and it is certainly simple enough to pull off.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php/forms/posting/I NEED HELP!!!!!!!!! general Programming 69 29-03-2006 14:36
php/forms/posting/I NEED HELP!!!!!!!!! general Website Design/Showcase 5 21-03-2006 16:36
PHP Help FRANK(WGH) Website Design/Showcase 5 22-02-2006 22:06
PHP Coding HELP!!! FRANK(WGH) Website Design/Showcase 9 26-01-2005 17:18
PHP bb... Stefan Website Design/Showcase 3 31-07-2003 13:48


All times are GMT -5. The time now is 01:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi