Gamingforce Interactive Forums
85239 35211

Go Back   Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk
Register FAQ GFWiki Community Donate Arcade ChocoJournal Calendar

Notices

Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis.
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).


Page development how-to
Reply
 
Thread Tools
Cal
_


Member 76

Level 25.37

Mar 2006


Reply With Quote
Old Mar 13, 2007, 06:31 AM Local time: Mar 13, 2007, 09:31 PM #1 of 4
Page development how-to

Found a copy of GoLive (CS2 8). Need to make a catalogue page that's able to relist a collection of info (DVDs, CDs, etc) by certain attributes. Descending order by artist, by release date, by label, etc.

I figure I'm looking at forms plus something else but I don't know what. Any help? Or noob sites out there for GoLive? Or better options altogether? (I only nicked GL because it was small.) Only web development I've ever done was a handcoded html ArrDev fansite.

Jam it back in, in the dark.
LlooooydGEEEOOORGE

Last edited by Cal; Mar 13, 2007 at 06:33 AM.
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 13, 2007, 09:55 AM 1 #2 of 4
You have two options:

(1) Hardcoded HTML. You have to update every page anything happens, which is ugly.

(2) Use a Database and PHP (or ASP.NET if you find that simpler). The code isn't tough at all, but you'd have to have a webserver with PHP and a Database.

A slightly more detailed version:

I'm using PHP since I know it and don't know ASP.

I'm using a sample table I call "discs" with the following rows:

title (string), artist (string), label (string), date (int)

Obviously your version could include more. A quick-and-dirty page (you could format it much nicer) that you could write would be something more like:
Code:
<? // config.php - Config Variables
$mysql_server = "www.myserver.com";
$mysql_username = "username";
$mysql_password = "password";
?>
Code:
<? // filename.php - Simple Album Browser
// Brian Beck, 2007

include('config.php');

// Get the passed variable of what to sort by.  Default to title.
if(!isset($_GET['sort_by'])) $sortby = 'title';
else $sortby = $_GET['sort_by'];
// Get the passed sorting order.
if(isset($_GET['order_by']) && ($_GET['order_by'] == 'desc')) $order = 'desc';
else $order = 'asc';

// use pconnect (persistent connect) to prevent server stress of reconnecting
// every time we reload the page
$dbConn = mysql_pconnect($mysql_server, $mysql_username, $mysql_password);

$query = 'SELECT title, label, artist, date FROM discs WHERE 1=1';
// use manual checks for values of passed variables to prevent exploits
if ($sortby == 'title') $query .= ' ORDER BY title';
else if ($sortby == 'label') $query .= ' ORDER BY label';
else if ($sortby == 'artist') $query .= ' ORDER BY artist';
else if ($sortby == 'date') $query .= ' ORDER BY date';

// if we need to be descending, do so

if ($order == 'desc') $query .= ' DESC';

// Perform the Query
$results = mysql_query($query);
?>
<table>
<tr> <td>Title</td> <td>Artist</td> <td>Label</td> <td>Date</td> </tr>
<?
// Display the results
while( $result = mysql_fetch_assoc($results) ) {
   echo '<tr><td>'.$result['title'].'</td><td>'.$result['artist'].'</td><td>'.$result['label'].'</td><td>'.$result['date'].'</td></tr>';
}
?>
</table>

<a href="<?=$PHP_SELF?>?sort_by=date&order_by=desc">A Sample Link</a>
<? // That's the general format for links in the rest of the (HTML) portions
// of the page.  sort_by can be any of the fields (date, artist, title, label)
// and order_by can be asc or desc ?>


There's nowhere I can't reach.

Last edited by Arainach; Mar 13, 2007 at 11:11 AM. Reason: This member got a little too post happy.
Cal
_


Member 76

Level 25.37

Mar 2006


Reply With Quote
Old Mar 14, 2007, 05:37 AM Local time: Mar 14, 2007, 08:37 PM #3 of 4
Cheeeeaz.

Also I should specify that I'm using my alloted 10mb webspace my ISP (Hellstra) provided me, simply because it's free.

This thing is sticky, and I don't like it. I don't appreciate it.
LlooooydGEEEOOORGE

Last edited by Cal; Mar 14, 2007 at 05:40 AM.
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 14, 2007, 05:10 PM #4 of 4
Most free webservers have no scripting languages and pretty much none have databases. So you're pretty much screwed. Have fun maintaining that hardcoded stuff.

How ya doing, buddy?
Reply


Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk > Page development how-to

Forum Jump


All times are GMT -5. The time now is 02:50 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.