how bout just using email :S
how bout just using email :S
you could create a very simple one which is two plain text files one is yours the other is your teachers for you only what happens is you enter your question at your end and it displays on the site online instantly at the teachers end he or she can then click on you and reply using a text area within a form to modify your plain text file with the answer which would then display on your page. Its not even hard. I can't go through the layout that would take yonks but the code to edit a plain text file in PHP is below
This first code reads the file into a text area of a form so the form is needed.
__________________________________________________ _____
<?php
$filename = "yourfilehere.txt" ;
$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
$fstring = fread ($fd , filesize ($filename)) ;
fclose($fd) ;
?>
<form method="post" action=" answer.php ">
<textarea name="message" cols="20" rows="5"><?php echo "$fstring" ; ?></textarea><br />
<input type="submit" value="change" />
</form>
__________________________________________________ ____________________________
the form above once submitted will pass your mesage onto this code which should be saved as a seperat page to process the file were it says answer .php above the code below would be saved in a page called that.
__________________________________________________ ____________________________
<?php
$file = "yourfilehere.txt";
$message=$_POST['message'];
$fd = fopen ($file , "w") or die ("Can't open $file") ;
$fout= fwrite ($fd , $message) ;
fclose($fd) ;
?>
__________________________________________________ ______________________________
Finally the code below will echo your file to the webpage so on your teachers end it will look like your question is part of the website but it can be changed by you at any time.
__________________________________________________ ______________________________
<?php
$file = "bbmessage.txt";
$fh = fopen($file, "r");
$fstring = fread ($fh , filesize ($file));
fclose($fh);
?>
<?php echo "$fstring"; ?>
______________________________________
thats it the code above does work I built a site for a guy that had a bulliten board where he used it tell people in the club were to meet using this code.
Try to get it working before implementing it on a scale of a portal by the way each student would have their own pages and your teacher would have a page with several sections for each student. Also you should look into log in scripts which i also have working but that takes more effort reason being other wise anyone could create questions on you teachers part and send them to you all. Below is a simple log in script I created.
<?php
ob_start();
$host="your host usually localhost";
$username="your usernam usually root";
$password="your pass usually blank";
$db_name="your db";
$tbl_name="your tb";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$username=$_POST['usernamelogin'];
$password=$_POST['passwordlogin'];
$email=$_POST['emaillogin'];
$username = stripslashes($username);
$password = stripslashes($password);
$email = stripslashes($email);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$email = mysql_real_escape_string($email);
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password' and email='$email'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_register("username");
session_register("password");
session_register("email");
header("location:login_success.php");
}
else {
echo "<b>Wrong Username, Password<br />or E-Mail combination</b>";
}
?>
obviously you need to build the form for the script above although the script tells you what form inputs you need the code above would be on its on page with the log in form on another page it would then when submitted pass you onto this one.
By the way don't worry about databases just downlaod and install WAMP if you havent already php my admin builds the database for you.
you could create a very simple one which is two plain text files one is yours the other is your teachers for you only what happens is you enter your question at your end and it displays on the site online instantly at the teachers end he or she can then click on you and reply using a text area within a form to modify your plain text file with the answer which would then display on your page. Its not even hard. I can't go through the layout that would take yonks but the code to edit a plain text file in PHP is below
This first code reads the file into a text area of a form so the form is needed.
__________________________________________________ _____
<?php
$filename = "yourfilehere.txt" ;
$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
$fstring = fread ($fd , filesize ($filename)) ;
fclose($fd) ;
?>
<form method="post" action=" answer.php ">
<textarea name="message" cols="20" rows="5"><?php echo "$fstring" ; ?></textarea><br />
<input type="submit" value="change" />
</form>
__________________________________________________ ____________________________
the form above once submitted will pass your mesage onto this code which should be saved as a seperat page to process the file were it says answer .php above the code below would be saved in a page called that.
__________________________________________________ ____________________________
<?php
$file = "yourfilehere.txt";
$message=$_POST['message'];
$fd = fopen ($file , "w") or die ("Can't open $file") ;
$fout= fwrite ($fd , $message) ;
fclose($fd) ;
?>
__________________________________________________ ______________________________
Finally the code below will echo your file to the webpage so on your teachers end it will look like your question is part of the website but it can be changed by you at any time.
__________________________________________________ ______________________________
<?php
$file = "bbmessage.txt";
$fh = fopen($file, "r");
$fstring = fread ($fh , filesize ($file));
fclose($fh);
?>
<?php echo "$fstring"; ?>
______________________________________
thats it the code above does work I built a site for a guy that had a bulliten board where he used it tell people in the club were to meet using this code.
Try to get it working before implementing it on a scale of a portal by the way each student would have their own pages and your teacher would have a page with several sections for each student. Also you should look into log in scripts which i also have working but that takes more effort reason being other wise anyone could create questions on you teachers part and send them to you all. Below is a simple log in script I created.
<?php
ob_start();
$host="your host usually localhost";
$username="your usernam usually root";
$password="your pass usually blank";
$db_name="your db";
$tbl_name="your tb";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$username=$_POST['usernamelogin'];
$password=$_POST['passwordlogin'];
$email=$_POST['emaillogin'];
$username = stripslashes($username);
$password = stripslashes($password);
$email = stripslashes($email);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$email = mysql_real_escape_string($email);
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password' and email='$email'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_register("username");
session_register("password");
session_register("email");
header("location:login_success.php");
}
else {
echo "<b>Wrong Username, Password<br />or E-Mail combination</b>";
}
?>
obviously you need to build the form for the script above although the script tells you what form inputs you need the code above would be on its on page with the log in form on another page it would then when submitted pass you onto this one.
By the way don't worry about databases just downlaod and install WAMP if you havent already php my admin builds the database for you.
you could create a very simple one which is two plain text files one is yours the other is your teachers for you only what happens is you enter your question at your end and it displays on the site online instantly at the teachers end he or she can then click on you and reply using a text area within a form to modify your plain text file with the answer which would then display on your page. Its not even hard. I can't go through the layout that would take yonks but the code to edit a plain text file in PHP is below
This first code reads the file into a text area of a form so the form is needed.
__________________________________________________ _____
<?php
$filename = "yourfilehere.txt" ;
$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
$fstring = fread ($fd , filesize ($filename)) ;
fclose($fd) ;
?>
<form method="post" action=" answer.php ">
<textarea name="message" cols="20" rows="5"><?php echo "$fstring" ; ?></textarea><br />
<input type="submit" value="change" />
</form>
__________________________________________________ ____________________________
the form above once submitted will pass your mesage onto this code which should be saved as a seperat page to process the file were it says answer .php above the code below would be saved in a page called that.
__________________________________________________ ____________________________
<?php
$file = "yourfilehere.txt";
$message=$_POST['message'];
$fd = fopen ($file , "w") or die ("Can't open $file") ;
$fout= fwrite ($fd , $message) ;
fclose($fd) ;
?>
__________________________________________________ ______________________________
Finally the code below will echo your file to the webpage so on your teachers end it will look like your question is part of the website but it can be changed by you at any time.
__________________________________________________ ______________________________
<?php
$file = "bbmessage.txt";
$fh = fopen($file, "r");
$fstring = fread ($fh , filesize ($file));
fclose($fh);
?>
<?php echo "$fstring"; ?>
______________________________________
thats it the code above does work I built a site for a guy that had a bulliten board where he used it tell people in the club were to meet using this code.
Try to get it working before implementing it on a scale of a portal by the way each student would have their own pages and your teacher would have a page with several sections for each student. Also you should look into log in scripts which i also have working but that takes more effort reason being other wise anyone could create questions on you teachers part and send them to you all. Below is a simple log in script I created.
<?php
ob_start();
$host="your host usually localhost";
$username="your usernam usually root";
$password="your pass usually blank";
$db_name="your db";
$tbl_name="your tb";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$username=$_POST['usernamelogin'];
$password=$_POST['passwordlogin'];
$email=$_POST['emaillogin'];
$username = stripslashes($username);
$password = stripslashes($password);
$email = stripslashes($email);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$email = mysql_real_escape_string($email);
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password' and email='$email'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_register("username");
session_register("password");
session_register("email");
header("location:login_success.php");
}
else {
echo "<b>Wrong Username, Password<br />or E-Mail combination</b>";
}
?>
obviously you need to build the form for the script above although the script tells you what form inputs you need the code above would be on its on page with the log in form on another page it would then when submitted pass you onto this one.
By the way don't worry about databases just downlaod and install WAMP if you havent already php my admin builds the database for you.
how bout just using email :S
like can you get a script like a portal where students can ask teachers questions about exams and home work?
how bout just using email :S
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks