Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    VE9A's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jul 2009
    Posts
    22
    Downloads
    0
    Uploads
    0
    how bout just using email :S

  2. #2
    Nik's Avatar
    Senior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    222
    Downloads
    0
    Uploads
    0
    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.

  3. #3
    Nik's Avatar
    Senior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    222
    Downloads
    0
    Uploads
    0
    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.

  4. #4
    Nik's Avatar
    Senior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    222
    Downloads
    0
    Uploads
    0
    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.

  5. #5
    VE9A's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jul 2009
    Posts
    22
    Downloads
    0
    Uploads
    0
    how bout just using email :S

  6. #6
    Riley's Avatar
    Senior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    178
    Downloads
    0
    Uploads
    0

    is there a php script where you can ask the teacher questions?

    like can you get a script like a portal where students can ask teachers questions about exams and home work?

  7. #7
    VE9A's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Jul 2009
    Posts
    22
    Downloads
    0
    Uploads
    0
    how bout just using email :S

 

 

Quick Reply Quick Reply

Click here to log in


What comes after M0nday

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 11-28-2010, 04:32 AM
  2. Replies: 1
    Last Post: 05-30-2010, 10:27 AM
  3. Replies: 0
    Last Post: 05-22-2010, 10:16 AM
  4. PHP, Java, and other script language questions?
    By KookieKlan in forum Discuss PHP
    Replies: 0
    Last Post: 07-26-2009, 06:28 PM
  5. Replies: 0
    Last Post: 12-16-2008, 06:57 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •