Google Answers Logo
View Question
 
Q: Web Site Data Management for Novices ( No Answer,   4 Comments )
Question  
Subject: Web Site Data Management for Novices
Category: Computers > Internet
Asked by: fullthrottle-ga
List Price: $25.00
Posted: 07 Jul 2004 18:02 PDT
Expires: 06 Aug 2004 18:02 PDT
Question ID: 371083
I am making a new web site about English Language schools in Canada. 
The domain is http://www.english-canada.net .  It is hosted at
www.simplenet.com.  The site will mostly be lists of schools, with
names, addresses and telephone numbers.  Time permitting, I plan to
eventually add lists of specialty schools, such as Business English
schools and TEFL schools.

I do not want to create a lot of work though, updating and rearranging
information as addresses change.  I presume that it would be best to
use a database to store the school addresses.  unfortunately, I am
somewhat technically challenged and I do not know how to go about
this.  Can you suggest some software that is easy for a novice to use?
Answer  
There is no answer at this time.

Comments  
Subject: Re: Web Site Data Management for Novices
From: dreamboat-ga on 08 Jul 2004 16:08 PDT
 
The answer to your question depends on the software provided by your
hosting service. Generally, it is one of two setups:

Windows/ASP
Unix/PHP

If Unix/PHP, you will likely have better luck finding free
information, such as that available here:
http://www.freewebmasterhelp.com/tutorials/phpmysql/

I am not a Google researcher, but they will likely need to know your
hosting services to answer the question with intelligence.
Subject: Re: Web Site Data Management for Novices
From: fullthrottle-ga on 08 Jul 2004 18:18 PDT
 
Thanks dreamboat-ga.  The tutorial looks helpful.  I'll try to get
around to it when I have time.  I'm currently a little short of time,
though, so I'm hoping for a straight answer.

http://www.english-canada.net is hosted by www.simplenet.com. 

Once again, thanks for your help.
Subject: Re: Web Site Data Management for Novices
From: nvachro-ga on 11 Jul 2004 14:36 PDT
 
From what I've seen, most of the pre-made scripts / applications are
going to make your pages look a bit cluttered if you're looking to
keep the listings looking as they currently do.

According to your host's website,
http://www.simplenet.com/hosting.html, your package should include
both MySQL and PHP, (since you're using your own domain name it's
obvious you aren't using the first hosting package).


[Step 1:]

From your hosting service's FAQ:
---------------------------------
8. How do I set up MySQL Databases?

1. Log into your Control Panel at: https://secure.simplenet.com/cp 

2. Click the "MySql" link in the side menu. 

3. Click the "MySql DB Wizard" link. 

4. You will need to use mysql.simplenet.com as the Host Name for your
MySql Database.
---------------------------------

[Step 2:]
---------------------------------
To Enable PHP:

Log into the web interface. 
Click the wrench icon to the right of the site on which you intend to enable PHP. 
Click 'Site Settings' on the upper-left side. 
Check the box to the right of 'Enable PHP Embedded Scripting.' 
Click 'Save Changes.' 
---------------------------------


Here's some code to do what you want very quickly - It's barebones and
will need edited to if you want pretty pages:

-----------------------------------------------------------------------------------
[Step 3:]
-----------------------------------------------------------------------------------

Make a table as follows:  (either manually or use this exact SQL statement)
...................................................................................
CREATE TABLE schools (
ID int(11) NOT NULL auto_increment,
SchoolName varchar(255) NOT NULL,
SchoolCategory varchar(255) NOT NULL,
SchoolAddressLine1 varchar(255) NOT NULL,
SchoolAddressLine2 varchar(255) NOT NULL,
SchoolTN varchar(255) NOT NULL,
SchoolURL varchar(255) NOT NULL,

PRIMARY KEY (ID)
);
...................................................................................
-----------------------------------------------------------------------------------

-----------------------------------------------------------------------------------
[Step 4:] 
-----------------------------------------------------------------------------------
Create the following files and upload them to your server:


file name: connect.php // Change $username, $password, $host, and
$database to your settings
...................................................................................
<?php
$username = "yourUserName";
$password = "yourPassword";
$host = "mysql.simplenet.com";
$database = "yourDBname";

mysql_connect($host,$username,$password) or die("Cannot connect to the
database.<br>" . mysql_error());
mysql_select_db($database) or die("Cannot select the database.<br>" .
mysql_error());

?>
...................................................................................
...................................................................................


file name: add.php
...................................................................................
<?php
include("connect.php");

if(!empty($sname)) {
$sname = addslashes($sname);
$scategory = addslashes($scategory);
$saddress1 = addslashes($saddress1);
$saddress2 = addslashes($saddress2);
$stelephone = addslashes($stelephone);
$surl = addslashes($surl);


$sql = "INSERT INTO schools SET SchoolName='$sname',
SchoolCategory='$scategory', SchoolAddressLine1='$saddress1',
SchoolAddressLine2='$saddress2', SchoolTN='$stelephone',
SchoolURL='$surl'";

$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());

echo "Database Updated. <a href='adminlisting.php'>Full List</a> ";
} else {
?>

<b>Add Address</b> 
<form name="address" method="post" action="<?php echo $PHP_SELF; ?>">
School Name: <input type="text" name="sname">
<br>
Category: 
<input type="text" name="scategory">
<br>
Address:<br>
<input type="text" name="saddress1">
<BR>
<input type="text" name="saddress2">
<BR>
Telephone Number: 
<input type="text" name="stelephone">
<br>
URL: 
<input type="text" name="surl">
<br>
<input type="submit" name="Submit" value="Submit">
</form>

<?php
}
?>
...................................................................................
...................................................................................


file name: edit.php
...................................................................................
<?php
include("connect.php");

if(!empty($sname)) {
$sname = addslashes($sname);
$scategory = addslashes($scategory);
$saddress1 = addslashes($saddress1);
$saddress2 = addslashes($saddress2);
$stelephone = addslashes($stelephone);
$surl = addslashes($surl);


$sql = "UPDATE schools SET SchoolName='$sname', SchoolName='$sname',
SchoolCategory='$scategory', SchoolAddressLine1='$saddress1',
SchoolAddressLine2='$saddress2', SchoolTN='$stelephone',
SchoolURL='$surl' WHERE ID='$id'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());

echo "Database Updated. <a href='adminlisting.php'>Full List</a>";
} else {

$sql = "SELECT * FROM schools WHERE ID='$id'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());
$result = mysql_fetch_array($query);

$SchoolName = stripslashes($result["SchoolName"]);
$SchoolCategory = stripslashes($result["SchoolCategory"]);
$SchoolAddressLine1 = stripslashes($result["SchoolAddressLine1"]);
$SchoolAddressLine2 = stripslashes($result["SchoolAddressLine2"]);
$SchoolTN = stripslashes($result["SchoolTN"]);
$SchoolURL = stripslashes($result["SchoolURL"]);

?> 

<b>Edit Address</b> 


<form name="address" method="post" action="<?php echo $PHP_SELF; ?>">
School Name: <input type="text" name="sname" value="<?php echo $SchoolName; ?>">
<br>
Category: 
<input type="text" name="scategory" value="<?php echo $SchoolCategory; ?>">
<br>
Address:<br>
Address:<br>
<input type="text" name="saddress1" value="<?php echo $SchoolAddressLine1; ?>">
<BR>
<input type="text" name="saddress2" value="<?php echo $SchoolAddressLine2; ?>">
Telephone Number: 
<input type="text" name="stelephone" value="<?php echo $SchoolTN; ?>"">
<br>
URL: 
<input type="text" name="surl" value="<?php echo $SchoolURL; ?>">
<br>

<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="id" value="<?php echo $id; ?>">
</form>

<?php
}
?>
...................................................................................
...................................................................................

filename: delete.php
...................................................................................
<?php
include("connect.php");

$sql = "DELETE FROM schools WHERE ID='$id'";
$query = mysql_query($sql) or die("Cannot delete record.<br>" . mysql_error());

echo "Record Deleted! <a href='adminlisting.php'>Full List</a>";

?>
...................................................................................
...................................................................................


filename: adminlisting.php
...................................................................................

<h2>List Records</h2>
<a href='add.php'>Add Record</a><br>
<?php
include("connect.php");

$sql = "SELECT * FROM schools ORDER BY SchoolName";
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());
while($result = mysql_fetch_array($query)) {
$SchoolName = stripslashes($result["SchoolName"]);
$SchoolCategory = stripslashes($result["SchoolCategory"]);
$ID = $result["ID"];

echo "$SchoolName in $SchoolCategory [<a
href='edit.php?id=$ID'>Edit</a> | <a
href='delete.php?id=$ID'>Delete</a>]<br>";

}

?>
...................................................................................
...................................................................................

-----------------------------------------------------------------------------------
[Step 5:]
-----------------------------------------------------------------------------------

Once the pages are on your server, go to
http://www.english-canada.net/adminlisting.php to add, edit, and / or
delete listings.

To pull from the database, you need to change the extensions of the
pages that use the script to .php.

For example, montreal.htm would change to montreal.php

In montreal.php, where the current list of schools is, you'd add the
following code:
...................................................................................
...................................................................................
<font face='Arial' size='+1' color='#FFFFFF'>Language Schools in Montreal</font>

<h2>Language Schools in Montreal</h2>
<?php
include("connect.php");

$sql = "SELECT * FROM schools WHERE SchoolCategory='Language Schools
in Canada - Montreal' ORDER BY SchoolName";
// change above Category to suit page it's going to be on
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());
while($result = mysql_fetch_array($query)) {

$SchoolName = stripslashes($result["SchoolName"]);
$SchoolCategory = stripslashes($result["SchoolCategory"]);
$SchoolAddressLine1 = stripslashes($result["SchoolAddressLine1"]);
$SchoolAddressLine2 = stripslashes($result["SchoolAddressLine2"]);
$SchoolTN = stripslashes($result["SchoolTN"]);
$SchoolURL = stripslashes($result["SchoolURL"]);

$ID = $result["ID"];


echo "<font face='Arial' size='2' color='#E3E8E3'>";
echo "$SchoolName <BR> $SchoolAddressLine1 <BR> $SchoolAddressLine2
<BR> Tel.: $SchoolTN <BR> URL: <A HREF='$SchoolURL'>$SchoolURL</A>
<BR> Classification: <B> $SchoolCategory </B> <BR>";
echo "</font><BR>";
}
?>

...................................................................................
...................................................................................

Note where it says SchoolCategory='Language Schools in Canada - Montreal'? 

For Business English schools, you would enter their category as
"Language Schools in Canada - Business English", or however you'd want
to enter it, and then have this line say SchoolCategory='Language
Schools in Canada - Business English'.

Hope this was clear enough - Ask if you have any questions about using this. 

*-* NOT A GOOGLE RESEARCHER *-*
Subject: Re: Web Site Data Management for Novices
From: nvachro-ga on 11 Jul 2004 18:22 PDT
 
Same files as in Step 4 above, with a primitive static password login
to discourage riffraff from abusing your list modification pages. 
Change the files once you get the previous code working - the fewer
lines of code above will make it easier to troubleshoot.


file name: connect.php 
//Change $username, $password, $host, 
//and $database to your settings
...................................................................................
<?php
$username = "yourUserName";
$password = "yourPassword";
$host = "mysql.simplenet.com";
$database = "yourDBname";

mysql_connect($host,$username,$password) or die("Cannot connect to the
database.<br>" . mysql_error());
mysql_select_db($database) or die("Cannot select the database.<br>" .
mysql_error());

?>
...................................................................................
...................................................................................


file name: add.php
...................................................................................
<?php
include("connect.php");

// quick password check 
session_start(); 

if (!$_SERVER['HTTP_REFERER']=='http://www.english-canada.net/adminlisting.php'){
	echo "<a href='adminlisting.php'>Log In</a>";
	exit;
}

if($_SESSION['validpass']==$_SESSION['mypass']){	
	echo "<!-- Admin already logged in. -->";
}
else {
	
		if ($listingspassword==$_SESSION['mypass']) {
	  		$_SESSION['validpass']=$listingspassword;
		}
		else{
			exit;
		}		
}
// 



if(!empty($sname)) {
$sname = addslashes($sname);
$scategory = addslashes($scategory);
$saddress1 = addslashes($saddress1);
$saddress2 = addslashes($saddress2);
$stelephone = addslashes($stelephone);
$surl = addslashes($surl);


$sql = "INSERT INTO schools SET SchoolName='$sname',
SchoolCategory='$scategory', SchoolAddressLine1='$saddress1',
SchoolAddressLine2='$saddress2', SchoolTN='$stelephone',
SchoolURL='$surl'";

$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());

echo "Database Updated. <a href='adminlisting.php'>Full List</a> ";
} else {
?>

<b>Add Address</b> 
<form name="address" method="post" action="<?php echo $PHP_SELF; ?>">
School Name: <input type="text" name="sname">
<br>
Category: 
<input type="text" name="scategory">
<br>
Address:<br>
<input type="text" name="saddress1">
<BR>
<input type="text" name="saddress2">
<BR>
Telephone Number: 
<input type="text" name="stelephone">
<br>
URL: 
<input type="text" name="surl">
<br>
<input type="submit" name="Submit" value="Submit">
</form>

<?php
}
?>
...................................................................................
...................................................................................


file name: edit.php
...................................................................................
<?php
include("connect.php");

// quick password check 
session_start(); 

if (!$_SERVER['HTTP_REFERER']=='http://www.english-canada.net/adminlisting.php'){
	echo "<a href='adminlisting.php'>Log In</a>";
	exit;
}

if($_SESSION['validpass']==$_SESSION['mypass']){	
	echo "<!-- Admin already logged in. -->";
}
else {
	
		if ($listingspassword==$_SESSION['mypass']) {
	  		$_SESSION['validpass']=$listingspassword;
		}
		else{
			exit;
		}		
}

// 


if(!empty($sname)) {
$sname = addslashes($sname);
$scategory = addslashes($scategory);
$saddress1 = addslashes($saddress1);
$saddress2 = addslashes($saddress2);
$stelephone = addslashes($stelephone);
$surl = addslashes($surl);


$sql = "UPDATE schools SET SchoolName='$sname', SchoolName='$sname',
SchoolCategory='$scategory', SchoolAddressLine1='$saddress1',
SchoolAddressLine2='$saddress2', SchoolTN='$stelephone',
SchoolURL='$surl' WHERE ID='$id'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());

echo "Database Updated. <a href='adminlisting.php'>Full List</a>";
} else {

$sql = "SELECT * FROM schools WHERE ID='$id'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());
$result = mysql_fetch_array($query);

$SchoolName = stripslashes($result["SchoolName"]);
$SchoolCategory = stripslashes($result["SchoolCategory"]);
$SchoolAddressLine1 = stripslashes($result["SchoolAddressLine1"]);
$SchoolAddressLine2 = stripslashes($result["SchoolAddressLine2"]);
$SchoolTN = stripslashes($result["SchoolTN"]);
$SchoolURL = stripslashes($result["SchoolURL"]);

?> 

<b>Edit Address</b> 


<form name="address" method="post" action="<?php echo $PHP_SELF; ?>">
School Name: <input type="text" name="sname" value="<?php echo $SchoolName; ?>">
<br>
Category: 
<input type="text" name="scategory" value="<?php echo $SchoolCategory; ?>">
<br>
Address:<br>
Address:<br>
<input type="text" name="saddress1" value="<?php echo $SchoolAddressLine1; ?>">
<BR>
<input type="text" name="saddress2" value="<?php echo $SchoolAddressLine2; ?>">
Telephone Number: 
<input type="text" name="stelephone" value="<?php echo $SchoolTN; ?>"">
<br>
URL: 
<input type="text" name="surl" value="<?php echo $SchoolURL; ?>">
<br>

<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="id" value="<?php echo $id; ?>">
</form>

<?php
}
?>
...................................................................................
...................................................................................

filename: delete.php
...................................................................................
<?php
include("connect.php");

// quick password check 
session_start(); 

if (!$_SERVER['HTTP_REFERER']=='http://www.english-canada.net/adminlisting.php'){
	echo "<a href='adminlisting.php'>Log In</a>";
	exit;
}

if($_SESSION['validpass']==$_SESSION['mypass']){	
	echo "<!-- Admin already logged in. -->";
}
else {
	
		if ($listingspassword==$_SESSION['mypass']) {
	  		$_SESSION['validpass']=$listingspassword;
		}
		else{
			exit;
		}		
}

// 


$sql = "DELETE FROM schools WHERE ID='$id'";
$query = mysql_query($sql) or die("Cannot delete record.<br>" . mysql_error());

echo "Record Deleted! <a href='adminlisting.php'>Full List</a>";

?>
...................................................................................
...................................................................................


file name: adminlisting.php
// change 'anypassyouwant' to any password that 
// you want to use to control access to these pages
...................................................................................

<?php
include("connect.php");

// quick password check 
session_start(); 

$_SESSION['mypass']='anypassyouwant';
// change this password here

if($_SESSION['validpass']==$_SESSION['mypass']){	
	echo "<!-- Admin already logged in. -->";
}
else {
	
		if ($listingspassword ==$_SESSION['mypass']) {
	  		$_SESSION['validpass']=$listingspassword;
		}
		else{
				echo "<FORM ACTION='$PHP_SELF' METHOD=POST> Password: <INPUT
TYPE='password' NAME='listingspassword'><BR> <INPUT TYPE='submit'
VALUE='log in'></FORM>";
				exit;
		}		
}
// 

echo "<h2>List Records</h2>";
$sql = "SELECT * FROM schools ORDER BY SchoolName";
$query = mysql_query($sql) or die("Cannot query the database.<br>" .
mysql_error());
while($result = mysql_fetch_array($query)) {
$SchoolName = stripslashes($result["SchoolName"]);
$SchoolCategory = stripslashes($result["SchoolCategory"]);
$ID = $result["ID"];

echo "$SchoolName in $SchoolCategory [<a
href='edit.php?id=$ID'>Edit</a> | <a
href='delete.php?id=$ID'>Delete</a>]<br>";
}
echo "<BR> <a href='add.php'>Add Record</a><br>";
?>

...................................................................................
...................................................................................


file name: logout.php
...................................................................................
<?php
session_start(); 

$_SESSION['validpass']='nothing';
$_SESSION['mypass']='nothing';

echo "Logged Out! <a href='adminlisting.php'>Back to Admin Listing</a>";

?>
...................................................................................
...................................................................................


*-* NOT A GOOGLE RESEARCHER *-*

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy